Repository navigation
v0.1.0
Initial release. bthman is a Bluetooth HFP profile manager for Linux that keeps PipeWire/PulseAudio and headset audio sane across profile switches and suspend/resume cycles. Rust rewrite of the Python bluetooth-headset-manager daemon.
What it does
- Picks the best available HFP profile in priority order: LC3-24kHz, then mSBC. Auto-detects adapters where LC3 is broken (MediaTek
0e8dby default) and skips it. - Fixes the default PulseAudio source from
bluez_output.*.monitorback tobluez_input.*when WirePlumber picks the wrong one. - Raises mic input volume to the configured target (default 100%) when PipeWire spawns the stream too low.
- Snapshots currently connected Bluetooth audio devices before suspend and reconnects them after resume with exponential backoff (
0.0s,0.5s,1.5s,3.5s). - Defers to external recorders by reading
wpctl settings bluetooth.autoswitch-to-headset-profile, so it yields the card when an app wants to drive it.
Install
cargo install bthman
bthman install-serviceinstall-service detects the running init system and writes the right service file:
- systemd user service
- OpenRC 0.60+ user init script
- OpenRC pre-0.60 system init script (root required)
Prebuilt tarballs for x86_64-gnu, x86_64-musl, and aarch64-gnu are attached to this release.
Config
Optional ~/.config/bthman.conf (one flag per line, # comments allowed):
--preferred-profile=headset-head-unit-msbc
--input-volume=85
--broken-vendor=0e8d
SIGHUP reloads the config without restarting the daemon; systemctl --user reload bthman.service also works.
CLI
bthman # run as daemon (default)
bthman --once # reconcile once and exit
bthman install-service # install + enable via detected init system
bthman uninstall-service # disable + remove via detected init system
Implementation notes
- No tokio, no zbus. Shells out to
pactl,wpctl,bluetoothctl, anddbus-monitor; zero system library build dependencies forcargo install bthmanconsumers. - Docker-based integration tests for all three supported init systems.
Full Changelog: https://github.com/mwolson/bthman/commits/v0.1.0