mpd: Failed to read mixer for 'My ALSA Device': no such mixer control: PCM

16,051

Solution 1

@CL was right; alsa was working but mpd was not.

I discovered that if I switched to the home folder of the mpd user (export HOME=/var/log/mpd), the aplay commands (e.g. sudo -u mpd aplay /usr/share/sounds/alsa/Front_Center.wav) would no longer work.

More Googling until I found http://ubuntuforums.org/showthread.php?t=1138454

The solution was sudo apt-get remove pulseaudio. Once that was done, everything was working again.

Solution 2

Since your using MPD with pulseaudio, you can change the audio_output accordingly:

sudo nano /etc/mpd.conf

Comment this section:

#audio_output {
#   type       "alsa"
#   name       "My ALSA Device"
#   device      "hw:0,0"    # optional
#   mixer_type      "hardware"      # optional
#   mixer_device    "default"   # optional
#   mixer_control   "PCM"       # optional
#   mixer_index "0"     # optional
#}

Uncomment this

audio_output {
    type        "pulse"
    name        "My Pulse Output"
#   server      "remote_server"     # optional
#   sink        "remote_server_sink"    # optional
}

You may have to add rights on the mpd user too:

sudo adduser mpd pulse
sudo adduser mpd pulse-access

Restart your MPD:

sudo systemctl restart mpd

Solution 3

For me the solution was to set mixer_control to "Headphones" as amixer output suggested.

audio_output {
   type          "alsa"
   name          "My ALSA Device"
   mixer_control "Headphones"
}

This is for the Raspberry Pi 1 B.

Share:
16,051

Related videos on Youtube

user220227
Author by

user220227

Updated on September 18, 2022

Comments

  • user220227
    user220227 over 1 year

    I had mpd/mpc running on my Ubuntu 12.04.3 LTS headless, X-less server. I decided to switch out the songs; I moved the old songs out of the /Music directory, moved the new songs in, and ran mpc update, but it failed to resume playing.

    Naturally, I started changing things, according to what I could find on Google, but nothing seems to work.

    When I run mpc commands, like mpc status, I get the error message Failed to read mixer for 'My ALSA Device': no such mixer control: PCM.

    I can play music when I use the command sudo aplay piano.wav, and similar commands.

    Here's some diagnostic info: http://pastebin.com/1CzbeYBC. It contains

    • /etc/mpd.conf
    • aplay -L
    • aplay -l
    • mpd verbose from the command line
    • amixer & amixer contents

    I would appreciate any pointers! Thank you.

    • CL.
      CL. over 10 years
      Why sudo? Don't you have access to the device nodes in /dev/snd/? Are you member of the audio group?
    • user220227
      user220227 over 10 years
      @CL: mpd runs under the account mpd, but that account doesn't have login privileges, so I use sudo when debugging. My login is not a member of the audio group, but mpd is. /dev/snd/* have crw-rw---T permissions, and belong to the group audio.
    • user220227
      user220227 over 10 years
      I added alsa-info.sh output: pastebin.com/2zmWPKv6
    • CL.
      CL. over 10 years
      Does amixer set "PCM" 0dB work? If yes, something has changed with the mpd configuration.
    • user220227
      user220227 over 10 years
      @CL: Continued... I don't know if that's what you meant when you asked if it "worked". Yet aplay still works and mpd still does not.
    • CL.
      CL. over 10 years
      Yes, that works. If amixer and aplay work, then there is nothing wrong with your ALSA configuration. It is possible that mpd does not have rights you think it has.
  • Sethos II
    Sethos II almost 3 years
    On my Raspberry Pi 1 B+ the correct mixer is "Headphone" without "s" at the end. You can check this with amixer scontrols.