You are not logged in.

#1 2014-10-26 08:04:17

jlmr
Member
Registered: 2014-10-26
Posts: 14

[SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

Hi everyone,

I'm now working on my first ArchLinux installation and I've been working on the following problem for the last days or so. Somehow only one application can play sound at a time. I've read a lot of posts on this forum and the wiki, but nothing I do seems to fix the problem. Right now the only thing that seems to play audio is chromium. My main problem is that MPD produces no sound, but Plex Home Theather also produces nothing at the moment.

I'll try to post some of the relevant configuration files and outputs here:

sudo fuser -v /dev/snd/*
---------------------------------------------------------------------------------------------
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  mpd         375 F.... pulseaudio
                     jelmer      590 F.... chromium
/dev/snd/controlC1:  mpd         375 F.... pulseaudio
/dev/snd/pcmC0D0p:   jelmer      590 F...m chromium
/dev/snd/pcmC1D7p:   mpd         375 F...m pulseaudio
/dev/snd/timer:      jelmer      590 f.... chromium
cat /etc/mpd.conf
---------------------------------------------------------------------------------------------
# See: /usr/share/doc/mpd/mpdconf.example

pid_file "/run/mpd/mpd.pid"
db_file "/var/lib/mpd/mpd.db"
state_file "/var/lib/mpd/mpdstate"
playlist_directory "/var/lib/mpd/playlists"
music_directory "/var/lib/mpd/music"

audio_output {
	type		"pulse"
	name		"MPD"
}
pgrep -af pulseaudio
---------------------------------------------------------------------------------------------
375 /usr/bin/pulseaudio --start --log-target=syslog
cat /etc/asound.conf
---------------------------------------------------------------------------------------------
# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

# vim:set ft=alsaconf:

As far as I can tell there are two audio devices on my machine: one built-in on the motherboard (which I'm using) and one in the NVidia graphics card (which I'm not using). Alsamixer levels are unmuted and 100%.

I hope you can point me to a fix or a way to further diagnose this problem.

Last edited by jlmr (2014-10-28 21:52:10)

Offline

#2 2014-10-26 08:35:28

parazyd
Member
From: Amsterdam
Registered: 2012-10-14
Posts: 259
Website

Re: [SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

Same thing happens to me. Whichever applications plays a  sound first, gets the priority and then other applications can't give any sound.
It probably started happening after installing PulseAudio. I remember it being fine only with alsa.

Offline

#3 2014-10-26 17:11:45

mindcrime
Member
Registered: 2014-10-11
Posts: 33

Re: [SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

What desktop environment are you using? Did the issue arise after installing Pulse (did audio work properly with just ALSA - or did you test it at all)?

You can try this.

I found this topic that mentioned the program above.

I also found PulseAudio-ALSA which might be of some use. Note that it's redundant unless you specifically need Pulse for some application.


Arch user since August 2014.
Currently flirting with BSPWM ~\\~ CLI enthusiast.
Also currently building an Arch desktop PC. Suggestions welcome!
Please excuse occasional beginner questions.

Offline

#4 2014-10-26 21:44:45

jlmr
Member
Registered: 2014-10-26
Posts: 14

Re: [SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

I'm not using a DE per se: I installed X11 and XMonad. I'm now slowly adding things such as a filemanager and so on.

PulseAudio-ALSA was already installed. I reinstalled it, but nothing changed. Also enabling simultaneous output in paprefs didn't change anything.

Offline

#5 2014-10-27 22:54:16

mindcrime
Member
Registered: 2014-10-11
Posts: 33

Re: [SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

Huh. I poked around a little bit but cannot find much of anything besides what I mentioned in my previous post.

Being a complete beginner with Arch, I am not sure what else to suggest other than what I personally would do...

I would uninstall Pulse and the program(s) that require it and test sound with just ALSA (after a reboot) and then re-install Pulse if audio was working properly without it. If it does not work properly without Pulse, then you have more testing to do with ALSA.

After that I would re-install Pulse (and any apps that require it) and do some trial and error.

If you find that the issue is predominately in MPD, and you just want to try a different player out, I suggest MOC.

Good luck!


Arch user since August 2014.
Currently flirting with BSPWM ~\\~ CLI enthusiast.
Also currently building an Arch desktop PC. Suggestions welcome!
Please excuse occasional beginner questions.

Offline

#6 2014-10-28 07:27:37

jlmr
Member
Registered: 2014-10-26
Posts: 14

Re: [SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

I thought I had it figured out. In the journal I found the following error messages:

Oct 28 08:12:10 argon systemd[1]: Started Music Player Daemon.
Oct 28 08:12:10 argon mpd[360]: server_socket: bind to '0.0.0.0:6600' failed: Address already in use (continuing anyway, because binding to '[::]:6600' succeeded)
Oct 28 08:12:12 argon pulseaudio[376]: [pulseaudio] module-jackdbus-detect.c: Unable to contact D-Bus session bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY fo
Oct 28 08:12:12 argon pulseaudio[376]: [pulseaudio] module.c: Failed to load module "module-jackdbus-detect" (argument: "channels=2"): initialization failed.
Oct 28 08:12:12 argon pulseaudio[376]: [pulseaudio] main.c: Module load failed.
Oct 28 08:12:12 argon pulseaudio[376]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Oct 28 08:12:12 argon pulseaudio[376]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Oct 28 08:12:12 argon pulseaudio[376]: [pulseaudio] bluez5-util.c: GetManagedObjects() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files

So I created the DBus files as described here: https://wiki.archlinux.org/index.php/Systemd/User#D-Bus. But the same error still pops up. Should I also do this? On the one hand I would say yes, because PulseAudio is complaining about a $DISPLAT variable. But why would PulseAudio need something related to the display anyway?

Offline

#7 2014-10-28 15:12:46

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

My first guess would be that you start mpd before you start pulseaudio. That would mean that mpd cannot connect to pulse, thus not being able to output the sound. This does not see to be the case though, as Plex is also not producing sound. How do you start Plex and MPD?

About the dbus problem: Can you post the output of

systemctl list-units | grep dbus

Since you do not use a DE, how do you start your graphical session? DM or via startx?

Offline

#8 2014-10-28 17:20:30

jlmr
Member
Registered: 2014-10-26
Posts: 14

Re: [SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

Hi runical,

Apparently one of the previous steps I took fixed Plex. Both it and Chromium play fine. So now it seems to be only MPD that's having a problem.

systemctl list-units | grep dbus
dbus.service                                                                              loaded active running   D-Bus System Message Bus
dbus.socket                                                                               loaded active running   D-Bus System Message Bus Socket

I start XMonad using the SliM display manager, but I think it just uses .xinitrc to start it.

Offline

#9 2014-10-28 18:55:55

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

Hmm, I heard that slim had some problems with systemd, but I am not sure what the problems are.

So, d-bus is running as it is supposed to. Do you by any chance start mpd using a service file? If so, can you try moving it to either .xinitrc or the xmonad startup config? (That would remove the problem of mpd starting before pulse)

Offline

#10 2014-10-28 19:50:31

jlmr
Member
Registered: 2014-10-26
Posts: 14

Re: [SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

Runical how would I do that? I'm now starting MPD as a seperate user 'mpd' using a service file. Can I start from xinitrc as a different user (mpd)?

Offline

#11 2014-10-28 20:02:04

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

That could be the problem. If you use mpd with a separate user with pulseaudio, you will need to have a pulseaudio instance running for that user. For that, see the wiki. The workaround is linked there.

For a quick test, you can set up mpd for a local user (also described in the wiki) and add the following to your .xinitrc (before the exec command):

mpd &

Last edited by runical (2014-10-28 20:02:35)

Offline

#12 2014-10-28 21:50:32

jlmr
Member
Registered: 2014-10-26
Posts: 14

Re: [SOLVED] Problems with ALSA and PulseAudio: no sound in MPD

Hi runical,

I implemented the workaround you linked to and now it works! Thanks a lot!

Offline

Board footer

Powered by FluxBB