Audio does not come out of Bluetooth earbuds on Linux

I am using SuperCollider 3.10.0 on a laptop with Linux Mint 20.3 Cinnamon and the software is working correctly through the laptop speakers and wired earphones. However, I cannot make SC send audio to my Bluetooth earbuds. If I use sclang, audio comes out of the laptop speakers anyway (even though any other audio comes out of the earbuds) and if I use scide, audio is muted anyway.

This is the output of jack_lsp -c after I s.boot; on SC:

$ jack_lsp -c
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
system:capture_1
   SuperCollider:in_1
system:capture_2
   SuperCollider:in_2
system:playback_1
   SuperCollider:out_1
system:playback_2
   SuperCollider:out_2
SuperCollider:in_1
   system:capture_1
SuperCollider:in_2
   system:capture_2
SuperCollider:out_1
   system:playback_1
SuperCollider:out_2
   system:playback_2

I’m part of the audio group:

$ groups
juanlu adm cdrom sudo audio dip plugdev lpadmin netdev sambashare vboxusers docker

According to this SO answer from 2014 I have to use system:playback_3 and 4, but

$ jack_connect SuperCollider:out_1 system:playback_3
ERROR system:playback_3 not a valid port

I see references to Catia, Cadence, patchage, and kxstudio as “JACK Patchbays” but I cannot find .deb packages for any of them. The only one that seems to work is qjackctl but the interface is quite arcane and I don’t even know where to start.

I’m sure it’s some sort of JACK configuration problem but I don’t know how to continue troubleshooting this.

Hope I’m at the right place, otherwise feel free to redirect me.

Ubuntu handles Bluetooth audio through PulseAudio.

The usual PA-JACK integration setup places PulseAudio as a JACK client – JACK is downstream.

SuperCollider audio goes into JACK. So SC’s audio enters the system downstream of PA (which handles the Bluetooth device).

Thus SC audio is not available to the normal Bluetooth audio channel.

A couple years ago, I tried to set up a Bluetooth ALSA layer, which could receive SC signals. It never quite worked. It required a ridiculously large hardware buffer size in JACK (8192 as I recall), and… JACK is extremely sensitive to timing and it very much does not like a virtual device such as Bluetooth which depends on time-unbounded wireless communication. I could run the server for about 15 minutes before it would hang, requiring a complete machine reboot.

That’s a long way of saying you may need to give up this idea.

There’s talk of implementing a PipeWire back-end for scsynth, but this isn’t done. It might improve the situation in the future (I don’t know).

hjh

2 Likes

Thanks a lot for the quick and super detailed answer!

Well I have some exciting news to share: I fixed the issue by

  1. Installing Pipewire with the instructions from here
  2. Launching pw-jack sclang as advised in the Pipewire README

And it magically worked! I admit I had zero expectations but I’m thrilled that audio on Linux is starting to look cool.

2 Likes

Huh. I’m gonna have to try that – I didn’t know there was a Pipewire – JACK bridge.

(Though it might be a couple weeks before I could put much time into that.)

hjh