linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bluez PATCH 0/1] policy: Fix connection stealing with Airpods
@ 2020-12-07 23:49 Abhishek Pandit-Subedi
  2020-12-07 23:49 ` [bluez PATCH 1/1] policy: Refactor reconnect policy for resume Abhishek Pandit-Subedi
  0 siblings, 1 reply; 7+ messages in thread
From: Abhishek Pandit-Subedi @ 2020-12-07 23:49 UTC (permalink / raw)
  To: luiz.dentz, linux-bluetooth
  Cc: chromeos-bluetooth-upstreaming, Abhishek Pandit-Subedi


Hi Luiz,

When a2dp-sink was added to the reconnection policy, it exposed a bug in
Airpods which were incorrectly emitting Connection Timeout when
connecting to a new device. As a result, Chromebooks started
reconnecting immediately (link loss) and inadvertently "stole"
connections. See hci trace below:

> HCI Event: Disconnect Complete (0x05) plen 4                 #1680 [hci0] 62.656436
        Status: Success (0x00)
        Handle: 256
        Reason: Connection Timeout (0x08)
@ MGMT Event: Device Disconnected (0x000c) plen 8              {0x0004} [hci0] 62.656510
        BR/EDR Address: E4:90:FD:7D:E7:5F (OUI E4-90-FD)
        Reason: Connection timeout (0x01)
@ MGMT Event: Device Disconnected (0x000c) plen 8              {0x0002} [hci0] 62.656510
        BR/EDR Address: E4:90:FD:7D:E7:5F (OUI E4-90-FD)
        Reason: Connection timeout (0x01)
@ MGMT Event: Device Disconnected (0x000c) plen 8              {0x0001} [hci0] 62.656510
        BR/EDR Address: E4:90:FD:7D:E7:5F (OUI E4-90-FD)
        Reason: Connection timeout (0x01)
@ MGMT Event: Device Disconnected (0x000c) plen 8              {0x0003} [hci0] 62.656510
        BR/EDR Address: E4:90:FD:7D:E7:5F (OUI E4-90-FD)
        Reason: Connection timeout (0x01)
< HCI Command: Write Scan Enable (0x03|0x001a) plen 1          #1681 [hci0] 62.668156
        Scan enable: Page Scan (0x02)
> HCI Event: Command Complete (0x0e) plen 4                    #1682 [hci0] 62.670442
      Write Scan Enable (0x03|0x001a) ncmd 2
        Status: Success (0x00)
< HCI Command: Create Connection (0x01|0x0005) plen 13         #1683 [hci0] 64.090171
        Address: E4:90:FD:7D:E7:5F (OUI E4-90-FD)
        Packet type: 0xcc18
          DM1 may be used
          DH1 may be used
          DM3 may be used
          DH3 may be used
          DM5 may be used
          DH5 may be used
        Page scan repetition mode: R2 (0x02)
        Page scan mode: Mandatory (0x00)
        Clock offset: 0x0000
        Role switch: Allow slave (0x01)
> HCI Event: Command Status (0x0f) plen 4                      #1684 [hci0] 64.090446
      Create Connection (0x01|0x0005) ncmd 1

This patch separates the ReconnectUUIDs by adding a ReconnectResumeUUIDs
and distinguishes reconnections that occur on timeout vs. resume.

I've run the following tests:

- Check that Airpods changing to a different device doesn't cause
  a reconnection with this change.
- Check that adding a2dp-sink to ReconnectUUIDs will cause the original
  issue to be seen.
- Make sure Airpods are reconnected on resume.
- Make sure other headphones are reconnected on resume (tested Anker
  Soundcore Life Q20 and ATH-M50xBT)
- Run bluetooth_AdapterSRHealth.sr_reconnect_a2dp (ChromeOS end-to-end
  test)

Thanks
Abhishek



Abhishek Pandit-Subedi (1):
  policy: Refactor reconnect policy for resume

 plugins/policy.c | 72 ++++++++++++++++++++++++++++++++++++------------
 src/main.conf    |  9 +++++-
 2 files changed, 62 insertions(+), 19 deletions(-)

-- 
2.29.2.576.ga3fc446d84-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-12-12  1:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-07 23:49 [bluez PATCH 0/1] policy: Fix connection stealing with Airpods Abhishek Pandit-Subedi
2020-12-07 23:49 ` [bluez PATCH 1/1] policy: Refactor reconnect policy for resume Abhishek Pandit-Subedi
2020-12-08  0:36   ` Luiz Augusto von Dentz
2020-12-08  1:19     ` Abhishek Pandit-Subedi
2020-12-08  3:08       ` Luiz Augusto von Dentz
2020-12-12  0:04         ` Abhishek Pandit-Subedi
2020-12-08  1:12   ` policy: Fix connection stealing with Airpods bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).