Hi everyone!
I have a steren bluetooth high definition audio monitor and I want to connect SuperCollider to it but my Linux system dont allow it to me due tath Qjack dont seems to support bluetooth audio, or so I feel.
Is there a way to connect Qjack to bluetooth audio in Fedora or Mint?
oxxo.
A bit long, but it may be helpful to understand why your Bluetooth headset isn’t available in JACK.
Linux pro audio, the old way:
PulseAudio (browsers, media players etc.) JACK (pro audio apps) Backend (ALSA, FFADO for FireWire which has mostly fallen out of use, etc.)
… with some familiar problems: Pulse and JACK don’t work together out of the box, which confuses users; limited ability to interconnect Pulse apps with JACK ones; and, in that configuration, I could never get audio device hot-swapping to work.
In Linux, PulseAudio provides Bluetooth audio support. That is: without BT (and assuming you’ve configured Pulse ↔ JACK connectivity), when you play a YouTube cat video, Pulse sends the audio to a virtual device called “JACK sink,” and JACK forwards that to the hardware. But, when you use a Bluetooth headset, Pulse sends the audio directly to the Bluetooth device, bypassing JACK entirely. That’s why it seems like “well, Bluetooth audio shouldn’t be a problem” but it is a problem for JACK apps.
As I understand it, to achieve ideal low latency performance, JACK has very strict requirements on audio device timing. Bluetooth cannot meet those requirements, so, even if you can make your Bluetooth headset available to ALSA, 1/ you’ll need a ridiculously large buffer size, like, 8192 samples and 2 periods (almost 400 ms latency) and 2/ if the BT transmission encounters the tiniest hiccup, JACK goes down → reboot the machine.
If you really want to try, there’s a package “bluez-alsa” that can connect Bluetooth audio directly into ALSA, where JACK can use it as a backend. It was hard to configure and not at all stable, in my experience. So I don’t recommend it.
PipeWire: The new way
Pipewire pretends to be both PulseAudio and JACK (and ALSA etc.) all at the same time.
When you play the cat video, the browser asks for a PulseAudio output port, and Pipewire provides it. When you boot the SC server, it requests JACK input and output ports, and Pipewire provides them – you’re not running a JACK server – Pipewire is always running, and it acts like JACK. When you connect your BT headset, Pipewire manages that connection and they are all interchangeable.
You can use the app “qpwgraph” to see the devices and connections, similar to qjackctl. Device selection is through the PulseAudio Volume Control widget.
I didn’t test Bluetooth with SC extensively, but I did connect my earpieces, connect SC server to them, and played a glitch-free sinewave: it Just Worked, which is very different from the quite awful bluez-alsa experience before. So, if Bluetooth audio is an important use case for you, Pipewire offers a big improvement.
EDIT: For fun, I tried it again with Bluetooth speakers in my living room:
JackDriver: connected SuperCollider:out_1 to [Samsung]W_Audio 48563C:playback_FL
JackDriver: connected SuperCollider:out_2 to [Samsung]W_Audio 48563C:playback_FR
Doing some more complex synthesis this time, and I’ll leave it running for a few more minutes. So far it’s solid. … and, 30 minutes later, still stable.
(Caveat, there are Pipewire bugs about laptop cameras which is kinda par for the course with relatively new Linux technologies. Also, I hear recording professionals say that Pipewire’s latency is a bit higher than JACK’s. So far, PW has been good enough for my needs, but it might not be up to recording studio usage yet.)
OK!
Now I understads, just I remember taht last month I used AV Linux and I configured Bluez-alsa in it and the Bluetooth works fine, there the sound was not a problem for SC but the screen in SC show spots and dont allow to see the code well. Thaks for the Pipe Wire info.
Your device needs to be supported by ALSA (or Fado for old Firewire soundcards). You may have better luck trying pipewire. I use Bluetooth devices on Fedora that are just plug-and-play using pipewire.