Thierry Vignaud <[EMAIL PROTECTED]> writes:

> with something like the following in /etc/init.d/mandrake_firstime, we
> could have better sound level defaults (which would get rid of 95% of
> alsa users bad feedback) :
> 
>      >====================================================>
>      > MIXER_SETTINGS=/root/tmp/l                         >
>      > aumix -f $MIXER_SETTINGS -S                        >
>      > perl -pi -e 's/\d+:\d+/50:50/' $MIXER_SETTINGS     >
>      > aumix -f $MIXER_SETTINGS -L                        >
>      >====================================================>
> 
> then we could swtich requested sound cards from oss to alsa on demand
> (after the communauty valid the switch), probably for "advanced" sound
> cards first.

something like this (untested):
Index: mandrake_firstime
===================================================================
RCS file: /cooker/soft/initscripts/mandrake/mandrake_firstime,v
retrieving revision 1.13
diff -u -p -r1.13 mandrake_firstime
--- mandrake_firstime	13 Sep 2002 14:57:07 -0000	1.13
+++ mandrake_firstime	1 Jul 2003 11:27:07 -0000
@@ -19,6 +19,21 @@ MOZ_REBUILD_DATABASE="/usr/lib/mozilla-*
  action "Building Mozilla registry" $MOZ_REBUILD_DATABASE 2>> $FLO
 }
 
+# provide decent default sound level for alsa drivers
+if [[ -e /proc/asound/cards ]]; then
+    MIXER_SETTINGS=/root/tmp/l
+    if [[ -x /usr/bin/aumix ]]; then
+        aumix -f $MIXER_SETTINGS -S
+        perl -pi -e 's/\d+:\d+/50:50/' $MIXER_SETTINGS
+        aumix -f $MIXER_SETTINGS -L
+    fi
+    if [[ -x /usr/sbin/alsactl ]]; then
+        alsactl -f $MIXER_SETTINGS store
+        perl -pi -e 's/(value\S*\s*) 0/\1 50/' $MIXER_SETTINGS
+        alsactl -f $MIXER_SETTINGS restore
+    fi
+fi
+
 #
 [ -s $FLO ] || rm -f $FLO
 

Reply via email to