Bug 54673 - master volume at zero and muted when pulseaudio starts
master volume at zero and muted when pulseaudio starts
Status: RESOLVED FIXED
Product: PulseAudio
Classification: Unclassified
Component: core
unspecified
x86-64 (AMD64) Linux (All)
: medium normal
Assigned To: pulseaudio-bugs
pulseaudio-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-08 15:55 UTC by Frank Wilson
Modified: 2013-05-08 13:57 UTC (History)
3 users (show)

See Also:


Attachments
default amixer levels for card 0 after modifications to extra-hdmi.conf (5.13 KB, application/octet-stream)
2012-09-10 19:15 UTC, Frank Wilson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Wilson 2012-09-08 15:55:13 UTC
Pulseaudio version: pulseaudio 2.1

This is issue was previously reported and discussed on the mailinglist back in June.

http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-June/013710.html

I have since updated my arch linux system and it is still affected.

I reran the same test I described earlier and I got the same results.

Problem description:

I have noticed that the master channel volume is set to zero and muted
when I login to gnome3 on my arch linux vm.

After looking at various things such as storing and restoring alsa
settings, I determined the volume settings get changed when pulseaudio
starts.

To fully isolate the cause I did a test with a bare non-graphical
login (no gnome session, no login manager, no other sound program).

Test trace (fresh as of 08/09/2012)

[frank@basilica ~]$ date
Sat  8 Sep 16:33:28 BST 2012
[frank@basilica ~]$ alsactl init 0
Found hardware: "ICH" "SigmaTel STAC9700,83,84" "AC97a:83847600" "0x8086" "0x000                                                                                              0"
Hardware is initialized using a generic method
[frank@basilica ~]$ speaker-test

<<<<< CAN HEAR SOUND >>>>>

[frank@basilica ~]$ amixer -c0 > amixer.org
[frank@basilica ~]$ pulseaudio --start -vvvvv
I: [pulseaudio] main.c: Daemon startup successful.
[frank@basilica ~]$ speaker-test

<<<<< CANNOT HEAR SOUND! >>>>

[frank@basilica ~]$ amixer -c0 > amixer.pulse

I will attach *fresh* amixer.org, amixer.pulse and pulse_syslog.log.gz (the
relevant portion of my syslog file, where pulseaudio has logged its
stuff).
Comment 1 Frank Wilson 2012-09-08 16:00:49 UTC
I cannot upload the fresh amixer.org, amixer.pulse and pulseaudio log files (internal server error). Either use the ones attached to mailinglist post or email me for the fresh files.
Comment 2 Frank Wilson 2012-09-08 16:03:51 UTC
There are other people on ArchLinux that seem to be affected.

http://archlinux.2023198.n4.nabble.com/GDM-and-or-PulseAudio-mute-my-sound-td4659822.html

https://bbs.archlinux.org/viewtopic.php?id=130201
Comment 3 Tanu Kaskinen 2012-09-09 06:35:51 UTC
Pulseaudio seems to remove the "analog-output" path, because it appears to be a subset of "analog-output-mono". "analog-output-mono" is then chosen as the active path, and it mutes the Master element, because it thinks that Master Mono (also available) is the right element to use.

It appears that Master Mono has volume control for two channels. That seems strange, I wonder if this is an alsa bug? If it had only one channel, as would be logical, then I believe the "analog-output" path wouldn't be considered a subset of "analog-output-mono", and things would work for you.

But there's another odd thing: why is "analog-output-mono" path part of the "analog-stereo" mapping at all? That doesn't make sense to me. Removing the path from the "analog-stereo" mapping should also make things work for you.

So, try editing /usr/share/pulseaudio/alsa-mixer/profile-sets/extra-hdmi.conf. There's this section:

[Mapping analog-stereo]
device-strings = front:%f hw:%f
channel-map = left,right
paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono analog-output-lfe-on-mono
paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headphone-mic
priority = 10

Remove analog-output-mono from the paths-output line.
Comment 4 Frank Wilson 2012-09-09 10:00:17 UTC
(In reply to comment #3)
> 
> But there's another odd thing: why is "analog-output-mono" path part of the
> "analog-stereo" mapping at all? That doesn't make sense to me. Removing the
> path from the "analog-stereo" mapping should also make things work for you.
> 
> So, try editing /usr/share/pulseaudio/alsa-mixer/profile-sets/extra-hdmi.conf.
> There's this section:
> 
> [Mapping analog-stereo]
> device-strings = front:%f hw:%f
> channel-map = left,right
> paths-output = analog-output analog-output-speaker
> analog-output-desktop-speaker analog-output-headphones
> analog-output-headphones-2 analog-output-mono analog-output-lfe-on-mono
> paths-input = analog-input-front-mic analog-input-rear-mic
> analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic
> analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner
> analog-input-fm analog-input-mic-line analog-input-headphone-mic
> priority = 10
> 
> Remove analog-output-mono from the paths-output line.

I tried this after deleting my ~/.pulse dir (I am not sure if that was necessary, I guess I just assumed it was). Now gnome session starts up muted but this time you can actually see a muted speaker symbol in the notification area. Then it is simply a matter of raising the volume with the basic volume control in the notification area. The settings seem to be automatically recovered when I reboot and login again.

Also, Jan Steffens replied to my downstream bug report [1], he suggested playing with pavucontrol/gnome-settings. I had tried this before.

After his comment I had another go with pavucontrol and started clicking everything and suddenly I start getting sound again.

I reset my .pulse dir to find out what made the difference (delete .pulse from console session and reboot, login to gnome).

It turns out I have to switch output "connector" (in gnome) or "port" (pavucontrol) from "Analog Mono" to "LFE on seperate mono output" (whatever that is!).

Now pulseaudio seems to keep the "good" setting where sound can be heared. It seems that after changing this one setting, the master channel that was zeroed and muted is now maxed and unmuted.


[1] https://bugs.archlinux.org/task/31469
Comment 5 Frank Wilson 2012-09-09 10:05:13 UTC
(In reply to comment #3)
> It appears that Master Mono has volume control for two channels. That seems
> strange, I wonder if this is an alsa bug? If it had only one channel, as would
> be logical, then I believe the "analog-output" path wouldn't be considered a
> subset of "analog-output-mono", and things would work for you.
> 

It seems the master channel on my "Intel 82801AA-ICH"/"SigmaTel STAC9700,83,84" on alsamixer (it's actually a virtualised device on VirtualBox) has left and right sub channels that can be adjusted with Q-Z and E-C respectively.
Comment 6 Frank Wilson 2012-09-09 10:08:14 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > It appears that Master Mono has volume control for two channels. That seems
> > strange, I wonder if this is an alsa bug? If it had only one channel, as would
> > be logical, then I believe the "analog-output" path wouldn't be considered a
> > subset of "analog-output-mono", and things would work for you.
> > 
> 
> It seems the master channel on my "Intel 82801AA-ICH"/"SigmaTel STAC9700,83,84"
> on alsamixer (it's actually a virtualised device on VirtualBox) has left and
> right sub channels that can be adjusted with Q-Z and E-C respectively.

I couldn't tell you if you if this was a bug in alsa or not. Is there a "standard" way for driver writers/device manufactures to arrange mixer channels on a device?

If you need help reporting this to alsa let me know.

Thanks.
Comment 7 Tanu Kaskinen 2012-09-10 14:48:35 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > It seems the master channel on my "Intel 82801AA-ICH"/"SigmaTel STAC9700,83,84"
> > on alsamixer (it's actually a virtualised device on VirtualBox) has left and
> > right sub channels that can be adjusted with Q-Z and E-C respectively.
> 
> I couldn't tell you if you if this was a bug in alsa or not. Is there a
> "standard" way for driver writers/device manufactures to arrange mixer channels
> on a device?
> 
> If you need help reporting this to alsa let me know.

If by "this" you mean that the Master element has two channels, that's not a bug at all. What may or may not be a bug is that the Master Mono element has two channels too. But in any case, I don't think alsa needs to be fixed here even if it's broken.

What I'd like you to do is to test the change in extra-hdmi.conf that I suggested. If it fixes the problem, then I can write a patch, and hopefully this problem won't bug people any more.

Changing the port to "LFE on seperate mono output" is only a workaround, not a fix. The "LFE on seperate mono output" port is meant for cases where a laptop has a separate subwoofer speaker that is handled in a bit strange way: there's no separate subwoofer channel in the audio stream that pulseaudio writes to alsa, but there's a separate volume element (Master Mono) for the subwoofer.
Comment 8 Frank Wilson 2012-09-10 19:11:24 UTC
(In reply to comment #7)
> If by "this" you mean that the Master element has two channels

Yes that is what I meant.

> What may or may not be a bug is that the Master Mono element has
two channels too

Yes that does sound a little weird.

> What I'd like you to do is to test the change in extra-hdmi.conf that I
> suggested.

I did try this the result where in my reply to comment #3:

>> (In reply to comment #3)
>> I tried this after deleting my ~/.pulse dir (I am not sure if that was
>> necessary, I guess I just assumed it was). Now gnome session starts up muted
>> but this time you can actually see a muted speaker symbol in the notification
>> area. Then it is simply a matter of raising the volume with the basic volume
>> control in the notification area. The settings seem to be automatically
>> recovered when I reboot and login again.

> If it fixes the problem, then I can write a patch, and hopefully
> this problem won't bug people any more.

I guess your "extra-hdmi" fix improves matters but there are still a few issues. With the default settings the speaker-test program still produces no audible sound. The master channel is *still* muted and zeroed. However, the gnome3 volume control applet also shows muted and "very low". So the level can be corrected easily by a regular user. If I look in alsamixer on card0 the master channel is still zeroed and muted while the master mono is maxed and unmuted.

I think I'd prefer the volume to default to maxed and unmuted on the master channel by default.
Comment 9 Frank Wilson 2012-09-10 19:15:23 UTC
Created attachment 66938 [details]
default amixer levels for card 0 after modifications to extra-hdmi.conf
Comment 10 Frank Wilson 2012-09-10 19:18:29 UTC
(In reply to comment #8)
> > What I'd like you to do is to test the change in extra-hdmi.conf that I
> > suggested.
> 
> I did try this the result where in my reply to comment #3:
> 

This should have read:

I did try this. The results were in my reply to comment #3:
Comment 11 Tanu Kaskinen 2012-09-12 12:59:30 UTC
Sorry for missing the point that you had already tested my suggestion. It sounds that the fix works fine. The default behavior of volume being low and mute being on most likely happens because if the user hasn't set any particular volume (which is the case if you cleared ~/.pulse), then the volume is initialized to whatever volume alsa is currently having. Alsa should have a sane default volume, but in your case maybe the previously-broken pulseaudio behavior had left the alsa mixer muted and at a low volume.
Comment 12 Tanu Kaskinen 2012-09-12 13:12:47 UTC
Patch sent to the mailing list: http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/14348