[Redmi AirDots Bluetooth] I need to remove device in settings every time i want to connect again

Bug #1879582 reported by FelipeAF
2
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
New
Undecided
Unassigned

Bug Description

I can connect to my bluetooth phone only the first time after pair the device. It works until disconnecting, (whether by turning off the phone, or putting into the case, or disconnecting in ubuntu settings), and then i turn on the phone again (or remove from the case), i cannot connect until I manually remove from bluetooth devices list in Ubuntu Settings, and then pair it again..
If the Ubuntu/Gnome Settings is opened, i can see the status "connected" blinks, and fastly change to "disconnected".

My bluetooth phone works fine with another devices.
Ubuntu 20.04 LTS
Laptop Acer Aspire Nitro 5 (AN515-52-5771).

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: alsa-base 1.0.25+dfsg-0ubuntu5
ProcVersionSignature: Ubuntu 5.4.0-29.33-generic 5.4.30
Uname: Linux 5.4.0-29-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: felipe 2149 F.... pulseaudio
 /dev/snd/controlC0: felipe 2149 F.... pulseaudio
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Tue May 19 19:10:35 2020
InstallationDate: Installed on 2020-04-29 (20 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
PackageArchitecture: all
SourcePackage: alsa-driver
Symptom: audio
Symptom_Card: Redmi AirDots_R
Symptom_Type: None of the above
Title: [Redmi AirDots_R, playback] Playback problem
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/05/2019
dmi.bios.vendor: Insyde Corp.
dmi.bios.version: V1.28
dmi.board.asset.tag: Type2 - Board Serial Number
dmi.board.name: Freed_CFS
dmi.board.vendor: CFL
dmi.board.version: V1.28
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.version: V1.28
dmi.modalias: dmi:bvnInsydeCorp.:bvrV1.28:bd08/05/2019:svnAcer:pnNitroAN515-52:pvrV1.28:rvnCFL:rnFreed_CFS:rvrV1.28:cvnAcer:ct10:cvrV1.28:
dmi.product.family: Nitro 5
dmi.product.name: Nitro AN515-52
dmi.product.sku: 0000000000000000
dmi.product.version: V1.28
dmi.sys.vendor: Acer

Revision history for this message
FelipeAF (felipealexandref) wrote :
affects: ubuntu → alsa-driver (Ubuntu)
Revision history for this message
Hui Wang (hui.wang) wrote :

When the bluetooth headphone is trying to connect on the 2nd time (will fail), could you see any error message from syslog?

open a terminal and run 'tail -f /var/log/syslog', then reconnect the bluetooth headphone.

Revision history for this message
FelipeAF (felipealexandref) wrote :
Download full text (5.9 KiB)

Hi, thanks for help. When i manually try to connect in ubuntu settings, yes, there are this messages:

May 20 12:50:29 felipe-Nitro-AN515-52 bluetoothd[1257]: Unable to get Headset Voice gateway SDP record: Device or resource busy
May 20 12:50:29 felipe-Nitro-AN515-52 bluetoothd[1257]: connect error: Device or resource busy (16)

But, when the phone is paired and i just turn the paired phone again, the status "connected" blinks (change to "connected" for a second, and then change to disconnected again), but no messages are printed.

I have also messages when i pair the fone (after removing from device list), and when i disconnected from that real connection (first use after pairing).

Connecting:

May 20 13:08:30 felipe-Nitro-AN515-52 gnome-control-c[69201]: Setting up /org/bluez/hci0/dev_1C_52_16_B6_64_01 failed: GDBus.Error:org.bluez.Error.ConnectionAttemptFailed: Page Timeout
May 20 13:08:38 felipe-Nitro-AN515-52 bluetoothd[1257]: /org/bluez/hci0/dev_1C_52_16_B6_64_01/sep1/fd7: fd(146) ready
May 20 13:08:38 felipe-Nitro-AN515-52 rtkit-daemon[1600]: Supervising 12 threads of 8 processes of 2 users.
May 20 13:08:38 felipe-Nitro-AN515-52 rtkit-daemon[1600]: Successfully made thread 69567 of process 2149 owned by '1000' RT at priority 5.
May 20 13:08:38 felipe-Nitro-AN515-52 rtkit-daemon[1600]: Supervising 13 threads of 8 processes of 2 users.
May 20 13:08:38 felipe-Nitro-AN515-52 kernel: [170513.995309] input: Redmi AirDots_R (AVRCP) as /devices/virtual/input/input44
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[2242]: (II) config/udev: Adding input device Redmi AirDots_R (AVRCP) (/dev/input/event16)
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[2242]: (**) Redmi AirDots_R (AVRCP): Applying InputClass "libinput keyboard catchall"
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[2242]: (II) Using input driver 'libinput' for 'Redmi AirDots_R (AVRCP)'
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[2242]: (II) systemd-logind: got fd for /dev/input/event16 13:80 fd 108 paused 0
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[2242]: (**) Redmi AirDots_R (AVRCP): always reports core events
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[2242]: (**) Option "Device" "/dev/input/event16"
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[2242]: (**) Option "_source" "server/udev"
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[1537]: (II) config/udev: Adding input device Redmi AirDots_R (AVRCP) (/dev/input/event16)
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[1537]: (**) Redmi AirDots_R (AVRCP): Applying InputClass "libinput keyboard catchall"
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[1537]: (II) Using input driver 'libinput' for 'Redmi AirDots_R (AVRCP)'
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[2242]: (II) event16 - Redmi AirDots_R (AVRCP): is tagged by udev as: Keyboard
May 20 13:08:38 felipe-Nitro-AN515-52 /usr/lib/gdm3/gdm-x-session[2242]: (II) event16 - Redmi AirDots_R (AVRCP): device is a keyboard
May 20 13:08:38 felipe-Nitro-AN515...

Read more...

Revision history for this message
Hui Wang (hui.wang) wrote :

Let's capture more logs from pulseaudio:

Please edit /usr/lib/systemd/user/pulseaudio.service

comment out the existing line starting with ExecStart and add a new one ExecStart=/usr/bin/pulseaudio -vvvv --log-target=file:/tmp/a.txt

reboot

tail -f /tmp/a.txt

Then connect the BT headphone, after fails, please upload the log starting from you connect the BT headphone.

Revision history for this message
FelipeAF (felipealexandref) wrote :

Hi! i'm sorry for taking so long to reply, i lost the email notification in spam.

Well, I did that. There is a log of log messages there, but nothing when i tried to connect again (i was checking with tail -f).

Revision history for this message
FelipeAF (felipealexandref) wrote :

Hi, i just found out that if i try to click *a lot* of times in connection button i can connect the second time.

the only message in log was not really in the same time when i tried to connect or disconnect

D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC0 is accessible: no
D: [pulseaudio] module-udev-detect.c: Suspending all sinks and sources of card alsa_card.pci-0000_00_1f.3.

Just for test, i paired another kind of bluetooth device, a gamepad controller, and i was able to connect and disconect normally every time (without this bug)

Revision history for this message
FelipeAF (felipealexandref) wrote :

bluetoothctl connect is the same that connecting in ubuntu settings?

I tried to connect via terminal, and I had same problem:

*TURN PHONE ON*
bluetoothctl connect 1C:52:16:B6:64:01
Attempting to connect to 1C:52:16:B6:64:01
Failed to connect: org.bluez.Error.Failed

Trying a lot of times, after more than 10 times, it works:

 bluetoothctl connect 1C:52:16:B6:64:01
Attempting to connect to 1C:52:16:B6:64:01
^[[A
[CHG] Device 7C:A6:B4:62:CF:86 RSSI: -90
[CHG] Device 64:32:A8:7D:D7:45 RSSI: -70
[CHG] Device 09:5D:DC:F8:A8:BE RSSI: -72
[CHG] Device 1C:52:16:B6:64:01 RSSI: -51
[CHG] Device 7C:A6:B4:62:CF:86 RSSI: -90
[CHG] Device 3B:F2:81:DB:FB:25 RSSI: -57
[CHG] Device 1C:52:16:B6:64:01 Connected: yes
[CHG] Device E4:7D:BD:56:A8:FD RSSI: -93
[NEW] Device 29:87:FF:B9:CE:42 29-87-FF-B9-CE-42
[CHG] Device 3B:F2:81:DB:FB:25 RSSI: -68
[CHG] Device 3B:F2:81:DB:FB:25 RSSI: -56
[CHG] Device 09:5D:DC:F8:A8:BE RSSI: -71
[CHG] Device 3B:F2:81:DB:FB:25 RSSI: -64
[CHG] Device 09:5D:DC:F8:A8:BE RSSI: -72
[CHG] Device D0:03:DF:52:8A:44 RSSI: -85
[CHG] Device D0:03:DF:52:8A:44 ManufacturerData Key: 0x0075
[CHG] Device D0:03:DF:52:8A:44 ManufacturerData Value:
  42 04 01 01 7e d0 03 df 52 8a 44 d2 03 df 52 8a B...~...R.D...R.
  43 01 16 ad 09 00 00 00 C.......
[CHG] Device D0:03:DF:52:8A:44 ManufacturerData Key: 0x001d
[CHG] Device D0:03:DF:52:8A:44 ManufacturerData Value:
  00 01 4c ..L

Revision history for this message
Hui Wang (hui.wang) wrote :

If there is no log from pulseaudio, it means the pulseaudio does not join the connection process yet. The pulseaudio needs to receive a Dbus message (connection request) from bluez first, then it starts to processing bluetooth connection. So in your case, the connection failed in the bluez.

Could you connect other bluetooth heapdhones to your laptop? Let's see if it is the problem on your laptop (bluetooth hci controller). If it is, it is highly possible that it is bluetooth driver or firmware's problem.

Could you connect your redmi headphone to other laptops? If yes, you could capture bt packages during the reconnection and compare them:

close gnome bluetooth applet,
$sudo btmon -w good.cap
$btmon -r good.cap

on the machine with problem:
$sudo btmon -w bad.cap
$btmon -r bad.cap

Revision history for this message
FelipeAF (felipealexandref) wrote :

well, i had done both tests (redmi in other laptop and same laptop with another phone), and the result was quite confusing. Seems the bug occurs with the combination of ubuntu+redmi

1 - Testing Redmi In an old laptop Lenovo G470, autoconnection (after turn phone on again) not works at all (just as in my acer, on status blinks when i turn phone on, but it immediately change to off again). Manual connection fails kind of 50% of times, in a different way than in my acer (here it keeps loading for some seconds and then fail, while in acer it just become of immediactly).
2 - In MS Windows, in the same lenovo laptop (i had tested just for discard a hardware problem), redmi works fine both, manual and auto connection (also in my android tablet and android phone).
3 - With an old and cheap bluetooth phone, called "fitphone", in my acer, works both, auto-connection after turn phone on and manual connection in gnome.

I had noticed that when i try to manual connect in my acer, i get in btmon a status "bluetoothd: connect error: Device or resource busy", while in lenovo, the fails status are
When lenovo auto-connection blinks, it printed in btmon: "= bluetoothd: connect error: Operation already in progress" (while it's not)

Revision history for this message
FelipeAF (felipealexandref) wrote :
Revision history for this message
FelipeAF (felipealexandref) wrote :

I tested a third headphone, Philips SHB3075, in my acer laptop, and autoconnection works, but manual reconnections not. For manual connections is the same than for redmi, i had to try connect a lot of times than it works.

Revision history for this message
FelipeAF (felipealexandref) wrote :

autoconnection works.
Besides the auto-connection bug is just with redmi+ubuntu, manual connections (and disconnections) are also useful if you use the same headphone in more than one device.

Revision history for this message
Hui Wang (hui.wang) wrote :

According to the log, when autoconnection fails:

Redmi phone sent (Handsfree):
> ACL Data RX: Handle 11 flags 0x02 dlen 17 #37 [hci0] 9.000527
      Channel: 64 len 13 [PSM 1 mode 0] {chan 0}
      SDP: Service Search Request (0x02) tid 1 len 8
        Search pattern: [len 5]
          Sequence (6) with 3 bytes [8 extra bits] len 5
            UUID (3) with 2 bytes [0 extra bits] len 3
              Handsfree (0x111e)
        Max record count: 68
        Continuation state: 0

But laptop reply not support:
< ACL Data TX: Handle 11 flags 0x00 dlen 14 #38 [hci0] 9.000848
      Channel: 64 len 10 [PSM 1 mode 0] {chan 0}
      SDP: Service Search Response (0x03) tid 1 len 5
        Total record count: 0
        Current record count: 0
        Continuation state: 0

Then Redmi phone propose disconnection.

It looks like your philip headphone doesn't inquire the handsfree service, maybe pulseaudio/bluez doesn't support handsfree service well or enable to do some change to enable it?

Revision history for this message
Hui Wang (hui.wang) wrote :

If the handsfree is not a critical service feature, even the laptop reply that it doesn't support this service, the redmi phone should inquire other audio services, but it doesn't.

Revision history for this message
FelipeAF (felipealexandref) wrote :

Hi! I had test the same redmi airdots in more scenarios, that led me to guess that, while autoconnection is not a bug, manual connection is really an Ubuntu bug, since it worked fine in Linux Mint 19.3 in the same hardware.

These was the new tested cenarios (all these with redmi airdots phone):
* Scenario 1 - Dell Inspiron 5480 with Ubuntu 20.04 in live usb mode. Exactly the same bug that in My acer from original post. I need to do annoying clicks in connection switcher until it works.
* Scenario 2 - Same Dell Inspiron 5480, but with Windows 10. Manual Connection works fine. Auto connection not (maybe it's kind a airdots feature, try to connect just in more used device, instead of the last).
* Scenario 3 - The acer nitro 5, same from original report, but with Linux Mint 19.3 (live usb). It works, i can manually connect with just one click (but also no auto connection).

Revision history for this message
FelipeAF (felipealexandref) wrote :
Revision history for this message
FelipeAF (felipealexandref) wrote :

About the Philips SHB3075, i had tested just for music. I had borrow that, so, i didn't do more tests. What is the handsfree service? The volume control in that phone worked independent, regardless, from volume in the system.

Revision history for this message
FelipeAF (felipealexandref) wrote :

hi! I'm here again because some package upgrade, or something else (i dont't know what) just fixed it. Now I can connect with just one click.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.