Bug 115765

Summary: (ALSA CS46XX ACPI)Alsa / Sound stops working after returning from suspend mode
Product: [Fedora] Fedora Reporter: Vic Gedris <vic>
Component: kernelAssignee: Dave Jones <davej>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 2CC: abo, byte, imc, notting, pfrields, redhat-bugs2eran
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-04-16 05:31:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vic Gedris 2004-02-15 21:37:44 UTC
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):
kernel-2.6.2-1.81

How reproducible:
Always

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)
alsa-lib-1.0.2-1

Comment 1 Bill Nottingham 2004-02-16 06:44:35 UTC
APM or ACPI suspend?

Comment 2 Vic Gedris 2004-02-16 06:58:10 UTC
APM

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:
RESTORESOUND="yes"
RESTORESOUNDPROGS="yes"


Comment 3 Vic Gedris 2004-02-19 06:16:35 UTC
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 16:19:39 UTC
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 05:45:23 UTC
There are some flags (RESTORESOUND, RESTORESOUNDPROGS) in
/etc/sysconfig/apm-scripts/apmscript you should be able to set for this.

Comment 6 Ed Swierk 2004-10-09 20:13:16 UTC
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 15:18:22 UTC
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 23:53:20 UTC
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 12:28:28 UTC
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
well?



Comment 10 Ian Collier 2005-01-20 11:46:48 UTC
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
"snd-card";
 (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 16:33:58 UTC
Separate bug, please.

Comment 12 Ed Swierk 2005-01-21 01:16:23 UTC
Looks like bug 141463 addresses the apmscript fix.


Comment 13 Dave Jones 2005-04-16 05:31:16 UTC
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 20:11:03 UTC
The problem persists in with 2.6.11-1.1312_FC4.