Jack Output over Bluetooth?

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Jack Output over Bluetooth?

Post by bluebell »

Hi all, I got a new notebook yesterday from linux-onlineshop.de: 16 GB RAM, 500 GB SSD, digital audio (via HDMI, not yet tried), Core i5 CPU and ... Bluetooth.

I installed it today and I wonder if I could route Jack's output via Bluetooth to my Bluetooth adapter that's connected to my HiFi-amplifier.

I saw that Pulseaudio has some Bluetooth support. Pulse can output to Jack, but AFAIK Jack can't output to Pulse.

Any ideas?

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

AndreeeCZ
Established Member
Posts: 29
Joined: Tue Jun 26, 2012 10:01 am

Re: Jack Output over Bluetooth?

Post by AndreeeCZ »

Is bluetooth even fast enough for this?
User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: Jack Output over Bluetooth?

Post by bluebell »

AndreeeCZ wrote:Is bluetooth even fast enough for this?
I am afraid, no. I was halfway there.

1.) Bought Philips bluetooth adapter and connected it to my HiFi amp
2.) Paired the device using Blueman applet in xfce4
3.) Used the following .asoundrc

pcm.btphilips {
type plug
slave {
pcm {
type bluetooth
device "00:1D:DF:E4:59:B6"
profile "auto"
}
}
hint {
show on
description "Philips Bluetooth Adapter"
}
}

4.) Played a song with Clementine, ALSA-output to device btphilips. Sounded ok, but not perfect. There was no distortion but the high frequencies were a bit damped. Maybe that can be tuned in the A2DP protocol or equalized.

5.) Started alsa_out. It keept crashing until I used the same buffersize like my jackd (-p 256)
6.) Now the shit begins. I can connect alsa_out in Qjackctl to Qtractor or Clementine with jack output, but the sound was totally distorted.

Bad luck.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: Jack Output over Bluetooth?

Post by bluebell »

I found another tool, zita-j2a. But unfortunately this tool doesn't work with my bluetooth device:

hm@wolke:~$ zita-j2a -v -p 128 -c 2 -d btphilips
Alsa_pcmi: detected more than 1024 playback channnels, reset to 2.
Alsa_pcmi: can't set playback period size to 128.
Can't open ALSA playback device 'btphilips'.

Now I'm stuck.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

bazsound
Established Member
Posts: 480
Joined: Sat Aug 03, 2013 11:46 am

Re: Jack Output over Bluetooth?

Post by bazsound »

I'm not sure there enough bandwidth for high quality audio. isn't it only 1mbps connection.

I used to have a Bluetooth headset for my phone and the sound quality was awfully. all midrange no highs.

unless It's improved since tgen
User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: Jack Output over Bluetooth?

Post by bluebell »

bazsound wrote:I'm not sure there enough bandwidth for high quality audio. isn't it only 1mbps connection.

I used to have a Bluetooth headset for my phone and the sound quality was awfully. all midrange no highs.

unless It's improved since tgen
Sound quality is good enough to do some arrangements and record midi tracks. The Philips Bluetooth adapter has no audible distortion. The very high frequencies are a bit weak. With an ALSA-client it sounds ok. I wouldn't do the final mix with it, though.

My next approach is using the Bluetooth device as the sole device für jackd. So I subscribed to the jack-dev mailing list and hope to find a working solution with their help.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

guikubivan
Established Member
Posts: 3
Joined: Sat Aug 15, 2015 5:01 am

Re: Jack Output over Bluetooth?

Post by guikubivan »

This is working great for me thanks to the info posted. I was getting a lot of clipping distortion so I set my period size to -p 6144 for the heck of it and now the sound is coming clean from my hometheater bluetooth. Note my purpose was just to play around with playing music in audacious with funky effects by Calf plugins, and oh it served its purpose!

I didn't know about alsa_out, that is really cool.
guikubivan
Established Member
Posts: 3
Joined: Sat Aug 15, 2015 5:01 am

Re: Jack Output over Bluetooth?

Post by guikubivan »

This works great for me to play some music over my home theater with some funky effects by Calf. I was getting distortion from low periods, but this command worked wonderfully:

Code: Select all

alsa_out -d btonkyo -p 6144
guikubivan
Established Member
Posts: 3
Joined: Sat Aug 15, 2015 5:01 am

Re: Jack Output over Bluetooth?

Post by guikubivan »

This works great for me to play some music over my home theater with some funky effects by Calf. I was getting distortion from low periods, but this command worked wonderfully:

Code: Select all

alsa_out -d btonkyo -p 6144
alignwaivers
Established Member
Posts: 5
Joined: Thu Sep 26, 2019 11:38 pm

Re: Jack Output over Bluetooth?

Post by alignwaivers »

Quite new post relative to others and my solution applies much more generally to any already-connected-to-pulseaudio bluetooth device

Finally figured out how to make it work (since the pulseaudio-jack bridge never seemed to output to the bluetooth headset even when other pulseaudio stuff was working fine over BT)

Make sure your bluetooth is functioning with pulseaudio (for some reason each time I startup my computer I have to do pactl load-module module-bluetooth-discover and after that it lets me connect to bluetooth))

then use:
alsa_out -d pulse
and route the jack audio ports to the newly created alsa out ports via your favorite jack-connections manager (mine is catia for simplicity). Voila!

Not sure why the pulseaudio bridge doesn't work directly but with alsa_out it's fine! Slight delay of course over bluetooth

UPDATE: When I tried again after sleeping the computer, I was getting errors with alsa_out but it worked after I restarted pulseaudio

Can anyone duplicate this?
UncleOilybag
Established Member
Posts: 5
Joined: Mon Dec 26, 2016 8:37 pm
Has thanked: 1 time

Re: Jack Output over Bluetooth?

Post by UncleOilybag »

I had hoped your solution would help me with my problem but unfortunately I can't get it to work.
I have successfully got my bluetooth working with jack sink ( using Cadence ) with one exception - I cannot get any of my MIDI programs (Rosegarden, Frescobaldi) to work via bluetooth.
This sounds similar to your problems :-
Finally figured out how to make it work (since the pulseaudio-jack bridge never seemed to output to the bluetooth headset even when other pulseaudio stuff was working fine over BT)
but when I put in alsa_out -d pulse I just get error messages:
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
WARNING: period size does not match: (requested 1024, got 682)
Segmentation fault (core dumped)
Any suggestions?
nwmahoney
Posts: 1
Joined: Mon Oct 04, 2021 9:55 pm

Re: Jack Output over Bluetooth?

Post by nwmahoney »

I am in the same situation as UncleOilybag:
$ alsa_out -d pulse
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
WARNING: period size does not match: (requested 1024, got 682)
Segmentation fault (core dumped)
I would love to get this working since my only earbuds are wireless :/
Post Reply