Comment 243 for bug 274995

Revision history for this message
Robb Topolski (funchords) wrote : Re: MASTER storing ALSA mixer element values during shutdown hangs nondeterministically if non-loopback network interfaces are still up

I'll buy the beer if this is a BIOS bug.

Bug 295136 (aschuring) is the most succinct test case I've seen on this. That bug is a duplicate but shows what is going on. It should not be ignored.

Key observations:

---Quote---
After dist-upgrading to intrepid, Ubuntu appears to hang when shutting down. I have traced this down to the ALSA shutdown script taking more than a minute (!) to save sound card state. More specifically:

root@neminis:~$ time amixer -c0 -q set Mic 0% mute

real 0m8.061s
user 0m0.003s
sys 0m0.012s

This is reproducable only in single-user mode. When I run the amixer command when logged in into X (I can even run the command from a console, as long as X is running), the same command takes only a few milliseconds as it should. I will attach an strace log from above call. Of interest is the following line:

 4.013297 ioctl(5, FIONREAD, [37]) = 0

which occurs twice in the script. It seems to be expecting data from a network socket, but I can't figure out why.
---endQuote---

- commenting out everything in /usr/share/alsa/pulse.conf:
   amixer responds fast

(The description of this file is, "PulseAudio alsa plugin configuration file to set the pulseaudio plugin as default output for applications using alsa when pulseaudio is running." However, pulseaudio is not running, wasn't running, so why does Aschuring's commenting out of lines change anything? /usr/share/alsa/pulse.conf calls its config from /usr/share/alsa/pulse-alsa.conf which appears to set pulse as the default sound device. Aschuring's tests at the single-user root prompt create a similar situation to what all these users are reporting where when the user session is ended, X and pulse are no longer running, and the alsa configuration is to use pulse.)

- removing dns in /etc/nsswitch.conf or adding localhost to ipv6 ::1 in /etc/hosts
      amixer responds fast

(This addresses the networking delay, but not whether alsa should be looking for pulse at all when the server is not running. Removing dns from nsswitch.conf is not desirable.)

It's a shame that bug 295136 isn't the primary bug, because the best information is there. I don't know if launchpad etiquette allows that to happen -- but developers investigating this bug ought to be paying attention.