Skip to content

added audio codec selector for bluetooth headphones#2396

Open
temidaradev wants to merge 4 commits intonoctalia-dev:mainfrom
temidaradev:main
Open

added audio codec selector for bluetooth headphones#2396
temidaradev wants to merge 4 commits intonoctalia-dev:mainfrom
temidaradev:main

Conversation

@temidaradev
Copy link
Copy Markdown

Pull Request

Motivation

This PR adds a Bluetooth codec selector to the Bluetooth panel using real, system-reported profiles instead of hardcoded/fake options.

Why this is needed:

  • Users need a quick way to switch codec/profile (AAC/LDAC/etc.) per connected headset.
  • Codec handling in bluetooth menu itself may be better than launching Blueman or using command line.

What this PR does:

  • Adds codec selector UI for connected audio Bluetooth devices.
  • Detects real profiles from PipeWire/Pulse stack (pw-cli/wpctl, fallback to pactl).
  • Applies selected profile through backend commands.
  • Improves switching reliability with pending/single-flight handling to prevent snap-back and double-click behavior.

Type of Change

Mark the relevant option with an "x".

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring

Related Issue

  • Closes #N/A

Testing

Describe how you tested your changes and mark the relevant items.

Manual validation performed:

  • Verified profile discovery for WH-1000XM5 from live PipeWire data.

  • Verified codec profile parsing returns real options (a2dp-sink-sbc, a2dp-sink-aac, a2dp-sink/LDAC description).

  • Verified race-condition fixes (selection stability during async apply/query refresh).

  • Tested on niri

  • Tested on Hyprland

  • Tested on sway

  • Tested with different bar positions and density settings

  • Tested at different interface scaling values

  • Tested with multiple monitors (if applicable)

Screenshots / Videos

Bluetooth panel screenshot(s) attached in discussion showing connected WH-1000XM5 and codec-related UI flow.

image image

Checklist

  • Code follows project style guidelines
  • Self-reviewed my code
  • No new warnings or errors
  • Documentation or comments updated (if relevant)

Additional Notes

  • Backend preference is pactl when available; otherwise wpctl + pw-cli is used.
  • Selector is shown only when real codec/profile options are discovered for the device.

@temidaradev temidaradev marked this pull request as draft April 4, 2026 13:04
@temidaradev temidaradev marked this pull request as ready for review April 10, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant