From owner-freebsd-mobile@FreeBSD.ORG Mon Jun 12 03:55:21 2006 Return-Path: X-Original-To: freebsd-mobile@freebsd.org Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A3FB316A41F for ; Mon, 12 Jun 2006 03:55:21 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34E1A43D45 for ; Mon, 12 Jun 2006 03:55:21 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [192.168.42.22] (andersonbox2.centtech.com [192.168.42.22]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id k5C3t4NK066395; Sun, 11 Jun 2006 22:55:04 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <448CE5A0.70806@centtech.com> Date: Sun, 11 Jun 2006 22:55:12 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.2 (X11/20060506) MIME-Version: 1.0 To: Andrea Bittau References: <20060606124030.GA32057@shorty.sorbonet.org> <4485CEF8.10201@centtech.com> <20060606192229.GA4465@shorty.sorbonet.org> <4485DA6D.9020304@centtech.com> <4485E199.7000604@centtech.com> <20060606205918.GA6765@shorty.sorbonet.org> <20060606231025.R50560@volatile.chemikals.org> <20060607073918.GB9245@shorty.sorbonet.org> In-Reply-To: <20060607073918.GB9245@shorty.sorbonet.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1532/Sun Jun 11 17:57:47 2006 on mh2.centtech.com X-Virus-Status: Clean Cc: freebsd-mobile@freebsd.org Subject: Re: HDA sound driver mod for thinkpad x60s X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jun 2006 03:55:21 -0000 Andrea Bittau wrote: > On Tue, Jun 06, 2006 at 11:15:55PM -0400, Wesley Morgan wrote: >> pcm0: node 2 type 0 cap d0401 >> pcm0: Cap d0401 sf 0 st 0 >> pcm0: node 5 type 0 cap 40211 >> pcm0: Cap 40211 sf e01e0 st 5 > > You have two audio outputs [even IBM does]. Node ID 5 looks most promising > because it states its stream format and type. Thus, in the vanilla driver, you > should change: > sorbo_conf_output(sc, 0, 3); > to > sorbo_conf_output(sc, 0, 5); > >> pcm0: node 9 type 4 cap 400301 >> pcm0: nid 9 entries 2 list a05 cur 0 ctr 0 cap 10 s 0 > > Node ID 9 is a PIN which is connected to node id 5 [your audio output]. This > looks really promising. In the driver, you should change: > sorbo_set_amp(sc, 0, 5, > to > sorbo_set_amp(sc, 0, 9, > [two places, initial conf, and mixer.] > >> pcm0: node 11 type 3 cap 300105 >> pcm0: node 13 type 4 cap 400181 >> pcm0: nid 13 entries 1 list b cur 0 ctr 0 cap 3f s 7fffffff >> pcm0: node 14 type 4 cap 400181 >> pcm0: nid 14 entries 1 list b cur 0 ctr 0 cap 3f s 7fffffff >> pcm0: node 15 type 4 cap 400181 >> pcm0: nid 15 entries 1 list b cur 0 ctr 0 cap 37 s 7fffffff >> pcm0: node 16 type 4 cap 400181 >> pcm0: nid 16 entries 1 list b cur 0 ctr 0 cap 1737 s 7fffffff >> pcm0: node 17 type 4 cap 400104 >> pcm0: nid 17 entries 1 list 13 cur 0 ctr 0 cap 10 s 0 >> pcm0: node 19 type 2 cap 200100 > > Most of your other PINs, of which one of them could be the correct one, are > connected to node id 0xb [11]. This is the big difference with IBM. In IBM's > case, they are connected to audio output directly [by default]. In your case, > most of your pins seem to be connected to node 11, an audio selector. [One of > them is connected to node 19, a mixer, but lets hope that is not the pin we are > after.] > > A selector will get a bunch of inputs and spit one out. Useful debug > information would be "what is node id 11 connected to". Somewhere in the code, > perhaps before attach2(), add this: > static void > sorbo_print_conn(struct hdac_softc *sc, int cad, int nid) > { > int rc; > uint32_t l, p; > > rc = hdac_command_sendone_internal(sc, > HDA_CMD_GET_PARAMETER(cad, nid, HDA_PARAM_CONN_LIST_LENGTH), cad); > > if (rc) { > l = hdac_command_sendone_internal(sc, > HDA_CMD_GET_CONN_LIST_ENTRY(cad, nid, 0), cad); > > p = hdac_command_sendone_internal(sc, > HDA_CMD_GET_CONN_SELECT_CONTROL(cad, nid), cad); > > printf("nid %d list %x current %x\n", nid, l, p); > } > > } > > then in attach2, add: > sorbo_print_conn(sc, 0, 11); > > This will tell you what the selector is connected to. Hopefully it's current > selection is 5. > > Next, selectors may have amplifiers. Adding [in attach2] a > sorbo_set_amp(sc, 0, 11, 40); // 40 is the gain. 63 is max > shouldn't harm. > Also, amplify all pins... so do something like: > sorbo_set_amp(sc, 0, 9, 40); > sorbo_set_amp(sc, 0, 13, 40); > ... [all type 4] > sorbo_set_amp(sc, 0, 17, 40); > > Anyway, this driver mod was really meant for x60s only... as it's badly written > [a weekend hack]. Perhaps we should meet up on irc or something if you really > want to get it working. I wish someone on an x60 could try it to at least > "prove" that it works [or doesn't =P]. Well, I'm out of ideas, and you probably never wanted to hear about us soundless Dell users. :) Here's the dmesg's from various trials, maybe it's worth something to someone: Jun 11 22:37:45 neutrino kernel: pci0: driver added Jun 11 22:37:45 neutrino kernel: found-> vendor=0x8086, dev=0x27d8, revid=0x01 Jun 11 22:37:45 neutrino kernel: bus=0, slot=27, func=0 Jun 11 22:37:45 neutrino kernel: class=04-03-00, hdrtype=0x00, mfdev=0 Jun 11 22:37:45 neutrino kernel: cmdreg=0x0106, statreg=0x0010, cachelnsz=16 (dwords) Jun 11 22:37:45 neutrino kernel: lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) Jun 11 22:37:45 neutrino kernel: intpin=a, irq=21 Jun 11 22:37:45 neutrino kernel: powerspec 2 supports D0 D3 current D0 Jun 11 22:37:45 neutrino kernel: MSI supports 1 message, 64 bit Jun 11 22:37:45 neutrino kernel: pci0:27:0: reprobing on driver added Jun 11 22:37:45 neutrino kernel: pcm0: mem 0xdfffc000-0xdfffffff irq 21 at device 27.0 on pci0 Jun 11 22:37:45 neutrino kernel: init 0xc6039600 Jun 11 22:37:45 neutrino kernel: pcm0: sndbuf_setmap 3dc7b000, 1000; 0xc51a7000 -> 3dc7b000 Jun 11 22:37:45 neutrino kernel: pcm0: Reserved 0x4000 bytes for rid 0x10 type 3 at 0xdfffc000 Jun 11 22:37:45 neutrino kernel: pcm0: [MPSAFE] Jun 11 22:37:45 neutrino kernel: pcm0: Output Streams: 4, Input Streams: 4, Bidirectional Streams: 0 Jun 11 22:37:45 neutrino kernel: pcm0: CORB Size: 256, RIRB Size: 256 Jun 11 22:37:45 neutrino kernel: pcm0: