armyofme
Posts: 42
Joined: Sat Jan 12, 2013 11:28 am

Re: [Guide] Kodi on Raspbian Buster

Sun Sep 29, 2019 8:21 pm

cocodude wrote:
Sat Sep 28, 2019 8:16 pm
I have an interesting issue whereby audio goes down different HDMI ports on the RPi 4 depending on whether I'm allowing passthrough or not.

My situation is that I have a Raspberry Pi 4 with a 4k monitor on HDMI 0, and my audio receiver connected to HDMI 1. The reason for this is that the audio receiver can't process 4k video, so I'm sending sound directly to it so it can handle DTS etc. which my TV can't. The setup is:

[*] HDMI 0 -> TV
[*] HDMI 1 -> Audio receiver

In the Raspbian GUI, I have configured audio to go to HDMI 1 (right click on the speaker icon), which presumably changes the ALSA default to HDMI 1. In Kodi, I have configured the default sound output to be the ALSA default. Decoded/PCM audio in Kodi correctly goes to HDMI 1.

However, when I enable audio passthrough, the encoded (Dolby Digital in my case) audio only goes to HDMI 0.

I may be wrong, but I believe this is because Kodi only sends audio to direct digital audio outputs (e.g. not ALSA) and Kodi directly only lists one HDMI port for video output. This is, of course, HDMI 0.

Is there any reason why Kodi only lists the one HDMI port (plus ALSA etc.) in the list of sound output devices?
I've managed to set up my pi so hdmi0 is my tv and hdmi1 is my amp. It was this post that helped me do that...

https://www.raspberrypi.org/forums/view ... 4#p1526690

Rascas
Posts: 553
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Buster

Sun Sep 29, 2019 8:22 pm

armyofme wrote:
Sun Sep 29, 2019 7:09 pm
But all I did was follow the instructions in the first post. I didn't type 'unstable' into the repo manually. I wonder what could have happened? I'll try and change it to buster.
In the first post the repo is for buster, not the unstable that you have. You probably updated Raspbian Stretch to Busyer and you where using the unstable repo but that is empty now as there is no unstable builds yet for Buster. Just remove the unstable repo and update again.

armyofme
Posts: 42
Joined: Sat Jan 12, 2013 11:28 am

Re: [Guide] Kodi on Raspbian Buster

Sun Sep 29, 2019 8:46 pm

Thanks rascas! And thanks for putting all this together. Much appreciated :)

piplip
Posts: 10
Joined: Sun Sep 29, 2019 6:12 pm

Re: [Guide] Kodi on Raspbian Buster

Tue Oct 01, 2019 5:45 pm

piplip wrote:
Sun Sep 29, 2019 6:45 pm
I put both logs (with hdmi/with composite video) on pastebin (I tried to attach them but both .log and .txt extensions aren't admitted here).
I removed the timestamps so it's easier to diff them.

with hdmi https://pastebin.com/EfRaY8NU
with composite video https://pastebin.com/RXM3HF6w

the only difference, apart from the available resolutions (only 720x576 with composite), is that the latter hangs at " NOTICE: Checking resolution 16"

FWIW if I leave the pi in NTSC mode kodi starts :o (though the tv isn't multi standard so it's black and white).
I tried with libreelec and it does the same.
Oh, and the pvr/tvheadend client is broken (the up/down arrows switch the channel only once, then they don't work, it seems like kodi thinks it's a normal video instead of a pvr client video). Again, libreelec does the same.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: [Guide] Kodi on Raspbian Buster

Wed Oct 02, 2019 6:15 am

Kodi still works great with Raspberry Pi 4. I use the latest bleeding edge updates on kernel and all and do not have a single problem. I only use official add ons and do not mess with "free tv" crap. Many of the unofficial add ons are not safe and you risk adding malware to your machine with them. Add ons are in fact executables and should be treated as such.

pinkfloydhomer
Posts: 2
Joined: Wed Oct 02, 2019 5:35 pm

Re: [Guide] Kodi on Raspbian Buster

Wed Oct 02, 2019 5:40 pm

Am I the only one experiencing occasional micro stutters with some videoes? For example I have a 23.976fps file that does this with this version of kodi on my rpi4 and that doesn't do it with whatever version of Kodi is on my rpi3. Maybe auto switching refresh rate is not switching to 23.976 exactly, or...?

How can I debug this further? What can I do to help?

Rascas
Posts: 553
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Buster

Wed Oct 02, 2019 7:59 pm

pinkfloydhomer wrote:
Wed Oct 02, 2019 5:40 pm
Am I the only one experiencing occasional micro stutters with some videoes? For example I have a 23.976fps file that does this with this version of kodi on my rpi4 and that doesn't do it with whatever version of Kodi is on my rpi3. Maybe auto switching refresh rate is not switching to 23.976 exactly, or...?

How can I debug this further? What can I do to help?
Enable debug logging as explained in the first post. And in the components log, enable ffmpeg. Any errors will be in the log but take note that if it is really frameskipping it will produce a quite big log.
You can also upload a test sample of the video for us to test to see if we can reproduce the error.

farid77
Posts: 6
Joined: Fri Feb 22, 2019 5:37 pm

Re: [Guide] Kodi on Raspbian Buster

Fri Oct 04, 2019 12:15 pm

I am having the following problem when trying to install kodi in buster

Code: Select all

Setting up kodi (2:18.4-5~buster) ...
dpkg: error processing package kodi (--configure):
 installed kodi package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.28-10+rpi1) ...
Processing triggers for systemd (241-7~deb10u1+rpi1) ...
Processing triggers for mime-support (3.62) ...
Errors were encountered while processing:
 kodi
E: Sub-process /usr/bin/dpkg returned an error code (1)
i tried with:
sudo dpkg ––configure –a
sudo apt-get install –f

unsuccessfully. any ideas?

Rascas
Posts: 553
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Buster

Fri Oct 04, 2019 12:36 pm

farid77 wrote:
Fri Oct 04, 2019 12:15 pm
I am having the following problem when trying to install kodi in buster

Code: Select all

Setting up kodi (2:18.4-5~buster) ...
dpkg: error processing package kodi (--configure):
 installed kodi package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.28-10+rpi1) ...
Processing triggers for systemd (241-7~deb10u1+rpi1) ...
Processing triggers for mime-support (3.62) ...
Errors were encountered while processing:
 kodi
E: Sub-process /usr/bin/dpkg returned an error code (1)
i tried with:
sudo dpkg ––configure –a
sudo apt-get install –f

unsuccessfully. any ideas?
I cannot see what's the error with only that, you have to put the full output since when you issue the command.

Anyway, try removing everything kodi related:

Code: Select all

sudo apt-get purge kodi*
And install it again according to first post.

farid77
Posts: 6
Joined: Fri Feb 22, 2019 5:37 pm

Re: [Guide] Kodi on Raspbian Buster

Fri Oct 04, 2019 12:44 pm

Here is the log

https://pastebin.com/FyHZNRFC

and i already try to purgue and reinstall

Rascas
Posts: 553
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Buster

Fri Oct 04, 2019 2:39 pm

farid77 wrote:
Fri Oct 04, 2019 12:44 pm
Here is the log

https://pastebin.com/FyHZNRFC

and i already try to purgue and reinstall
Looks like you missed the dist-upgrade:

Code: Select all

sudo apt-get update && sudo apt-get dist-upgrade -y
Only "sudo apt upgrade" is not enough.

ppattard
Posts: 1
Joined: Sat Oct 05, 2019 8:18 pm

Re: [Guide] Kodi on Raspbian Buster

Sat Oct 05, 2019 8:27 pm

Hello,

Thanks a lot for the work! I'm on RPi 3 + Buster Lite and have tested today this new version.

I have a problem though: some videos are rendering just fine but I also have a lot that don't work properly, which worked previously on stretch. After a few seconds it stops as if it was buffering. Sometimes it starts to render again after a few tens of seconds, sometimes it does not. I have checked that CPU is idle when it happens and RAM is not full. I have given 256MB for the video card as recommended.
After playing a bit with the settings I found that using omxplayer instead of MMAL acceleration (which is the default) fixes the problem however omxplayer is not suitable for me as I have a USB sound card and it seems it is not supported with this acceleration (don't know why but read that of the kodi forum) so I always get the sound on HDMI channel if I use this option. So I'm willing to stay on the MMAL version.

Any of you encountered such playback issues ? Any hint to try and fix it ? I'm a bit stuck here and don't know what else to check.

Thanks.

piplip
Posts: 10
Joined: Sun Sep 29, 2019 6:12 pm

Re: [Guide] Kodi on Raspbian Buster

Sun Oct 06, 2019 1:32 pm

piplip wrote:
Tue Oct 01, 2019 5:45 pm
piplip wrote:
Sun Sep 29, 2019 6:45 pm
I put both logs (with hdmi/with composite video) on pastebin (I tried to attach them but both .log and .txt extensions aren't admitted here).
I removed the timestamps so it's easier to diff them.

with hdmi https://pastebin.com/EfRaY8NU
with composite video https://pastebin.com/RXM3HF6w

the only difference, apart from the available resolutions (only 720x576 with composite), is that the latter hangs at " NOTICE: Checking resolution 16"

FWIW if I leave the pi in NTSC mode kodi starts :o (though the tv isn't multi standard so it's black and white).
I tried with libreelec and it does the same.
Oh, and the pvr/tvheadend client is broken (the up/down arrows switch the channel only once, then they don't work, it seems like kodi thinks it's a normal video instead of a pvr client video). Again, libreelec does the same.
I did a fresh install of raspbian (just in case), same result, I upgraded the firmware with rpi-update (since I read somewhere else, I think in the kodi forum, that it fixed a similar problem) same result.
Is there really no way to use kodi with pal output?

Rascas
Posts: 553
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Buster

Sun Oct 06, 2019 11:27 pm

ppattard wrote:
Sat Oct 05, 2019 8:27 pm
Hello,

Thanks a lot for the work! I'm on RPi 3 + Buster Lite and have tested today this new version.

I have a problem though: some videos are rendering just fine but I also have a lot that don't work properly, which worked previously on stretch. After a few seconds it stops as if it was buffering. Sometimes it starts to render again after a few tens of seconds, sometimes it does not. I have checked that CPU is idle when it happens and RAM is not full. I have given 256MB for the video card as recommended.
After playing a bit with the settings I found that using omxplayer instead of MMAL acceleration (which is the default) fixes the problem however omxplayer is not suitable for me as I have a USB sound card and it seems it is not supported with this acceleration (don't know why but read that of the kodi forum) so I always get the sound on HDMI channel if I use this option. So I'm willing to stay on the MMAL version.

Any of you encountered such playback issues ? Any hint to try and fix it ? I'm a bit stuck here and don't know what else to check.

Thanks.
I don't see any diference between Kodi on Raspbian Stretch and Buster on the Pi 3. To check your problem, reproduce it and post your Kodi debug log: https://kodi.wiki/view/Log_file

PS: And yes, I believe that Kodi does not support DACs/USB sound cards if you enable OMXPlayer, but I never tested it.

Rascas
Posts: 553
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Buster

Sun Oct 06, 2019 11:38 pm

piplip wrote:
Sun Oct 06, 2019 1:32 pm
piplip wrote:
Tue Oct 01, 2019 5:45 pm
piplip wrote:
Sun Sep 29, 2019 6:45 pm
I put both logs (with hdmi/with composite video) on pastebin (I tried to attach them but both .log and .txt extensions aren't admitted here).
I removed the timestamps so it's easier to diff them.

with hdmi https://pastebin.com/EfRaY8NU
with composite video https://pastebin.com/RXM3HF6w

the only difference, apart from the available resolutions (only 720x576 with composite), is that the latter hangs at " NOTICE: Checking resolution 16"

FWIW if I leave the pi in NTSC mode kodi starts :o (though the tv isn't multi standard so it's black and white).
I tried with libreelec and it does the same.
Oh, and the pvr/tvheadend client is broken (the up/down arrows switch the channel only once, then they don't work, it seems like kodi thinks it's a normal video instead of a pvr client video). Again, libreelec does the same.
I did a fresh install of raspbian (just in case), same result, I upgraded the firmware with rpi-update (since I read somewhere else, I think in the kodi forum, that it fixed a similar problem) same result.
Is there really no way to use kodi with pal output?
Kodi works on old analog TV/Monitors with PAL or NTSC, but it may depend on the monitor. Some hacking is needed on config.txt. The last time I configured one was like more than one year ago, but after some tunning everything was fine, including the arcade emulators from RetroPie that was the main purpose. I saw that there was a kernel/firmware combo some time ago that had problems on the anolog video. It was supossedly fixed, but there may be a regression lately. See: https://retropie.org.uk/2019/07/retropie-4-5-1-update/
Try the kernel/firmware that they are using. Unfortunatly I don't have analog TV/Monitor for testing now...

PascalBu
Posts: 3
Joined: Mon Oct 07, 2019 8:50 pm

Re: [Guide] Kodi on Raspbian Buster

Mon Oct 07, 2019 8:55 pm

In need of some help here.

Was thoroughly enjoying Kodi, but then decided to try out another skin, more specifically Aeon Mq 8. Did not work out well... Stuck on the config screen forever, also after reboot and reinstall. Kodi every time start by trying to configure the skin (and crashing?)

Tried to fix it by removing guisettings.xml, but cannot find this file...

Would love some tips to get me going again!

Rascas
Posts: 553
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Buster

Mon Oct 07, 2019 10:17 pm

Kodi packages are now available on Raspbian Buster, more exactly on the raspberrypi.org repo. Just updated the first post accordingly.

I recommend that you remove the pipplware, you can do it by just running:

Code: Select all

sudo rm /etc/apt/sources.list.d/pipplware.list
sudo apt-get update

piplip
Posts: 10
Joined: Sun Sep 29, 2019 6:12 pm

Re: [Guide] Kodi on Raspbian Buster

Mon Oct 07, 2019 10:28 pm

Rascas wrote:
Sun Oct 06, 2019 11:38 pm
[there may be a regression lately. See: https://retropie.org.uk/2019/07/retropie-4-5-1-update/
Try the kernel/firmware that they are using. Unfortunatly I don't have analog TV/Monitor for testing now...

The bug report ("no composite output") seems different than my case (I have composite output, but kodi hangs) but I'll try anyway and report back. Thank you.

piplip
Posts: 10
Joined: Sun Sep 29, 2019 6:12 pm

Re: [Guide] Kodi on Raspbian Buster

Mon Oct 07, 2019 11:08 pm

I downgraded the kernel as per the directions here (sudo ./retropie_packages.sh raspbiantools install_firmware 1.20190401-1) and now kodi doesn't even start:

Illegal instruction (core dumped)
Crash report available at /home/pi/kodi_crashlog-20191008_000037.log

unfortunately the crash report seems bogus, at least the "LOG FILE" part (from the timestamps it's the kodi.log of the last attempt before downgrading the kernel).

Code: Select all

############## Kodi CRASH LOG ###############

################ SYSTEM INFO ################
 Date: Tue  8 Oct 00:01:47 BST 2019
 Kodi Options: 
 Arch: armv6l
 Kernel: Linux 4.14.98+ #1200 Tue Feb 12 20:11:02 GMT 2019
 Release: Raspbian GNU/Linux 10 (buster)
############## END SYSTEM INFO ##############

############### STACK TRACE #################
=====>  Core file: /home/pi/.kodi/temp/core (2019-10-08 00:01:46.566332719 +0100)
        =========================================
[New LWP 1003]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Core was generated by `/usr/lib/arm-linux-gnueabihf/kodi/kodi-rbpi_v8 --lircdev /var/run/lirc/lircd --'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x005a33a8 in xbmcutil::GlobalsSingleton<CApplication>::getInstance() ()

Thread 1 (Thread 0xb12d2c60 (LWP 1003)):
#0  0x005a33a8 in xbmcutil::GlobalsSingleton<CApplication>::getInstance() ()
#1  0x0051b648 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
############# END STACK TRACE ###############

Rascas
Posts: 553
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Buster

Mon Oct 07, 2019 11:45 pm

piplip wrote:
Mon Oct 07, 2019 11:08 pm
I downgraded the kernel as per the directions here (sudo ./retropie_packages.sh raspbiantools install_firmware 1.20190401-1) and now kodi doesn't even start:

Illegal instruction (core dumped)
Crash report available at /home/pi/kodi_crashlog-20191008_000037.log

unfortunately the crash report seems bogus, at least the "LOG FILE" part (from the timestamps it's the kodi.log of the last attempt before downgrading the kernel).

Code: Select all

############## Kodi CRASH LOG ###############

################ SYSTEM INFO ################
 Date: Tue  8 Oct 00:01:47 BST 2019
 Kodi Options: 
 Arch: armv6l
 Kernel: Linux 4.14.98+ #1200 Tue Feb 12 20:11:02 GMT 2019
 Release: Raspbian GNU/Linux 10 (buster)
############## END SYSTEM INFO ##############

############### STACK TRACE #################
=====>  Core file: /home/pi/.kodi/temp/core (2019-10-08 00:01:46.566332719 +0100)
        =========================================
[New LWP 1003]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Core was generated by `/usr/lib/arm-linux-gnueabihf/kodi/kodi-rbpi_v8 --lircdev /var/run/lirc/lircd --'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x005a33a8 in xbmcutil::GlobalsSingleton<CApplication>::getInstance() ()

Thread 1 (Thread 0xb12d2c60 (LWP 1003)):
#0  0x005a33a8 in xbmcutil::GlobalsSingleton<CApplication>::getInstance() ()
#1  0x0051b648 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
############# END STACK TRACE ###############
Well, I am out of ideas then. Since it happens also on LibreELEC, try asking on forum.kodi.tv. Do it with Libreelec first, otherwise you won't get much help there.

pinkfloydhomer
Posts: 2
Joined: Wed Oct 02, 2019 5:35 pm

Re: [Guide] Kodi on Raspbian Buster

Tue Oct 08, 2019 4:44 pm

Rascas wrote:
Wed Oct 02, 2019 7:59 pm
Enable debug logging as explained in the first post. And in the components log, enable ffmpeg. Any errors will be in the log but take note that if it is really frameskipping it will produce a quite big log.
You can also upload a test sample of the video for us to test to see if we can reproduce the error.
First post have nothing about debug logging, but I guess I can google it.

EDIT: I guess something like this? https://kodi.wiki/view/Log_file/Easy

I don't know if component specific logging was needed (I guess ffmpeg could be interesting?) but: https://paste.kodi.tv/cefuyehike.kodi

And in a stroke of luck, that video file that I chose at random (Sharp Objects S01E01) actually contains a lot of panning shots in it's opening scenes so it demonstrates the problem quite well. I just played the same file on my rpi3 at it is smooth. The rpi4 with this kodi on it, there are subtle (or not so subtle?) stutters every 5-10 seconds or so, it is very obvious in the panning shots, you focus on some object during the panning and suddenly there's a jump/skip/stutter/whatever.

Thanks in advance, let me know if I can do more!

Rascas
Posts: 553
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Buster

Tue Oct 08, 2019 10:18 pm

pinkfloydhomer wrote:
Tue Oct 08, 2019 4:44 pm
Rascas wrote:
Wed Oct 02, 2019 7:59 pm
Enable debug logging as explained in the first post. And in the components log, enable ffmpeg. Any errors will be in the log but take note that if it is really frameskipping it will produce a quite big log.
You can also upload a test sample of the video for us to test to see if we can reproduce the error.
First post have nothing about debug logging, but I guess I can google it.

EDIT: I guess something like this? https://kodi.wiki/view/Log_file/Easy

I don't know if component specific logging was needed (I guess ffmpeg could be interesting?) but: https://paste.kodi.tv/cefuyehike.kodi

And in a stroke of luck, that video file that I chose at random (Sharp Objects S01E01) actually contains a lot of panning shots in it's opening scenes so it demonstrates the problem quite well. I just played the same file on my rpi3 at it is smooth. The rpi4 with this kodi on it, there are subtle (or not so subtle?) stutters every 5-10 seconds or so, it is very obvious in the panning shots, you focus on some object during the panning and suddenly there's a jump/skip/stutter/whatever.

Thanks in advance, let me know if I can do more!
After looking at your log, I can see what the problem is, but I cannot see what is causing it and how to solve it.
Basically, by unknow reason, it is using software decoding for a 1920x1080p h264 which should be hardware decoding. If you look at the logs, you will see that Kodi is reporting the video as 1920x1088. And I believe it is the reason it is decoding it via software and causing it to stutter, as the h264 hardware decoder on the Pis are limited to 1080p max.
The first thing to do is to check if the video is really 1080p and not 1088p. Check with Mediainfo.

You are using a 4K TV and looks like you are forcing some settings on config.txt. The first thing I would do is, reset/use the default config.txt settings. Without any changes. And also with a clean Kodi settings. This is without forcing any resolution inside Kodi, changing scan settings, enable "Sync playback to display" and "Adjust display refresh rate", etc, etc.
This is to make sure the problem is not caused by any custom setting or configuration.

It would be usefull if you could post a sample of that video file, so I can test it at home.

vtolstov
Posts: 3
Joined: Thu Sep 26, 2019 8:44 pm

Re: [Guide] Kodi on Raspbian Buster

Wed Oct 09, 2019 9:40 pm

Does anybody have kernel errors when using kodi on rapsbian buster?
I don't have now kernel log (because reboot device and enable persistent logs in journald). But i have such errors two times.

Rascas
Posts: 553
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Buster

Thu Oct 10, 2019 10:10 am

vtolstov wrote:
Wed Oct 09, 2019 9:40 pm
Does anybody have kernel errors when using kodi on rapsbian buster?
I don't have now kernel log (because reboot device and enable persistent logs in journald). But i have such errors two times.
When you have them again, post the log...

vtolstov
Posts: 3
Joined: Thu Sep 26, 2019 8:44 pm

Re: [Guide] Kodi on Raspbian Buster

Thu Oct 10, 2019 10:26 am

Ok, now with persistent logs i think that this will be easy.

Return to “Raspbian”