Bluetooth dongle USB reset after first HFP/SCO connection when 4.1 mode is active on CM106-like sound card
Describe the bug
Hello, I experience strange issue with my Bluetooth dongles and CM106-like (surround) sound card.
I want to pair my phone with the Raspberry PI 4B 8GB and handle HFP calls with surround sound enabled (I need multiple speakers). 4.1 mode works like a charm in entire OS but problem happens right after I finish first HFP call. Phone call itself is perfect. Audio quality is great, no delays or any other problems. When I end the phone call, after ~10 seconds, I see in dmesg that my dongle was disconnected from the USB bus and connected immediately (looks like a reset). After that some hci event timeouts are visible. The dongle itself becomes unusable until physical replug. Bluetooth connection is stalled. Next phone calls go through internal phone speaker.
Interesting fact is that the issue occures only when surround profile (4.0, 4.1, 5.1, etc.) is enabled on the sound card (via pactl set-card-profile). Issue is reproducible on the latest Raspberry PI OS and Ubuntu 24.04 LTS Desktop with 100% occurence. Issue is reproducible with both native and ofono backends of Pipewire. Issue is not reproducible with stereo profile of the sound card. Issue is not reproducible on my x86 PC with Ubuntu 24.04 LTS. Issue is not reproducible with built-in Bluetooth adapter.
I tested Bluetooth connection with various phones (Pixels, Samsung, Xiaomi, Huawei) but it seems to be not related to phone itself. I tried connect devices to different USB ports, powered USB hub, etc. I even used SD card intstead of USB SSD but still no luck.
Bluetooth dongles I tested so far (all affected): 4x CSR8510 4.0 (dmesg does not complain about fake. I even forced fake quirks in btusb driver but no change) Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
1x Edimax BT8500 Bus 001 Device 008: ID 7392:c611 Edimax Technology Co., Ltd Edimax Bluetooth Adapter
1x TP-Link UB500 Bus 001 Device 009: ID 2357:0604 TP-Link TP-Link Bluetooth USB Adapter
Sound card: Bus 001 Device 004: ID 0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound Device
I tried to debug a bit btusb driver and found massive flood of isochronous transfers but might be normal as both SCO and sound card xfer data. However, those transfers are visible even after phone call ends. The same is also visible in collected traces from usbmon together with plenty of CLEAR_TT_BUFFER messages.
I apologize in advance for maybe chaotic description but I collected so many details for past week and I wanted to share every single detail.
Thank you. Best regards, Richi
Steps to reproduce the behaviour
- Connect BT dongle to the USB
- Connect Sound card to the USB
- Use pactl set-card-profile to change profile of the CM106 sound card (e. g. pactl set-card-profile alsa_card.usb-0d8c_USB_Sound_Device-00 output:analog-surround-41+input:analog-stereo)
- Pair phone and Raspberry PI
- Make a phone call
- End phone call
- After few seconds Bluetooth connection is stalled and reset of the dongle is visible in dmesg
- The only way to recover is physical replug of the dongle and reconnect the Bluetooth
- The issue is visible again after another phone call end.
Device (s)
Raspberry Pi 4 Mod. B
System
Raspberry Pi reference 2024-11-19 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 891df1e21ed2b6099a2e6a13e26c91dea44b34d4, stage4
Nov 26 2024 12:52:28 Copyright (c) 2012 Broadcom version 2ae30f53898ae2f1ba77ff570a92991bedfb0398 (clean) (release) (start)
Linux raspberrypi 6.6.74+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.74-1+rpt1 (2025-01-27) aarch64 GNU/Linux
Logs
dmesg: [ 1402.305436] usb 1-1.2.3: USB disconnect, device number 10 [ 1402.629013] usb 1-1.2.3: new full-speed USB device number 12 using xhci_hcd [ 1402.834910] usb 1-1.2.3: New USB device found, idVendor=0a12, idProduct=0001, bcdDevice=88.91 [ 1402.834924] usb 1-1.2.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [ 1402.834929] usb 1-1.2.3: Product: CSR8510 A10 [ 1404.869019] Bluetooth: hci0: command 0x1001 tx timeout [ 1404.869052] Bluetooth: hci0: CSR: Local version failed (-110)
lsusb -t with all mentioned devices connected but I tested with one dongle connected at a time: /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 5000M |__ Port 4: Dev 4, If 0, Class=Hub, Driver=hub/4p, 5000M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M |__ Port 3: Dev 10, If 1, Class=Wireless, Driver=btusb, 12M |__ Port 3: Dev 10, If 0, Class=Wireless, Driver=btusb, 12M |__ Port 4: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M |__ Port 2: Dev 9, If 0, Class=Wireless, Driver=btusb, 12M |__ Port 2: Dev 9, If 1, Class=Wireless, Driver=btusb, 12M |__ Port 1: Dev 8, If 0, Class=Wireless, Driver=btusb, 12M |__ Port 1: Dev 8, If 1, Class=Wireless, Driver=btusb, 12M |__ Port 4: Dev 7, If 1, Class=Vendor Specific Class, Driver=, 480M |__ Port 4: Dev 7, If 0, Class=Vendor Specific Class, Driver=dvb_usb_rtl28xxu, 480M |__ Port 2: Dev 5, If 1, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 2: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 3: Dev 4, If 0, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 3: Dev 4, If 1, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 3: Dev 4, If 2, Class=Audio, Driver=snd-usb-audio, 12M |__ Port 3: Dev 4, If 3, Class=Human Interface Device, Driver=usbhid, 12M
Wireshark traces (collected by usbmon) with resets after flood of isochronous tranfers:
Frame 64029: 64 bytes on wire (512 bits), 64 bytes captured (512 bits) USB URB [Source: host] [Destination: 1.2.0] URB id: 0xffff584a86a093c0 URB type: URB_SUBMIT ('S') URB transfer type: URB_CONTROL (0x02) Endpoint: 0x00, Direction: OUT Device: 2 URB bus id: 1 Device setup request: relevant ('\0') Data: present ('\0') URB sec: 1740560749 URB usec: 171275 URB status: Operation now in progress (-EINPROGRESS) (-115) URB length [bytes]: 0 Data length [bytes]: 0 [Response in: 64030] Interval: 0 Start frame: 0 Copy of Transfer Flags: 0x00000000 Number of ISO descriptors: 0 [bInterfaceClass: Unknown (0xffff)] Setup Data bmRequestType: 0x23 bRequest: SET_FEATURE (0x03) wValue: 0x0004 wIndex: 2 wLength: 0
Frame 64030: 64 bytes on wire (512 bits), 64 bytes captured (512 bits) USB URB [Source: 1.2.0] [Destination: host] URB id: 0xffff584a86a093c0 URB type: URB_COMPLETE ('C') URB transfer type: URB_CONTROL (0x02) Endpoint: 0x00, Direction: OUT Device: 2 URB bus id: 1 Device setup request: not relevant ('-') Data: not present ('>') URB sec: 1740560749 URB usec: 171451 URB status: Success (0) URB length [bytes]: 0 Data length [bytes]: 0 [Request in: 64029] [Time from request: 0.000176000 seconds] Unused Setup Header Interval: 0 Start frame: 0 Copy of Transfer Flags: 0x00000000 Number of ISO descriptors: 0 [bInterfaceClass: Unknown (0xffff)]
Frame 64061: 64 bytes on wire (512 bits), 64 bytes captured (512 bits) USB URB [Source: host] [Destination: 1.2.0] URB id: 0xffff584a86a093c0 URB type: URB_SUBMIT ('S') URB transfer type: URB_CONTROL (0x02) Endpoint: 0x00, Direction: OUT Device: 2 URB bus id: 1 Device setup request: relevant ('\0') Data: present ('\0') URB sec: 1740560749 URB usec: 183640 URB status: Operation now in progress (-EINPROGRESS) (-115) URB length [bytes]: 0 Data length [bytes]: 0 [Response in: 64062] Interval: 0 Start frame: 0 Copy of Transfer Flags: 0x00000000 Number of ISO descriptors: 0 [bInterfaceClass: Unknown (0xffff)] Setup Data bmRequestType: 0x23 bRequest: CLEAR_FEATURE (0x01) wValue: 0x0014 wIndex: 2 wLength: 0
Frame 64062: 64 bytes on wire (512 bits), 64 bytes captured (512 bits) USB URB [Source: 1.2.0] [Destination: host] URB id: 0xffff584a86a093c0 URB type: URB_COMPLETE ('C') URB transfer type: URB_CONTROL (0x02) Endpoint: 0x00, Direction: OUT Device: 2 URB bus id: 1 Device setup request: not relevant ('-') Data: not present ('>') URB sec: 1740560749 URB usec: 184023 URB status: Success (0) URB length [bytes]: 0 Data length [bytes]: 0 [Request in: 64061] [Time from request: 0.000383000 seconds] Unused Setup Header Interval: 0 Start frame: 0 Copy of Transfer Flags: 0x00000000 Number of ISO descriptors: 0 [bInterfaceClass: Unknown (0xffff)]
Additional context
Issue reproducible only on Raspberry PI with external Bluetooth Dongle and surround enabled on CM106-like sound card.
It looks like related to the USB rather than Bluetooth.
Reproducible 100% times.
Pi5 is on the way so I will give it a try on the Pi5 still this week.
Tested it on the Pi5 and issue is not reproducible with CSR8510 dongle. It also works with built-in Bluetooth adapter.
Couldn't make Edimax BT8500 and TP-Link UB500 to work on Pi5.
dmsg for Edimax BT8500 after plug-in: [ 137.747867] usb 3-1.2: new full-speed USB device number 6 using xhci-hcd [ 137.877501] usb 3-1.2: New USB device found, idVendor=7392, idProduct=c611, bcdDevice= 2.00 [ 137.877509] usb 3-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 137.877512] usb 3-1.2: Product: Edimax Bluetooth Adapter [ 137.877515] usb 3-1.2: Manufacturer: Realtek [ 137.877517] usb 3-1.2: SerialNumber: 00E04C239987 [ 137.919409] Bluetooth: hci1: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761 [ 137.920395] Bluetooth: hci1: RTL: rom_version status=0 version=1 [ 137.920400] Bluetooth: hci1: RTL: loading rtl_bt/rtl8761bu_fw.bin [ 137.920505] Bluetooth: hci1: RTL: loading rtl_bt/rtl8761bu_config.bin [ 137.920561] Bluetooth: hci1: RTL: cfg_sz 6, total sz 30210 [ 140.175867] Bluetooth: hci1: command 0xfc20 tx timeout [ 140.175879] Bluetooth: hci1: RTL: Failed to generate devcoredump [ 140.175888] Bluetooth: hci1: RTL: download fw command failed (-110) [ 142.191867] Bluetooth: hci1: command tx timeout [ 150.319873] Bluetooth: hci1: RTL: RTL: Read reg16 failed (-110)
hciconfig up for Edimax BT8500: [ 212.528086] Bluetooth: hci1: command tx timeout [ 220.720158] Bluetooth: hci1: RTL: RTL: Read reg16 failed (-110)
dmesg for TP-Link UB500 after plugin:
[ 672.812647] usb 3-1.2: new full-speed USB device number 7 using xhci-hcd
[ 672.942212] usb 3-1.2: New USB device found, idVendor=2357, idProduct=0604, bcdDevice= 2.00
[ 672.942217] usb 3-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 672.942220] usb 3-1.2: Product: TP-Link Bluetooth USB Adapter
[ 672.942223] usb 3-1.2: Manufacturer:
[ 672.942225] usb 3-1.2: SerialNumber: DC6279372F5F
[ 672.986747] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[ 672.988683] Bluetooth: hci0: RTL: rom_version status=0 version=1
[ 672.988694] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_fw.bin
[ 672.988770] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_config.bin
[ 672.988810] Bluetooth: hci0: RTL: cfg_sz 6, total sz 30210
[ 675.248656] Bluetooth: hci0: command 0xfc20 tx timeout
[ 675.248668] Bluetooth: hci0: RTL: Failed to generate devcoredump
[ 675.248669] Bluetooth: hci0: RTL: download fw command failed (-110)
[ 677.264658] Bluetooth: hci0: command tx timeout
hciconfig up for TP-Link UB500: [ 725.712768] Bluetooth: hci0: command tx timeout [ 733.744794] Bluetooth: hci0: RTL: RTL: Read reg16 failed (-110)
Raspberry Pi reference 2024-11-19 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 891df1e21ed2b6099a2e6a13e26c91dea44b34d4, stage4
2024/09/23 14:02:56 Copyright (c) 2012 Broadcom version 26826259 (release) (embedded)
Linux raspberrypi 6.6.74+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.74-1+rpt1 (2025-01-27) aarch64 GNU/Linux