Settings > Playback > Audio Output Changes On Plexamp Headless

I am running Plexamp Headless (v4.11.0). My Raspberry Pi has a HiFiBerry Digi2 Pro. My Audio Device needs to be set to ‘snd_rpi_hifiberry_digi: HiFiBerry Digi+ Pro HiFi wm8804-spdif-0’ in order for it to work, I have an optical cable to my Marantz receiver.

Many times this will change on it’s own, usually to ‘vc4-hdmi-0: MAI PCM i2s-hifi-0’ or ‘vc4-hdmi-1: MAI PCM i2s-hifi-0’. After this happens, trying to play any music nothing plays and I am back at the home page.

This has been happening for multiple versions of Plexamp Headless. I tried to get log files, but under Setting > Debugging there is no option to download logs.

This usually happens after I ssh into the Raspberry Pi and run ‘sudo apt-get update && sudo apt-get upgrade’ or ‘sudo reboot’.

the card number for a linux audio device can change after reboots and other events … and headless uses the card number to remember your selected audio device

one option to address is to disable all audio devices except the one you use for headless (i’ve seen other threads here that describe how to disable hdmi audio and the on-board headphone output on a Pi)

another option is to specify a preferred audio device as your default (this can be done, for example, in a ~/.asoundrc file … using your card name rather than the number), and then select the Default audio device using the headless browser interface

1 Like

On the list to use the card name instead of number…

2 Likes

Thank you. I believe I have fixed my issue with the ~/.asoundrc solution. I looking at documentation, there is a lot that can be in this file. I tried to keep mine as simple as possible.

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: sndrpihifiberry [snd_rpi_hifiberry_digi], device 0: HiFiBerry Digi+ Pro HiFi wm8804-spdif-0 [HiFiBerry Digi+ Pro HiFi wm8804-spdif-0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

I created a ~/.asoundrc file (see below), set the Plexamp Audio Device to Default. I rebooted my Raspberry Pi and the audio worked correctly.

.asoundrc file:

pcm.!default {
    type hw
    card sndrpihifiberry
}

ctl.!default {
    type hw           
    card 0
}

@tgp-2, thank you for the suggestion!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.