JACK won't play through Bluetooth speaker.

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

Moderators: khz, MattKingUSA

bobby.calamari
Establlshed Member
Posts: 5
Joined: Fri Apr 21, 2017 10:52 am

JACK won't play through Bluetooth speaker.

Postby bobby.calamari » Fri Apr 21, 2017 10:59 am

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
Establlshed Member
Posts: 1199
Joined: Thu Apr 17, 2008 9:57 pm

Re: JACK won't play through Bluetooth speaker.

Postby Pablo » Fri Apr 21, 2017 3:05 pm

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
Establlshed Member
Posts: 5
Joined: Fri Apr 21, 2017 10:52 am

Re: JACK won't play through Bluetooth speaker.

Postby bobby.calamari » Sat Apr 22, 2017 12:43 pm

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
Establlshed Member
Posts: 1199
Joined: Thu Apr 17, 2008 9:57 pm

Re: JACK won't play through Bluetooth speaker.

Postby Pablo » Sun Apr 23, 2017 8:18 am

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
Establlshed Member
Posts: 5
Joined: Fri Apr 21, 2017 10:52 am

Re: JACK won't play through Bluetooth speaker.

Postby bobby.calamari » Mon Apr 24, 2017 3:15 pm

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
Establlshed Member
Posts: 1199
Joined: Thu Apr 17, 2008 9:57 pm

Re: JACK won't play through Bluetooth speaker.

Postby Pablo » Tue Apr 25, 2017 4:47 pm

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
Establlshed Member
Posts: 5
Joined: Fri Apr 21, 2017 10:52 am

Re: JACK won't play through Bluetooth speaker.

Postby bobby.calamari » Tue Apr 25, 2017 9:28 pm

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.

User avatar
falkTX
Establlshed Member
Posts: 5944
Joined: Sat Jan 09, 2010 3:04 pm

Re: JACK won't play through Bluetooth speaker.

Postby falkTX » Wed Apr 26, 2017 8:08 am

On Ubuntu 14.04, those are part of bluez-alsa.

Code: Select all

$ dpkg -S /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_bluetooth.so
bluez-alsa:amd64: /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_bluetooth.so

bobby.calamari
Establlshed Member
Posts: 5
Joined: Fri Apr 21, 2017 10:52 am

Re: JACK won't play through Bluetooth speaker.

Postby bobby.calamari » Wed Apr 26, 2017 11:40 am

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
Establlshed Member
Posts: 114
Joined: Wed Jan 28, 2009 2:24 am

Re: JACK won't play through Bluetooth speaker.

Postby aicram » Wed Apr 26, 2017 5:59 pm

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


Return to “Linux Distributions & Other Software”

Who is online

Users browsing this forum: No registered users and 6 guests