portafreak
Posts: 6
Joined: Tue Dec 12, 2017 12:29 am

please help with bluetooth and pulseaudio

Tue Dec 12, 2017 12:41 am

Hi,

I'm trying to keep my bluetooth speaker connected to my raspberry Pi 3. I'm using Jessie 8 headless.
So far, I can connect my bluetooth speaker (google home mini) using the following guide:

http://youness.net/raspberry-pi/bluetoo ... -ad2p-only

It's working great as long as I'm connected by ssh, but I get this message from pulseaudio if no one is logged to the pi and a script is executed by root:

Code: Select all

systemctl status pulseaudio
raspberrypi pulseaudio[28095]: W: [pulseaudio] protocol-native.c: Denied access to client with invalid authorization data.


Any help will be greatly appreciated.

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

Re: please help with bluetooth and pulseaudio

Tue Dec 12, 2017 2:00 am

You could try adding root to the 'audio' group.

portafreak
Posts: 6
Joined: Tue Dec 12, 2017 12:29 am

Re: please help with bluetooth and pulseaudio

Tue Dec 12, 2017 2:20 am

I did already, no luck.

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

Re: please help with bluetooth and pulseaudio

Tue Dec 12, 2017 2:39 am

It's been awhile since I've used PulseAudio, but I always ran it in 'systemwide mode' to avoid just these kinds of problems. You should be able to Google on that, else I can look up some things. Are you starting PulseAudio from the command line? And are you running initd or systemd?

portafreak
Posts: 6
Joined: Tue Dec 12, 2017 12:29 am

Re: please help with bluetooth and pulseaudio

Tue Dec 12, 2017 2:46 am

I am running it in system mode with systemd, but I will only get audio if I manually type pulseaudio --start .

My pulseaudio status:

Code: Select all

pulseaudio.service - Pulse Audio
   Loaded: loaded (/lib/systemd/system/pulseaudio.service; disabled)
   Active: active (running) since Mon 2017-12-11 18:10:27 EST; 3h 33min ago
 Main PID: 28095 (pulseaudio)
   CGroup: /system.slice/pulseaudio.service
           ââ28095 /usr/bin/pulseaudio --system --disallow-exit --disable-shm --exit-idle-time=-1

Dec 11 18:10:27 raspberrypi systemd[1]: Started Pulse Audio.
Dec 11 18:10:27 raspberrypi pulseaudio[28095]: W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set!
Dec 11 18:10:27 raspberrypi pulseaudio[28095]: W: [pulseaudio] main.c: OK, so you are running PA in system mode. Please note that you most likely shouldn't be doing that.
Dec 11 18:10:27 raspberrypi pulseaudio[28095]: W: [pulseaudio] main.c: If you do it nonetheless then it's your own fault if things don't work as expected.
Dec 11 18:10:27 raspberrypi pulseaudio[28095]: W: [pulseaudio] main.c: Please read http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode for an explanation why system mode is usually a bad idea.
Dec 11 18:10:39 raspberrypi pulseaudio[28095]: W: [pulseaudio] protocol-native.c: Denied access to client with invalid authorization data.

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

Re: please help with bluetooth and pulseaudio

Tue Dec 12, 2017 3:14 am

OK, you've added both module-bluetooth-policy and module-bluetooth-discover to /etc/pulse/system.conf? And try adding root to the 'pulse' and 'pulse-access' groups.

If you're having to manually run 'pulseaudio --start', then the systemwide instance is not running. Need to figure out why.

portafreak
Posts: 6
Joined: Tue Dec 12, 2017 12:29 am

Re: please help with bluetooth and pulseaudio

Tue Dec 12, 2017 10:28 pm

I finally got it working by adding this to the end of /etc/pulse/system.pa:

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif


Thank you for your help.

maza
Posts: 4
Joined: Sun Dec 29, 2013 5:41 pm

Re: please help with bluetooth and pulseaudio

Thu Feb 08, 2018 11:57 pm

Hi i have wrote an small post for connecting a Bluetooth-Speaker (in my case it is the Amazon Echo).
In all post i have fond is one important thing missing: the userrights

See my post for a step by step configuration: https://ma-za.blogspot.com/2018/01/rasb ... ation.html
Matthias Zartmann :geek:

Return to “Troubleshooting”