Skip to content

Commit 517b693

Browse files
xyzzy42holtmann
authored andcommitted
Bluetooth: btusb: Always fallback to alt 1 for WBS
When alt mode 6 is not available, fallback to the kernel <= 5.7 behavior of always using alt mode 1. Prior to kernel 5.8, btusb would always use alt mode 1 for WBS (Wide Band Speech aka mSBC aka transparent SCO). In commit baac627 ("Bluetooth: btusb: handle mSBC audio over USB Endpoints") this was changed to use alt mode 6, which is the recommended mode in the Bluetooth spec (Specifications of the Bluetooth System, v5.0, Vol 4.B §2.2.1). However, many if not most BT USB adapters do not support alt mode 6. In fact, I have been unable to find any which do. In kernel 5.8, this was changed to use alt mode 6, and if not available, use alt mode 0. But mode 0 has a zero byte max packet length and can not possibly work. It is just there as a zero-bandwidth dummy mode to work around a USB flaw that would prevent device enumeration if insufficient bandwidth were available for the lowest isoc mode supported. In effect, WBS was broken for all USB-BT adapters that do not support alt 6, which appears to nearly all of them. Then in commit 461f95f ("Bluetooth: btusb: USB alternate setting 1 for WBS") the 5.7 behavior was restored, but only for Realtek adapters. I've tested a Broadcom BRCM20702A and CSR 8510 adapter, both work with the 5.7 behavior and do not with the 5.8. So get rid of the Realtek specific flag and use the 5.7 behavior for all adapters as a fallback when alt 6 is not available. This was the kernel's behavior prior to 5.8 and I can find no adapters for which it is not correct. And even if there is an adapter for which this does not work, the current behavior would be to fall back to alt 0, which can not possibly work either, and so is no better. Signed-off-by: Trent Piepho <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 9a39a92 commit 517b693

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

drivers/bluetooth/btusb.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@ static const struct dmi_system_id btusb_needs_reset_resume_table[] = {
506506
#define BTUSB_HW_RESET_ACTIVE 12
507507
#define BTUSB_TX_WAIT_VND_EVT 13
508508
#define BTUSB_WAKEUP_DISABLE 14
509-
#define BTUSB_USE_ALT1_FOR_WBS 15
510509

511510
struct btusb_data {
512511
struct hci_dev *hdev;
@@ -1736,15 +1735,12 @@ static void btusb_work(struct work_struct *work)
17361735
new_alts = data->sco_num;
17371736
}
17381737
} else if (data->air_mode == HCI_NOTIFY_ENABLE_SCO_TRANSP) {
1739-
/* Check if Alt 6 is supported for Transparent audio */
1740-
if (btusb_find_altsetting(data, 6)) {
1741-
data->usb_alt6_packet_flow = true;
1742-
new_alts = 6;
1743-
} else if (test_bit(BTUSB_USE_ALT1_FOR_WBS, &data->flags)) {
1744-
new_alts = 1;
1745-
} else {
1746-
bt_dev_err(hdev, "Device does not support ALT setting 6");
1747-
}
1738+
/* Bluetooth USB spec recommends alt 6 (63 bytes), but
1739+
* many adapters do not support it. Alt 1 appears to
1740+
* work for all adapters that do not have alt 6, and
1741+
* which work with WBS at all.
1742+
*/
1743+
new_alts = btusb_find_altsetting(data, 6) ? 6 : 1;
17481744
}
17491745

17501746
if (btusb_switch_alt_setting(hdev, new_alts) < 0)
@@ -4548,10 +4544,6 @@ static int btusb_probe(struct usb_interface *intf,
45484544
* (DEVICE_REMOTE_WAKEUP)
45494545
*/
45504546
set_bit(BTUSB_WAKEUP_DISABLE, &data->flags);
4551-
if (btusb_find_altsetting(data, 1))
4552-
set_bit(BTUSB_USE_ALT1_FOR_WBS, &data->flags);
4553-
else
4554-
bt_dev_err(hdev, "Device does not support ALT setting 1");
45554547
}
45564548

45574549
if (!reset)

0 commit comments

Comments
 (0)