ehough / docker-kodi

Dockerized Kodi with audio and video
https://hub.docker.com/r/erichough/kodi/
GNU General Public License v3.0
232 stars 54 forks source link

Playing DVD #32

Open GorillaCoder opened 4 years ago

GorillaCoder commented 4 years ago

How do I run x11docker so that kodi can either:

ehough commented 4 years ago

Though I haven't tested this myself, I would imagine that it would simply be a matter of exposing your DVD drive to your Kodi container. e.g. something like this:

$ /usr/local/bin/x11docker --share /dev/dvd:ro ... erichough/kodi

Of course, replace /dev/dvd with whatever device your host system uses for its DVD drive. Kodi should be able to access the device and everything should work as expected. Give that a try?

GorillaCoder commented 4 years ago

Thanks much, I'm still a docker/x11docker noob. Let me try it, and I'll let you know how it goes. Perhaps a worthwhile addition to the doc?

ehough commented 4 years ago

Checking in. Did you have any luck?

GorillaCoder commented 4 years ago

Thanks for reaching out. I'm fighting it. I'd love to get kodi running in docker (first step in dockerizing my whole "house server", but not much luck.

Minor issue: with --share /dev/dvd:ro x11docker blows chow complaining docker: bad mode specified: ro. Replacing it with just --share /dev/dvd at least lets docker/x11/kodi run.

The real issue is that when running with the following command line: /usr/bin/x11docker --share /dev/dvd --hostdbus --gpu --home=$HOME/kodi -- -v /media/giuliano/45035146-fa0d-4b8a-95d7-4c6d06477427 -- erichough/kodi, the host /dev/dvd is not showing up in the container. From inside kodi I go to Setting/File manager/Add source/Browse/Root filesystem, and then dive down into /dev. All I see is: dri fd mqueue pts shm.

At this point I'm trying to just become conversant with x11docker, and figuring out why the --share isn't working. Unfortunately, trying to merely have it bring up kde-plasma fails:x11docker --desktop --gpu --init=systemd x11docker/kde-plasma squawking: /usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server. If I could at least get x11docker to bring up a simple terminal I'd have half a chance at figuring out what's going on. I could look at dmesg, try sharing other files/folders/devices and see if the are shared in the container, etc.

At some point I'll just need to bail and install kodi on the host system. I've just started a new gig, and have a whole new code base to get up to speed on.

Any how, thanks again for checking in!

GorillaCoder commented 4 years ago

Ah, BTW, x11docker seems to think it is sharing /dev/dvd and /dev/sr0:

x11docker note: Option --share: Shared file is a symbolic link. Sharing target, too. Symlink: /dev/dvd Target: /dev/sr0

On the off chance the symlink was the issue, I also tried --share=/dev/sr0 with no luck there either.

mviereck commented 4 years ago

Basic thought: Maybe kodi cannot handle the device file directly but needs the dvd to be mounted. Share the mount point. Some systems automatically mount dvds in /media. Maybe --share /media works.

If I could at least get x11docker to bring up a simple terminal I'd have half a chance at figuring out what's going on.

You can get a terminal with:

x11docker --interactive --no-entrypoint --share /dev/dvd -- erichough/kodi bash

the host /dev/dvd is not showing up in the container.

Just checked, /dev/dvd and /dev/sr0 do appear here.

-v /media/giuliano/45035146-fa0d-4b8a-95d7-4c6d06477427

This looks suspicious. This does not share a host volume but creates one in Docker. Is this intended?

GorillaCoder commented 4 years ago

Thanks.

I need to figure out how to get to the device, if I'm to get access to the DVD. Ideally to dbus too, so I can get it to auto load. Thanks for clueing me in about how to run bash. Hopefully I'll have time to play with it this week.

The -v was me playing around, based on something I saw in either the x11docker or docker-kodi docs, I've forgotten which. Not really directly related to this. Basically, it's where my ripped media is.

Thanks again, you've been very helpful. I appreciate it.

mviereck commented 4 years ago

Some first progress!

I've inserted an audio CD in my computer. Opening it showed cdda://sr0/ in the file browser. Here I found that the CD is sort of mounted in /run/user/1000/gvfs/cdda:host=sr0.

Docker fails to share this. Ideally we should share /run/user/1000/gvfs, but this fails with:

docker: Error response from daemon: error while creating mount source path '/run/user/1000/gvfs': mkdir /run/user/1000/gvfs: file exists. 

Sharing /run/user/1000 (same as XDG_RUNTIME_DIR) works, but exposes some sensitive data from host. So this is not a good solution.

This works so far:

x11docker --pulseaudio --share $XDG_RUNTIME_DIR -- erichough/kodi

In kodi, browse to /run/user/1000/gvfs/cdda:host=sr0. You see an empty folder. Click "Add", and the audio files appear.