[ltp] »Ø¸´£º [ltp] Missing Alsa Master Channel on T 61

Yonggang Guo linux-thinkpad@linux-thinkpad.org
Wed, 16 Jan 2008 22:15:37 +0800 (CST)


--0-1403685043-1200492937=:17227
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: quoted-printable

hello,=0A=0AI made a simple script to handle the volume control on KDE.=0AT=
he script use kmix and osd_cat to get the volume function work.=0AMaybe it'=
s useful for you.=0A=0AFirstly, add acpi_osi=3DLinux to kernel param.=0A=0A=
1. add the key map in ~/.Xmodmap=0Akeycode 160 =3D XF86AudioMute=0Akeycode =
174 =3D XF86AudioLowerVolume=0Akeycode 176 =3D XF86AudioRaiseVolume=0A=0A2.=
 add the global preset actions in KDE=0A1) mute      XF86AudioMute      /et=
c/acpi/volume.sh mute=0A2) volumeUp  XF86AudioLowerVolume  /etc/acpi/volume=
.sh down=0A3) volumeUp  XF86AudioRaiseVolume  /etc/acpi/volume.sh up=0A=0A3=
. add the script  /etc/acpi/volume.sh=0A=0A#!/bin/bash=0AKMIX=3D"dcop kmix =
Mixer0"=0A=0Aosd() {=0A    pkill osd_cat=0A    echo $@ | osd_cat -p bottom =
-A center -c green -d 5 -O 1 -u black -f "-adobe-helvetica-bold-r-normal-*-=
*-320-*-*-p-*-iso8859-1" &=0A}=0A=0Amute() {=0A    $KMIX setMute 0 $@=0A   =
 $KMIX setMute 13 $@=0A    $KMIX setMute 14 $@=0A}=0A=0Acase "$1" in=0A    =
mute)=0A        mute "on"=0A        osd "mute on"=0A        ;;=0A    up)=0A=
        mute "off"=0A        $KMIX setMasterVolume $(expr $($KMIX masterVol=
ume) + 7)=0A        osd $($KMIX masterVolume) %=0A        ;;=0A    down)=0A=
        mute "off"=0A        $KMIX setMasterVolume $(expr $($KMIX masterVol=
ume) - 3)=0A        osd $($KMIX masterVolume) %=0A        ;;=0Aesac=0A=0Asl=
eep 5=0Apkill osd_cat=0Aexit 0=0A=0A=0AIn function mute(), the number (0,13=
, 14) is the headphone and speaker deviceidx.=0AWhen i use kmix to mute the=
 master channel, no use.=0ASo  i have to find the other channel to mute.=0A=
=0A=0A=0A=0A---------=0A=B7=A2=BC=FE=C8=CB=A3=BA Sin Tzu <sintzu@gmail.com>=
=0A=CA=D5=BC=FE=C8=CB=A3=BA linux-thinkpad@linux-thinkpad.org=0A=D2=D1=B7=
=A2=CB=CD=A3=BA 2008/1/16(=D6=DC=C8=FD), =CF=C2=CE=E78:23:13=0A=D6=F7=CC=E2=
=A3=BA Re: [ltp] Missing Alsa Master Channel on T61=0A=0Ado your volume con=
trols work?=0A =0A=0AOn 1/16/08, Yves-Alexis Perez <corsac@debian.org> wrot=
e:=0AOn Wed, Jan 16, 2008 at 06:45:03AM +0000, Sin Tzu wrote:=0A> why do yo=
u need a master channel?=0A=0A=0AI don't *need* a master channel, I guess P=
CM is fine (I don't really know to=0Awhat it correspond anyway). But it'd b=
e nice to have "mutable" channel.=0A--=0AYves-Alexis=0A--=0AThe linux-think=
pad mailing list home page is at:=0A=0Ahttp://mailman.linux-thinkpad.org/ma=
ilman/listinfo/linux-thinkpad=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A      __________=
_________________________________________________ =0A=D1=C5=BB=A2=D3=CA=CF=
=E4=B4=AB=B5=DD=D0=C2=C4=EA=D7=A3=B8=A3=A3=AC=B8=F6=D0=D4=BA=D8=BF=A8=CB=CD=
=C7=D7=C5=F3=A3=A1 =0Ahttp://cn.mail.yahoo.com/gc/index.html?entry=3D5&souc=
e=3Dmail_mailletter_tagline
--0-1403685043-1200492937=:17227
Content-Type: text/html; charset=gb2312
Content-Transfer-Encoding: quoted-printable

<html><head><style type=3D"text/css"><!-- DIV {margin:0px;} --></style></he=
ad><body><div style=3D"font-family:times new roman, new york, times, serif;=
font-size:12pt"><div style=3D"font-family: times new roman,new york,times,s=
erif; font-size: 12pt;">hello,<br><br>I made a simple script to handle the =
volume control on KDE.<br>The script use kmix and osd_cat to get the volume=
 function work.<br>Maybe it's useful for you.<br><br>Firstly, add acpi_osi=
=3DLinux to kernel param.<br><br>1. add the key map in ~/.Xmodmap<br>keycod=
e 160 =3D XF86AudioMute<br>keycode 174 =3D XF86AudioLowerVolume<br>keycode =
176 =3D XF86AudioRaiseVolume<br><br>2. add the global preset actions in KDE=
<br>1) mute&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XF86AudioMute&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp; /etc/acpi/volume.sh mute<br>2) volumeUp&nbsp; XF86AudioLowerVolu=
me&nbsp; /etc/acpi/volume.sh down<br>3) volumeUp&nbsp; XF86AudioRaiseVolume=
&nbsp; /etc/acpi/volume.sh up<br><br>3. add the script=20
 /etc/acpi/volume.sh<br><br>#!/bin/bash<br>KMIX=3D"dcop kmix Mixer0"<br><br=
>osd() {<br>&nbsp;&nbsp;&nbsp; pkill osd_cat<br>&nbsp;&nbsp;&nbsp; echo $@ =
| osd_cat -p bottom -A center -c green -d 5 -O 1 -u black -f "-adobe-helvet=
ica-bold-r-normal-*-*-320-*-*-p-*-iso8859-1" &amp;<br>}<br><br>mute() {<br>=
&nbsp;&nbsp;&nbsp; $KMIX setMute 0 $@<br>&nbsp;&nbsp;&nbsp; $KMIX setMute 1=
3 $@<br>&nbsp;&nbsp;&nbsp; $KMIX setMute 14 $@<br>}<br><br>case "$1" in<br>=
&nbsp;&nbsp;&nbsp; mute)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mute "on"=
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; osd "mute on"<br>&nbsp;&nbsp;&nbs=
p; &nbsp;&nbsp;&nbsp; ;;<br>&nbsp;&nbsp;&nbsp; up)<br>&nbsp;&nbsp;&nbsp; &n=
bsp;&nbsp;&nbsp; mute "off"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $KMIX =
setMasterVolume $(expr $($KMIX masterVolume) + 7)<br>&nbsp;&nbsp;&nbsp; &nb=
sp;&nbsp;&nbsp; osd $($KMIX masterVolume) %<br>&nbsp;&nbsp;&nbsp; &nbsp;&nb=
sp;&nbsp; ;;<br>&nbsp;&nbsp;&nbsp; down)<br>&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; mute "off"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $KM=
IX setMasterVolume $(expr $($KMIX masterVolume) - 3)<br>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; osd $($KMIX masterVolume) %<br>&nbsp;&nbsp;&nbsp; &nbsp;=
&nbsp;&nbsp; ;;<br>esac<br><br>sleep 5<br>pkill osd_cat<br>exit 0<br><br><b=
r>In function mute(), the number (0,13, 14) is the headphone and speaker de=
viceidx.<br>When i use kmix to mute the master channel, no use.<br>So&nbsp;=
 i have to find the other channel to mute.<br><br><br><br><br><div style=3D=
"font-family: times new roman,new york,times,serif; font-size: 12pt;">-----=
----<br>=B7=A2=BC=FE=C8=CB=A3=BA Sin Tzu &lt;sintzu@gmail.com&gt;<br>=CA=D5=
=BC=FE=C8=CB=A3=BA linux-thinkpad@linux-thinkpad.org<br>=D2=D1=B7=A2=CB=CD=
=A3=BA 2008/1/16(=D6=DC=C8=FD), =CF=C2=CE=E78:23:13<br>=D6=F7=CC=E2=A3=BA R=
e: [ltp] Missing Alsa Master Channel on T61<br><br><div>do your volume cont=
rols work?<br>&nbsp;</div>=0A<div><span class=3D"gmail_quote">On 1/16/08, <=
b class=3D"gmail_sendername">Yves-Alexis Perez</b> &lt;<a rel=3D"nofollow" =
ymailto=3D"mailto:corsac@debian.org" target=3D"_blank" href=3D"mailto:corsa=
c@debian.org">corsac@debian.org</a>&gt; wrote:</span>=0A<blockquote class=
=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin=
: 0px 0px 0px 0.8ex; padding-left: 1ex;">On Wed, Jan 16, 2008 at 06:45:03AM=
 +0000, Sin Tzu wrote:<br>&gt; why do you need a master channel?<br><br>=0A=
I don't *need* a master channel, I guess PCM is fine (I don't really know t=
o<br>what it correspond anyway). But it'd be nice to have "mutable" channel=
.<br>--<br>Yves-Alexis<br>--<br>The linux-thinkpad mailing list home page i=
s at:=0A<br><a rel=3D"nofollow" target=3D"_blank" href=3D"http://mailman.li=
nux-thinkpad.org/mailman/listinfo/linux-thinkpad">http://mailman.linux-thin=
kpad.org/mailman/listinfo/linux-thinkpad</a><br></blockquote></div><br>=0A<=
/div><br></div></div><br>=0A=0A=0A      <hr size=3D1><a href=3D"http://cn.m=
ail.yahoo.com/gc/index.html?entry=3D5&souce=3Dmail_mailletter_tagline">=D1=
=C5=BB=A2=D3=CA=CF=E4=B4=AB=B5=DD=D0=C2=C4=EA=D7=A3=B8=A3=A3=AC=B8=F6=D0=D4=
=BA=D8=BF=A8=CB=CD=C7=D7=C5=F3=A3=A1</a> </body></html>
--0-1403685043-1200492937=:17227--