Pi Zero W Bluetooth working But!

Hi Guy’s.
I have built a tiny music player & internet radio for my caravan.
Hardware is
Raspberry Pi Zero W
Hifi Berry Dac Zero
Guittarreria.com case
128Gb USB pen holding my complete music Lib (converted to MP3)

Software is volumio-2.118-2017-03-07-pi

It all works well connected from the DAC to the Aux In on the Caravan Radio.
I also have a Studio Series Bluetooth speaker and I’d like to stream to it.

Using phweyland’s excellent instructions @ volumio-bluez-alsa-a2dp-bluetooth-support-t6130.html I have got Bluetooth working.
It took me a few goes so here are my notes on the steps I took

The Pi was connected by USB to my Mac
Everything was then done in Terminal
ssh volumio@volumio.local
password volumio

Generate locale

sudo nano /etc/locale.gen
Uncomment this line -

en_en_GB.UTF-8 UTF-8 - by deleting the

Comment this line - en_US.UTF-8 UTF-8 by adding # to make it

en_US.UTF-8 UTF-8

Ctrl+X, Y and Enter to save

generate the locales
sudo locale-gen

I don’t know if generating locales is necessary, but it stopped the persistant
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
I was getting.

Re Booted the Pi Zero

I tnen followed phweyland’s post
I could only get it to work by doing each install, make & bulid etc. as a seperate step
sudo apt-get install bluez
sudo apt-get install pi-bluetooth
sudo apt-get install bluez-tools
sudo apt-get install libbluetooth-dev

I was confuded by this

Update file /etc/bluetooth/main.conf
Class = 0x20041C

In the end plumped for doing it this way

Class = 0x20041C

Default adaper name

%h - substituted for hostname

%d - substituted for adapter id

Defaults to ‘BlueZ’

#Name = %h-%d

Default device class. Only the major and minor device class bits are

considered. Defaults to ‘0x000000’.

#Class = 0x000100

How long to stay in discoverable mode before going back to non-discoverable

The value is in seconds. Default is 180, i.e. 3 minutes.

0 = disable timer, i.e. stay discoverable forever

#DiscoverableTimeout = 0

How long to stay in pairable mode before going back to non-discoverable

The value is in seconds. Default is 0.

Should I have updated this line?
#Class = 0x000100
and do I unstatement it?

It all worked a treat and I weas able to pair my iPad to the Pi Zero & stream music through Volumio.

Unfortunately getting the Studio Series Speaker working on Bluetooth is being a pain

The speaker is paired & trusted, but it’s not connected!

$ systemctl | grep blue gives the following output

volumio@volumio:~$ systemctl | grep blue
sys-subsystem-bluetooth-devices-hci0.device loaded active plugged /sys/subsystem/bluetooth/devices/hci0
● bluealsa.service loaded failed failed BluezAlsa proxy
bluetooth.service loaded active running Bluetooth service
bluetooth.target loaded active active Bluetooth

I suspect the problem might be with the speaker, but in truth I don’t even know if this set up is capable of streaming from the Pi to a paired device?

Any suggestions or thoughts would be much appreciated.

Volumio is fantastic.
Many thanks

I’m wonering is my problem a sinks or sources issue?
When streaming audio from the paired & connected iPad, is it the Audio Output & therefore the “sinks” is limked to it’s MAC address?
While the Pi Zero is the Audio Input with it’s MAC address linked to the sources?

I want to make the Pi stream Audio to my StudioSeries Xplorer speaker, so should the sinks be set to the Pi’s Mac address & the Xplorers MAC address set as the sources?

All of this is way beyond my limited knowledge & perhaps everything above should be reversed!

Which ever way, can anyone please help & suggest the Terminal Codes I would need to use to set up the correct protocol?

Once again
Thanks for looking

I think you would be better off contacting the author of the guide you followed. They obviously have spent some time looking into this, and would be best placed to answer your questions.

Sorry for not having looked at it earlier.
The settings i’ve described are about:
Bluetooth device (like ipad) -> Bluetooth controller (on pi) -> bluez 5 -> alsa -> sound device (hifiberry)
The path you want to follow is more like:
Volumio -> alsa -> bluez 5 -> Bluetooth controller (on pi) -> Bluetooth Headset.
On github.com/Arkq/bluez-alsa you will find instruction for that.
As I haven’t Bluetooth Headset I haven’t tried this.

Thanks so much for getting back to me, but I’m sorry to say that I am a complete newbe at this

I was hoping I could get my set up working with a tweek to the /etc/bluetooth/audio.conf file?
Perhaps by re-writing
Enable = source, sink, media, socket
to a different path?

I guess it’s not that simple?

I had looked at github.com/Arkq/bluez-alsa and thought the answer might be there, but I’m too green to be able to follow that installation.

I need something as clear and precise as your post.

If you would be willing to give me that help, it would be very much appreciated.

On a more positive note, attached is a picture of my tiny set up in our little van.

Digging into github.com/Arkq/bluez-alsa I have found the following.

$ export DEBIAN_FRONTEND=noninteractive

$ git clone --depth=50 --branch=master github.com/Arkq/bluez-alsa.git Arkq/bluez-alsa

$ cd Arkq/bluez-alsa

$ git checkout -qf 960a3f908877b8ed71ed548bc0d43682c9b69169

$ export DEBIAN_FRONTEND=noninteractive

$ echo “deb cz.archive.ubuntu.com/ubuntu xenial main” | sudo tee -a /etc/apt/sources.list > /dev/null

$ export DEBIAN_FRONTEND=noninteractive

$ sudo -E apt-get -yq update &>> ~/apt-get-update.log

$ sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install libasound2-dev libbluetooth-dev libbsd-dev libfdk-aac-dev libglib2.0-dev libncurses5-dev libortp-dev libsbc-dev

$ export CC=gcc

$ gcc –version

$ mkdir -p m4

$ autoreconf --install && mkdir build && cd build

$ …/configure && make && make check

$ …/configure --enable-aac && make && make check

I can see that this contains much of the build in phweyland’s instructions @ volumio-bluez-alsa-a2dp-bluetooth-support-t6130.html
I suspect github.com/Arkq/bluez-alsa is a broader Debian build & not specific to volumio?
I just don’t have the knowledge to understand how to follow it through!

Can anyone explain how much, if any of phweyland’s install I can use?
If some is useable, where do I modify it to achieve a working connection to my Bluetooth speaker?

Thanks for looking