Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Jun 2006 15:12:09 -0500
From:      Eric Anderson <anderson@centtech.com>
To:        Andrea Bittau <a.bittau@cs.ucl.ac.uk>
Cc:        freebsd-mobile@freebsd.org
Subject:   Re: HDA sound driver mod for thinkpad x60s
Message-ID:  <4485E199.7000604@centtech.com>
In-Reply-To: <4485DA6D.9020304@centtech.com>
References:  <20060606124030.GA32057@shorty.sorbonet.org>	<4485CEF8.10201@centtech.com>	<20060606192229.GA4465@shorty.sorbonet.org> <4485DA6D.9020304@centtech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Eric Anderson wrote:
> Andrea Bittau wrote:
>> On Tue, Jun 06, 2006 at 01:52:40PM -0500, Eric Anderson wrote:
>>> I can't seem to play any audio tho..  I realize this isn't an IBM, 
>>> but was hoping it would work.. :)
>>
>> What does that mean?  If you:
>> cat /dev/urandom > /dev/dsp
>> does it complain?  dmesg?  Also, if you ctrl C, does it stop after a 
>> bit, with
>> no complatins?
> 
> No, the cat command doesn't complain, and the ctrl-c stops after a 
> little bit, no errors.

One thing to note: I have /dev/dsp0.0 and /dev/dspW0.0 and no /dev/dsp.

I can't recall which is normal..


> Some more information about my system can be found here:
> http://www.googlebit.com/freebsd/200606061340/
> 
> Although earlier when playing around and trying kldunload the module, I 
> saw this rather hilarious message:
> 
> Jun  6 13:53:15 neutrino kernel: pcm0: unregister: mixer busy
> Jun  6 13:53:15 neutrino kernel: Fucked up register 16
> 
> P.S. - you can probably safely remove the calc.core file from the 
> archive (along with a few other extra items). :)
> 
> 
>> Anyway, assuming my code is "good enough" there might be two reasons 
>> why it's
>> not working:
>>
>> 1) I lamely hardcoded the Output device node identifier.
>> 2) I hardcoded the Pin node identifier for the volume control.
>>
>>
>> To solve #1 try this in my code:
>> in hdac_attach2() get rid of the if(0) before sorbo_enum().  That is,
>> sorbo_enum() needs to be called.  Then, in sorbo_print_widget() get 
>> rid of the 0
>> && in the type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_OUTPUT.  That is,
>> sorbo_conf_output() needs to be called if the type is audio output.  
>> [I'm not
>> sure what happens if all output devices are configured though...].  
>> Basically,
>> this will cause all output devices to accept the music stream.  Try it 
>> like
>> that.

Did - nothing different really.


>> Ideally you want only one output device to be configured, but I guess 
>> if you
>> look at the dmesg output u can figure out which node identifiers are 
>> output
>> devices and try them all, one at a time, until you find the correct 
>> one.  You
>> might notice that in IBM's case it's a 3, so I call 
>> sorbo_conf_output(sc, 0, 3);
>> Actually, you probably wanna get rid of that call too if your output 
>> device is
>> not node id 3.

How can I figure out the node id?

With more stuff uncommented in the code, I get:

Jun  6 14:43:51 neutrino kernel: pcm0: <audio> at device 0:1 (no driver 
attached)
Jun  6 14:43:51 neutrino kernel: pcm0: <modem> at device 1:2 (no driver 
attached)
Jun  6 14:43:51 neutrino kernel: pcm0: node 2 type 0 cap d0401
Jun  6 14:43:51 neutrino kernel: pcm0: Cap d0401 sf 0 st 0
Jun  6 14:43:51 neutrino kernel: pcm0: Set 0:2 10
Jun  6 14:43:51 neutrino kernel: pcm0: node 3 type 1 cap 1d0541
Jun  6 14:43:51 neutrino kernel: pcm0: node 4 type 1 cap 140311
Jun  6 14:43:51 neutrino kernel: pcm0: node 5 type 0 cap 40211
Jun  6 14:43:51 neutrino kernel: pcm0: Cap 40211 sf e01e0 st 5
Jun  6 14:43:51 neutrino kernel: pcm0: Set 0:5 10
Jun  6 14:43:51 neutrino kernel: pcm0: node 6 type f cap f30201
Jun  6 14:43:51 neutrino kernel: pcm0: node 7 type 3 cap 300901
Jun  6 14:43:51 neutrino kernel: pcm0: node 8 type 4 cap 430681
Jun  6 14:43:51 neutrino kernel: pcm0: node 9 type 4 cap 400301
Jun  6 14:43:51 neutrino kernel: pcm0: node 10 type 3 cap 30090d
Jun  6 14:43:51 neutrino kernel: pcm0: node 11 type 3 cap 300105
Jun  6 14:43:51 neutrino kernel: pcm0: node 12 type 3 cap 30010d
Jun  6 14:43:51 neutrino kernel: pcm0: node 13 type 4 cap 400181
Jun  6 14:43:51 neutrino kernel: pcm0: node 14 type 4 cap 400181
Jun  6 14:43:51 neutrino kernel: pcm0: node 15 type 4 cap 400181
Jun  6 14:43:51 neutrino kernel: pcm0: node 16 type 4 cap 400181
Jun  6 14:43:51 neutrino kernel: pcm0: node 17 type 4 cap 400104
Jun  6 14:43:51 neutrino kernel: pcm0: node 18 type 4 cap 400001
Jun  6 14:43:51 neutrino kernel: pcm0: node 19 type 2 cap 200100
Jun  6 14:43:51 neutrino kernel: pcm0: node 20 type 7 cap 70000c
Jun  6 14:43:51 neutrino kernel: pcm0: Cap 1d0541 sf 0 st 0
Jun  6 14:43:51 neutrino kernel: pcm0: Set 0:3 10


>> To solve #2 do this:
>> Enable sorbo_enum() like above, and then in sorbo_print_widget() get 
>> rid of the
>> if (0) before sorbo_set_amp(sc, codecid, nodeid, 40);.  Basically, 
>> this will
>> cause all nodes to be amplified.  Try it like that.  Once again, 
>> ideally you
>> only want the correct node [TYPE_PIN] to be amplified.

Did that too, still nothing different..


>> As a final test, you might want to put a printf in sorbo_in_intr() to 
>> see if you
>> are getting any interrupts.

Ok - looks like I am getting interrupts, because any time I try sound 
output, I see a large number of my handy print's to dmesg, like this:

Jun  6 15:02:30 neutrino kernel: pcm0: w00t 0xc5011e80 1856
Jun  6 15:02:30 neutrino kernel: pcm0: w00t 0xc5011e80 3904




Eric



-- 
------------------------------------------------------------------------
Eric Anderson        Sr. Systems Administrator        Centaur Technology
Anything that works is better than anything that doesn't.
------------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4485E199.7000604>