3

Problems when using mpd with pulse

Pulseaudio was created in order to enable using more than 1 audio source for one sink (correct?). If so, it should be possible to use one sink for mpd and another audio source right? That's exactly what I'm trying to do and I can't find the way.

Relevant Info

  • I use Awesome WM and pulseaudio so I rely purely commands to change audio settings - No gnome-settings for example.
  • I use mpd as a service and the user running it is mpd in group audio.
  • I have 2 audio outputs of type pulse defined in my /etc/mpd.conf that use the following sinks: alsa_output.pci-0000_00_03.0.hdmi-stereo and alsa_output.pci-0000_00_1b.0.analog-stereo.
  • I can switch between those 2 audio outputs with mpc or other client for mpd like ncmpcpp.
  • This is the output of grep -E "pulse|mpd|audio":
    audio:x:29:pulse
    pulse:x:123:mpd
    pulse-access:x:124:mpd
    Bonus Question: Why are there 2 groups for pulse and what is the difference between them?
  • I use Ubuntu 16.04.

The problem is that if I want to hear music from my browser for example, I have to pause mpd and refresh the page. It's quite annoying and sometimes I have to refresh the page more than once to hear something.

What I know

  • I can view the programs that use (or want to use audio) with pacmd list-sink-inputs and I never see mpd there.
  • I know that mpd is running it's own pulseaudio session because I can see with htop/top/ps aux the following:
    doron [..] /usr/bin/pulseaudio --start --log-target=syslog -vvvv
    mpd [..] /usr/bin/pulseaudio --start --log-target=syslog -vvvv

1 Answer 1

3

I've found the Solution in archlinux's great wiki: https://wiki.archlinux.org/index.php/Music_Player_Daemon/Tips_and_tricks#PulseAudio.

Notes

  • You need to have the following line in your /etc/pulse/default.pa (Use the commented line if you find it):
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
  • Don't use localhost as the server for mpd to talk with in /etc/mpd.conf, Use 127.0.0.1.
  • I would sudo service mpd stop before pulseaudio --kill and then sudo service mpd start.
1
  • 1
    Maybe you could change this to say: You need the following line in your /etc/pulse/default.pa... load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1. The first load-module... part may already be in your default.pa, uncomment it. Took me a few extra minutes to get this as I read "right after" as next line... Great solution! Thank you!!!
    – erwin
    Jul 13, 2021 at 5:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .