Skip to content

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 21 Apr 01:01
· 29 commits to main since this release

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 0e8d by default) and skips it.
  • Fixes the default PulseAudio source from bluez_output.*.monitor back to bluez_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-service

install-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, and dbus-monitor; zero system library build dependencies for cargo install bthman consumers.
  • Docker-based integration tests for all three supported init systems.

Full Changelog: https://github.com/mwolson/bthman/commits/v0.1.0