Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Any way on Linux to support OMTP or CTIA headphone remote?
6 points by sandreas on Sept 21, 2023 | hide | past | favorite | 2 comments
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/



To my knowledge, most modern Linux systems use MPRIS over D-Bus to support hardware media controls. You'll want to find some form of software driver or bridge that detects the Apple protocol and translates it to the native Linux one.

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...


Thanks for posting this.Is MPRIS / Playercontrol supporting this? I did not find anything in Archwiki: https://wiki.archlinux.org/title/MPRIS

My idea was a bit more `low level`, e.g. looking at the amplitute of the microphone input to check, if the remote clicks can be distinguished from everything else.

Currently, the clicks are a full peak for a defined period of time, and with this, I could implement a deamon watching for these peaks and then run specific actions via dbus (e.g. Play, Pause, etc.).

If this was implemented in the kernel / OS layer, it would work like on macOS, but I'm not sure, that there would be security considerations and what would be about a turned of microphone. Seems that the mic cannot be turned off on macOS?! :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: