BT Headphones with JACKAudio

My bluetooth headphones work well with pulseaudio, but I also want them to work with JACK.

From my research, Jack bypasses pa and connects directly to ALSA - it is possible to feed pa into JACK but not the other way round.

So it seems there are two stages to achieving what I want:

  1. Get the BT headphones recognised as an ALSA device
  2. Use alsa_out to make that device recognised as a writable client by JACK

So first, I created a file /.asoundrc with the following contents:

pcm.btheadset {  type plug
  slave {
    pcm {
      type bluetooth
      device 30:23:24:54:8C:CE
      profile "auto"
  hint {
    show on
    description "BT Headset"
ctl.btheadset {
  type bluetooth

aplay -L in the terminal shows that much has worked:

    Discard all samples (playback) or generate zero samples (capture)
    Default ALSA Output (currently PulseAudio Sound Server)
    BT Headset

However, when I try to use alsa_out:

/usr/bin/alsa_out -j "Headphones" -d "btheadset" -q1 2>&1 1> /dev/null

the response is:

Cannot lock down 86605722 byte memory area (Cannot allocate memory)
ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib64/alsa-lib/

Further research suggest that the first line is pretty common and should not prevent alsa_out from working; the second line might have been because pa is using that module exclusively.

So I tried stopping pa using YAST (checked that it had indeed stopped using pavucontrol) and tried alsa_out again … with the same result.

Now I’m stumped.

Can anyone suggest either where to proceed from here, or an alternative solution. I do remember getting this working a couple of years ago, but I can’t remember exactly what I did, and that was with OpenSuse 13.X, so perhaps things have changed.

Any suggestions would be much appreciated.

A quick update …

I continued my research and found that alsa_in and alsa_out are deprecated and have been replaced by “jack_load audioadapter”. However there seems to be scant information on how to use it.

Meanwhile, I have half solved my immediate problem by changing Qsynth/Fluidsynth to output to pa instead of Jack.

So at least I can use my headset while recording/editing MIDI. I have seen references to using QTractor with pa as well, so I suppose I could go down that route.

However I don’t want to mark this as [SOLVED] because these are both work-arounds and do no address the inherent question in the title.

I will keep looking into jack_load audioadapter to see if there is a straightforward tutorial somewhere.