PlexAmp V2B2 on Raspberry Pi using wrong sound device

As a result of a drive failure I have had to rebuild my Plex Server running on a Raspberry Pi, which also had PlexAmp running on it - it’s all built into a unit containing amplifiers etc.

I had been using PlexAmp V1 previously, but decided to try V2B2 again, it is up and running and I can redirect to it from phone etc.

The problem I have is it has decided it wants to use the HDMI for sound rather the the IQAudio sound card that is attached to the Pi and I can’t find how to change this. I did find a post about doing it on V1, there being a mpd.conf file in a resources dir, but this doesn’t exist under V2.

The PlexServer works fine on the IQAudio, as does using VLC.

I do wonder if this is related to device locking I saw previously and other have commented on, has it taken HDMI because the IQAudio is in use by something else?

Tom

Any one got any thoughts on this?

It’s chuffing annoying as I’m having to make do with the browser being open on the Pi at the moment, but every so often it throws a wobbly then I have to log in and reload the web page.

Tom

What are the different output devices you have? Try to run:

aplay -l

Also, do you have an alsa config file? What is the content?

cat /etc/asound.conf
cat ~/.asoundrc

Edit the alsa config file to set the default playback device to match the number of the wanted device outputted from the first command. For example:

defaults.pcm.card 1
defaults.ctl.card 1

@masi

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 2/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 2: IQaudIODAC [IQaudIODAC], device 0: IQaudIO DAC HiFi pcm512x-hifi-0 [IQaudIO DAC HiFi pcm512x-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Neither asound.conf or .asoundrc exist.

Playing from VLC the sound is delivered to IQAudio
Playing from Plex in the browser is delivered to IQAudio
Playing from PlexAmp the sound is delivered to HDMI

pi@raspberrypi:/ $ aplay -L
default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
jack
    JACK Audio Connection Kit
pulse
    PulseAudio Sound Server
sysdefault:CARD=b1
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Default Audio Device
dmix:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct sample mixing device
dsnoop:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct sample snooping device
hw:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct hardware device without any conversions
plughw:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Hardware device with all software conversions
usbstream:CARD=b1
    bcm2835 HDMI 1
    USB Stream Output
sysdefault:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
dmix:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample mixing device
dsnoop:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample snooping device
hw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Hardware device with all software conversions
usbstream:CARD=Headphones
    bcm2835 Headphones
    USB Stream Output
sysdefault:CARD=IQaudIODAC
    IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
    Default Audio Device
dmix:CARD=IQaudIODAC,DEV=0
    IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
    Direct sample mixing device
dsnoop:CARD=IQaudIODAC,DEV=0
    IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
    Direct sample snooping device
hw:CARD=IQaudIODAC,DEV=0
    IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
    Direct hardware device without any conversions
plughw:CARD=IQaudIODAC,DEV=0
    IQaudIODAC, IQaudIO DAC HiFi pcm512x-hifi-0
    Hardware device with all software conversions
usbstream:CARD=IQaudIODAC
    IQaudIODAC
    USB Stream Output

I am far from ALSA knowledgeable… But it looks like your DAC is card #2, so create the /etc/asound.conf file (sudo nano /etc/asound.conf) with the 2 lines below and then reboot the Pi. It should globally set card #2 as default.

defaults.pcm.card 2
defaults.ctl.card 2

Well…

Sound is now coming from the IQAudio for PlexAmp, but no longer for VLC or Plex Media in the browser.

Removing the lines doesn’t restore it to as was either.

Tom

Hi again! I suspect that now you need a “mixer” in ALSA to support multiple applications playing sound… First application “steals” the interface. (all the things :crazy_face:)

Just a little test: If you reboot the RPi. Start VLC first - will VLC then play sound? But Plexamp not?

Reference:
https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture

Update your /etc/asound.conf to something like this:

defaults.pcm.card 2
defaults.ctl.card 2

pcm.iqaudio {
  type hw
  card 2
  device 0
}

pcm.dmixer {
  type dmix
  ipc_key 1024
  ipc_perm 0666
  slave.pcm "iqaudio"
  slave {
    period_time 0
    period_size 1024
    buffer_size 8192
    format S32_LE
    rate 96000
#    rate 44100 <- don't know sample rates possible for the DAC?
  }
  bindings {
    0 0
    1 1
  }
}

ctl.dmixer {
  type hw
  card 2
}

pcm.!default {
  type plug
  slave.pcm "dmixer"
}

I don’t know what the story is here.

I get no sound at all. If I right click the speaker and choose profiles and choose HDMI VLC & Plex in the browser uses that.

But for some reason whilst the Pi is on the network, can access the internet and has the IP I expect, it is now no longer available from other machines on the network, so I can’t VNC, SSH or use PlexAmp!

PlexAmp from the browser version of Plex on the Pi appears 3 times, but none of them produce output anywhere.

Wish there was some way of resetting the sound system back to basic install, or for that matter the entire OS, I’m beginning to think a reinstall might be the only approach.

Appears that you have additional network related problems. If you go for the route of reinstalling from scratch, consider following this script, provided by another forum member:

https://forums.plex.tv/t/plexamp-installer-for-raspberry-pi-with-armv7l-hw/664489

What’s annoying is I didn’t have network issues until I started trying to sort the sound issue.

Tom

Can this help you?

@masi

OK, after some playing around this morning, it appears the network issue is tied to one Windows 10 machine no longer being able to SSH/VNC to the Pi - while weird, it’s a relief that a network issue on the Pi hadn’t mysteriously appeared as a result of trying to fix the sound issue.

Checking the /boot/config.txt I noticed that the overlay for the IQAudio wasn’t there, adding that and commenting out dtparam=audio-on and rebooting, when I now check aplay -l only the IQAudio is listed. Under the speaker in the top right however, the only device listed for audio output is the bluetooth earphones, choosing profiles only lists the earphone also.

Playing music from anything yields nothing from the sounds card however.

Tom

@lpr

I have an IQAudio card on the Pi already, for some reason applications aren’t always inclined to use it.

Tom

I believe the issue may lie with pulseaudio.

pacmd list-sinks

returns a single entry with the name , I think this should be pointing to something alsa related, a bridge?

Tom

Too many unknowns for me with your installation… I was not aware that you run PulseAudio on top of ALSA. I’m not familiar with PulseAudio. Also, I don’t use a desktop environment with my PI, just headless. (Actually I don’t use desktop for any of my linux machines :stuck_out_tongue: ). So I’m not sure what is referred to or what is “behind” what you refer to as the “speaker in the top right”. Is PulseAudio necessary?

Now that you have disabled the built-in audio - have you changed the ALSA /etc/asound.conf file accordingly? I guess your DAC is now indexed as Card 0? In that case the /etc/asound.conf should be modified to:

defaults.pcm.card 0
defaults.ctl.card 0

pcm.iqaudio {
  type hw
  card 0
  device 0
}

pcm.dmixer {
  type dmix
  ipc_key 1024
  ipc_perm 0666
  slave.pcm "iqaudio"
  slave {
    period_time 0
    period_size 1024
    buffer_size 8192
    format S32_LE
    rate 44100
  }
  bindings {
    0 0
    1 1
  }
}

ctl.dmixer {
  type hw
  card 0
}

pcm.!default {
  type plug
  slave.pcm "dmixer"
}

Also, I see now from your response above, when you quote the /etc/asound.conf file, that the complete file is not include? The last part up to and including the pcm.!default section in the configuration is not included in the quote - but it is present in your file?

Again, I’m not familiar with PulseAudio at all - sorry for not being able to help out more.

@masi

Raspbian comes as default with PulseAudio these days.

I removed pulse, and for a while all was fine, then after a restart I have no sounds at all. Everything I try to play music with on the Pi says the device is already in use, trying to play via PlexAmp seems to be playing to nothing.

I currently don’t have the asound.conf, though I’m going to try adding it back before I get really cheesed off with this mess and have to pull the whole thing apart and do a fresh install.

Tom

Not the " Raspberry Pi OS Lite" version, you must be running the desktop version!

According to @elan there is a config option in the server.json file that will allow you to select which audio device is used by Plexamp:

},
"audio: {
“device”: “device name here”
}

I have been wrangling with this for hours trying to find the right voodoo incantation to place in “device name” to get my USB Dac working, but to no avail. I used the wording from the log for mine (FiiO USB DAC E17K". But audio continues to be pushed thru the on-board headphone jack in mono.

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