[Pkg-alsa-devel] Error APMD resume ALSA reload-modules

Tom Dom dorn_zahn at yahoo.com
Sun Mar 16 18:20:34 UTC 2008


Error APMD resume ALSA reload-modules
-------------------------------------


Hi,
I apologize for probably causing the bug, at least as
I'm the proud owner
of the affected machine.


Thinkpad a21 a22 - Debian 4.0 r 1

kernel options noacpi acpi=off apm=on
apt-get install apmd



The /etc/apm/scripts.d/alsa script does not
unload/reload snd modules when
executed by the apmd. Though it obviously runs, see
below. 

It does all expected actions when invoked manually as
root.
e.g. "/etc/apmd/apmd_proxy resume suspend"



thanks for having a look at this

best regards, hans





Here are my attempts:
--------------------------------------------------------------------


#!/bin/sh
#
# apmd proxy script for ALSA

[ -x /usr/sbin/alsactl ] || exit 0

#case "$1,$2" in
#	suspend,*) /usr/sbin/alsactl store &&
/etc/init.d/alsa suspend ;;
#	resume,suspend) /etc/init.d/alsa resume &&
/usr/sbin/alsactl restore ;;
#esac

#  does not work, snd modules are not un-/re-loaded
#  (yes I have set /etc/default/alsa:
force_unload_modules_before_suspend=all)
#

# -----------------------------------------------


#
# These machines (thinkpad a21m, a22m) seem not to be
reliably useable with acpi.
# APM works fine generally. I need it.
#
# WRT suspend + snd, these machines need: modprobe -r
snd_cs46xx ; modprobe snd_cs46xx
# Doing this at resume is ok (after having killed
processes using alsa).
#




# to test the simplest:

#case "$1,$2" in
#	suspend,*) ;;
#	resume,suspend) /etc/init.d/alsa force-reload ;;
#esac

#
# ... does not reload the snd modules.
#

# -----------------------------------------------


# to check if ...
#  - the script is executed
#  - unloading fails due to other activity while
resuming



case "$1,$2" in
	suspend,*)
	
	echo -n "02 " >> /home/x/a
	/bin/date >> /home/x/a
	
	/usr/sbin/alsactl store
	
	echo -n "04 " >> /home/x/a
	/bin/date >> /home/x/a
	
	;;

	
	resume,suspend)
	
	echo -n "06 " >> /home/x/a
	/bin/date >> /home/x/a
	
	sleep 10

#	modprobe -r snd_cs46xx
#	/etc/init.d/alsa force-unload
	/etc/init.d/alsa force-reload

	echo -n "08 " >> /home/x/a
	/bin/date >> /home/x/a

	;;
esac


#
# The modules are'nt unloaded or reloaded.
#
# But the numbers and date strings are written to the
file as expected,
# the file being owned by root. Strange ?



#
# BTW, doing
#    /etc/init.d/alsa force-reload
#
# or manually invoking the script
#
#    /etc/apm/scripts.d/alsa resume suspend
# or
#    /etc/apm/events.d/apm-proxy resume suspend 
#
# works fine.


      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alsa_apm_20080315
Type: application/octet-stream
Size: 2498 bytes
Desc: 4124926239-alsa_apm_20080315
Url : http://lists.alioth.debian.org/pipermail/pkg-alsa-devel/attachments/20080316/1793dbe4/attachment.obj 


More information about the Pkg-alsa-devel mailing list