Master, Headphones and PCM muted at reboot

Bug #432660 reported by Martin-Éric Racine on 2009-09-18
82
This bug affects 16 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: pulseaudio

After booting, not all channels get correctly restored.

First of all, Master is always positioned at -93dB.

Then, Master, Headphones and PCM always start with the Mute button enabled.

Having to manually restore these via alsamixer after every reboot gets tiresome.

ProblemType: Bug
AplayDevices:
 **** List of PLAYBACK Hardware Devices ****
 card 0: Audio [CS5535 Audio], device 0: CS5535 Audio [CS5535 Audio]
   Subdevices: 0/1
   Subdevice #0: subdevice #0
Architecture: i386
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Audio [CS5535 Audio], device 0: CS5535 Audio [CS5535 Audio]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', '/dev/snd/controlC0', '/dev/snd/pcmC0D0c', '/dev/snd/pcmC0D0p', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
Card0.Amixer.info:
 Card hw:0 'Audio'/'CS5535 Audio cs5535audio at 0xfe00, irq 11'
   Mixer name : 'Realtek ALC203 rev 0'
   Components : 'AC97a:414c4770'
   Controls : 33
   Simple ctrls : 21
Date: Fri Sep 18 21:44:23 2009
DistroRelease: Ubuntu 9.10
Package: pulseaudio 1:0.9.17-0ubuntu2
ProcEnviron:
 LANGUAGE=fi_FI:fi:en_US:en
 PATH=(custom, user)
 LANG=fi_FI.UTF-8
 SHELL=/bin/bash
SourcePackage: pulseaudio
Uname: Linux 2.6.30-020630-generic i586
mtime.conffile..etc.default.pulseaudio: 2009-07-11T12:04:55
mtime.conffile..etc.pulse.daemon.conf: 2009-09-08T13:31:29
mtime.conffile..etc.pulse.system.pa: 2009-08-06T19:15:42

Martin-Éric Racine (q-funk) wrote :
Martin-Éric Racine (q-funk) wrote :

I'm nominating this as a 100 Paper Cuts bug:

1) it is a Karmic regression that will turn PulseAudio usage into an everyday annoyance; it worked fine until Jaunty.
2) it can be reproduced on different hardware types.
3) it occurs in a systematic way.

Martin-Éric Racine (q-funk) wrote :

This bug keeps on going from bad to worse. Now, every damn control starts with the volume zeroed out and muted!

Changed in pulseaudio (Ubuntu):
importance: Undecided → High
tags: added: regression-karmic regression-potential

2009/10/14 Martin-Éric Racine <email address hidden>:
> This bug keeps on going from bad to worse. Now, every damn control
> starts with the volume zeroed out and muted!

Seriously, I can't reproduce this symptom in alsa-utils
1.0.20-2ubuntu5, and I spent a few hours turning over every
possibility of crap racing the alsactl store. If it's reproducible for
you, please set -x and log it...

Daniel T Chen (crimsun) wrote :

Also, please disable autospawn, kill the daemon, and enable verbose
logging using -vvvv.

Martin-Éric Racine (q-funk) wrote :

Sorry, where and how do I enable this?

Daniel T Chen (crimsun) wrote :

/etc/pulse/client.conf (or ~/.pulse/client.conf) should be amended to
contain "autospawn = no".

Then, killall pulseaudio ; pulseaudio -vvvv (as the desired user)

Martin-Éric Racine (q-funk) wrote :

Something tells me that doing that in client.conf won't accomplish anything useful on a system where PA is launched as a system daemon. Correct? If so, then I'd actually need step-by-step instructions for exactly what I'm supposed to test for and how.

Daniel T Chen (crimsun) wrote :

2009/10/18 Martin-Éric Racine <email address hidden>:
> Correct? If so, then I'd actually need step-by-step instructions for
> exactly what I'm supposed to test for and how.

The idea is to see, via verbose daemon logging, what PA sees as the
hardware volumes as it enumerates the ALSA sink(s). It shouldn't
matter whether it's a system-wide or a user-specific PA daemon.

Of course, the culprit could involve alsa-utils's initscript. The
symptoms sound suspiciously as if user-configured state weren't being
restored properly, which can happen if state isn't stored properly on
reboot/shutdown and/or if the state file (/var/lib/alsa/asound.state)
is munged (thereby causing alsactl restore to fail on startup).

So, here's how I would eliminate alsa-utils's initscript as a contributor:

Alter /etc/default/pulseaudio not to start a system-wide daemon. Prior
to logging in via gdm/kdm/xdm, log in on a text console and check
alsamixer/amixer for zeroed and/or muted settings. Next, alter
/etc/default/pulseaudio to start a system-wide daemon again. Next,
alter /etc/init.d/pulseaudio to pass -vvvv as additional parameters to
$DAEMON. Finally, invoke the system-wide daemon.

Martin-Éric Racine (q-funk) wrote :

This is what amixer shows after a reboot.

Martin-Éric Racine (q-funk) wrote :

PS: ...if PA is enabled in /etc/default/pulseaudio, that is.

Martin-Éric Racine (q-funk) wrote :

If PA is disabled, amixer instead shows this.

Martin-Éric Racine (q-funk) wrote :

Assuming that user.log is what I'm supposed to attach, here is what it shows after -vvvv was added to the options in the init script, then defaults got system mode re-enabled and the init script was launched.

Martin-Éric Racine (q-funk) wrote :

And, sure enough, the stupid command options are order-sensitive, so my initial insertion of -vvvv was ignored, as confirmed by "proc axfu". Here's what it shows when -vvvv appears at a usable location.

Martin-Éric Racine (q-funk) wrote :

Daniel, is any information missing for you and the Ubuntu audio team to be able to process this issue?

Daniel T Chen (crimsun) wrote :

The culprit appears to be in src/modules/module-device-restore.c.

Martin-Éric Racine (q-funk) wrote :

1:0.9.20-0ubuntu1 succeeds at restoring all ALSA levels, except for exactly one: Mono Master. See previously attached amixer dumps for the exact nomenclature of that audio channel.

Daniel T Chen (crimsun) wrote :

2009/11/15 Martin-Éric Racine <email address hidden>:
> 1:0.9.20-0ubuntu1 succeeds at restoring all ALSA levels, except for
> exactly one: Mono Master.  See previously attached amixer dumps for the
> exact nomenclature of that audio channel.

Unfortunately I don't think 0.9.20 fixed anything -- in fact, the
symptom you're seeing of PA "succeeds at restoring all ALSA levels" is
in fact due to a bug in Makefile.{am,in} as shipped in 0.9.20. [Sjoerd
has already fixed it in the Debian sid source package, and the
relevant patch is in my bzr branch (lp:~crimsun/pulseaudio/ubuntu)
awaiting upload.] Because two path files were not installed, hardware
mixer controls were not being used at all.

Kevin (kcozens) wrote :

I am experiencing a similar problem. I am using external speakers which have a light on top which is normally blue but turns red when audio is muted. When I start my machine, the light is blue until gdm starts. When gdm starts the speaker light goes red.

When I login to my user account and start the Gnome ALSA Mixer program it shows me the Master volume and Front channel volume on the "Realtek ALC889A" tab are muted. Also, on the "USB Mixer" tab, PCM volume has been set to almost zero and the channel muted. I have to reset all four of these settings every time I login. If I log out, the speaker light goes from blue to red once more. I login again and have to reset all four settings.

I ran the tests listed above re: killing pulseaudio, setting autospawn=no, and running pulseaudio -vvvv. Doing this as my normal login user was fine. The start of pulseaudio did not change any of my mixer settings. The problem is with something that the start of (or return) to gdm which changed the audio mixer settings.

Kevin (kcozens) wrote :

I'm attaching the output from running pulseaudiow with the -vvvv option.

Kevin (kcozens) wrote :

I forgot to mention I'm running Ubuntu 9.10 (Karmic).

Daniel T Chen (crimsun) wrote :

On Sun, Nov 22, 2009 at 11:38 AM, Kevin <email address hidden> wrote:
> I am experiencing a similar problem. I am using external speakers which
> have a light on top which is normally blue but turns red when audio is
> muted. When I start my machine, the light is blue until gdm starts. When
> gdm starts the speaker light goes red.

So the hardware mute state is "unmuted" until PA runs as the gdm user,
upon which the hardware mute state is restored to "muted".

> When I login to my user account and start the Gnome ALSA Mixer program
> it shows me the Master volume and Front channel volume on the "Realtek
> ALC889A" tab are muted. Also, on the "USB Mixer" tab, PCM volume has
> been set to almost zero and the channel muted. I have to reset all four
> of these settings every time I login. If I log out, the speaker light
> goes from blue to red once more. I login again and have to reset all
> four settings.

So the hardware volume and mute states are different per pulse user,
which is expected. However, what appears to be happening for you is
that volumes and mutes are preserved across the gdm -> $USER switch.
Do you have visual verification from the mute led that upon logging
in, the mute state is "unmuted"?

There's some serious screwage with module-{device,stream}-restore going on here.

Steve Beattie (sbeattie) on 2009-11-30
tags: added: karmic regression-release
removed: regression-karmic regression-potential
Martin-Éric Racine (q-funk) wrote :

PA 1:0.9.21-0ubuntu5 with alsa-utils 1.0.21-1ubuntu3 still matches the behavior described in comment #17, that is, everything except Mono Master gets restored.

Kevin (kcozens) wrote :

I found, or rather stumbled on to, a workaround to the problem. At the end of the day I usually go from logged in to shutdown of my computer. More recently, when I went to shutdown the machine a box popped up asking me for the password to get root perms. I don't remember if it was now asking for root perms to allow shutdown or it thought another user was logged in. Instead of giving the password (as i wasn't sure why the box popped up at that time), I hit a Cancel in the dialog and that logged me out to the gdm login screen instead of doing a shutdown. I then did the shutdown from the gdm screen.

The next day when I went to turn on my computer, I was surprised to find that the alsa mixer settings were restored properly. It played a sound which I could hear after entering my password when logging in. All sounds from gdm were audible without me having to open up the mixer settings and reset things.

It seems to me that mixer settings are not save when going from logged in to system shutdown. Mixer settings are being saved when you logout before a shutdown. This should give help someone to track down the problem and get it fixed. If you have to keep fiddling with audio settings on each boot, just log out to gdm before you next shutdown. You should not have to fiddle with the settings after the next boot.

Cruncher (ubuntu-wkresse) wrote :

This strongly looks like a duplicate of bug #378470 and/or bug #298301. Please check these bugs and confirm.

Martin-Éric Racine (q-funk) wrote :

Neither of those.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:0.9.22~0.9.21+341-g62bf-0ubuntu1

---------------
pulseaudio (1:0.9.22~0.9.21+341-g62bf-0ubuntu1) lucid; urgency=low

  * New snapshot based on stable-queue git branch (testing requested
    specifically by upstream)
    - LP: #164745, #173212, #201391, #204536, #207796, #210016, #221038,
    - LP: #226342, #230408, #236423, #237443, #250059, #269585, #274304,
    - LP: #274577, #275474, #277532, #277566, #277932, #278025, #280534,
    - LP: #283049, #286816, #287036, #292732, #298011, #298301, #300290,
    - LP: #302038, #311497, #311853, #324062, #339448, #344057, #348979,
    - LP: #350829, #356206, #367379, #367544, #369822, #371897, #374846,
    - LP: #375570, #381801, #399515, #402950, #403786, #408169, #409322,
    - LP: #409723, #410326, #410446, #417695, #417976, #419271, #421072,
    - LP: #422774, #423979, #424655, #425028, #427016, #431072, #432660,
    - LP: #437640, #437996, #442191, #443306, #443389, #446719, #449762,
    - LP: #455417, #461532, #464652, #483191, #497537, #503780
  * debian/patches/:
    + add: 0099-change-configure-git-version-tag.patch: Match released
           upstream 0.9.21 for shlibs and LIBPULSE_VERSION_INFO
    - drop: 0004-set-tsched0.patch (no longer relevant)
            0050-revert-pacmd-poll-argv.patch (no longer relevant)
            0056-dont-bail-on-sound-class-modem.patch (merged)
            0056-ignore-sound-class-modem.patch (merged)
            0058-Backport-4c793.patch (merged)
            0059-Backport-978d3.patch (merged)
            0060-fix-implicit-func-decl-cpu-arm.patch (merged)
            0061-Backport-c5fdb.patch (merged)
            0070-dont-bail-on-sound-class-modem-devs.patch (merged)
    + refresh: 0001-change-resample-and-buffering.patch
               0090-disable-flat-volumes.patch
               0091-dont-load-cork-music-on-phone.patch
               0057-load-module-x11-bell.patch
 -- Daniel T Chen <email address hidden> Thu, 14 Jan 2010 20:33:05 -0500

Changed in pulseaudio (Ubuntu):
status: New → Fix Released
Martin-Éric Racine (q-funk) wrote :

Sorry, no, this is not completely fixed. Master Mono still doesn't get restored.

Changed in pulseaudio (Ubuntu):
status: Fix Released → Triaged
Daniel T Chen (crimsun) wrote :

Sorry, the previous upload was bunk (wrong branch, arrg!). I've
uploaded a new (correct) one and would appreciate confirmation of this
symptom (or its resolution).

Daniel T Chen (crimsun) on 2010-03-04
Changed in pulseaudio (Ubuntu):
importance: High → Medium
Martin-Éric Racine (q-funk) wrote :

Master Mono still doesn't get restored.

Daniel T Chen (crimsun) wrote :

From my reading of the mixer-paths, it isn't supposed to be restored:

/usr/share/pulseaudio/alsa-mixer/paths $ grep "Master Mono" *
analog-output-desktop-speaker.conf:[Element Master Mono]
analog-output-headphones-2.conf:[Element Master Mono]
analog-output-headphones.conf:[Element Master Mono]
analog-output-lfe-on-mono.conf:[Element Master Mono]
analog-output-mono.conf:[Element Master Mono]
analog-output-speaker.conf:[Element Master Mono]
analog-output.conf:[Element Master Mono]
crimsun@errno:/usr/share/pulseaudio/alsa-mixer/paths $ grep -A4 "Master Mono" *
analog-output-desktop-speaker.conf:[Element Master Mono]
analog-output-desktop-speaker.conf-switch = off
analog-output-desktop-speaker.conf-volume = off
analog-output-desktop-speaker.conf-
analog-output-desktop-speaker.conf-; This profile path is intended to control the desktop speaker, not
--
analog-output-headphones-2.conf:[Element Master Mono]
analog-output-headphones-2.conf-switch = off
analog-output-headphones-2.conf-volume = off
analog-output-headphones-2.conf-
analog-output-headphones-2.conf-; This profile path is intended to control the second headphones, not
--
analog-output-headphones.conf:[Element Master Mono]
analog-output-headphones.conf-switch = off
analog-output-headphones.conf-volume = off
analog-output-headphones.conf-
analog-output-headphones.conf-[Element Headphone]
--
analog-output-lfe-on-mono.conf:[Element Master Mono]
analog-output-lfe-on-mono.conf-required = any
analog-output-lfe-on-mono.conf-switch = mute
analog-output-lfe-on-mono.conf-volume = merge
analog-output-lfe-on-mono.conf-override-map.1 = lfe
--
analog-output-mono.conf:[Element Master Mono]
analog-output-mono.conf-required = any
analog-output-mono.conf-switch = mute
analog-output-mono.conf-volume = merge
analog-output-mono.conf-override-map.1 = all
--
analog-output-speaker.conf:[Element Master Mono]
analog-output-speaker.conf-switch = off
analog-output-speaker.conf-volume = off
analog-output-speaker.conf-
analog-output-speaker.conf-; This profile path is intended to control the speaker, not the
--
analog-output.conf:[Element Master Mono]
analog-output.conf-switch = off
analog-output.conf-volume = off
analog-output.conf-
analog-output.conf-; This profile path is intended to control the default output, not the

Martin-Éric Racine (q-funk) wrote :

It seems that this issue has returned in Maverick. After a reboot, none of the Masters get restored and neither does PCM.

David Henningsson (diwic) wrote :

I believe this issue was fixed in Maverick, the final version. You might still have to do it one more time (for every user), but after that it should be ok across reboots. Let me know if this is not the case.

Changed in pulseaudio (Ubuntu):
status: Triaged → Fix Released
Martin-Éric Racine (q-funk) wrote :

Solved in Natty, but definitely not in Maverick nor in Lucid.

To post a comment you must log in.