2

I've read tons of threads about this, but i cant figure it out. So i have a MPD server running on Raspbian, with an external sound card attached to it. Music works fine trough mpd with the 2 channels, but not for 6 channels.

Also i am confused what is the task of all programs involved.

So there's alsa. I Have tried to change the /etc/asound.conf to many different configurations. Like: pcm.!default { type route slave.pcm surround51 slave.channels 6 ttable.0.0 1 ttable.1.1 1 ttable.0.2 1 ttable.1.3 1 ttable.0.5 0.5 ttable.1.5 0.5 }

But it did not work. My current settings are:

    pcm.!default {
    type hw
    card 2
    device 0
}

    ctl.!default {
    type hw
    card 2   #If you want to set HDMI as output ,turn 0 to 1.
}

Then there is pulse audio. I am not sure if the function of both programs overlap, or if you should use them together. To the pulseaudio config file /etc/pulse/daemon.conf i have edited the following line:

default-sample-channels = 6

Furthermore i have added the following line to /etc/pulse/default.pa

set-card-profile 2 output:analog-surround-51
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 # IP of l$

But i am not sure it has any effect at all.

So last there is mpd configuration which I had configure at ~/.mpd/mpd.conf

    audio_output {
        type            "alsa"
        name            "My ALSA Device"
        mixer_type      "software"             
        mixer_control   "PCM"
}

If i change alsa to pulse i cant hear sound. Furthermore, the command speaker-test -c 6 -t wav

IS working for 6 channels. Since mpd is configured with alsa, and speaker-test does work, i guess that it is pulseaudio that creates the surround sound. But how can i configure MPD to work with surround sound?

Does anyone have any idea? Any help is much appreciated!

Here is the ouput of aplay -l

    xcb_connection_has_error() returned true
card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sunxisndhdmi [sunxi-sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Device [USB Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

and

Update: If i play sound as the mpd user it also works with surround sound

sudo -u mpd speaker-test -c 6 -t wav
Julian
  • 385
  • 2
  • 9

1 Answers1

2

Eventually this worked for me:

pcm.ch51 {
    slave sl2
    #slave.channels 6
    type route
    ttable.0.0 1
    ttable.1.1 1
    ttable.0.2 1
    ttable.1.3 1
    ttable.0.4 0.5
    ttable.1.4 0.5
    ttable.0.5 0.5
    ttable.1.5 0.5
}

pcm_slave.sl2 {
    channels 6
    pcm "hw:1,0"
}

In ~/.asoundrc. The table thing duplicates sound to other speakers so all 5+1 speakers are used. The pcm "hw:1,0" selects my external usb sound card.

Additionally in ~/.mpd/mpd.conf

audio_output {
    type            "alsa"
    name            "My ALSA Device"
    channels        "6"
    device          "ch51"

You select the device specified in asound.rc

Ich
  • 1,350
  • 16
  • 27
Julian
  • 385
  • 2
  • 9