I just confirmed this to be the problem. @bscphil and @psyke83 you guys are geniuses for find this out.
Basically, here is what happens. When I originally compiled Kodi, I was able to launch it from a terminal and it worked great. But when I tried using chvt
or even wrote my own proggy to switch terminals, the Kodi would be extremely slow. It didn't have time or patience to figure out why and came up with the kodi-shell@.service
hack, which creates a logged-in shell, switches to it and launches Kodi.
This works 99% of the time, but as @bscphil has discovered it would misfire once in a while. I now know why.
creates a logged-in shell on tty8, behind the scenes systemd/logind creates needed ACLs which give Kodi access to /dev/dri/renderD128
. My guess is that occasionally systemd/logind doesn't have enough time to set up the ACLs and Kodi ends up not being able to access the file and falls back to the LLVMPipe renderer, which is extremely slow.
Same thing would happen when I tried using chvt
earlier. (Since no shell was being created, Kodi didn't have access to the file from that tty.)
If I either chown :video /dev/dri/renderD128
or add myself to the render
group, everything starts working beautifully. No more need for kodi-shell@.service
I will try to do another release soon with these fixes. My only question is, should we change ownership of /dev/dri/renderD128
to the video
group, or should just advise the user to add themselves to the render
If any of the RPi devs happen to be reading this, please advise.