Proposal : Audio output device selector +Bluetooth A2DP fix for Linux #2129
MauricioBarrientos
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
On Linux, playback through Bluetooth devices is broken. Nuclear always plays through the system default audio output, so when a Bluetooth headset/speaker is connected, WebKitGTK keeps routing audio to the wrong sink — or drops the audio entirely. The UI shows the track as playing, but no sound comes out.
Proposed solution
I implemented a working fix locally and it has been running well. It consists of two parts:
1. Audio output device selector (Settings -> Audio Output)
audioOutputStorethat enumerates devices vianavigator.mediaDevices.enumerateDevices(), persists the selection, and listens fordevicechangeevents so Bluetooth devices appear/disappear in real timesetSinkId()support wired into the<audio>element (hifi Sound component), gracefully ignored when unsupported2. Bluetooth A2DP stability buffers (Linux)
PULSE_LATENCY_MSECincreased from 60ms to 200msPIPEWIRE_LATENCYincreased from1024/48000to4096/48000These larger buffers give Bluetooth codecs (SBC, AAC, LDAC) enough headroom to avoid underruns and dropouts.
How it was tested
Why I am posting this
The repository auto-closes external pull requests (PR #2128 was closed by the bot). I understand the project prefers plugins for extensions, but an audio output selector is core functionality that cannot be implemented as a plugin.
I would be happy to open a PR with these changes if the maintainers are open to it. The code touches:
packages/player/src/stores/audioOutputStore.ts(new)packages/player/src/views/Settings/AudioOutputSection.tsx(new)packages/hifi/src/Sound.tsx/types.ts(setSinkId support)packages/player/src/components/SoundProvider.tsxpackages/player/src-tauri/src/main.rs(latency buffers)Thanks for considering this!
All reactions