Skip to content
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

[Bug]: mpv missing in docker image and no mention in documentation #2910

Closed
3 tasks done
michaelkrieger opened this issue Mar 16, 2024 · 6 comments
Closed
3 tasks done
Labels
bug triage New bug reports that need to be evaluated

Comments

@michaelkrieger
Copy link

michaelkrieger commented Mar 16, 2024

I confirm that:

  • I have searched the existing open AND closed issues to see if an issue already exists for the bug I've encountered
  • I'm using the latest version (your issue may have been fixed already)

Version

0.51.1

Current Behavior

$ docker exec -ti navidrome sh
/app $ mpv --audio-device=help
sh: mpv: not found

Expected Behavior

Docker container should have mpv to enable jukebox mode for architectures where it is supported.
Alpine mpv packages exist.

Steps To Reproduce

We can use jukebox mode in docker by either passing /dev/snd to the container (for exclusive use by navidrome) or ideally passing the pulseaudio socket at /run/user/1000/pulse (for non-exclusive use of the audio output which is more friendly to other system applications).

The dockerfile should be updated to add the mpv package to the container by default.

Environment

- OS: Docker running on Debian Stable
- Browser: Chrome
- Client: N/A

How Navidrome is installed?

Docker

Configuration

relevant excerpt

  navidrome:
    user: 1000:1000
    devices:
      - /dev/snd
    environment:
      ND_JUKEBOX_ENABLED: "true"
    volumes:
      - /run/user/1000/pulse/:/run/user/1000/pulse/

Relevant log output

Version: 0.51.1 (6d253225)
...
time="2024-03-16T18:48:46Z" level=info msg="Starting playback server"
time="2024-03-16T18:48:46Z" level=info msg="1 audio devices found"
time="2024-03-16T18:48:46Z" level=info msg="Using audio device: auto"
...
time="2024-03-16T18:48:46Z" level=info msg="----> Navidrome server is ready!" address="0.0.0.0:4533" startupTime=18.9ms tlsEnabled=false

Anything else?

# docker exec -ti --user root navidrome sh
/app # apk add mpv
...
OK: 202 MiB in 179 packages

/app # mpv --audio-device=help
List of detected audio devices:
  'auto' (Autoselect device)
  'alsa' (Default (alsa))
  'alsa/default:CARD=PCH' (HDA Intel PCH, ALC233 Analog/Default Audio Device)
  'alsa/sysdefault:CARD=PCH' (HDA Intel PCH, ALC233 Analog/Default Audio Device)
  'alsa/front:CARD=PCH,DEV=0' (HDA Intel PCH, ALC233 Analog/Front output / input)
  'alsa/surround21:CARD=PCH,DEV=0' (HDA Intel PCH, ALC233 Analog/2.1 Surround output to Front and Subwoofer speakers)
  'alsa/surround40:CARD=PCH,DEV=0' (HDA Intel PCH, ALC233 Analog/4.0 Surround output to Front and Rear speakers)
  'alsa/surround41:CARD=PCH,DEV=0' (HDA Intel PCH, ALC233 Analog/4.1 Surround output to Front, Rear and Subwoofer speakers)
  'alsa/surround50:CARD=PCH,DEV=0' (HDA Intel PCH, ALC233 Analog/5.0 Surround output to Front, Center and Rear speakers)
  'alsa/surround51:CARD=PCH,DEV=0' (HDA Intel PCH, ALC233 Analog/5.1 Surround output to Front, Center, Rear and Subwoofer speakers)
  'alsa/surround71:CARD=PCH,DEV=0' (HDA Intel PCH, ALC233 Analog/7.1 Surround output to Front, Center, Side, Rear and Woofer speakers)
  'alsa/hdmi:CARD=PCH,DEV=0' (HDA Intel PCH, HDMI 0/HDMI Audio Output)
  'alsa/hdmi:CARD=PCH,DEV=1' (HDA Intel PCH, HDMI 1/HDMI Audio Output)
  'alsa/hdmi:CARD=PCH,DEV=2' (HDA Intel PCH, HDMI 2/HDMI Audio Output)
  'jack' (Default (jack))
  'sndio' (Default (sndio))

Once this is done, mpv exists and can see all of the sound devices on the system, though navidrome has already tried to enumerate devices and doesn't show any in the web interface.

Alternately, the documentation should be updated to advise whether this is not supported in a docker configuration.
Right now, jukebox mode doesn't work in docker, but there is no mention of this or why.

Code of Conduct

  • I agree to follow Navidrome's Code of Conduct
@michaelkrieger michaelkrieger added bug triage New bug reports that need to be evaluated labels Mar 16, 2024
@michaelkrieger michaelkrieger changed the title [Bug]: mpv missing in docker image [Bug]: mpv missing in docker image and no mention in documentation Mar 16, 2024
@MRodneyMcKay
Copy link

MRodneyMcKay commented Apr 20, 2024

Hope that this bugreport will be more successfull, than my feature request.
I would like to use jukebox mode on a truenas app, and their support says thatonce mpv is present at the docker, they can experiment with sound devices, playback modes, but until then, they cannot do anything

@deluan
Copy link
Member

deluan commented Apr 20, 2024

Adding MPV to the image increases its size considerably:
Current:

deluan/navidrome                     develop              4a7c5af5cb83   6 minutes ago   173MB

With MPV:

deluan/navidrome                     develop              c1dda16003ca   7 seconds ago   246MB

I don't think it is worthy adding it by default, as most users don't use the Jukebox mode.

Ideally we would have to change the pipeline/release process to add a new Docker image variant, including MPV. Contributions are most welcome :)

In the meantime, you could create your own image, by using this simple Dockerfile:

FROM deluan/navidrome:latest
RUN apk add --no-cache mpv

@michaelkrieger
Copy link
Author

Adding MPV to the image increases its size considerably
I do wonder if all the dependencies are required for this purpose, as MPV isn’t huge in itself. I’ll have a look at what is required.

Ideally we would have to change the pipeline/release process to add a new Docker image variant, including MPV.
Agreed. A new tag with MPV is helpful.

Also, I’m not sure disk size is a huge consideration for most folks on container size, but I understand wanting a small core container.

@MRodneyMcKay
Copy link

I don't think it is worthy adding it by default, as most users don't use the Jukebox mode.

Right now, the app has a feature, which, ideally, should be supported on all platforms.

Adding MPV to the image increases its size considerably:

I understand your consertn about needlessly increase the image size, with, arguably bloat. However, there are certain usecases, (like on TrueNAS), where you cannot really edit the docker.
Would it really be that hard and resource intensive, to publish another docker train, with jukebox support? So itnot only contains MPV, but all relevant config to make it actually work (a simple direct strem to an ALSA device, no need to play with pulse sockets/pipes).
How can I contribute to the release proccess, so it would work?

@deluan
Copy link
Member

deluan commented Apr 22, 2024

where you cannot really edit the docker.

I'm not suggesting editing an image, but to create your own using the Dockerfile mentioned above.

Would it really be that hard and resource intensive, to publish another docker train, with jukebox support?

Is not that hard, but it is also not free. Remember, this is an open source project that I work on in my spare time...

So itnot only contains MPV, but all relevant config to make it actually work (a simple direct strem to an ALSA device, no need to play with pulse sockets/pipes). How can I contribute to the release proccess, so it would work?

I decided to add mpv to the image, as you can see in ca005f6. In the end, using Alpine 3.18, it only added ~20MB uncompressed (~10%). But I don't have any means to test it on TrueNAS, so feel free to contribute with changes required to make it work.

@MRodneyMcKay
Copy link

Thank you, this works great in a docker in arch!
From now on, we will need to work on the Truenas app release/config.
This commit solved our issue, this can get merged, if it is alright

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage New bug reports that need to be evaluated
Projects
None yet
Development

No branches or pull requests

3 participants