Better performance from within docker than apt install on Raspberry Pi OS - RPi4B
#1
Weird one here that I'd love to get to the bottom of.  I don't love the special, kodi-only OS's, for a variety of different reasons each, so, I decided to try a few alternate routes.

The "best" (easiest?) one I've found so far is a kodi-specific docker image https://github.com/rimago/rpi-kodi that's based off of balenalib's bullseye raspbian build, from 2022-11-25.  The docker install then just does a really straight forward bunch of apt installs, and ends up just running "kodi-standalone" inside.

If I replicate that exactly, outside the container, the install feels much "clunkier" running it, and any video playing is incredibly low fps.

Below are two pics of Kodi, on the same RPi, during the same boot.  Host kodi-standalone,

Image

Docker container kodi-standalone second,

Image

I'm obviously perfectly happy to provide any logs you guys want, but this has me baffled!
Reply
#2
from the cpu usage it appears to be the difference between hardware and software decoding

not enough information to draw any conclusions, go ahead and post a Debug Log for each to https://paste.kodi.tv
Reply
#3
(2023-06-23, 02:07)seaders Wrote: The "best" (easiest?) one I've found so far is a kodi-specific docker image https://github.com/rimago/rpi-kodi that's based off of balenalib's bullseye raspbian build, from 2022-11-25.  The docker install then just does a really straight forward bunch of apt installs, and ends up just running "kodi-standalone" inside.

If I replicate that exactly, outside the container, the install feels much "clunkier" running it, and any video playing is incredibly low fps.

I concur that this looks like a HW vs SW decoding issue given the CPU utilization numbers. But with regards to your comments, I've been running LibreElec on Raspberry Pis for a few years (since model 2s) and it's always been very smooth and no major issues.  I am not sure what other OS builds / images you tested.  Loading a docker container on top of an OS just to run Kodi seems to add another level of complexity unless you are planning to run other docker apps.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#4
"Working" docker container log - https://paste.kodi.tv/zokamivoha.kodi

"Imperfect" host log * - https://paste.kodi.tv/otawodomiy.kodi


I ran the host as root, as I saw some issues when it was run as a normal user, and the docker container runs as privileged and root.

From my own scanning of the logs, the biggest red flag is the OpenGL issue? 
Quote:2023-06-23 11:44:33.525 T:6373    debug <general>: Failed to create EGL context (EGL error 12288)
2023-06-23 11:44:33.527 T:6373  warning <general>: Your OpenGL drivers do not support OpenGL 3.2 core profile. Kodi will run in compatibility mode, but performance may suffer.
Quote:2023-06-23 11:44:45.377 T:6373    error <general>: CShader::InsertSource - failed to open file gl_tonemap.glsl
Quote:2023-06-23 11:44:33.524 T:6373    debug <general>: failed to find EGL config with EGL_NATIVE_VISUAL_ID=808669761
2023-06-23 11:44:33.524 T:6373    debug <general>: failed to find EGL config with EGL_NATIVE_VISUAL_ID=808669784
and a HDMI one?
Quote:2023-06-23 11:44:33.890 T:6378     info <general>: CAESinkALSA - Unable to open device "default" for playback
2023-06-23 11:44:33.914 T:6378     info <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi0" for playback
2023-06-23 11:44:33.915 T:6378     info <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi0,DEV=0" for playback
 
There also seems to be general issues on both around hdml
Quote:2023-06-23 11:46:04.706 T:6379 info <general>: CAESinkALSA::Initialize - Opened device "hdmi:CARD=vc4hdmi1,DEV=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x02"
2023-06-23 11:46:04.706 T:6379 info <general>: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
---

Also, I do have plans to do all sorts with docker on the pi, and plenty of other messing about.  I've run both LibreElec and OSMC in the past, and they're both good in many ways, while also have their flaws.  Nonetheless, Raspberry Pi OS is the default and flagship OS of the thing, I think it's a shame that you can't do a plain old `sudo apt install kodi` right away, and have a "good" working version of it.  There's already delays from debian's builds to RPiOS, there are then more delays, if you want to run one of the media centre OS's to there, and more, different delays with getting the latest Kodi build to those platforms.

There's currently a 20.1 build of Kodi on debian bookworm, which was released a few weeks ago.  I don't know when that will come down the line to us, and then, after that, how that build of Kodi will run on the Pi.

As for complexity with the docker build, it really wasn't.  Docker is fully supported on the Pi now, and I got it up and running in less than 5 minutes.
Reply
#5
(2023-06-23, 13:59)seaders Wrote: As for complexity with the docker build, it really wasn't.  Docker is fully supported on the Pi now, and I got it up and running in less than 5 minutes.

My complexity reference was simply for ongoing support.  With this approach you manage the OS, docker and Kodi, not to mention the Kodi library, scraping etc.  I realize all-in-one solutions like LibreElec may be a bit less flexible but all things being equal, ongoing support should be less work.  But as with most of this type technology, it gets down to what folks are most comfortable with.  I run, what many might consider a complex Kodi solution, with centralized sharing and a number of other specialized tools.  But for me it provides near 100% automation.  It's what I am accustomed to.


Thanks,

jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#6
(2023-06-23, 14:18)jbinkley60 Wrote:
(2023-06-23, 13:59)seaders Wrote: As for complexity with the docker build, it really wasn't.  Docker is fully supported on the Pi now, and I got it up and running in less than 5 minutes.

My complexity reference was simply for ongoing support.  With this approach you manage the OS, docker and Kodi, not to mention the Kodi library, scraping etc.  I realize all-in-one solutions like LibreElec may be a bit less flexible but all things being equal, ongoing support should be less work.  But as with most of this type technology, it gets down to what folks are most comfortable with.  I run, what many might consider a complex Kodi solution, with centralized sharing and a number of other specialized tools.  But for me it provides near 100% automation.  It's what I am accustomed to.


Thanks,

jeff

Totally get, and appreciate your point, but I really, really like to play with any and all the tech toys like the Pi's that I get.  When I'm doing that, I'll often make some plan of a "perfect" project I want, but then real life comes along and makes that plan change.  IMO, when I'm then "stuck" in a custom build of Libre, Core, or OSMC - which don't even have raspi-config available - that bugs me a ton.

As a real big fan of both the Pi, and Kodi though, my main point is still the above one, IMO everyone with a Pi should be able to install the vanilla Pi OS, and be able to "easily" install an okay version of Kodi too, just like folks on Windows, and OSX, and Linux, and Android can, especially on the current flagship Pi, because you know the exact hardware you're dealing with there.
Reply
#7
[edited above comment]
Reply
#8
as i suspected the host installation isnt using hardware acceleration - https://paste.kodi.tv/zexufecogu.kodi line 883
where the docker is using it - https://paste.kodi.tv/zokamivoha.kodi line 618

i think you will find that the audio errors in zokamivoha (docker) at line 97 are because those devices are not available to docker
but in the end both use vc4-hdmi-1 for audio so those would be negligable errors as those devices it can't use aren't supposed to be used anyway

need to compare the kodi settings for video acceleration on both and see if the host can use hardware acceleration - https://kodi.wiki/view/Settings/Player/Videos
(be sure expert level is selected to see the acceleration options)

as far as if it is requiring root to use hardware acceleration i have no insight as i have never come across this


offtopic addition

since you are running docker with multiple containers i would recommend looking into portainer for docker management
i use it with my docker containers and i absolutely love it
Reply
#9
(2023-06-23, 13:59)seaders Wrote: Nonetheless, Raspberry Pi OS is the default and flagship OS of the thing, I think it's a shame that you can't do a plain old `sudo apt install kodi` right away, and have a "good" working version of it.
If you install RPiOS bullseye, and then apt-install kodi, you will have kodi working with hardware acceleration.
I've done this countless times (as have many others).
Reply
#10
Host (broken boi)

Image

Container (fairly well working boi)

Image

Not sure which "internals" / text settings you want?  I can get them much easier than screenies cos I can get them remotely from my chair in the office here! Big Grin

offtopic reply...

I'll absolutely try that out cos I've been blown away by the support of Docker on the pi, I really wasn't expecting it to be this good (hadn't gone near any of it while I was running everything from a SD Card).  I was mildly disappointed that VSCode's docker container magic doesn't work out of the box just yet.  I'm sure I / they will get it working, but might take a wee while.
Reply
#11
its there, docker has "Allow using DRM PRIME" under Enable HQ Scalers, the host does not

that made me look back at the logs, the host is using OpenGL where docker is using OpenGL ES - this is likely the difference

there is probably an advanced setting to force allow it, if it is capable on OpenGL

im not familiar in this aspect, i can do some research and implore you to do some of your own - my knowledge lies in Android*, Linux*, Debian* and Kodi* in general and we are now getting more pi* specific


im also going to tag @basilgello here since they are the official kodi from debian representative and you did get it from debian

i expect they would be much more knowledgeable as this gets less general and more specific
Reply
#12
question - are all the packages that the docker installs also installed on your host? - https://github.com/rimago/rpi-kodi/blob/...erfile#L50
Reply
#13
(2023-06-23, 17:49)jepsizofye Wrote: question - are all the packages that the docker installs also installed on your host? - https://github.com/rimago/rpi-kodi/blob/...erfile#L50

Yep, they are indeed.

Though I might try a reinstall, just in case to see.
Reply
#14
Okay... terribly sorry for all this, but now I'm here with my tail between my legs cos... After a reinstall, none of those issues are present, on the base install and everything is running easily as well as what was coming from the docker container.  I'm really not sure what I'd done to my system, but it clearly caused an issue, to a ton of things up and down...

One thing that does seem to be odd/broken though is mkv files, like the one above.  When I go to play it, no errors show up, nor seem to be occurring, but, it seems like the signal is cut off from my TV?

I can hear audio fine, and like, skip forward and rewind back.  Stopping it brings me back to the menu area, but while the video's playing, all goes to black and my TV says "searching for sources", as if they Pi is completely off.

debug log - https://paste.kodi.tv/dikumulufu.kodi

Sorry again for the above, all's NEARLY perfect now, if I could get this good too, I'd be delighted.
Reply
#15
sounds like it is playing on the wrong screen or the resolution it switched to isnt supported by the tv - more so the first

your log is cut off, please provide the uncut version

-----

all good on the previous posts at least you got it going the way it should be (almost)
Reply

Logout Mark Read Team Forum Stats Members Help
Better performance from within docker than apt install on Raspberry Pi OS - RPi4B0