Is there any facility for developing an ALSA device driver in userspace? I'm particularly interested in mixer devices; my goal is to expose the Thinkpad hardware volume buttons as an ALSA mixer.
Thanks for any pointers!
On Wed, 2007-09-26 at 15:28 -0400, Josh Litherland wrote:
Is there any facility for developing an ALSA device driver in userspace? I'm particularly interested in mixer devices; my goal is to expose the Thinkpad hardware volume buttons as an ALSA mixer.
Thanks for any pointers!
The volume buttons should be supported by either acpi controls or keyboard settings. Try running showkey and seeing if they trigger keycodes. Once you have those, you could map them to a macro that adjusts volume through amixer. I know that there are applets for KDE to support the thinkpad keys, there may be others as well.
On 9/26/07, Tobin Davis tdavis@dsl-only.net wrote:
The volume buttons should be supported by either acpi controls or keyboard settings. Try running showkey and seeing if they trigger keycodes. Once you have those, you could map them to a macro that adjusts volume through amixer. I know that there are applets for KDE to support the thinkpad keys, there may be others as well.
It's true; in particular, in Ubuntu, the thinkpad-keys binary from the hotkey-setup package watches for these key-events, and connects as a userspace input device to synthesize normal volumeup, volumedown and mute key events.
Unfortunately, that's not really how thinkpads work. =( They are fairly unique in that the hardware volume buttons actually control a separate hardware mixer independent of the sound chip itself, and there is no way I've seen in open source to prevent them from controlling that phantom mixer. So mapping them to also control the sound card's master mixer will eventually lead to a skew from expected results.
The phantom mixer can, however, be queried and changed through /dev/nvram and, in recent kernels, in /proc/acpi/ibm and some knobs in /sys. What I'm proposing is to expose the phantom mixer as an alsa mixer device.
-- Tobin Davis
Today's weirdness is tomorrow's reason why. -- Hunter S. Thompson
On 09/26/2007 09:28 PM, Josh Litherland wrote:
Is there any facility for developing an ALSA device driver in userspace? I'm particularly interested in mixer devices; my goal is to expose the Thinkpad hardware volume buttons as an ALSA mixer.
Thanks for any pointers!
Most of the cheaper hardware today does volume control in software which ALSA supports through the softvol plugin that runs in userspace. I've never actually owned any of this hardware but assuming the volume control shows up in say alsamixer same as if it had been a hardware control, you'd have an example of a userspace volume control there. Actually talking to the buttons is another matter ofcourse but it may serve as a useful example of how to expose the control through alsa at least.
Or not, comments obviously welcome -- never look at it but also have a use in mind...
Rene.
On 9/27/07, Rene Herman rene.herman@keyaccess.nl wrote:
assuming the volume control shows up in say alsamixer same as if it had been a hardware control, you'd have an example of a userspace volume control there
Thanks, this looks like exactly the hook I was needing. Now to try to grok it. =D
On 09/27/2007 04:38 PM, Josh Litherland wrote:
On 9/27/07, Rene Herman rene.herman@keyaccess.nl wrote:
[ softvol ]
assuming the volume control shows up in say alsamixer same as if it had been a hardware control, you'd have an example of a userspace volume control there
Thanks, this looks like exactly the hook I was needing. Now to try to grok it. =D
Assuming you do, please report back. I'd like to know how that works as well... :-)
Rene
participants (3)
-
Josh Litherland
-
Rene Herman
-
Tobin Davis