linuxserver / docker-airsonic

GNU General Public License v3.0
37 stars 8 forks source link

Jukebox mode can't find any audio devices #26

Closed witten closed 4 years ago

witten commented 5 years ago

I'm trying to set up Jukebox mode for local playback, as documented here: https://airsonic.github.io/docs/jukebox/

The first step list is to compile and run some Java code to list available audio devices. When I do that with the LinuxServer Airsonic image, this is what I get:

sudo docker run -it --rm -v /scratch:/scratch \
  --device /dev/snd:/dev/snd --entrypoint bash linuxserver/airsonic:v10.4.0-ls29
root@8aa7db053f60:/# cd /scratch
root@8aa7db053f60:/scratch# ls
audioDevList.class
root@8aa7db053f60:/scratch# java audioDevList
Available mixers:
PulseAudio Mixer

But this doesn't list any of my actual audio devices, and I don't even have PulseAudio installed.

According to this Airsonic issue comment, the problem may be that you're using the headless JRE variant instead of the non-headless one containing audio capabilities.

This also means that no actual audio devices show up in the Jukebox player settings (not my screenshot).

If I try the same procedure on the same host with the official Airsonic Docker image, which is built with the non-headless JRE, I get the following results:

sudo docker run -it --rm -v /scratch:/scratch \
  --device /dev/snd:/dev/snd --entrypoint bash airsonic/airsonic:10.4.0-RELEASE
bash-4.4# cd /scratch/
bash-4.4# ls
audioDevList.class
bash-4.4# java audioDevList
Available mixers:
HDMI [plughw:0,3]
HDMI [plughw:0,7]
HDMI [plughw:0,8]
HDMI [plughw:0,9]
PCH [plughw:1,0]
Port HDMI [hw:0]
Port PCH [hw:1]

Actual audio devices!

Host OS: Manjaro Linux 18.1-rc10 Host kernel: 4.19.69 Docker version: 19.03.1-ce, build 74b1e89e8a

witten commented 5 years ago

As suspected: I confirmed that rebuilding the linuxserver/airsonic Docker image with s/-headless// and s/headless=true/headless=false/ across all files in the repo results in a working audio device list:

# java audioDevList
Available mixers:
PulseAudio Mixer
HDMI [plughw:0,3]
HDMI [plughw:0,7]
HDMI [plughw:0,8]
HDMI [plughw:0,9]
PCH [plughw:1,0]
Port HDMI [hw:0]
Port PCH [hw:1]

And when I run the image with the appropriate PUID/PGID so that the Airsonic Docker image user has read access to the /dev/snd devices, then the audio devices also show up in the pull-down list in Airsonic's Java Jukebox devices UI.

tobbenb commented 5 years ago

We accept PR's, if you have the fix ready.

witten commented 5 years ago

Added!

tobbenb commented 5 years ago

Thanks. I commented on the PR.