Raspberry Pi Zero W and buildin Bluetooth chip not detected

Hi.

I have Volumio 2.323 on my Raspberry Pi Zero W and after installing bluetooth stack when I type “hciconfig -a” i get nothing.

[code]$ hciconfig -a

[/code]

When i type this same command on Raspbian 8 Lite on this same Raspberry Pi Zero W I get:

$ hciconfig -a hci0: Type: BR/EDR Bus: UART BD Address: B8:27:EB:C1:E1:EF ACL MTU: 1021:8 SCO MTU: 64:1 UP RUNNING RX bytes:1578 acl:0 sco:0 events:54 errors:0 TX bytes:2036 acl:0 sco:0 commands:54 errors:0 Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH SNIFF Link mode: SLAVE ACCEPT Name: 'w' Class: 0x0c0000 Service Classes: Rendering, Capturing Device Class: Miscellaneous, HCI Version: 4.1 (0x7) Revision: 0x145 LMP Version: 4.1 (0x7) Subversion: 0x2209 Manufacturer: Broadcom Corporation (15)

What I have to do to enable builtin Bluetooth Chip?

I want to set AD2P on my Raspberry Pi Zero W with:
https://github.com/BaReinhard/Super-Simple-Raspberry-Pi-Audio-Receiver-Install

I have this already set up on my Raspberry Pi 2 with HiFiBerry Amp and it works great (with BT USB dongle and USB WiFi).
On my Raspberry Pi Zero W sound will be send to HiFiBerry Miniamp. It works already, but Bluetooth is not detected.

I want to send audio from my Android phone to Raspberry Pi Zero W with Volumio2 system over Bluetooth.

Unfortunately this (streaming audio from mobile to Volumio) is not directly supported by Volumio.

Yes, I know that.

I think that i must install “pi-bluetooth” package from the base Raspbian system.

First thing is to enable SSH server by typing to my browser “volumio.local/dev” and activating it.

Now i must login to my Volumio Box:

$ ssh volumio@volumio.local

Check if my root filesystem has enough free space:

$ du -hs Filesystem Size Used Avail Use% Mounted on /dev/mmcblk0p2 2.2G 592M 1.5G 29% /imgpart /dev/loop0 260M 260M 0 100% /static overlay 13G 525M 12G 5% / devtmpfs 230M 0 230M 0% /dev tmpfs 241M 0 241M 0% /dev/shm tmpfs 241M 4.6M 237M 2% /run tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 241M 0 241M 0% /sys/fs/cgroup tmpfs 241M 28K 241M 1% /tmp tmpfs 241M 0 241M 0% /var/spool/cups tmpfs 20M 80K 20M 1% /var/log tmpfs 241M 0 241M 0% /var/spool/cups/tmp /dev/mmcblk0p1 61M 35M 26M 58% /boot tmpfs 49M 0 49M 0% /run/user/1000

Then I type the following:

$ sudo apt-get update
$ sudo apt-get install mc build-essential git intltool pi-bluetooth
$ sudo apt-get install alsa-utils bluez bluez-tools pulseaudio-module-bluetooth python-gobject python-gobject-2
$ sudo usermod -a -G lp volumio
$ git clone https://github.com/BaReinhard/Super-Simple-Raspberry-Pi-Audio-Receiver-Install.git
$ cd Super-Simple-Raspberry-Pi-Audio-Receiver-Install
$ sudo ./install.sh

Then i choose option: 4 (Volumio installation).
Use the same name for all devices and choose a name by which my Pi Zero W will be seen by Bluetooth protocol.

When my Pi Zero W is rebooted I can now check (after login via SSH) if buildin Bluetooth chip is enabled:

$ hciconfig -a hci0: Type: BR/EDR Bus: UART BD Address: B8:27:EB:C1:E1:EF ACL MTU: 1021:8 SCO MTU: 64:1 UP RUNNING PSCAN ISCAN RX bytes:745 acl:0 sco:0 events:46 errors:0 TX bytes:1551 acl:0 sco:0 commands:46 errors:0 Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH SNIFF Link mode: SLAVE ACCEPT Name: 'w' Class: 0x0c0414 Service Classes: Rendering, Capturing Device Class: Audio/Video, Loudspeaker HCI Version: 4.1 (0x7) Revision: 0x145 LMP Version: 4.1 (0x7) Subversion: 0x2209 Manufacturer: Broadcom Corporation (15)

If you see something like this then it is enabled.

I must now change some config files.

First I want to find my HiFiBerry Miniamp under Pulseaudio:

$ pulseaudio --start
$ pacmd list-sinks | grep -e 'name:' -e 'index'

It should be the last one.

$ sudo nano /etc/pulse/default.pa

Paste it to the second last line of this file instead of output.
In my case this line will look like this:
set-default-sink alsa_output.platform-soc_sound.analog-stereo

$ sudo nano /etc/pulse/daemon.conf

Change:
resample-method = ffmpeg
to:
resample-method = trivial

And uncomment:
load-default-script-file = yes
default-script-file = /etc/pulse/default.pa

$ sudo nano /etc/bluetooth/audio.conf

[General]:
Enable=Source,Sink,Media,Socket

Now I can reboot my Pi Zero W.

$ sudo reboot

Now I should be able to find my Raspberry Pi Zero W via Bluetooth in my Android phone, connect to it with PIN 0000 and play music to it.

I tested it and it works great. :slight_smile:

Well, not everything is ok.

I got interruptions in the sound I send to my RPi Zero W. I am sure it’s not because of my phone.

I’m sure it has to do something with WiFi and BT working at the same time.

Help please?

I have a work around. I found a small script below and it is loaded from /etc/rc.local in the background.

If I connect from my phone via BT then WiFi is temporarily disabled. If I disconnect my phone from it, then WiFi is enabled again.

You must install inotify-tools package.

Now the sound is super stable with no chopping.

Wow that’s great, is it work with Allo mini boss on RPI zero w? I think super simple RPI audio receiver not supporting allo mini boss.

Super simple rpi doesn’t outright support mini boss, but it can be easily configured. If you can document what is needed for configuring the mini boss I will happily add support for it.

Update:

Wanted to add that I have issued a fix for Volumio users as there were issues with the current install for bluetooth. You can find the new changes in the README and how to benefit from them.

Wanted to provide an update on bluetooth support for Volumio, it is unofficial as well as not completely integrated with Volumio, meaning that you may need to configure what pulseaudio input sink goes to what output sink. If you have any issues with that feel free to open an issue on my github repo:
github.com/bareinhard/super-sim … er-install

Install Process

[code]# enable ssh through volumio.local/dev

ssh to volumio

git clone https://github.com/bareinhard/super-simple-raspberry-pi-audio-receiver-install
cd super-simple-raspberry-pi-audio-receiver-install
git checkout volumio-fix
sudo ./install.sh

Choose Bluetooth Option, #4

Wait for it to complete, and enjoy[/code]