Thursday, October 27, 2011

Fixing volume control in XFCE4

Volume control in XFCE4 worked fine with the volume control in the indicator-applet, but failed to work with the hotkeys on the keyboard, namely:
  • lowering the volume to minimum wouldn't mute
  • muting was possible with the keyboard, unmuting was not
Turns out the problem is caused by xfce4-volumed accessing my sound card directly, while the indicator-applet is using pulse audio. Pulseaudio mirrors the controls of the soundcard, but only partially so for some reason. Proper fix for me: Tell xfce4-volumed to use Pulseaudio, but there either isn't a GUI config for that or it's really well hidden. But there is luckily a command line workaround, use:

xfconf-query -c xfce4-mixer -l

to get a list of soundcards and then tell xfce4-mixer to use that

xfconf-query -c xfce4-mixer -p /active-card -s PlaybackInternalAudioAnalogStereoPulseAudioMixer

Now the volume controls seem to work proper.

Edit: A killall xfce4-volumed might be needed, as otherwise the setting will be instantly reverted.

2 comments:

Doug McCasland said...

Thanks for the tip on how to get Unmute to work! Works great now.

Paul Perkins said...

Thanks, this note was what pointed me the way to solving some strange symptoms related to volume control. I wonder why the xfce4 mixer has both /active-card and /sound-card properties and, in the gui, a stealthy way to set one and no way to set the other (that I have found)? Symptoms of having these point to different mixers (ALSA vs PULSE) vary depending on what strategy PULSE uses to make a sane volume control based on particular sound hardware's mixer capabilities as exposed by ALSA.