[ltp] Re: 600X Sound After Resume

Richard Neill linux-thinkpad@linux-thinkpad.org
Sun, 16 Jul 2006 03:17:01 +0100


Chris Schumann wrote:
> Florian wrote:
> 
>>On Fre, 14 Jul 2006, Chris Schumann wrote:
>>
>>
>>>I'm running FC5 on two 600X's that exhibit the same problem: No sound after
>>>a resume. I know I can rmmod the snd_cs46xx module and modprobe it, but I
>>>can't do that (even as root) when I'm logged in an X session because it's in
>>>use. lsmod shows that it's being used by one process, but gives no name.
>>
>>lsof should give the names of processes...
>>
>>lsof | grep /dev/snd | awk '{print $2}' | xargs kill
>>sleep 2
>>lsof | grep /dev/snd | awk '{print $2}' | xargs kill -9
>>
>>after that you should be able to remove the module
> 
> 
> Yep, and what's holding the device open is the mixer_app, the volume
> control on the task bar.

So, you should be able to kill the program, then restart alsa, then 
restart the mixer. I'd be wary of the above lsof commands though: 
consider if a firefox plugin has grabbed the soundcard: you probably 
don't want to kill-9 it!

> 
>>Let me guess - you are using a sound server? Likely culprits are:
>>
>>  KDE's arts
>>  timidity
> 
> Uhm, I don't think so. The volume control has the device open. Neither
> of those appears to be running.
> 
>>I don't know what gone does.
> 
> Me neither.

D'Oh!  s/gone/Gnome/

Since you're using (probably) Gnome under FC5, you need to look at how 
it is set up.


> 
>>The good news is, you don't need to run *any* sound servers now. We have 
>>alsa + dmix.
>>
>>1)Disable the Desktop Environment's sound server. Tell it to play 
>>notifications through an external player. Eg this
>>-----------------
>>#!/bin/bash
>>#Play audio file immediately (alsa; avoid arts startup delay). Volume 
>>decreased to 0.4
>>sox "$1" -t wav -v 0.4 - | aplay
>>----------------------
> 
> 
> Where do I put that? Why decrease volume?
> 

I have KDE set to use that as the "external player" in system 
notifications.  The 0.4 is because I like my music fairly loud, but I 
prefer not to be startled out of my skin by every error beep.

I'm not a Gnome user, so I can't advise exactly how you do the 
equivalent - although I'm sure it's possible.

>>2)Set all applications to output to alsa, rather than oss.
>>Certainly you can do this with mplayer,vlc,xmms etc
> 
> 
> I haven't used apps to play anything yet. It's all desktop sounds and
> sounds from web pages.
> 
> 
>>3)Anything that can't should be wrapped in "aoss". eg
>>     aoss /usr/bin/play  somefile.
> 
> 
> See #2.
> 
> Thanks for the tips, guys, but there's still no joy. Is this
> fundamentally a bug in the sound driver? Maybe it's a good way to get my
> feet wet with Linux driver hacking?
> 


No - it's (probably) not a driver bug. Almost certainly you just need to 
  reload the driver after a suspend - but you have to unload it first, 
which means closing the sound device.

Regards,

Richard