You are not logged in.

#1 2015-12-22 15:10:41

Paris
Member
Registered: 2013-07-22
Posts: 21

[SOLVED] Mpd locks sound with pulseaudio.

Hello,

I have mpd running with pulseaudio and my problem is that when mpd is running I get no sound from other sources like a game, a video played with smplayer or even a youtube video (it actually causes flash to crash).

This is my mpdfconf:

~$ cat .mpdconf 
music_directory     "/home/.../music"
playlist_directory  "/home/.../playlists"
log_file            "/home/.../mpd.log"
db_file             "/home/.../mpd.db"
pid_file            "/home/.../pid"
state_file          "/home/.../state"

bind_to_address     "localhost"
filesystem_charset  "UTF-8"
id3v1_encoding      "UTF-8"
metadata_to_use     "artist,album,title,track,name,genre,date,composer,performer,disc"

audio_output {
        type                    "pulse"
        name                  "pulseaudio"
}

Do I need to change something in this configuration file? It used to work fine before I installed pulseaudio for skype and obs studio mostly.

Last edited by Paris (2015-12-22 22:14:44)

Offline

#2 2015-12-22 15:28:46

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,601

Re: [SOLVED] Mpd locks sound with pulseaudio.

Have you installed extra/pulseaudio-alsa  ?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2015-12-22 15:48:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,076

Re: [SOLVED] Mpd locks sound with pulseaudio.

you need to setup mpd as a normal user instance https://wiki.archlinux.org/index.php/Mu … er_user.29 or set the necessary pulse modules correctly so that your other applications are allowed to access the mpd started pulse server: https://wiki.archlinux.org/index.php/Pu … er_network (The network here, being your own computer)

Afaik mpd user instance should be prefered but I don't use it (yet) so I don't have that much experience here, maybe Rasi pops in he can definitely give saner advice.

You might also want to post

sudo fuser -v /dev/snd/*

so we can confirm this suspicion

@ewaller shouldn't be necessary with applications that can natively use pulse, as is the case here.

Last edited by V1del (2015-12-22 15:54:38)

Offline

#4 2015-12-22 15:51:58

Paris
Member
Registered: 2013-07-22
Posts: 21

Re: [SOLVED] Mpd locks sound with pulseaudio.

Thank you for your answer. I do:

~$ pacman -Qs pulseaudio-alsa
local/pulseaudio-alsa 2-3
    ALSA Configuration for PulseAudio

Offline

#5 2015-12-22 16:02:03

Paris
Member
Registered: 2013-07-22
Posts: 21

Re: [SOLVED] Mpd locks sound with pulseaudio.

@v1del

Thank you too for answering. I think I do run mpd as a normal user instance. My mpdconf is the one in my home directory.

# fuser -v /dev/snd/*
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  me       542 F.... pulseaudio
/dev/snd/controlC1:  me       542 F.... pulseaudio
/dev/snd/pcmC0D0p:   me       542 F...m pulseaudio

Last edited by Paris (2015-12-22 16:04:21)

Offline

#6 2015-12-22 16:05:17

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,076

Re: [SOLVED] Mpd locks sound with pulseaudio.

can you post the fuser command while having mpd open?

Looks good, any error messages related to connecting to pulse in the output of any of the other programs?

Last edited by V1del (2015-12-22 16:07:07)

Offline

#7 2015-12-22 16:11:32

Paris
Member
Registered: 2013-07-22
Posts: 21

Re: [SOLVED] Mpd locks sound with pulseaudio.

If mpd is paused (for example through sonata client) my other applications have normal sound output but mpd won't unpause until I turn them off.

Offline

#8 2015-12-22 16:12:51

Paris
Member
Registered: 2013-07-22
Posts: 21

Re: [SOLVED] Mpd locks sound with pulseaudio.

V1del wrote:

any error messages related to connecting to pulse in the output of any of the other programs?

Nothing noticed.

Offline

#9 2015-12-22 16:18:11

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,076

Re: [SOLVED] Mpd locks sound with pulseaudio.

The fuser output is while having mpd running and playing something? It looks like that should be fine, what does

pacmd list-sink-inputs #Preferably with MPD and one of the not working apps open

give?

Offline

#10 2015-12-22 16:22:24

Paris
Member
Registered: 2013-07-22
Posts: 21

Re: [SOLVED] Mpd locks sound with pulseaudio.

~$ pacmd list-sink-inputs

1 sink input(s) available.
    index: 29
	driver: <protocol-native.c>
	flags: 
	state: RUNNING
	sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	muted: no
	current latency: 234.10 ms
	requested latency: 210.00 ms
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	resample method: (null)
	module: 9
	client: 47 <Music Player Daemon>
	properties:
		media.name = "pulseaudio"
		application.name = "Music Player Daemon"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "30"
		media.role = "music"
		application.icon_name = "mpd"
		application.process.id = "4459"
		application.process.user = "me"
		application.process.host = "myHost"
		application.process.binary = "mpd"
		application.language = "C"
		window.x11.display = ":0.0"
		application.process.machine_id = "044c520b97284f68bda4fb057a023c4b"
		application.process.session_id = "c1"
		module-stream-restore.id = "sink-input-by-media-role:music"

Offline

#11 2015-12-22 16:24:53

Paris
Member
Registered: 2013-07-22
Posts: 21

Re: [SOLVED] Mpd locks sound with pulseaudio.

V1del wrote:

The fuser output is while having mpd running and playing something?

Yes!

Last edited by Paris (2015-12-22 16:25:10)

Offline

#12 2015-12-22 16:53:59

Paris
Member
Registered: 2013-07-22
Posts: 21

Re: [SOLVED] Mpd locks sound with pulseaudio.

~$ ps aux | grep mpd
myusername     4459  0.7  0.6 1033992 41672        Ssl  18:06   0:19 mpd

I suppose this confirms that mpd runs localy...

Offline

#13 2015-12-22 17:41:31

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [SOLVED] Mpd locks sound with pulseaudio.

Does `mpv -ao pulse $some_media` (or you can use mplayer too) give you some error? As V1del suggested, is the `pacmd list-sink-inputs` output captured when you have multple things playing as well? If not, try to capture and paste again.

P.S. pulseaudio-alsa is only needed for programs does NOT support pulseaudio.

Offline

#14 2015-12-22 19:10:07

Paris
Member
Registered: 2013-07-22
Posts: 21

Re: [SOLVED] Mpd locks sound with pulseaudio.

tom.ty89 wrote:

Does `mpv -ao pulse $some_media` (or you can use mplayer too) give you some error?

Now that is weird to me:
`mplayer -ao pulse some.mp3` plays fine with mpd also playing (not very pleasant though)
but if I open the very same mp3 with smplayer it won't play unless mpd is paused through sonata and mpd won't unpause if paused.

Offline

#15 2015-12-22 21:11:12

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [SOLVED] Mpd locks sound with pulseaudio.

Well I don't know. You need to check which -ao smplayer was trying to use. You can try mplayer again with -ao alsa to see if it works too or just become the same case as smplayer. If it doesn't work, it means pulseaudio-alsa (/etc/asound.conf) is not working properly. Reason can be you have some other garbage alsa conf like ~/.asoundrc.

I wonder what you mean by "not very pleasant" btw. :S

Last edited by tom.ty89 (2015-12-22 21:11:56)

Offline

#16 2015-12-22 22:13:30

Paris
Member
Registered: 2013-07-22
Posts: 21

Re: [SOLVED] Mpd locks sound with pulseaudio.

SOLVED

tom.ty89 wrote:

Reason can be you have some other garbage alsa conf like ~/.asoundrc.

roll you nailed it. Thank you.

tom.ty89 wrote:

I wonder what you mean by "not very pleasant" btw. :S

"Aphex Twin" and "The Knife" didn't mix well.

Offline

Board footer

Powered by FluxBB