Bluetooth speakers

I’m trying to get the output from my Zynthian to a bluetooth speaker. It’s a UE Boom 2 since you ask. I’m not getting too far. My PI is a 3 so there’s onboard bluetooth. I’ve installed all the extras I think should be needed. That is pi-bluetooth, bluez, bluez-firmware and I’ve even installed blueman and pulseaudio although I’m not convinced I actually need either of those. I can run bluetoothctl and I can power on set the default agent and find and pair my speakers. But I can’t connect them. It just says Failed to connect: org.bluez.error.Failed. I haven’t found any log that gives me any more information. Anybody got any clues? Am I barking up the wrong tree? Before I get into actual code to try to work out what is going on I thought I’d ask if anybody could help?

BTW. It’s a laser cut wooden box so I don’t think I’ve got comms issues.

To debug audio problems, I access the Linux command line via ssh and use some command-line utilities to test and configure.
The Linux audio system is called ALSA. You can install alsa-utils to get some command line tools for testing/configuring audio. Unfortunately, ALSA and Linux audio configuration is complex and hard to figure out.

Install those utilities by giving the command: sudo apt-get install alsa-utils

Here’s some documentation on ALSA http://www.linuxfromscratch.org/blfs/view/cvs/multimedia/alsa-utils.html

One command I use is speaker-test. This will cause your audio device to make tones, if everything is properly configured.

I finally got the speakers to connect. It was a matter of installing pulseaudio-module-bluetooth and making sure that pulseaudio was started before trying to connect. And now speaker-test produces the pink noise it’s supposed to. However the zynthian test sounds (Test Audio or Test MIDI) don’t produce anything. So what else needs to change to get the Zynthian output to the bluetooth speaker?

Hi @oily_wagg!

A “Bluetooth speaker” is an audio device in its own. In order to get this device working with Zynthian you need to configure it with Jack Audio. See the “audio config” tab in the webconf tool.

Pulseaudio is a multimedia “desktop” audio system and it’s better you don’t enable this with Zynthian, as it can cause problems. I recommend you to uninstall/disable any pulseaudio package you have installed, or start with a fresh image.

Anyway, when you configure the bluetooth device and get it working with Zynthian, i suspect that latency will be too big for playing/sequencing in real-time. A wireless device like this normally need a big buffer to avoid “cuts”. Any case, i’m very interested in knowing the result of your tests, so keep sending feedback, please :wink:

Kind Regards,

Hiya
I’m going to keep going since what I’m aiming at is something involving zythian that is lightweight and very portable. A bluetooth speaker would be the output part.

I’ve immediately got a problem with your advice. You talk about the webconf tool and according to the documentation that should just be running and I can connect to it with a browser. Sadly it doesn’t appear to be there. It’s not surprising that zynthian doesn’t run a web server by default but I’m assuming it needs starting up? The documentation doesn’t say that it does. I’ve found scripts that look like they should help and I’m working with them. I should be able to sort it but the documentation seems a bit misleading.

Also you mention Jack Audio. Is this what Zynthian is already using to control i//o or is it a package I need to add? I can find it, I’m just not sure what you intend.

But more importantly, thanks! I hope I can contribute more than ask questions in the future.

Hi @oily_wagg!

Connecting with a cable wont do it less portable and it will be a lot more simple to configure, more reliable and the sound quality will be better. Of course, the latency should be better too …

Regarding the webconf tool, if you are using the latest SD image:

Updated Gorgona SD image for the new Kits v2

it should work out-the box. Check the Wiki for detailed instructions:

Accessing Zynthian from your computer - ZynthianWiki

You don’t need to enable nothing. The web server is running all the time :wink:
Same for Jack Audio. It’s working from boot time as it’s the core audio system of Zynthian.

Kind Regards!

True. @jofemodo.

In my very first tests I used a BT speaker “just for fun”. Latency was a little less than 1 second, more than enough to make it unplayable :slight_smile:

Fair enough. You’ve convinced me. But what sort of speaker is your alternative. Something that is portable.

the question is rather, what quality you need. Only for your ears? with audience?
Anybody tried to add a tweeter with a switch at the second output of the hifiberry?

I still use that very same portable bluetooth speaker, but using the stereo audio cable from HiFiBerry. I have 3 different speakers at home, and every one of them have the 3.5mm jack AUX analog input.

OK. I think I understand. Obviously there is a limit to the quality that will be achievable if it’s going to be really portable. I think I had sort of discounted using 3.5 travel speakers because I’ve never used them and haven’t seen any that don’t seem a bit cheap and nasty. I’ve been really happy with my bluetooth speaker on the other hand so I thought that would be the way to go. That’s obviously wrong though. I do have a 3.5 input socket on my bluetooth speaker but that doesn’t seem to work too well. I can get sound out of the speaker but it breaks up. I guess it’s doing more than just a bit of amplification to the signal.

From what I can see 3.5 travel speakers are all pretty much the same. Does anybody have any recommendations of specific ones?