Bug 115765 - (ALSA CS46XX ACPI)Alsa / Sound stops working after returning from suspend mode
(ALSA CS46XX ACPI)Alsa / Sound stops working after returning from suspend mode
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Dave Jones
Depends On:
  Show dependency treegraph
Reported: 2004-02-15 16:37 EST by Vic Gedris
Modified: 2015-01-04 17:04 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-16 01:31:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Vic Gedris 2004-02-15 16:37:44 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115

Description of problem:
When I bring my laptop back from suspend mode, sound stops working. 
Here's some output from ogg123:
ALSA write error: Input/output error
It just keeps doing that over and over.

I never had any problems returning from suspend mode with FC1 or
Redhat 9, so I'm pretty sure this is a kernel 2.6 + alsa problem.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Put laptop into suspend mode
2. Return from suspend mode
3. Try playing some audio

Actual Results:  Sound drivers appear to be loaded, but I can't play
anything. Applications attempting to outout sound just appear to be
blocked.  ogg123 gives me the error messages that I mentioned.

Expected Results:  Continue being able to play sounds like normal.

Additional info:

IBM Thinkpad A20m

0000:00:05.0 Multimedia audio controller: Cirrus Logic CS 4614/22/24
[CrystalClear SoundFusion Audio Accelerator] (rev 01)

kernel-2.6.2-1.81 (Same problem with previous FC2-test1 kernels)
Comment 1 Bill Nottingham 2004-02-16 01:44:35 EST
APM or ACPI suspend?
Comment 2 Vic Gedris 2004-02-16 01:58:10 EST

Same results whether I suspend with "apm -s", shut the lid, or Fn-F4.

Changing the following lines in /etc/sysconfig/apmd doesn't help either:
Comment 3 Vic Gedris 2004-02-19 01:16:35 EST
I noticed there are many changes to ALSA in the 2.6.3 kernel.  I
wonder if these have fixed my problem.  I may give that a try if I
find some time.
Comment 4 Vic Gedris 2004-02-21 11:19:39 EST
OK, I figured this out and have a temporary workaround for it.

When I return from APM suspend mode, the sound driver snd_cs46xx stops
working.  What I need to do is:
1) Exit all applications that may be using that module (xmms, mixers,
etc).  Verify this with lsmod (third colunm for this driver shows 0)
2) rmmod snd_cs46xx
3) modprobe snd_cs46xx
4) restart all of my sound applications.

So I no longer need to reboot, and I have my sound back.  But this
whole procedure is still terribly annoying.  Especially since it
worked in FC1 and kernel 2.4.x
Comment 5 Bill Nottingham 2004-02-22 00:45:23 EST
/etc/sysconfig/apm-scripts/apmscript you should be able to set for this.
Comment 6 Ed Swierk 2004-10-09 16:13:16 EDT
Setting RESTORESOUND and RESTORESOUNDPROGS to yes does not solve the
problem (Fedora Core 2 on ThinkPad T21). I still have to manually stop
any applications using the sound driver, then manually unload and
reload snd_cs46xx.
Comment 7 Alexander Boström 2004-10-30 11:18:22 EDT
I still see this on 2.6.9-1.643. Anything writing to OSS or ALSA will
hang. I suspend using "echo -n mem >/sys/power/state" and have
"options snd-cs46xx thinkpad=1" in modprobe.conf.

Some web page suggested

  /usr/sbin/alsactl power off; /usr/sbin/alsactl power on

after resume, but that doesn't help. If I run it repeatedly though,
like this:

  while true; do /usr/sbin/alsactl power off; /usr/sbin/alsactl power
on; done

then the application that's writing to OSS or ALSA will get a bit of
output through to the device for every iteration, until it's done.
(Tested with ogg123.) No sound though. Most of the time is spent in
the off state.
Comment 8 Andre Dyck 2004-12-15 18:53:20 EST
Same problem with Debian Sarge, Kernel 2.6.9 and Alsa ...
So I think it is not Fedore specific ..
I have a Thinkpad T22 with snd_cs46xx sound ..
Comment 9 Yaron Minsky 2005-01-18 07:28:28 EST
The same problem appears to persist in FC3.  I'm running an T21 on a
fully update FC3, using ACPI for power management.  Same problem. 
Should this be reposted as an FC3 bug, givne that it applies to FC3 as

Comment 10 Ian Collier 2005-01-20 06:46:48 EST
Re comment 5:
/etc/sysconfig/apm-scripts/apmscript doesn't work because
 (a) it looks for the "sound-slot" entry in modprobe.conf, but
     the entry placed there by Fedora configuration is actually
 (b) it greps the output of lsmod for the sound module, but this fails
     because lsmod has "_" where modprobe.conf has "-" (in, for instance,
     alias snd-card-0 snd-cs46xx)

I made the following change a while ago and haven't had any problems
with the sound since then:

-               SOUNDMODULES=`modprobe -c | awk '/^alias sound-slot/ {
print $3 }'` 
+               SOUNDMODULES=`modprobe -c | awk '/^alias snd-card/ {
print $3 }' | tr - _` 

Is that worth creating another bug about, or will this one do?
Comment 11 Bill Nottingham 2005-01-20 11:33:58 EST
Separate bug, please.
Comment 12 Ed Swierk 2005-01-20 20:16:23 EST
Looks like bug 141463 addresses the apmscript fix.
Comment 13 Dave Jones 2005-04-16 01:31:16 EDT
Fedora Core 2 has now reached end of life, and no further updates will be
provided by Red Hat.  The Fedora legacy project will be producing further kernel
updates for security problems only.

If this bug has not been fixed in the latest Fedora Core 2 update kernel, please
try to reproduce it under Fedora Core 3, and reopen if necessary, changing the
product version accordingly.

Thank you.
Comment 14 Alexander Boström 2005-05-18 16:11:03 EDT
The problem persists in with 2.6.11-1.1312_FC4.

Note You need to log in before you can comment on or make changes to this bug.