User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 569
Joined: Sat Nov 02, 2013 2:06 pm

Bluetooth Audio Playback Pi2

Fri Nov 18, 2016 12:13 pm

Hi;

I am trying (unsuccessfully) to get audio playback via bluetooth.
I have a Jam Touch Bluetooth Speaker and a set of Logitech H800 Bluetooth Headphones / Mic.

I am using a Cambridge Silicon Ltd USB Bluetooth Dongle.

After trying various incantations I am now able to pair both of the above devices (and keep them paired) however when playing back a .mp4 video clip with audio or just an .mp3 both using VLC media player I can get no sound apart from the odd unrecognisable short millisecond burst as if the playback cannot get through the bandwidth?

With my current setup first I installed pi-bluetooth:

Code: Select all

sudo apt-get install pi-bluetooth blueman
With this installed the bluetooth devices were seen but would not stay connected and once disconnected they had to be removed to be reconnected and so on and so on!!!
After searching for an answer to the issue I found this and entered the following commands:

Code: Select all

sudo apt-get install pulseaudio-module-bluetooth

Code: Select all

pactl load-module module-bluetooth-discover
The second command failed to initialise but after pulse audio was installed the devices managed to stay connected.
Still no sound so I then installed pulse audio again using the following command:

Code: Select all

sudo apt-get install pulseaudio pauvcontrol pulseaudio-module-bluetooth


As this is an older Pi and Dongle do I need an alternative Bluetooth Manager (I am unsure of the differences between pi-bluetooth and bluez or are they all the [email protected][email protected]?)

Any help would be appreciated
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 569
Joined: Sat Nov 02, 2013 2:06 pm

Re: Bluetooth Audio Playback Pi2

Fri Nov 18, 2016 12:40 pm

OK so I uninstalled everything and installed bluez:

Code: Select all

sudo apt-get install bluetooth bluez blueman
This results in the first error that I had where the device is seen / paired but disconnects and is no longer recognised.
So I installed pulseaudio using:

Code: Select all

sudo apt-get install pulseaudio pauvcontrol pulseaudio-module-bluetooth
Rebooted and although the device stays connected and is see in the pulse audio volume control, I still get no sound. My system sound is also gone awol!!!
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 569
Joined: Sat Nov 02, 2013 2:06 pm

Re: Bluetooth Audio Playback Pi2

Fri Nov 18, 2016 2:27 pm

OK so I now have my system audio back.
When playing sound files in terminal using omxplayer hdmi I get sound, local I get sound but alsa I get nothing.

I can now get some NOISE out of my Jam Touch but it only seems to play intermittent pieces of sound (short bursts)??

Any ideas?

Trying to get this working for a school display using Bluetooth headphones.

Thanks
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

User avatar
Douglas6
Posts: 4779
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Audio Playback Pi2

Fri Nov 18, 2016 2:46 pm

Do the headphones support A2DP (most do, I think)? Do you have PulseAudio installed?
Try bluetoothctl. In a terminal, enter

Code: Select all

bluetoothctl
If the headphones are paired, they will be listed with a bdaddr. Try 'info <bdaddr>', replacing <bdaddr> with the 'phones bdaddr. What do you get? You can exit bluetoothctl with 'exit'.

User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 569
Joined: Sat Nov 02, 2013 2:06 pm

Re: Bluetooth Audio Playback Pi2

Fri Nov 18, 2016 3:29 pm

Douglas6 wrote:Do the headphones support A2DP (most do, I think)? Do you have PulseAudio installed?
Try bluetoothctl. In a terminal, enter

Code: Select all

bluetoothctl
If the headphones are paired, they will be listed with a bdaddr. Try 'info <bdaddr>', replacing <bdaddr> with the 'phones bdaddr. What do you get? You can exit bluetoothctl with 'exit'.
PulseAudio is installed - without it for some reason the bluetooth devices would keep disconnecting and stop being recognised.

bluetoothctl list:
Controller
Logitech Headset
Jam Touch (Speaker)

The speaker is now powered off downstairs but is still listed? The headphones are also shown in the bluetooth manager as connected and the menubar icon is green but I know they are not connected because the LED is flashing on the headset (goes solid when connected).

info <bdaddr> lists the device and a whole load more info Paired: Yes Blocked: no etc.

Oh an now the headset (when paired) is NOT listed in PulseAudio Volume Control Panel
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

User avatar
Douglas6
Posts: 4779
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Audio Playback Pi2

Fri Nov 18, 2016 3:43 pm

Bluetoothctl will list all paired devices, whether detected or not. The info command should list available services, do you see A2DP in the list? What happens if you try to connect to the headphones in bluetoothctl ('connect <bdaddr>')?
You should probably uninstall blueman, if installed, as it could be conflicting.

User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 569
Joined: Sat Nov 02, 2013 2:06 pm

Re: Bluetooth Audio Playback Pi2

Fri Nov 18, 2016 4:38 pm

Douglas6 wrote:Bluetoothctl will list all paired devices, whether detected or not. The info command should list available services, do you see A2DP in the list? What happens if you try to connect to the headphones in bluetoothctl ('connect <bdaddr>')?
You should probably uninstall blueman, if installed, as it could be conflicting.
Connecting in bluetoothctl works OK just no sound through bluetooth. When playing the file in VLC Bluetooth Headset is available as an Audio Option.
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

youness
Posts: 34
Joined: Sat Sep 03, 2016 4:51 pm
Contact: Website

Re: Bluetooth Audio Playback Pi2

Fri Dec 16, 2016 10:52 am

If you are trying to play audio with ALSA command (aplay), it is normal that you get nothing.
Because Bluetooth headsets are now supported by PulseAudio.
Try to play audio files using the command : paplay

User avatar
Douglas6
Posts: 4779
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Audio Playback Pi2

Fri Dec 16, 2016 11:51 am

youness wrote:If you are trying to play audio with ALSA command (aplay), it is normal that you get nothing.
No. You can play over Bluetooth speakers with aplay.

Return to “Troubleshooting”