I have a brand new Macbook Pro running Ubuntu 15.04-beta2. In OSX, I was able to use my iPhone headphones into the "headphone" jack and use the media keys on the headphones to control my system volume. Additionally, OSX was able to use the onboard mic as an additional input source.
The aforementioned feature has become my default way to control my system volume, and it's extremely hard for me to live without it. Coincidentally, I've been wanting to write some drivers for the Linux kernel, but wasn't quite sure what. I'd like to write drivers to implement volume control via the output jack, I just don't know where to start.
My current understanding of how this all works:
- 4-lead headphones uses 4th lead to short a certain range of ~2V to ~0V.
- Grab raw information from headphone jack (inside soundcard driver?) and convert data into an event
- Listen and respond to the newly created event and control media volume, just like media keys currently do.
I understand that this is potentially a huge protect, but I'm dedicated to get this working. I just need a bit information and I'm unclear as to where I can find it.