You are not logged in.

#1 2014-04-01 11:11:08

strix
Member
From: Switzerland
Registered: 2013-04-29
Posts: 13

[SOLVED] No Sound except in mpd

I have a strange behaviour in my sound setup since last week or so. I didn't notice it at first, so I can't tell if it was an update. However I didn't change anything in my configuration. I don't hear any sound from my laptop (a HP Elitebook 8470w), not with the speakers nor with headphones. Except playing music with mpd, this works as usual. I also noticed, that my multimedia keys don't work anymore. Was there any recent change in alsa I missed?
What I tried:

> speaker-test -c 2

speaker-test 1.0.27.2

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 1048576
Period size range from 32 to 349526
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
 0 - Front Left
 1 - Front Right
Time per period = 10.940069

-> No sound

My config:

`--> uname -a
Linux tirion 3.13.7-1-ARCH #1 SMP PREEMPT Mon Mar 24 20:06:08 CET 2014 x86_64 GNU/Linux

/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:
`--> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: 92HD81B1X5 Analog [92HD81B1X5 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

~/.mpd/mpd.conf

music_directory		"/home/strix/Musik"
playlist_directory	"/home/strix/Musik/Playlists"
db_file			"/home/strix/.mpd/mpd.db"
log_file		"/home/strix/.mpd/mpd.log"
log_level               "verbose"
pid_file		"/home/strix/.mpd/mpd.pid"
state_file		"/home/strix/.mpd/mpdstate"
save_absolute_paths_in_playlists    "yes"

audio_output 	{
	type    "alsa"
	name    "Mukke"
        mixer_type      "software"
        device  "hw:0,0"
}

My multimedia keymapping was:

bindsym XF86AudioRaiseVolume exec amixer set Master 2%+
bindsym XF86AudioLowerVolume exec amixer set Master 2%-
bindsym XF86AudioMute exec amixer sset Master toggle

which does not work anymore. Funny thing is, I can modify the volume and mute/unmute my music with the following setup:

bindsym XF86AudioMute exec "pactl set-sink-mute 1 toggle"
bindsym XF86AudioRaiseVolume exec "pactl set-sink-volume 1 +1%"
bindsym XF86AudioLowerVolume exec "pactl set-sink-volume 1 -- -1%"

Last edited by strix (2014-04-03 13:01:17)

Offline

#2 2014-04-01 13:05:55

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

Re: [SOLVED] No Sound except in mpd

mpd is blocking your audiodevice for exclusive use (and you probably autostart it i assume) Any particular reason why you have pulse installed and hardset it to use a ALSA device (leading to said locking) instead of using

audio_output {
        type            "pulse"
        name            "pulse audio"
}

?

That said, the problems probably happened with the PA 5 update, which made some changes in how it handles the ALSA plugin. This would be totally irrelevant if you simply set mpd to use pulse/set the alsa device to the asound.conf configured pulse instead of directly to hardware though

Last edited by V1del (2014-04-01 13:07:45)

Offline

#3 2014-04-01 13:20:18

strix
Member
From: Switzerland
Registered: 2013-04-29
Posts: 13

Re: [SOLVED] No Sound except in mpd

I tried this setup, but this way, I don't have any sound at all. But your answer brings me to the question why I should need to set up and use pulse? Couldn't I just use alsa only?

Offline

#4 2014-04-01 15:13:50

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

Re: [SOLVED] No Sound except in mpd

strix wrote:

I tried this setup, but this way, I don't have any sound at all. But your answer brings me to the question why I should need to set up and use pulse? Couldn't I just use alsa only?

Yes, and no.

If you do not want pulseaudio, fine.  But you need to enable dmix


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

#5 2014-04-01 15:16:09

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] No Sound except in mpd

Did you disable the alsa audio_output section first? Addressing hardware directly is usually a bad idea, unless using an advanced  configuration. Using "plug:default" in alsas audio_output section should work for both alsa and pulseaudio (through alsa). You could also leave the whole audio_output block out of mpd.conf, mpds autodetection usually works fine. If that does not work, look into pa5-alsa issues.

strix wrote:

Couldn't I just use alsa only?

Why did you install pulseaudio in the first place? Maybe you need(ed) it as a dependency, although this normally should not be. Pulseaudio is a sound server, that runs on top of alsa. Take a look here for pas features. If you do not use any of those that are pulseaduio exclusive, then you can safely drop it.
Either way you will have to change or remove addressing type in mpd.conf.

Offline

#6 2014-04-01 18:11:20

strix
Member
From: Switzerland
Registered: 2013-04-29
Posts: 13

Re: [SOLVED] No Sound except in mpd

Ok, mpd really works without specifying the output. But mpd was never really a problem. I can listen to music but everything else seems muted. I can try playing files with mplayer, vlc or watch something on youtube, that's where the sound is missing.

Offline

#7 2014-04-01 22:02:07

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [SOLVED] No Sound except in mpd

strix wrote:

Ok, mpd really works without specifying the output. But mpd was never really a problem. I can listen to music but everything else seems muted. I can try playing files with mplayer, vlc or watch something on youtube, that's where the sound is missing.

you specified hw:0 in your alsa block. this blocks the device for any other app. just get rid of that line.


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#8 2014-04-02 10:54:46

strix
Member
From: Switzerland
Registered: 2013-04-29
Posts: 13

Re: [SOLVED] No Sound except in mpd

I got rid of the whole audio_output-block, as I wrote above. No sound though...

Offline

#9 2014-04-02 15:30:05

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [SOLVED] No Sound except in mpd

fuser -v /dev/snd/* (as root)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#10 2014-04-02 16:16:12

strix
Member
From: Switzerland
Registered: 2013-04-29
Posts: 13

Re: [SOLVED] No Sound except in mpd

.-(~)-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(root@tirion)-
`--# fuser -v /dev/snd/*
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  strix      2801 F.... pulseaudio
                     strix     23753 F.... mpd
/dev/snd/controlC1:  strix      2801 F.... pulseaudio

If mpd blocks my audio, shouldn't it work then when I stop mpd? Because that's not the case...

Edit: When I set my mpd audio_output to this:

audio_output {
        type            "pulse"
        name            "pulse audio"
}

I get the following:

.-(~)-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(root@tirion)-
`--# fuser -v /dev/snd/*
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  strix      5730 F.... pulseaudio
/dev/snd/controlC1:  strix      5730 F.... pulseaudio
/dev/snd/pcmC0D0p:   strix      5730 F...m pulseaudio

And if it helps:

`--# lspci | grep Audio
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Turks/Whistler HDMI Audio [Radeon HD 6000 Series]

Last edited by strix (2014-04-02 16:48:52)

Offline

#11 2014-04-02 22:42:27

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [SOLVED] No Sound except in mpd

strix wrote:
.-(~)-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(root@tirion)-
`--# fuser -v /dev/snd/*
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  strix      2801 F.... pulseaudio
                     strix     23753 F.... mpd
/dev/snd/controlC1:  strix      2801 F.... pulseaudio

This is a clear indication that mpd is still set to use hw:0.


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#12 2014-04-03 02:06:35

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] No Sound except in mpd

Kill pulseaudio and anything else using audio. Try:

speaker-test -c 2 -D plughw:PCH

(I assume PCH is the sound card you want to use)
If it does not work, check configuration, modules, as last resort delete all alsa configuration, maybe even reinstall it. Restart and try again.
If it works, try speaker-test without device switch with pulseaudio. Now if that does not work, pulseaudio is at fault. Check settings and recent changes (look here in forum). And so on.
In cases like that use a methodology to narrow the problem down to a specific piece of software or hardware by checking every bit of signals path. Start at the top or bottom, that does not matter. Otherwise you will only waste time poking at random.

Offline

#13 2014-04-03 13:01:01

strix
Member
From: Switzerland
Registered: 2013-04-29
Posts: 13

Re: [SOLVED] No Sound except in mpd

Setting the mpd audio_output to 'pulse' was the key. I restarted my system and it worked. Thank you for your help!

Offline

#14 2014-04-04 08:30:59

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

Re: [SOLVED] No Sound except in mpd

Wait what? Didn't you say that didn't work initially? hmm Didn't you reboot/restart mpd on the first try or what was it? Well glad you got it working now tongue

Offline

#15 2014-04-04 08:33:21

strix
Member
From: Switzerland
Registered: 2013-04-29
Posts: 13

Re: [SOLVED] No Sound except in mpd

It did work after a few restarts, removing whole config directories and reinstalling mpd, pulseaudio and alsa... It wasn't the smoothest solving method but somehow it worked...

Offline

Board footer

Powered by FluxBB