arkq / bluez-alsa

Bluetooth Audio ALSA Backend
MIT License
866 stars 189 forks source link

Couldn't get BlueALSA PCM list: Rejected send message #426

Closed hymie0 closed 3 years ago

hymie0 commented 3 years ago

Hello.

I'm brand new to the world of Bluetooth, and I hope you can point what I (probably) did wrong.

I have my Jabra headset paired to my computer.

I set up my /etc/asound.conf

pcm.btheadset {
   type plug
   slave {
       pcm {
           type bluealsa
           device 30:50:75:43:F4:AE
           profile "a2dp"
       }   
   }   
   hint {
       show on
       description "BT Headset"
   }   
}

Then I run bluealsa ...

% sudo src/bluealsa
src/bluealsa: D: ../../src/bluez.c:497: Creating media endpoint object: /org/bluez/hci0/A2DP/SBC/Source/1
src/bluealsa: D: ../../src/bluez.c:413: Registering media endpoint: /org/bluez/hci0/A2DP/SBC/Source/1
src/bluealsa: D: ../../src/bluez.c:497: Creating media endpoint object: /org/bluez/hci0/A2DP/SBC/Source/2
src/bluealsa: D: ../../src/bluez.c:413: Registering media endpoint: /org/bluez/hci0/A2DP/SBC/Source/2
src/bluealsa: D: ../../src/bluez.c:792: Creating hands-free profile object: /org/bluez/HSP/AudioGateway
src/bluealsa: D: ../../src/bluez.c:726: Registering hands-free profile: /org/bluez/HSP/AudioGateway
src/bluealsa: D: ../../src/bluez.c:792: Creating hands-free profile object: /org/bluez/HFP/AudioGateway
src/bluealsa: D: ../../src/bluez.c:726: Registering hands-free profile: /org/bluez/HFP/AudioGateway
src/bluealsa: D: ../../src/main.c:396: Acquiring D-Bus service name: org.bluealsa
src/bluealsa: D: ../../src/main.c:401: Starting main dispatching loop

But none of the tools are succeeding.

% amixer -D bluealsa
ALSA lib ../../../src/asound/bluealsa-ctl.c:972:(_snd_ctl_bluealsa_open) Couldn't get BlueALSA PCM list: Rejected send message, 1 matched rules; type="method_call", sender=":1.186" (uid=1000 pid=23605 comm="amixer -D bluealsa ") interface="org.bluealsa.Manager1" member="GetPCMs" error name="(unset)" requested_reply="0" destination="org.bluealsa" (uid=0 pid=22707 comm="src/bluealsa ")
amixer: Mixer attach bluealsa error: No such device

Can you give me a push?

hymie0 commented 3 years ago

OK, I think I found my first mistake. I had to be running bluealso before I paired the headphones. Now I run bluealsa and I have this:

src/bluealsa: D: ../../src/dbus.c:59: Called: org.bluez.Profile1.NewConnection() on /org/bluez/HFP/AudioGateway
src/bluealsa: D: ../../src/ba-rfcomm.c:1285: Created new RFCOMM thread [ba-rfcomm]: HFP Audio Gateway (CVSD)
src/bluealsa: D: ../../src/ba-rfcomm.c:901: Starting RFCOMM loop: HFP Audio Gateway (CVSD)
src/bluealsa: D: ../../src/bluez.c:616: HFP Audio Gateway (CVSD) configured for device 30:50:75:43:F4:AE
src/bluealsa: D: ../../src/ba-transport.c:669: Starting transport: HFP Audio Gateway (CVSD)
src/bluealsa: D: ../../src/sco.c:245: IO loop: START: sco_thread: HFP Audio Gateway (CVSD)
src/bluealsa: D: ../../src/ba-transport.c:1043: Created new transport thread [ba-sco]: HFP Audio Gateway (CVSD)
src/bluealsa: D: ../../src/at.c:161: AT message: SET: command:+BRSF, value:923
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:+BRSF, value:2272
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:(null), value:OK
src/bluealsa: D: ../../src/ba-rfcomm.c:126: RFCOMM: HFP Audio Gateway (CVSD) state transition: 0 -> 2
src/bluealsa: D: ../../src/at.c:161: AT message: TEST: command:+CIND, value:(null)
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:+CIND, value:("service",(0-1)),("call",(0,1)),("callsetup",(0-3)),("callheld",(0-2)),("signal",(0-5)),("roam",(0-1)),("battchg",(0-5))
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:(null), value:OK
src/bluealsa: D: ../../src/ba-rfcomm.c:126: RFCOMM: HFP Audio Gateway (CVSD) state transition: 2 -> 5
src/bluealsa: D: ../../src/at.c:161: AT message: GET: command:+CIND, value:(null)
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:+CIND, value:0,0,0,0,0,0,5
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:(null), value:OK
src/bluealsa: D: ../../src/ba-rfcomm.c:126: RFCOMM: HFP Audio Gateway (CVSD) state transition: 5 -> 7
src/bluealsa: D: ../../src/at.c:161: AT message: SET: command:+CMER, value:3, 0, 0, 1
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:(null), value:OK
src/bluealsa: D: ../../src/ba-rfcomm.c:126: RFCOMM: HFP Audio Gateway (CVSD) state transition: 7 -> 8
src/bluealsa: D: ../../src/ba-rfcomm.c:126: RFCOMM: HFP Audio Gateway (CVSD) state transition: 8 -> 9
src/bluealsa: D: ../../src/at.c:161: AT message: SET: command:+VGS, value:07
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:(null), value:OK
src/bluealsa: D: ../../src/at.c:161: AT message: SET: command:+VGM, value:09
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:(null), value:OK
src/bluealsa: D: ../../src/at.c:161: AT message: SET: command:+XAPL, value:0B0E-BABE-0123,14
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:(null), value:+XAPL=BlueALSA,6
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:(null), value:OK
src/bluealsa: D: ../../src/at.c:161: AT message: GET: command:+BTRH, value:(null)
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:(null), value:OK
src/bluealsa: D: ../../src/at.c:161: AT message: SET: command:+BIA, value:0,1,1,1,0,0,0,0
src/bluealsa: D: ../../src/ba-rfcomm.c:107: Sending AT message: RESP: command:(null), value:OK
src/bluealsa: D: ../../src/dbus.c:59: Called: org.bluez.MediaEndpoint1.SelectConfiguration() on /org/bluez/hci0/A2DP/SBC/Source/1
src/bluealsa: D: ../../src/bluez.c:922: Signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded()
src/bluealsa: D: ../../src/dbus.c:59: Called: org.bluez.MediaEndpoint1.SetConfiguration() on /org/bluez/hci0/A2DP/SBC/Source/1
src/bluealsa: D: ../../src/a2dp.c:723: Selected A2DP SBC bit-pool range: [2, 53]
src/bluealsa: D: ../../src/bluez.c:298: A2DP Source (SBC) configured for device 30:50:75:43:F4:AE
src/bluealsa: D: ../../src/bluez.c:301: Configuration: channels: 2, sampling: 48000
src/bluealsa: D: ../../src/bluez.c:1110: Signal: org.freedesktop.DBus.Properties.PropertiesChanged(): org.bluez.MediaTransport1: Delay

but I'm still having no luck with

% amixer -D bluealsa
ALSA lib ../../../src/asound/bluealsa-ctl.c:972:(_snd_ctl_bluealsa_open) Couldn't get BlueALSA PCM list: Rejected send message, 1 matched rules; type="method_call", sender=":1.202" (uid=1000 pid=25588 comm="amixer -D bluealsa ") interface="org.bluealsa.Manager1" member="GetPCMs" error name="(unset)" requested_reply="0" destination="org.bluealsa" (uid=0 pid=22707 comm="src/bluealsa ")
amixer: Mixer attach bluealsa error: No such device
arkq commented 3 years ago

Rejected send message, 1 matched rules

This is a message from D-Bus daemon which have its own ACL system (other than UNIX's DAC). You need properly configured /etc/dbus-1/system.d/bluealsa.conf file (assuming that on your distro this config file is in that location). By default only root and user in the audio group are allowed to connect with bluealsa service.

hymie0 commented 3 years ago

You're right ... things work fine for root so it must be a permission error.

However, my user is in the audio group, so I'm not sure what the next step is.

% groups
hymie root disk lp floppy dialout audio video cdrom netdev scanner vboxusers

=====

I (think I) figured it out. Even though my groups listing includes "audio" , I'm not listed in /etc/group in the "audio" group. Once I did that, things are working.

Thank you for the help!