recklessfb
Posts: 37
Joined: Wed Jul 06, 2016 12:26 am

Bluetooth audio on stretch

Sun Nov 26, 2017 12:02 am

Hello,
I started with a clean stretch sd card this weekend. I understand bluetooth audio is supposed to be handled better with Raspbian stretch but I am having issues with it.
My bluetooth speaker is paired and shows up in the taskbar(when I right click on the speaker icon), but the audio still defaults to the analog jack.
What is the proper way to set up bluetooth audio on Raspbian stretch. Do I need to edit my .asoundrc?
Do I just add those lines?

Code: Select all

defaults.bluealsa.interface "hci0"
defaults.bluealsa.device "XX:XX:XX:XX:XX:XX"
defaults.bluealsa.profile "a2dp"
defaults.bluealsa.delay 10000
https://www.raspberrypi.org/blog/raspbian-stretch/
Edit:
I unpaired the speaker through the GUI and connected through bluetoothctl via cli. The speaker now shows up when I type alsamixer -D bluealsa and on vlc. Now I need to find a way to set the bluetooth speaker as my default audio speaker.
I

Code: Select all

pcm.btheadset {
        type plug
        slave.pcm {
                type bluealsa
                device "XX:XX:XX:XX:XX:XX"
                profile "a2dp"
        }
}

recklessfb
Posts: 37
Joined: Wed Jul 06, 2016 12:26 am

Re: Bluetooth audio on stretch

Tue Nov 28, 2017 2:01 am

I want to use the bluetooth speaker as my default audio speaker.
No one?

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

Re: Bluetooth audio on stretch

Tue Nov 28, 2017 2:18 am

As I recall (I stick to the command line for the most part), you need to right click on the sound icon, and select your Bluetooth speaker. I suspect that has the same effect as entering the lines you mentioned into .asoundrc (using a different syntax. The second set of lines you mentioned, except the name should be pcm.!default.)

pmos69
Posts: 1
Joined: Fri Dec 01, 2017 10:12 pm

Re: Bluetooth audio on stretch

Fri Dec 01, 2017 10:25 pm

Also new stretch installation, and some issues also.
Paired bluetooth speakers.
After pairing, right-cliking on the volume icon still doesn't show the bluetooth device for selecting.
Installed blueman and with that had no issues connecting. Right-clicking on volume icon still doesn't show bluetooth option. Only Analog and HDMI.

aplay works fine when addressing the device directly. ex:

Code: Select all

aplay -D bluealsa:HCI=hci0,DEV=00:02:5B:60:A6:2F,PROFILE=a2dp /usr/lib/libreoffice/share/gallery/sounds/applause.wav
alsamixer -D bluealsa also works fine.

What can I do to troubleshoot/fix this?

EDIT:
It was just stubborn after all.
Unpairing and pairing again fixed it. Removed blueman in the mean time.

About making it default: What I'm seeing is that, if the bluetooth speaker was selected at shutdown and is available after a reboot, it will be picked up as the output device.

It would be nice if it also remembered the previous volume level, but alsactl store/restore only seems to work for cards.
Also, the volume and mute control keys don't seem to work if the bluetooth device is selected.

recklessfb
Posts: 37
Joined: Wed Jul 06, 2016 12:26 am

Re: Bluetooth audio on stretch

Sat Dec 02, 2017 2:21 pm

@douglas6
I switched the line to pcm.!default and it now shows up under the gui.
I still cannot get audio to go through the bluetooth speaker though.
I'm getting a permission error.
This is on vlc

Code: Select all

Audio output failed:
The audio device "default" could not be used:
Permission denied. 
and with the alexa sdk

Code: Select all

AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': Permission denied
I think it's because I deleted the default pi user and have a different user as default. I have also posted on the bluez-alsa github for help on how to fix the permission issue.

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

Re: Bluetooth audio on stretch

Sat Dec 02, 2017 2:32 pm

Try adding your user to the 'audio' group.

recklessfb
Posts: 37
Joined: Wed Jul 06, 2016 12:26 am

Re: Bluetooth audio on stretch

Sat Dec 02, 2017 2:47 pm

Douglas6 wrote:
Sat Dec 02, 2017 2:32 pm
Try adding your user to the 'audio' group.
Thank you very much.
That was it.
Enjoy your weekend :)

julien.launay
Posts: 51
Joined: Wed Mar 30, 2016 5:22 am

Re: Bluetooth audio on stretch

Mon Jun 04, 2018 5:43 pm

Hello.
Do you know if A2DP bluetooth agent is already install in stretch version. I don't want my raspberry pi to be paired as a audio device.
So I this I have to unistall A2DP to not to have a headless icone on my smartphone when I pair.
Thanks to your help.
https://gist.github.com/mill1000/74c747 ... e9994ff84c

Regards.

Julien

Return to “Raspbian”