Andrey a0cdbb2842 linux-rust(feat): add stem press track control and headless mode support (#469)
* feat: add stem press track control and headless mode support

- Parse STEM_PRESS packets and emit AACPEvent::StemPress with press type and bud side
- Enable double/triple tap detection on init via StemConfig control command (0x06)
- Double press → next track, triple press → previous track via MPRIS D-Bus
- Add next_track() and previous_track() to MediaController
- Add --no-tray flag for headless operation without a GUI
- Replace unwrap() on ui_tx.send() calls with graceful warn! logging

(vibecoded)

* Update main.rs

* feat: make stem press track control optional with GUI toggle

Add a --no-stem-control CLI flag and a toggle in the Settings tab for
environments that handle AirPods AVRCP commands natively (e.g. via
BlueZ/PipeWire). The feature remains enabled by default.

- Load stem_control from app settings JSON on startup; --no-stem-control
  overrides it to false regardless of the saved value
- Share an Arc<AtomicBool> between the async backend and the GUI thread;
  AirPodsDevice holds the Arc directly so the event loop reads the live
  value on every stem press — toggle takes effect immediately without
  reconnecting
- Persist stem_control to settings JSON alongside theme and tray_text_mode
- Add a "Controls" section to the Settings tab with a toggler labelled
  "Stem press track control", with a subtitle explaining the AVRCP
  conflict scenario
- Fix StemConfig bitmask comment to clarify it uses a separate numbering
  scheme from the StemPressType event enum values (0x05–0x08)
2026-03-31 09:32:20 +05:30
2025-11-10 10:08:44 +05:30
2025-03-18 07:10:09 +05:30
2025-06-04 11:34:04 +00:00
2025-11-10 10:08:44 +05:30
2025-05-03 21:44:45 +05:30
2025-01-28 11:19:55 +05:30
2025-06-03 20:35:29 +05:30
2025-05-03 21:44:45 +05:30
2025-04-22 08:23:31 +05:30
2024-12-30 20:40:40 +05:30
2025-10-27 15:19:10 +05:30
2025-05-03 21:44:45 +05:30

LibrePods Banner

XDA Thread GitHub release (latest by date) GitHub all releases GitHub stars GitHub issues GitHub license GitHub contributors

What is LibrePods?

LibrePods unlocks Apple's exclusive AirPods features on non-Apple devices. Get access to noise control modes, adaptive transparency, ear detection, hearing aid, customized transparency mode, battery status, and more - all the premium features you paid for but Apple locked to their ecosystem.

Device Compatibility

Status Device Features
AirPods Pro (2nd Gen) Fully supported and tested
AirPods Pro (3rd Gen) Fully supported (except heartrate monitoring)
⚠️ Other AirPods models Basic features (battery status, ear detection) should work

Most features should work with any AirPods. Currently, I've only got AirPods Pro 2 to test with.

Key Features

  • Noise Control Modes: Easily switch between noise control modes without having to reach out to your AirPods to long press
  • Ear Detection: Controls your music automatically when you put your AirPods in or take them out, and switch to phone speaker when you take them out
  • Battery Status: Accurate battery levels
  • Head Gestures: Answer calls just by nodding your head
  • Conversational Awareness: Volume automatically lowers when you speak
  • Hearing Aid*
  • Customize Transparency Mode*
  • Multi-device connectivity* (upto 2 devices)
  • Other customizations:
    • Rename your AirPods
    • Customize long-press actions
    • Few accessibility features
    • And more!

See our pinned issue for a complete feature list and roadmap.

Platform Support

Linux

The Linux version runs as a system tray app. Connect your AirPods and enjoy:

  • Battery monitoring
  • Automatic Ear detection
  • Conversational Awareness
  • Switching Noise Control modes
  • Device renaming

Note

Work in progress, but core functionality is stable and usable.

For installation and detailed info, see the Linux README.

Android

Screenshots

Settings 1 Settings 2 Debug Screen
Battery Notification and QS Tile for NC Mode Popup Head Tracking and Gestures
Long Press Configuration Widget Customizations 1
Customizations 2 accessibility transparency
hearing-aid hearing-test hearing-aid-adjustments

here's a very unprofessional demo video

https://github.com/user-attachments/assets/43911243-0576-4093-8c55-89c1db5ea533

Root Requirement

Caution

You must have a rooted device with Xposed to use LibrePods on Android. This is due to a bug in the Android Bluetooth stack. Please upvote the issue by clicking the '+1' icon on the IssueTracker page.

There are no exceptions to the root requirement until Google merges the fix.

Until then, you must xposed. I used to provide a non-xposed method too, where the module used overlayfs to replace the bluetooth library with a locally patched one, but that was broken due to how various devices handled overlayfs and a patched library. With xposed, you can also enable the DID hook enabling a few extra features.

Bluetooth DID (Device Identification) Hook

Turns out, if you change the manufacturerid to that of Apple, you get access to several special features!

Multi-device Connectivity

Upto two devices can be simultaneously connected to AirPods, for audio and control both. Seamless connection switching. The same notification shows up on Apple device when Android takes over the AirPods as if it were an Apple device ("Move to iPhone"). Android also shows a popup when the other device takes over.

Accessibility Settings and Hearing Aid

Accessibility settings like customizing transparency mode (amplification, balance, tone, conversation boost, and ambient noise reduction), and loud sound reduction can be configured.

All hearing aid customizations can be done from Android, including setting the audiogram result. The app doesn't provide a way to take a hearing test because it requires much more precision. It is much better to use an already available audiogram result.

To enable these features, enable App Settings -> act as Apple Device.

A few notes

  • Due to recent AirPods' firmware upgrades, you must enable Off listening mode to switch to Off. This is because in this mode, louds sounds are not reduced.

  • If you have take both AirPods out, the app will automatically switch to the phone speaker. But, Android might keep on trying to connect to the AirPods because the phone is still connected to them, just the A2DP profile is not connected. The app tries to disconnect the A2DP profile as soon as it detects that Android has connected again if they're not in the ear.

  • When renaming your AirPods through the app, you'll need to re-pair them with your phone for the name change to take effect. This is a limitation of how Bluetooth device naming works on Android.

  • If you want the AirPods icon and battery status to show in Android Settings app, install the app as a system app by using the root module.

Star History

Star History Chart

License

LibrePods - AirPods liberated from Apples ecosystem Copyright (C) 2025 LibrePods contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program over here. If not, see https://www.gnu.org/licenses/.

All trademarks, logos, and brand names are the property of their respective owners. Use of them does not imply any affiliation with or endorsement by them. All AirPods images, symbols, and the SF Pro font are the property of Apple Inc.

Languages
Kotlin 79%
C++ 11.8%
Python 6.7%
QML 1.7%
Shell 0.6%
Other 0.2%