[PATCH v2] bluetooth: Fix possible adapter duplicates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2013-02-17 at 10:04 +0100, Mikel Astiz wrote:
> From: Mikel Astiz <mikel.astiz at bmw-carit.de>
> 
> The D-Bus signal AdapterAdded can be received during our call to
> GetProperties(), before the reply is received. In this case, the adapter
> will be listed twice and thus the endpoint registration will fail with
> "AlreadyExists" as follows:
> 
> D: [pulseaudio] bluetooth-util.c: dbus: interface=org.bluez.Manager, path=/, member=AdapterAdded
> D: [pulseaudio] bluetooth-util.c: Adapter /org/bluez/21220/hci0 created
> D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPAG on adapter /org/bluez/21220/hci0.
> D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPHS on adapter /org/bluez/21220/hci0.
> D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSource on adapter /org/bluez/21220/hci0.
> D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSink on adapter /org/bluez/21220/hci0.
> D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPAG on adapter /org/bluez/21220/hci0.
> D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPHS on adapter /org/bluez/21220/hci0.
> D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSource on adapter /org/bluez/21220/hci0.
> D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSink on adapter /org/bluez/21220/hci0.
> E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
> E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
> E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
> E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
> ---
>  src/modules/bluetooth/bluetooth-util.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)

Applied, thanks.

> @@ -1015,6 +1024,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
>  
>              if (new_owner && *new_owner) {
>                  pa_log_debug("Bluetooth daemon appeared.");
> +                y->adapters_listed = false;

I was still not entirely happy with the location of this assignment. I
moved it a few lines up, where we detect that the daemon disappeared.

-- 
Tanu



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux