JACK won't play through Bluetooth speaker.

What other apps and distros do you use to round out your studio?

Moderators: MattKingUSA, khz

Post Reply
bobby.calamari
Established Member
Posts: 33
Joined: Fri Apr 21, 2017 10:52 am
Has thanked: 3 times
Been thanked: 2 times

JACK won't play through Bluetooth speaker.

Post by bobby.calamari »

I'm using Linux Mint 18.1. I have a Bluetooth speaker and I'm able to play normal audio through it after I've connected the laptop to the speaker via Bluetooth.

But when I run a JACK application, it only plays through the laptop's speakers. It just ignores the Bluetooth connection completely.

Is there some kind of incompatibility between JACK and Bluetooth on Linux? How can I overcome this problem?
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: JACK won't play through Bluetooth speaker.

Post by Pablo »

You have to tell jack to use the alsa driver and the audio interface you want to use. By default, jack will use the alsa driver and the onboard audio interface which feeds the laptop speakers.

When the bluetooth speakers are recognized by the system's sound configuration, type in a terminal the following informative command which will tell you the names and availability of the audio interfaces recognised by alsa:

cat /proc/asound/cards && aplay -l
bobby.calamari
Established Member
Posts: 33
Joined: Fri Apr 21, 2017 10:52 am
Has thanked: 3 times
Been thanked: 2 times

Re: JACK won't play through Bluetooth speaker.

Post by bobby.calamari »

Thanks for you answer, it's appreciated.

Okay, so the output from that command is as follows:

0 [HDMI ]: HDA-Intel - HDA Intel HDMI
HDA Intel HDMI at 0xc3610000 irq 50
1 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0xc3614000 irq 48
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: CX20751/2 Analog [CX20751/2 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0

Note that the output of this command is the same regardless of whether Bluetooth is enabled and connected on the laptop.

Jumping ahead of you slightly, I have chosen every possible output device in qjackctl before starting, to see if that fixed anything. The results are here:

Output device -- [Result]
hw:HDMI HDA Intel HDMI (hw:0) -- [JACK server won't start]
hw:HDMI, 3 HDMI 0 (hw:0,3) -- [No sound]
hw:HDMI, 7 HDMI 1 (hw:0,7) -- [No sound]
hw:HDMI, 8 HDMI 2 (hw:0,8) -- [No sound]
hw:PCH HDA Intel PCH (hw:1) -- [Only plays through laptop speakers]
hw:PCH,0 CX20751/2 Analog (hw:1,0) -- [Only plays through laptop speakers]

Another few notes:
* The list of input devices that qjackctl gives me is slightly different.
* In some cases, I can only start the server if I choose an input device that matches the output device.
* Sometimes, a combination of input and output device that worked previously doesn't work anymore (i.e. the JACK server won't start), and I have to restart the laptop to get it to work again.

Can you make any sense of this?
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: JACK won't play through Bluetooth speaker.

Post by Pablo »

Sometimes, a combination of input and output device that worked previously doesn't work anymore (i.e. the JACK server won't start), and I have to restart the laptop to get it to work again.
.

When something weird happens with jack and friends, do a:

Code: Select all

killall -9 jackd jackdbus qjackctl
instead of restarting the laptop. Anyway, that has not anything to do with the original problem.

The bluetooth speakers are not recognized by alsa so making them work with jack won't be so easy as I naively thought.

I suggest you read the following thread:
viewtopic.php?t=12114
bobby.calamari
Established Member
Posts: 33
Joined: Fri Apr 21, 2017 10:52 am
Has thanked: 3 times
Been thanked: 2 times

Re: JACK won't play through Bluetooth speaker.

Post by bobby.calamari »

Thanks, that helps a lot.

If I can trouble you with one more question, do you think that the specific bluetooth device I'm using is invisible to alsa, or that bluetooth in general (as implemented in Linux) is invisible to alsa? I'm wondering if I might be able to fix the problem simply by using another Bluetooth device.

Thanks!
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: JACK won't play through Bluetooth speaker.

Post by Pablo »

do you think that the specific bluetooth device I'm using is invisible to alsa, or that bluetooth in general (as implemented in Linux) is invisible to alsa?
Not sure about that but I think the latter is true. It seems that pulseaudio takes care of bluetooth audio, but not via alsa drivers. I might be wrong, though.

In addition to the LM thread I linked, there is another one, currently active, that might be of your interest:

viewtopic.php?f=27&t=17008
bobby.calamari
Established Member
Posts: 33
Joined: Fri Apr 21, 2017 10:52 am
Has thanked: 3 times
Been thanked: 2 times

Re: JACK won't play through Bluetooth speaker.

Post by bobby.calamari »

Thanks again.

Okay, for future reference. I *may* have made some progress with this. Or it may just be a red herring.

Based on this link (https://superuser.com/questions/637783/ ... oth-device), I created a .asoundrc file with the following contents:

Code: Select all

pcm.baaa
{
   type plug
   slave
   {
      pcm
      {
         type bluetooth
         device [device MAC address]
         profile "auto"
      }
   }
}

ctl.baaa
{
   type bluetooth
}
I just used the name 'baaa' because I assumed the name wasn't significant.

Anyway, so after doing this, qjackctl didn't magically list my new ALSA device, so I thought I'd just type it into the 'Output Device' field, start the server and see what happened.

First, I typed a random word to see what happened if you gave qjackctl a false device name ('moo'). The server starts, but in Messages you see:

'Unknown PCM mooo'
and
'ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode'

...and JACK makes no sound.

Trying again, and providing the new ALSA device name 'baaa', the server starts and in Messages you *don't* see 'Unknown PCM baaa'. However, you do see:

'ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_ctl_bluetooth.so
control open "baaa" (No such device or address)
ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_bluetooth.so
ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode'

Sure enough, the specified location /usr/lib/x86_64-linux-gnu/alsa-lib/ does not contain either of those files.

So I'm hopeful that the .asoundrc trick is enough to get JACK to see the bluetooth adapter, and the next thing I need to do is figure out where to get those files.
bobby.calamari
Established Member
Posts: 33
Joined: Fri Apr 21, 2017 10:52 am
Has thanked: 3 times
Been thanked: 2 times

Re: JACK won't play through Bluetooth speaker.

Post by bobby.calamari »

Thanks, FalkTX. I found that out yesterday too. So I tried to install bluez-alsa, but APT told me that bluez-alsa isn't available anymore and I should consider bluez to be it's replacement package. (I can't remember the exact wording it used, but it was words to that effect).

Trouble is, I already had the latest version of bluez. So I think those files aren't part of the package anymore - it seems like ALSA support for Bluetooth has been ended?

Anyway, I found the files in one of those RPM site things and pasted them into that location, fiddled with their owner and group etc to match the other files there, but no dice. qjackctl still tells me it can't open the files.

I think this is where I draw the line. I just want to output JACK audio via Bluetooth; this is too much of a rabbit hole for me.
aicram
Established Member
Posts: 135
Joined: Wed Jan 28, 2009 2:24 am
Has thanked: 1 time

Re: JACK won't play through Bluetooth speaker.

Post by aicram »

Hello,

These links below may not provide what you need, however, maybe can help.

https://askubuntu.com/questions/414258/ ... ound-there

http://stackoverflow.com/questions/1233 ... pulseaudio

Hope you get a solution soon.

Sincerely,

aicram
Post Reply