charts icon indicating copy to clipboard operation
charts copied to clipboard

Navidrome, configure the container so local audo playback feature would work

Open MRodneyMcKay opened this issue 10 months ago • 8 comments

Navidrome has implemented local playback (aka jukebox, documentation ) mode, which at the moment cannot be used because of the configuration of the container. As far as i know, only a few changes would be needed to implement the dependencies

  • map /dev/snd (from host) to /dev/snd (container)
  • alsa be present
  • mpd be present There is no need to add extre steps to the install proccess (although it would be nice), If the feature can be configured with config files described in navidrome and mpd configuration, i am happy

MRodneyMcKay avatar Apr 13 '24 05:04 MRodneyMcKay

Doesn't that need mpv to exist in the container as well? Took a quicklook on the Dockerfile upstream and I didn't see it being added.

Also host should probably have audio drivers, which I'm not sure if there are for all audio devices if any at all.

stavros-k avatar Apr 18 '24 13:04 stavros-k

yes, mpv is not present, that is why i have raised the issue. If truenas did not remove it from the linux kernel, there should be sound drivers available on the host (if this is an indication, my external usb soundcard gets mounted to /dev/snd).

MRodneyMcKay avatar Apr 19 '24 13:04 MRodneyMcKay

If mpv is missing from the container, we cannot do something. We use the official navidrome container. Once navidrome adds mpv in the container we can revisit the audio devices mounting.

stavros-k avatar Apr 19 '24 13:04 stavros-k

Oh, i see. I thought you could configure in a way so, it would install it. It has been mentioned several times, that mpv would need to get added, ive opened a feature request for that, but there has been a bug reoprt raised as well: https://github.com/navidrome/navidrome/issues/2910

MRodneyMcKay avatar Apr 19 '24 13:04 MRodneyMcKay

Am I right to assume, that we do not need a complicated pulse audio server setup, we would only need a simple ALSA setup? So the sound would not get resampled and only the container could play sound with the forwarded device

MRodneyMcKay avatar Apr 19 '24 13:04 MRodneyMcKay

Am I right to assume, that we do not need a complicated pulse audio server setup, we would only need a simple ALSA setup? So the sound would not get resampled and only the container could play sound with the forwarded device

To be honest, I'm not sure, I am not aware of how the whole thing is implemented. Once we have mpv in the container we can do some tests.

stavros-k avatar Apr 19 '24 13:04 stavros-k

mpv is now included in an image, tagged develop

MRodneyMcKay avatar Apr 22 '24 07:04 MRodneyMcKay

I was experimenting with this a littlebit and it seems, relatively easy to make it work (on my laptop). I had to append these to the docker run and it worked flawlessly. --device /dev/snd (so the docker container has access to the sound devices) --group-add "$(getent group audio | cut -d: -f3)" (so, the container can play music)

MRodneyMcKay avatar Apr 22 '24 17:04 MRodneyMcKay

So, mpv is in the image tagged latest, so now, this could get be dealt with.

MRodneyMcKay avatar May 16 '24 18:05 MRodneyMcKay