Skip to content

fix(usb): support LE ISO data over Bulk endpoints#932

Merged
zxzxwu merged 2 commits into
google:mainfrom
zxzxwu:usb-iso-bulk-workaround
Jun 4, 2026
Merged

fix(usb): support LE ISO data over Bulk endpoints#932
zxzxwu merged 2 commits into
google:mainfrom
zxzxwu:usb-iso-bulk-workaround

Conversation

@zxzxwu
Copy link
Copy Markdown
Collaborator

@zxzxwu zxzxwu commented May 25, 2026

Some USB Bluetooth controllers (like Intel BE200) transport LE ISO data over Bulk endpoints instead of Isochronous endpoints when Interface 1 alternate settings are not fully configured or supported for LE Audio.

This change:

  1. Adds a workaround in the host layer to intercept ACL packets using CIS/BIS handles on Bulk In, reconstructing them into ISO packets.
  2. Supports sending HCI ISO Data packets over the default Bulk Out endpoint in the USB transport layer.

This enables a full Bulk-only transport for LE Audio ISO on these controllers without requiring Interface 1 altsetting activation (+sco is not needed).

TAG=agy
CONV=8b9a01f7-32cb-4a83-9300-23c4b688d861

@zxzxwu zxzxwu requested a review from barbibulle May 25, 2026 10:05
@zxzxwu
Copy link
Copy Markdown
Collaborator Author

zxzxwu commented May 25, 2026

ISO can be transmitted now on Intel BE200 and ASUS BT-540, but there are still some problems (melformed?)

Fixed

@zxzxwu zxzxwu force-pushed the usb-iso-bulk-workaround branch 3 times, most recently from eed19b1 to 8cb66ca Compare May 25, 2026 11:35
@zxzxwu
Copy link
Copy Markdown
Collaborator Author

zxzxwu commented May 25, 2026

A problem is that vendors have different bulk interfaces definition, though very similar, and a major problem is whether to include timestamp. Here it proposed a self-adaptive solution to determine if timestamp is present.

@zxzxwu zxzxwu marked this pull request as ready for review May 26, 2026 11:28
This change implements a complete Bulk-only transport for LE Audio ISO
data (CIS/BIS) on USB controllers (like Intel BE200 and ASUSTek) that
send/expect ISO data over Bulk endpoints. It also improves the stability
and compatibility of periodic advertising sync on newer controllers.

Key Changes:
1. Host Layer Workaround (Bulk In):
   - Intercepts ACL packets using CIS/BIS handles on Bulk In.
   - Adaptively reconstructs them into HCI ISO Data packets:
     * For CIS (Unicast): Dynamically determines if the receiver controller
       includes a Timestamp in the ACL-wrapped payload (Intel does not,
       Realtek does) by checking the controller's company_identifier.
       It then correctly reconstructs either a 4-byte (TS_Flag = 0) or
       8-byte (TS_Flag = 1) ISO header.
     * For BIS (Broadcast): Reconstructs an 8-byte ISO header (TS_Flag = 1)
       as BIS packets always include the Timestamp.
     This vendor-adaptive approach dynamically supports both Unicast and
     Broadcast ISO across different controller hardware (Intel & Realtek) in
     all transmitter/receiver roles.
   - Cleans up the learned TS flags from memory when the link is disconnected.
2. USB Transport Layer (Bulk Out):
   - Adds support for sending HCI ISO Data packets over the default
     Bulk Out endpoint when Isochronous endpoints are not enabled.
3. LE Periodic Sync V2 Event Support:
   - Enables `HCI_LE_PERIODIC_ADVERTISING_SYNC_ESTABLISHED_V2_EVENT` in
     the LE event mask and implements its handler in Host. This supports
     periodic sync on BT 5.4 controllers (like Intel BE200) that use the
     V2 event.

This enables seamless LE Audio Broadcast/Unicast ISO receipt and
transmission on standard USB Bluetooth controllers without requiring
alternate interface activation (+sco is not needed).

TAG=agy
CONV=8b9a01f7-32cb-4a83-9300-23c4b688d861
@zxzxwu zxzxwu force-pushed the usb-iso-bulk-workaround branch from 8cb66ca to 17a202b Compare June 2, 2026 08:24
Copy link
Copy Markdown
Collaborator

@barbibulle barbibulle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Copy link
Copy Markdown
Collaborator

@barbibulle barbibulle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR mentions support for sending ISO packets as well ("2. USB Transport Layer (Bulk Out):

  • Adds support for sending HCI ISO Data packets over the default
    Bulk Out endpoint when Isochronous endpoints are not enabled.") but I don't see the corresponding code here. Are you submitting that in a separate PR?

This change adds the missing transport-side support for sending HCI ISO Data packets
over the default Bulk Out endpoint when Isochronous endpoints are not enabled.
- Handles HCI_ISO_DATA_PACKET (0x05) in both `usb` and `pyusb` transports.
- Adds unit tests to verify the routing behavior.

TAG=agy
CONV=5502c76b-b272-4e43-a0b9-425a23cf137e
@zxzxwu
Copy link
Copy Markdown
Collaborator Author

zxzxwu commented Jun 3, 2026

Somehow I removed it probably during rebase...

@zxzxwu zxzxwu merged commit 17bc556 into google:main Jun 4, 2026
59 checks passed
@zxzxwu zxzxwu deleted the usb-iso-bulk-workaround branch June 4, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants