Subject: Re: NetBSD on Thinkpads
To: Tatoku Ogaito <tacha@tack.fukui-med.ac.jp>
From: Mark Davies <mark@mcs.vuw.ac.nz>
List: current-users
Date: 12/03/2007 17:17:12
--Boundary-00=_IN4UHu2aD1PdiUE
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
On Mon, 03 Dec 2007, Tatoku Ogaito wrote:
> Hi.
>
> >> In Message <loom.20071201T200258-216@post.gmane.org>
>
> at Sat, 1 Dec 2007 20:06:49 +0000 (UTC)
>
> Piotr Adamus <piotr.adamus1@wp.pl> wrote:
> > please try one of the mixerctl variables ->
>
> Thanks for your advise, but unfortunately this does not work for
> me. Actually I set both of *.dir variable in mixerctl output to
> "input", but no sounds come from headphones....
>
> Here is all "mixerctl -av" output. What shall/should I do next ?
> inputs.sel22.source=dac03 [ dac03 dac ]
On the AD1984 headphone input comes from dac03 by default but the
system tends to use dac04 (dac) so if you want to feed that to the
headphones try:
mixerctl -w inputs.sel22.source=dac
Attached is a patch for azalia_codec.c that gives somewhat more
meaningful names (to my mind) for the widgets of the AD1984. After
applying "mixerctl -av" will look something like this:
outputs.dac02.source=hdaudio [ hdaudio adc08 adc09 ]
inputs.dac03=130,130 delta=6
inputs.dac=130,130 delta=6
record.adc05.mute=off [ off on ]
record.adc05=127,127 delta=4
record.adc06.mute=off [ off on ]
record.adc06=127,127 delta=4
inputs.hp.hpsel.mute=off [ off on ]
inputs.hp.sel21.mute=off [ off on ]
inputs.spkr.dac.mute=off [ off on ]
inputs.spkr.sel21.mute=off [ off on ]
inputs.aux.auxsel.mute=off [ off on ]
inputs.aux.sel21.mute=off [ off on ]
inputs.adc08.source=mic [ mic mix20 dock.pre ]
outputs.adc08.mute=off [ off on ]
outputs.adc08=127,127 delta=4
inputs.adc09.source=mic [ mic mix20 dock.pre ]
outputs.adc09.mute=off [ off on ]
outputs.adc09=127,127 delta=4
inputs.monosel.source=dac03 [ dac03 dac ]
inputs.auxsel.source=dac03 [ dac03 dac ]
inputs.beep.mute=off [ off on ]
inputs.beep=136 delta=17
outputs.headphones.mute=off [ off on ]
outputs.headphones.boos=off [ off on ]
outputs.speaker.mute=off [ off on ]
outputs.speaker.boost=off [ off on ]
outputs.speaker.eapd=off [ off on ]
outputs.mono.mute=off [ off on ]
outputs.mono=131 delta=8
outputs.mono.eapd=off [ off on ]
outputs.mic=170,170 delta=85
outputs.line=170,170 delta=85
outputs.aux.mute=off [ off on ]
outputs.aux.dir=output [ input output ]
outputs.black1b.mute=off [ off on ]
outputs.black1b=130,130 delta=6
outputs.dock.mute=off [ off on ]
outputs.dock.dir=output [ input output ]
outputs.widget1d.source=hp [ hp pow19 spkr beep dock headphones
mono ]
inputs.mono.monosel.mu=off [ off on ]
inputs.mono.sel21.mute=off [ off on ]
inputs.mix20.mic.mute=off [ off on ]
inputs.mix20.beep.mute=off [ off on ]
inputs.mix20.dock.pre.=off [ off on ]
inputs.mix20.mic=131,131 delta=8
inputs.mix20.beep=131 delta=8
inputs.mix20.dock.pre=131,131 delta=8
outputs.sel21.mute=off [ off on ]
outputs.sel21=131,131 delta=8
inputs.hpsel.source=dac03 [ dac03 dac ]
inputs.docksel.source=dac03 [ dac03 dac ]
inputs.dock.docksel.mu=off [ off on ]
inputs.dock.sel21.mute=off [ off on ]
outputs.dock.pre=170,170 delta=85
outputs.widget26.source=mic [ mic line dock ]
playback.mode=04 [ 04 03 02 ]
record.mode=05 [ 05 06 08 09 ]
and the above command will become:
mixerctl -w inputs.hpsel.source=dac
You will still need to explicitly mute speakers when the headphones
are plugged in as I haven't yet done any of the pin detection.
cheers
mark
--Boundary-00=_IN4UHu2aD1PdiUE
Content-Type: text/x-diff;
charset="iso-8859-1";
name="patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="patch"
Index: azalia_codec.c
===================================================================
RCS file: /src/cvs/netbsd/src/sys/dev/pci/azalia_codec.c,v
retrieving revision 1.49
diff -u -r1.49 azalia_codec.c
--- azalia_codec.c 26 Nov 2007 15:47:36 -0000 1.49
+++ azalia_codec.c 27 Nov 2007 07:55:20 -0000
@@ -3090,12 +3090,73 @@
static int
ad1984_init_widget(const codec_t *this, widget_t *w, nid_t nid)
{
- if (this->subid == AD1984_THINKPAD) {
- switch (nid) {
- case 0x04:
- strlcpy(w->name, AudioNdac, sizeof(w->name));
- break;
- }
+ switch (nid) {
+ case 0x04:
+ strlcpy(w->name, AudioNdac, sizeof(w->name));
+ break;
+ case 0x07:
+ strlcpy(w->name, "hp", sizeof(w->name));
+ break;
+ case 0x0a:
+ strlcpy(w->name, "spkr", sizeof(w->name));
+ break;
+ case 0x0b:
+ strlcpy(w->name, AudioNaux, sizeof(w->name));
+ break;
+ case 0x0c:
+ strlcpy(w->name, "adc08", sizeof(w->name));
+ break;
+ case 0x0d:
+ strlcpy(w->name, "adc09", sizeof(w->name));
+ break;
+ case 0x0e:
+ strlcpy(w->name, AudioNmono "sel", sizeof(w->name));
+ break;
+ case 0x0f:
+ strlcpy(w->name, AudioNaux "sel", sizeof(w->name));
+ break;
+ case 0x10:
+ strlcpy(w->name, "beep", sizeof(w->name));
+ break;
+ case 0x11:
+ strlcpy(w->name, AudioNheadphone, sizeof(w->name));
+ break;
+ case 0x12:
+ strlcpy(w->name, AudioNspeaker, sizeof(w->name));
+ break;
+ case 0x13:
+ strlcpy(w->name, AudioNmono, sizeof(w->name));
+ break;
+ case 0x14:
+ strlcpy(w->name, AudioNmicrophone, sizeof(w->name));
+ break;
+ case 0x15:
+ strlcpy(w->name, AudioNline, sizeof(w->name));
+ break;
+ case 0x16:
+ strlcpy(w->name, AudioNaux, sizeof(w->name));
+ break;
+ case 0x1a:
+ strlcpy(w->name, "beep", sizeof(w->name));
+ break;
+ case 0x1c:
+ strlcpy(w->name, "dock", sizeof(w->name));
+ break;
+ case 0x1e:
+ strlcpy(w->name, AudioNmono, sizeof(w->name));
+ break;
+ case 0x22:
+ strlcpy(w->name, "hp" "sel", sizeof(w->name));
+ break;
+ case 0x23:
+ strlcpy(w->name, "dock" "sel", sizeof(w->name));
+ break;
+ case 0x24:
+ strlcpy(w->name, "dock", sizeof(w->name));
+ break;
+ case 0x25:
+ strlcpy(w->name, "dock.pre", sizeof(w->name));
+ break;
}
return 0;
}
--Boundary-00=_IN4UHu2aD1PdiUE--