MPD does not play flac, Failed to open "My ALSA Device"

Need help with MPD?
Post Reply
Art_Mooney
Posts: 4
Joined: February 2nd, 2021, 9:31 pm

MPD does not play flac, Failed to open "My ALSA Device"

Post by Art_Mooney »

Hi,
I am new to mpd. I managed to install it, connect to it using android app MALP. The app shows me all the files and I can select them and click "play". However, no sound plays. I use the HDMI port on a Raspberry Pi 3B.

Here is what the logfile says:

Code: Select all

ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
Feb 02 22:23 : exception: Failed to open "My ALSA Device" (alsa)
Feb 02 22:23 : exception: nested: Failed to open ALSA device "plughw:0,0": No such file or directory
Feb 02 22:23 : exception: Failed to open "My ALSA Device" (alsa)
Feb 02 22:23 : exception: nested: Failed to open ALSA device "plughw:0,0": No such file or directory
Feb 02 22:27 : player: played "flac/Wayne Shorter/Speak No Evil/Wayne Shorter - Witch Hunt.flac"
Feb 02 22:27 : zeroconf: No global port, disabling zeroconf
Feb 02 22:29 : player: played "flac/Wayne Shorter/Speak No Evil/Wayne Shorter - Witch Hunt.flac"
Feb 02 22:29 : zeroconf: No global port, disabling zeroconf
Obviously, there is a problem with ALSA (and zeroconf?). Here is the relevant part of my mpd.conf:

Code: Select all

audio_output {
        type            "alsa"
        name            "My ALSA Device"
#       device          "plughw:0,0"    # optional
#       mixer_type      "hardware"      # optional
#       mixer_device    "default"       # optional
#       mixer_control   "PCM"           # optional
#       mixer_index     "0"             # optional
When I type "speaker-test -c2 -twav -l7 -D plughw:0,0" I hear the sound output as desired.

I tried uncommenting the "device" line, no change. I noticed that my /etc/asound.conf is empty. I have no idea what the file should contain.

Any ideas, what the problem is?

Here is some more information. I do not know, if this is relevant.

Code: Select all

pi@raspberrypi:~ $ cat /proc/asound/modules
 0 snd_bcm2835
 1 snd_bcm2835

Code: Select all

pi@raspberrypi:~ $ aplay --list-pcm
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=b1
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Default Audio Device
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
default:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
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
max
Forum team
Posts: 1242
Joined: January 15th, 2013, 3:43 pm

Re: MPD does not play flac, Failed to open "My ALSA Device"

Post by max »

How did you install MPD? Which version?
How do you launch MPD?
Does MPD have permission to access the sound devices?
Art_Mooney
Posts: 4
Joined: February 2nd, 2021, 9:31 pm

Re: MPD does not play flac, Failed to open "My ALSA Device"

Post by Art_Mooney »

The question concerning the permission helped. I had to add user mpd to the group "audio" manually in /etc/group.

It works now. Thank you for the help!
Post Reply