Re: thinkpad_acpi alsa sub-driver with 2.6.33-rc3-git2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Heya,

> Your right, I checked /proc/asound and indeed I have a ThinkPadEC
> directory.
>
> $ cat /proc/asound/cards
> 0 [I82801DBICH4 ]: ICH4 - Intel 82801DB-ICH4
> Intel 82801DB-ICH4 with AD1981B at irq 11
> 1 [Modem ]: ICH-MODEM - Intel 82801DB-ICH4 Modem
> Intel 82801DB-ICH4 Modem at irq 11
> 29 [ThinkPadEC ]: ThinkPad EC - ThinkPad Console Audio Control
> ThinkPad Console Audio Control at EC reg 0x30, fw 1RHT71WW-3.04

Very nice! When will this be merged?

> When I run alsamixer, I can change to ThinkPadEC device and see the
> button presses change the volume and mute, so that all seems to work.
>
> But the question now is, how are you supposed to make use of this new
> volume/mute device under a modern distribution like Fedora 12? The
> gnome-volume-control-applet does not show any change when pressing the
> buttons, and indeed gnome-volume-control does not even show the device
> (or the modem for that matter) under the Hardware tab. Changing the alsa
> index from the default 29 to 3 does not change anything in this regard.
> Revent versions of gnome-volume-control use PulseAudio, so it is
> probably filtering the devices. But running 'pactl list' does not show
> any other devices either.
>
> I put some RedHat people on cc: that where involved with the
> volume-control makeover in F11 as I am hoping that Fedora 13 will have
> all of this working out of the box (assuming it gets the 2.6.33 kernel).
>
> When I have a bit of time, I might try it on my T60 also.

The problem is that we now have two seperate ALSA cards that control the 
volume of the same audio stream. There is currently no way for userspace 
to discover this and handle this situation properly. IIRC there was a 
very brief discussion about this problem with Takashi (added to CC) 
somewhere some years ago, and I think he suggested that the proper way 
to support this is to merge the sound card mixer and the laptop mixer in 
some way, so that the laptop volume slider just appears as yet another 
slider in the sound card mixer. The question is where to do that: on the 
kernel side or in userspace. Takashi, what do you say?

A while back, when Matthew Garrett (added to CC) started to work on 
doing this thinkpad/ALSA integration work I sat down and measured the dB 
attenuation factors of the X60s mixer in the hope this could be exported 
by the ALSA driver, for the integral volume steps. With this information 
provided by the driver and the merging of the mixers in place it would 
be very easy for PA to make use of this information by means of 
multiplying the laptop and the sound card volume sliders into one, for 
simplifying audio control and for increasing the granularity and range 
of volume control. This should then only require minor modifications in PA.

The tool I made my dB measurements with is available here:

http://git.0pointer.de/?p=dbmeasure.git

The README:

http://git.0pointer.de/?p=dbmeasure.git;a=blob;f=README

Here's an excerpt from that mail I sent to Matthew last year which 
includes the dB values for the X60s:

> Heya!
>
> I sat down now to implement a little tool that can measure the
> attenuation factors of sound card volume controls. More specifically I
> wanted to get those values for my X60s' hardware volume control.
>
> The tool works quite well, it measures almost exactly the same
> attenuation factors each time of quite a few runs I did here, so I am
> pretty confident they are accurate.
>
> What confused me a bit though is that the thinkpad-acpi claims the
> volume could set be in the range 0-15 (see
> /proc/acpi/ibm/volume). Which would suggest that there are 16 possible
> levels. However, there are only 15 I can control via the keys and the
> driver limits them to 15 too when I try to set the via sw. I am
> assuming now that that file is simply inaccurate or the programmer who
> did that was just confused...
>
> 14 is 0 dB
> 13 is -1,00567 dB
> 12 is -1,99476 dB
> 11 is -3,99038 dB
> 10 is -5,99167 dB
> 9 is -7,97708 dB
> 8 is -7,97657 dB
> 7 is -11,9629 dB
> 6 is -13,9691 dB
> 5 is -15,9507 dB
> 4 is -21,9484 dB
> 3 is -25,9103 dB
> 2 is -33,7952 dB
> 1 is -43,4907 dB
> 0 is -73,5398 dB

> This puts 0dB at 14, i.e. maximum amplification.
>
> What is surprsing is that the difference between 8 and 9 is much
> smaller than between 7 and 8, or 9 and 10.  But repeating the tests
> multiple times always gave the same results, and a listening test
> verified this result too. I guess the logic behind this simply looks
> up the volume level integer in a fixed table.
>
> Anyway, so here you have the dB data. If you can get me an ALSA driver
> for the thinkpad volume control with these values included then I'd be
> a happy man and in F12 we could merge PCM, Master and the TP volume
> slider into a single slider.
>
> I'd assume that other ThinkPads use the same attenuation table.
>
> The 'mute' key and volume=0 seem to have exactly the same effect,
> i.e. result in attenutation of -73.5 dB.
>
> The noise in these measurements is < -80 dB.
>
> In case you want to do similar measurements, here's the tool:
>
> http://git.0pointer.de/?p=dbmeasure.git
>
> Or read the README in case you just want to know how exactly my tool works:
>
> http://git.0pointer.de/?p=dbmeasure.git;a=blob_plain;f=README
>
> Lennart

Hope this is helpful and enlightening.

Lennart

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

[Index of Archives]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite Advice]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux