-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--gpu and --alsa options don't respect host ownership of devices in /dev/snd and /dev/dri #24
Conversation
Thank you! Depending on the container system there may be different ways to allow access to The docker bug report you've linked is a few years old; maybe it has been fixed and has a regression now. There has been a docker update a few days ago. On the x11docker side I've made a related change in V3.9.2.3, but that should not have effect here. It just --group-add's the GIDs of |
Thank you. x11docker has been incredibly useful for me and I think it has huge potential as more people learn about your work. Happy to contribute a little.
I remember updating Docker on my host a few days ago but didn't connect the dots that it might have been related. Sure enough, it's a regression reported here with a corresponding PR here. Presumably that will make it into the next Docker release. I'm not sure if there are any negative side effects of leaving my patch in x11docker. I haven't noticed any problems. At the very least, folks running x11docker with Docker 17.12.1 won't run into problems. p.s. I'm close to publishing details of how I run Kodi with x11docker. Once that's ready, I'll submit another PR for you to consider listing it with the other examples. |
# 05.03.2017 V3.9.4.0 --pulseaudio --hostnet: no fallback to alsa, use localhost IP instead # --pulseaudio --no-internet: fallback to --alsa # 04.03.2017 clean up error message on docker startup failure, remove multiple error lines # --systemd: bugfix: terminate x11docker if systemd startup fails # stdout and stderr of image command outsourced of docker.log # docker log -f > docker.log to get output in detached mode # --sys-admin: no longer deprecated, needed for debian 9 images (but not debian 10). # --net and --ipc changed to --hostnet and --hostipc # --dbus-daemon changed to --dbus-system # --auto --gpu: fallback to --hostdisplay for seamless mode if xpra and weston not found (#23) # 02.03.2018 #24 mount /dev/dri and /dev/snd not only with --device, but also --volume to keep ownership+group # --hostdisplay: minor bugfix: Use correct display number to share /tmp/.X0-lock, only share if it exists # more verbose messages in waiting routines
I am willingly to add a kodi example in the Readme. Do you want to create an automated build on docker hub? I have seen you shared Why do you add capability |
Cool! Yes, I'll create an automated build on Docker Hub + a repo. I'm still having a few audio/video quirks that I'm working out. e.g. sometimes I'll get no video after leaving it sit for a few days. Once that's done I'll publish my work and let you know. I just want to feel a little more confident about my setup before I share it.
Just personal preference. I run a bunch of local services on that box (file sharing, DNS, Kerberos, etc) and Kodi is non-essential so I |
The docker bug is fixed in current Docker version 18.03.1-ce. |
I'm enjoying the use of x11docker to run Kodi and, with the exception of a few kinks that need to be ironed out, it's been working great for the past few months.
This week, my sound stopped working and the video suddenly looked choppy. In the course of debugging, I found that the problem was related to the container's permissions of
/dev/snd/*
and/dev/dri/*
. The good news is that I believe I found a simple fix that you might want to consider.On my host, the items in
/dev/snd
and/dev/dri
have group ownership ofaudio
andvideo
. I think that's pretty standard for (at least) Debian-based distros..But in the container, if you inspect those same directories, you'll see that the items have
root:root
ownership:The result is that the processes started by x11docker, which are non-root of course, can't read/write to these devices. In my case, that results in Kodi not being able to utilize hardware video acceleration and output any sound.
So for some reason
--device
makes the respective devicesroot:root
in the container, but we need it to respect at least the group ownership. I found this comment which suggested adding-v
in addition to--device
. I tried that and boom:I don't know if that's a bug in Docker, or if there's a "better" way to get Docker to respect permissions of raw devices. Nor do I know why I'm only now seeing these issues. But I do know that adding
-v /dev/snd:/dev/snd
and-v /dev/dri:/dev/dri
fixes things for me.Here's a copy of my latest
x11docker.log
. In the "Created docker command" area you can see that I added my workaround.Thoughts?