Hey HN,
on macOS systems with audio jack it is possible to use in-ear headsets with a remote to change volume but also use media key codes like play/pause, next, prev, etc. (similar to iPods)
On my MacBook Pro 2015 with Apple Earpods I can control every playback action via this small headphone remote, e.g. Music, Youtube Videos, etc. Headsets from other brands with a remote (e.g. SoundMAGIC E11) are NOT supported.
On Android devices with audio jack (e.g. Google Pixel 4a), Apple Earpods are NOT supported but SoundMAGIC E11 are working.
After doing some research I found out the reason for this:
Basically there are two different standards (CTIA and OMTP), both made for mobile devices. Both use an audio jack with 4 connectors (instead of the normal 3), also called TRRS. Apple uses CTIA standard, Android devices use OMTP standard where the pinouts switched the aux channel.
In Both cases the control buttons on the remote are just shorting the auxiilliary line (mic) with a specific resistance:
Play/Pause <70 Ω
Vol+ 210–290 Ω
Vol− 360–680 Ω
(reserved for voice control) 110–180 Ω
More about this here: https://thecablesland.com/ctia-vs-omtp/
I own a ThinkPad T480, supporting a Headset with microphone via audio jack.
product: HDA Intel PCH Headphone
physical id: 1
logical name: input11
logical name: /dev/input/event9
Now to my question:
Would it be possible to support the same controls like apple does via some kind of driver?
Since the buttons are only shorting the mic channel, this could be possible with a generic driver / hook, but the only commit with the topic CTIA / OMTP in the kernel I found is this:
https://patchwork.kernel.org/project/alsa-devel/patch/1645017892-12522-1-git-send-email-quic_srivasam@quicinc.com/
It's interesting that it's not supported out-of-box, though. My Jabra and Sony headsets both have perfectly fine media control on Linux, even my old Earpods too if memory serves...