Bug 141463 - RESTORESOUND* can't find driver module nor sound programs
Summary: RESTORESOUND* can't find driver module nor sound programs
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: apmd
Version: 3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC4Target
TreeView+ depends on / blocked
 
Reported: 2004-12-01 10:45 UTC by Ilkka Tengvall
Modified: 2014-03-17 02:51 UTC (History)
2 users (show)

Fixed In Version: 3.2.2-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-03-16 22:29:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ilkka Tengvall 2004-12-01 10:45:53 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041111 Firefox/1.0

Description of problem:
In /etc/sysconfig/apm-scripts/apmscript there is fault when finding
sound module. Script looks for modules with '-' in the name while at
least my sound module uses '_' in the name.

Here's how I got it finding my module:

$ diff apmscript apmscript-new
174c174
<               SOUNDMODULES=`modprobe -c | awk '/^alias sound-slot/ {
print $3 }'`
---
>               SOUNDMODULES=`modprobe -c | awk '/^alias snd-card/ {
print $3 }'| tr - _`

and here's what those commands output from commandline:
1. original prints nothing:

$ /sbin/modprobe -c | awk '/^alias sound-slot/ { print $3 }'

2. changed finds the module:

$ /sbin/modprobe -c | awk '/^alias snd-card/ { print $3 }' | tr - _
snd_cs46xx

OK, thats the part finding the module.

Then the second problem is apmd does not find sound programs. It tries
to look for /dev/sndtat by using command:

cat /dev/sndstat 2>/dev/null| LC_ALL=C grep Open\ by|awk {'print $3'}|uniq

First of all, there is no such file (/dev/sndstat) after having udev.
But even if linking /proc/asound/oss/sndstat to the /dev/sndstat does
not help. There are no such lines in sndstat file as "Open by". I
tried playing sound with xmms using alsa and using oss emulation. No
difference. 

So unloading the driver module does not succeed because soundprocs are
not killed first.

This all comes to problem that sound does not work after suspend and
resume cyckle.

kernel-2.6.9-1.681_FC3, machine is IBM T20 laptop

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

How reproducible:
Always

Steps to Reproduce:
1. listen music via xmms
2. press suspend button on keyboard
3. wake up the machine

    

Actual Results:  sound does not work after resume, the sound driver
does not get unloaded & reloaded

Expected Results:  music (or any sound) should just continue

Additional info:

Comment 1 Ed Swierk 2005-01-21 01:14:03 UTC
Just wanted to note that modifying apmscript as the reporter describes
fixes the problem on my laptop (FC3, ThinkPad T21, kernel
2.6.10-1.741_FC3, acpi=off).  Sound comes back after suspend/resume
just fine.

I haven't tried suspending while sound programs are running, so it's
possible that the missing /dev/sndstat is also still a problem on my
system.


Comment 2 Bill Nottingham 2005-03-16 22:29:20 UTC
SOUNDMODULES grep fixed in 3.2.2-1. The sndstat thing will require more work,
and is deferred for the moment.

Comment 3 Yaron Minsky 2005-03-29 01:46:41 UTC
I just upgraded to 3.2.2-1 on my Thinkpad T21, FC3, kernel 2.6.10-1.770_FC3, and
this did not fix the problem.  On suspend, sound still doesn't work.  If I try
to play a sound, I get messages of the following kind:

ALSA lib pcm_hw.c:521:(snd_pcm_hw_prepare) SNDRV_PCM_IOCTL_PREPARE failed:
Device or resource busy
ALSA lib pcm_hw.c:521:(snd_pcm_hw_prepare) SNDRV_PCM_IOCTL_PREPARE failed:
Device or resource busy
ALSA lib pcm_hw.c:521:(snd_pcm_hw_prepare) SNDRV_PCM_IOCTL_PREPARE failed:
Device or resource busy
ALSA lib pcm_hw.c:521:(snd_pcm_hw_prepare) SNDRV_PCM_IOCTL_PREPARE failed:
Device or resource busy
ALSA lib pcm_hw.c:521:(snd_pcm_hw_prepare) SNDRV_PCM_IOCTL_PREPARE failed:
Device or resource busy

Any thoughts?  Should this bug be re-opened?

Comment 4 Yaron Minsky 2005-03-29 02:11:07 UTC
It just occurred to me that I'm probably being an idiot.  I use ACPI for suspend
and resume, so I imagine a fix to apmd won't do me much good.  My apologies.


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