INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: QNAP installation in Container Station for local playback  (Read 1281 times)

joechip

  • Recent member
  • *
  • Posts: 13
QNAP installation in Container Station for local playback
« on: December 22, 2023, 02:32:32 pm »

Hi All...

Thanks up front for any guidance offered, and apologies for being a slightly helpless noob to Linux and Docker.

I am running a QNAP NAS (TS-464) with native graphics and an HDMI output. I have an SMSL DO100 DAC connected via USB. Audio and video output works on the host - HD Station runs QNAP's onboard services (MusicStation, Spotify, etc...) without any issue.

I have used the QNAP Container Station 3 and installed Max's docker container for MC (shiomax/jrivermc) and have it working perfectly as a network streaming device to various clients.

Where I am having difficulty is getting the audio (and video) drivers working in the container so that I can get local MC audio (and video) output, from the SMSL connected to the TS-464's USB (and video output from the HDMI). The installation is apparently failing to expose the host services/drivers to the container - from the logs:

setup-devices: sound not supported: device /dev/snd not exposed to the container.

[and]

setup-intel-gpu: Directory '/dev/dri' not exposed to container. Cannot setup intel gpu.

From what I have been able to find (the instructions on Container Station 3 seem opaque) the host drivers should just be inherently available to containers within Container Station.

If anyone has any suggestions or experience getting local playback in MC running on Container Station, I would be grateful for any help.

Thanks,
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 359
Re: QNAP installation in Container Station for local playback
« Reply #1 on: December 24, 2023, 08:52:03 pm »

Hi All...

Thanks up front for any guidance offered, and apologies for being a slightly helpless noob to Linux and Docker.

I am running a QNAP NAS (TS-464) with native graphics and an HDMI output. I have an SMSL DO100 DAC connected via USB. Audio and video output works on the host - HD Station runs QNAP's onboard services (MusicStation, Spotify, etc...) without any issue.

I have used the QNAP Container Station 3 and installed Max's docker container for MC (shiomax/jrivermc) and have it working perfectly as a network streaming device to various clients.

Where I am having difficulty is getting the audio (and video) drivers working in the container so that I can get local MC audio (and video) output, from the SMSL connected to the TS-464's USB (and video output from the HDMI). The installation is apparently failing to expose the host services/drivers to the container - from the logs:

setup-devices: sound not supported: device /dev/snd not exposed to the container.

[and]

setup-intel-gpu: Directory '/dev/dri' not exposed to container. Cannot setup intel gpu.

From what I have been able to find (the instructions on Container Station 3 seem opaque) the host drivers should just be inherently available to containers within Container Station.

If anyone has any suggestions or experience getting local playback in MC running on Container Station, I would be grateful for any help.

Thanks,

You need to expose /dev/snd (for audio) and /dev/dri/renderD128 + /dev/dri/card0 (for video) to the container on container creation for that to work.

I only have instructions on how to do that with docker or docker-compose. In qnap as far as I can tell itīs under Advanced options > Runtime. Linked an image for where that would be (never used qnap, just looked it up).

Getting your GPU working for MC in the container is (as stated in the docs) a bit experimental. The main reason is that I donīt really have a setup to test that properly. So, Iīm also curious how that works out for you. It should work for compute (as in decoding over media network to another box that plays it) but it wonīt make it possible for you to plug a display into the container. For audio it works like that but not for video.
Logged

joechip

  • Recent member
  • *
  • Posts: 13
Re: QNAP installation in Container Station for local playback
« Reply #2 on: December 25, 2023, 02:08:45 pm »

Thank you Max,

I think I have followed your suggestion and configured the container with the audio and video devices (see the attached). But I am still getting the same failure where both host devices aren't being seen by the MC container. I'm assuming this is a QNAP issue and will send a service ticket, though I doubt I will get any kind of helpful response.

I appreciate you having a look though! Maybe I will just try and setup a virtual environment and see if I can figure out how to run MC locally on Debian - something new to get my head around.

Cheers
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 359
Re: QNAP installation in Container Station for local playback
« Reply #3 on: December 25, 2023, 08:35:15 pm »

Thank you Max,

I think I have followed your suggestion and configured the container with the audio and video devices (see the attached). But I am still getting the same failure where both host devices aren't being seen by the MC container. I'm assuming this is a QNAP issue and will send a service ticket, though I doubt I will get any kind of helpful response.

I appreciate you having a look though! Maybe I will just try and setup a virtual environment and see if I can figure out how to run MC locally on Debian - something new to get my head around.

Cheers

You can inspect the container it created with

Code: [Select]
docker inspect <name or id>

If you donīt know either you can list running containers with

Code: [Select]
docker ps

The part of the docker inspect output youīre looking for would look something like this

Code: [Select]
"Devices": [
   {
        "PathOnHost": "/dev/snd",
        "PathInContainer": "/dev/snd",
         "CgroupPermissions": "rwm"
    }
]

Youīd have two more for the GPU. "PathInContainer" has to be /dev/snd, /dev/dri/renderD128 and /dev/dri/card0. "PathOnHost" needs to be whatever those devices are on the host. Docker does allow you to rename devices when mapping to anything you want, but I donīt see that in the qnap ui.

I think you have to put together a docker run command with the devices and run that to deploy the container. Alternatively, you can also deploy portainer. Itīs a gui for docker that runs itself in docker that would allow you to do that too. For both ways you need to also know what each of those devices is called on your qnap. You should be able to tell that by looking at the docker inspect output of the container qnap created.

Logged

joechip

  • Recent member
  • *
  • Posts: 13
Re: QNAP installation in Container Station for local playback
« Reply #4 on: December 26, 2023, 08:50:11 pm »

So, after building a number of different VMs (Windows and Debian/Ubuntu) I found the sound driver implementation to be vexing: I couldn't get my DAC to operate without audible garbage (clicks and noise) and dropouts/stops in any of the VM installations. So I decided to come back to QNAP's container station and, using Max's suggestion, dug in to Portainer a little bit and got my head around editing the docker run command and managed to get the sound device to show up in the container, linking the "/dev/snd" on the host to the container. Audio so far sounds smooth and without digital artifacts or noise.

Will take a stab next at video. I am also slightly perplexed that I can only get 48kHz out of the DAC now, which I am guessing is a limitation created by a configuration within the audio driver itself...will also try and dig into this.

Big thank you for the help Max. 

 
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 359
Re: QNAP installation in Container Station for local playback
« Reply #5 on: December 27, 2023, 07:37:25 am »

Will take a stab next at video. I am also slightly perplexed that I can only get 48kHz out of the DAC now, which I am guessing is a limitation created by a configuration within the audio driver itself...will also try and dig into this.

You should be able to change to HW output in MC then it should also play higher than 48kHz.

I have a little hifiberry setup and by giving the container access to /dev/snd I get all of the options attached.
Logged
Pages: [1]   Go Up