stale /var/lib/alsa/asound.state breaks S/PDIF output after upgrade

Bug #360108 reported by Peter Cordes
2
Affects Status Importance Assigned to Milestone
alsa-utils (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: alsa-utils

I found this bug a while ago, but never got around to reporting it until now, so I'm a little vague on the details of my specific case. However, the general problem is that /etc/init.d/alsa-utils saves and restores the mixer settings, but the valid settings can change for the same hardware across different versions of the ALSA driver. Restoring settings that were saved on an older kernel can cause problems.

  In my case, it made digital output of stereo PCM (over S/PDIF) stop working. I could still output AC3 and DTS over S/PDIF, though. I have a DG965WH mobo, with HDA Intel hardware using the SigmaTel STAC9271D codec. I think the upgrade from Hardy to Intrepid broke things. I had the same problem with stereo PCM over S/PDIF on an Athlon64 with via82xx sound hardware on a Debian machine upgrading to Lenny.

 This "broken S/PDIF stereo PCM" thing manifests as my Logitech Z-5500 speakers sort of detecting a PCM stream, but acting funny. Like maybe there are format errors that confuse the firmware? Sometimes I can hear a snatch of it while using the remote control, so basically it's a stream that my speakers' firmware doesn't like _at_ _all_. Normally, when I have my speakers on optical input mode, playing an ogg file, or anything that just does normal output to /dev/snd/pcmC0D0p (alsa device hw 0:0), or via dmix, or whatever, produces stereo PCM over S/PDIF as well as analog output over the analog jacks, when I enable "IEC958 Default PCM" with alsamixer. Or I can get stereo PCM over S/PDIF separate from what's going over the analog outputs with alsa device hw 0:1.

 So maybe there's only ever been a problem with the meaning of the S/PDIF mixer value. I was going to suggest that upgrades optionally wipe out old mixer settings, either with some kind of heuristic to detect when it needs to wipe them out, or by asking the user...

 To reset my mixer, I did
sudo /etc/init.d/alsa-utils stop
move aside /var/lib/alsa/asound.state
sudo modprobe -r my sound modules
alsamixer # turn up the volume to good default levels
sudo /etc/init.d/alsa-utils stop

(alsa-utils start with no asound.state tries to reset things to some consistent state, but IIRC, it actually broke S/PDIF output of PCM stereo.)

 Fortunately, I kept my old asound.state, and they're text files, so I can diff:

In file "/var/lib/alsa/asound.state": (This is the version that works)
------------------------------
315: control.31 {
316: comment.access 'read write'
317: comment.type IEC958
318: comment.count 1
319: iface MIXER
320: name 'IEC958 Playback Default'
321: value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'

In file "/var/lib/alsa/asound.state.bak":
------------------------------
321: value '0682000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'

Daniel T Chen (crimsun)
Changed in alsa-utils (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Colin Watson (cjwatson) wrote :

alsa-utils (1.0.23-2ubuntu2) maverick; urgency=low

  * debian/init: Restore change from 1.0.21-1ubuntu2 lost during merge
    that skips muting and zeroing levels prior to shutdown/reboot,
    which was a hack for broken drivers. This change closes LP: #21804,
    LP: #208920, #227505, #360108, #432660, #449783, #553132, #564472,
    LP: #584609, #592016, #596360, #613054, #617516, #622487, #632019.
  * debian/patches/alsactl_init_update_to_52bd2f8a_head.patch: Add
    upstream git changesets:
    dcb90a77 - Use "Found hardware:" instead "Unknown hardware:"
    7f6a55e2 - use "generic method" instead "guess method"
    52bd2f8a - Handle "Capture Source" and "Mic Boost"
    ef919a47 - Initialize also "Master Front Playback Volume" & "Switch"
    (yes, this last changeset is included despite the patch filename)

 -- Daniel T Chen <email address hidden> Sun, 05 Sep 2010 11:57:59 -0400

Changed in alsa-utils (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.