Commit Graph

122 Commits

Author SHA1 Message Date
zxzxwu 17a202bc13 fix(usb): support LE ISO data over Bulk endpoints
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
2026-06-02 16:23:03 +08:00
Gilles Boccon-Gibod 808ea1abeb add basic support for SCO packets over USB 2026-05-22 18:02:47 +02:00
Gilles Boccon-Gibod f7cc6f6657 release command semaphore after timeout 2026-04-15 16:54:54 +02:00
Josh Wu 0ba9e5c317 Add read classic remote features support 2026-03-20 18:32:52 +08:00
Josh Wu 3d5648cdc3 Replace long if-else with match-case 2026-02-10 17:35:39 +08:00
Gilles Boccon-Gibod 3894b14467 better handling of complete/status events 2026-02-02 23:28:40 -08:00
Gilles Boccon-Gibod e62f947430 add workaround for some buggy controllers 2026-02-02 13:19:55 -08:00
Gilles Boccon-Gibod dcb8a4b607 Merge pull request #877 from google/gbg/hci-fixes
fix a few HCI types and make the bridge more robust
2026-02-02 11:19:28 -08:00
Gilles Boccon-Gibod 255f357975 resolve when bonded 2026-01-30 21:53:01 -08:00
Gilles Boccon-Gibod e63dc15ede fix handling of return parameters 2026-01-27 09:39:22 -08:00
Gilles Boccon-Gibod 85b78b46f8 Merge pull request #870 from antipatico/feat_AV53C1 2026-01-23 13:43:12 -08:00
Gilles Boccon-Gibod c577f17c99 add basic support for SCI 2026-01-20 15:32:55 -08:00
Gilles Boccon-Gibod 7e89c8a7f8 Merge pull request #868 from google/gbg/return-parameters
typing support for HCI commands return parameters
2026-01-19 09:49:15 -08:00
Gilles Boccon-Gibod 7523118581 typing surrport for HCI commands return parameters 2026-01-17 13:19:36 -08:00
Josh Wu 3d3acbb374 Add HCI Packets annotations and send_sco_sdu 2026-01-13 17:58:37 +08:00
Josh Wu 3f643de4c1 Ruff: Add and fix UP rules 2026-01-01 03:25:32 +08:00
Gilles Boccon-Gibod 4fb501a0ef use ruff for linting and import sorting 2025-12-29 19:28:45 -08:00
Josh Wu 456cb59b48 L2CAP: FCS Implementation 2025-12-01 16:10:45 +08:00
Gilles Boccon-Gibod aa1d7933da enhance serial port transport 2025-09-25 18:31:14 +02:00
khsiao-google b80b790dc1 Remove the word 'complete' from function name 2025-09-16 03:45:32 +00:00
khsiao-google dc93f32a9a Replace core.ConnectionParameters by Connection.Parameters in device.py 2025-09-08 02:00:49 +00:00
khsiao-google c720ad5fdc Add typing for host.py 2025-09-02 06:01:39 +00:00
Gilles Boccon-Gibod 7aba36302a use isort when formatting 2025-08-21 16:38:58 -07:00
Josh Wu 4a88e9a0cf Always log exception using logging.exception 2025-08-18 16:03:58 +08:00
khsiao-google 982aaeabc3 Support LE Subrating 2025-07-31 02:52:42 +00:00
khsiao-google 3d6c595c6e Merge branch 'google:main' into main 2025-07-16 05:22:43 +00:00
Gilles Boccon-Gibod 43a8cc37f8 add iso support to bench app 2025-07-07 13:03:19 +02:00
Josh Wu 0ab5b6c49a Migrate all HCI_Event to dataclasses 2025-06-25 17:07:22 +08:00
Josh Wu a0498af626 Dataclass-based HCI packets 2025-06-14 08:03:48 +08:00
Josh Wu 60e31884c8 HCI: Avoid patching __init__ 2025-06-09 22:08:18 +08:00
Josh Wu 8a0cd5d0d1 Replace deprecated typing aliases 2025-06-07 23:39:35 +08:00
Gilles Boccon-Gibod 088bcbed0b resolve merge conflicts 2025-05-04 11:31:15 -07:00
Gilles Boccon-Gibod fbd03ed4a5 fix a few timescale adjustments 2025-05-03 12:07:53 -07:00
Gilles Boccon-Gibod d3bd5a759f Revert "fix a few timescale adjustments"
This reverts commit dedef79bef.
2025-05-03 12:05:31 -07:00
Gilles Boccon-Gibod dedef79bef fix a few timescale adjustments 2025-05-03 12:00:34 -07:00
Josh Wu 55801bc2ca Make all event emitters async
* Also remove AbortableEventEmitter
2025-04-16 12:40:57 +08:00
Josh Wu a57cf13e2e Cleanup relative imports 2025-04-12 23:06:52 +08:00
Josh Wu 7569da37e4 Replace legacy transport and role constants 2025-04-09 19:04:02 +08:00
Josh Wu 637224d5bc Enum: PhysicalTransport, Role, AddressType 2025-03-09 23:34:01 +08:00
markus 4e35aba033 fix acl_packet_queue flush when controller does not support HCI_READ_BUFFER_SIZE_COMMAND 2025-02-22 08:37:12 +01:00
Josh Wu bac6f5baaf Fix mutable default values 2025-02-21 16:00:18 +08:00
Gilles Boccon-Gibod 73d2b54e30 make connection phy async 2025-02-17 19:24:18 -08:00
Josh Wu 7360a887d9 Receive Periodic Advertising Sync Transfer 2025-02-06 05:12:22 +08:00
zxzxwu 83ac70e426 Merge pull request #619 from zxzxwu/cs
Channel Sounding
2025-02-01 03:46:59 +08:00
Gilles Boccon-Gibod 6fe7931d7d rename drain event to flow 2025-01-24 11:05:02 -05:00
Gilles Boccon-Gibod cbd46adbcf add support for ACL and ISO HCI packet queues 2025-01-22 13:42:29 -05:00
Josh Wu 745e107849 Channel Sounding device handlers 2025-01-22 23:38:44 +08:00
Josh Wu 7324d322fe BIG 2024-12-20 13:45:12 +08:00
Gilles Boccon-Gibod d014acbe63 Merge pull request #597 from google/gbg/intel-hci
intel hci
2024-11-29 10:41:10 -08:00
Gilles Boccon-Gibod 9d3d5495ce only use __bytes__ when not argument is needed. 2024-11-23 15:56:14 -08:00