summaryrefslogtreecommitdiffstats
path: root/move/tree/alsa_default.pl
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-12-05 16:07:43 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-12-05 16:07:43 +0000
commit690c0c5602db9bf3ff954a9846a6766aa3a8e8cf (patch)
treeb8f5b3ba1da87a25b1e8cd2f9c13ea1803890a99 /move/tree/alsa_default.pl
parentd7635f540b77d89d1e0f98b438445b60a78b38fd (diff)
downloaddrakx-690c0c5602db9bf3ff954a9846a6766aa3a8e8cf.tar
drakx-690c0c5602db9bf3ff954a9846a6766aa3a8e8cf.tar.gz
drakx-690c0c5602db9bf3ff954a9846a6766aa3a8e8cf.tar.bz2
drakx-690c0c5602db9bf3ff954a9846a6766aa3a8e8cf.tar.xz
drakx-690c0c5602db9bf3ff954a9846a6766aa3a8e8cf.zip
titi fixes sound initscript for some alsa devices
Diffstat (limited to 'move/tree/alsa_default.pl')
-rwxr-xr-xmove/tree/alsa_default.pl19
1 files changed, 19 insertions, 0 deletions
diff --git a/move/tree/alsa_default.pl b/move/tree/alsa_default.pl
new file mode 100755
index 000000000..927c8c1d3
--- /dev/null
+++ b/move/tree/alsa_default.pl
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+
+# state machine:
+if (/\s*control\./) {
+ ($min, $max) = (0, 0);
+} elsif (/\s*name '/) {
+ # skip masks
+ $ignore = /\s*name '.*(3D Control|mask|Exchange DAC|Output Jack)/;
+} elsif (!$ignore) {
+ if (/s*comment.range '(\d+) - (\d+)'/) {
+ ($min, $max) = ($1, $2);
+ } elsif (/s*value/) {
+ # enable switches (we should really blacklist sb live and the like):
+ s/(value\w*\S*)\s* false/\1 true/;
+ # set volume to 67%:
+ my $val = $max*0.6;
+ s/(value\w*\S*)\s* 0/\1 $val/
+ }
+}