Sound volume problem solved (Re: [ltp] Sound and the mwave modem (More on Redhat 7.3 vs the Thinkpad 600))

Charles E Taylor IV linux-thinkpad@www.bm-soft.com
Wed, 31 Jul 2002 14:05:32 -0400


Replying to myself here, but I came up with a workable solution.

> I'm guessing aumix -v 100 run when the computer wakes up will solve the
> problem, but what do I need to edit to get it to run automatically when
> I resume?
> /etc/sysconfig/apmd might be a logical place to look, but how do I get
> it to run an arbitrary program on resume?

I noticed that I could specify services to be started in
/etc/sysconfig/apmd, so I created a service that simply ran aumix -v 100.

Result - sound restored automatically after a resume.

The script was shamelessly modeled after the IBM "cs4232" script to fix
the CS4232 sound driver problem from
http://www.pc.ibm.com/qtechinfo/MIGR-4BP6Q6.html

[user@tycho user]$ cat /etc/init.d/resetmixer
#!/bin/bash

# chkconfig: 345 85 16

# description: Resets the audio mixer volume (useful after a
# suspend/resume)

HOME=/etc

case "$1" in
start)
	echo "Resetting sound volume (start)"
	/usr/bin/aumix -v100
;;
stop)
	echo "Resetting sound volume (stop)"
	/usr/bin/aumix -v100
;;
restart)
	$0 stop
	$0 start
;;
status)
	echo "Status (NO-OP)"
;;
*)
echo "Usage:resetmixer {start|stop|status|restart}"
exit 1
esac

exit 0

***************************

I then edited /etc/sysconfig/apmd:

> # some services might need restarting after a suspend/resume cycle - for
> # example, named will shut down if all network interfaces go down.
> # Any valid service (as in "ls /etc/init.d/") can be listed, and will be
> # restarted if it was running at suspend time.
> RESTORESERVICES="mwaved cs4232 resetmixer"

-- 
--------------------------------------------------------------------
*  Charles Taylor <tomalek@mindspring.com>
*  Chemistry teacher, Linux enthusiast!
--------------------------------------------------------------------
*  College Chemistry website: http://home.mindspring.com/~charletiv/
--------------------------------------------------------------------

----- The Linux ThinkPad mailing list -----
The linux-thinkpad mailing list home page is at:
http://www.bm-soft.com/~bm/tp_mailing.html