Skip to content

Bluetooth: btcentauri: headset audio (SCO, wideband speech, HRB voice) - #3461

Merged
RyanTheTide merged 4 commits into
aurora-silicon:mainfrom
m0d16l14n1:feat/btcentauri-audio
Nov 30, 2026
Merged

RyanTheTide merged 4 commits into
aurora-silicon:mainfrom
m0d16l14n1:feat/btcentauri-audio

Conversation

@m0d16l14n1

@m0d16l14n1 m0d16l14n1 commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

What: headset audio on the N1 Bluetooth. This adds SCO and LE Audio ISO rings, wideband speech, and voice setup on the HRB links the firmware reports with vendor link types, plus the factory Bluetooth address. Before this, a headset connected for A2DP only: HFP/HSP had no SCO path, the core's Enhanced Setup Synchronous Connection was rejected with status 0x11, and eSCO on HRB links failed. Both btcentauri and btcentauri_t6050 get the same changes. Stacked on #3458 (base feat/centauri-wifi-stats 625fd0f15687, needed for the shared-transport structures); this PR's own commits are the three listed under Details. This replaces the N1 test branch #3166 for this topic.
Tested: J815 (MacBook Air 15" M5) with this head's code: apple_centauri and btcentauri built from the N1 tester merge cded55efa713 and swapped live into the running j815/prtest-r8 (7b4bbe9) kernel (see Evidence), no centauri or Bluetooth words on the command line: PASS. hci0 used the DT's factory address and reported wideband speech. AirPods worked as a headset: picked as the sound input, the mic recorded speech over mSBC (air coding "Transparent Data"), and a recording played back through the AirPods. No HCI timeouts. btcentauri host tests: SCO, arena and scan suites with their negative controls, 22/22 Centauri runs. Regression: 0 SELinux denials (SELinux not built on this image), 0 failed units, 0 N1 driver errors, 0 WARN/BUG/Oops.
Risk: two-way door; every N1 board (shared transport through btcentauri, T6050 through btcentauri_t6050). Headsets that negotiated A2DP only before now also offer HFP/HSP. The voice route command after init is non-fatal: if the firmware refuses it, Bluetooth comes up as before without SCO.
Not yet: a T6050 board; LE Audio with an LC3 headset; CVSD narrowband (only mSBC was used); a J813 row; this branch tested on its own.

Details

Commits of this PR (on top of #3458):

  • Bluetooth: btcentauri: SCO and LE Audio, wideband speech, voice setup, and factory address: SCO rings 3/9 and LE Audio ISO rings 5/11 (H4 indicator framing), dropping a bad frame without halting the transport; HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED and HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN so the core uses Setup Synchronous Connection (0x0428); set_bdaddr (0xfc06); reset timeout diagnostics; RX cookie, lock scope and duplicate-filter fixes.
  • Bluetooth: btcentauri: support HRB synchronous voice connections and HCI voice routing: track HRB ACL handles; translate 0x0428/0x0429 to the extended 0xfdc7/0xfdf8 forms for those handles and restore the standard opcode in Command Status; normalize the 8-bit transparent voice setting to 0x0063 for mSBC; send the voice route (rings 3/9) after init; new tools/asahi/centauri-bt-sco-tests.py, registered in run-host-tests.py.
  • Bluetooth: btcentauri: keep HDR packet bits clear and normalize extended SCO events: keep bits 13:10 clear in the 24-bit packet-type mask (with them set, the remote refuses eSCO with 0x20); normalize vendor link types >= 0xf0 in the 0x03/0x04/0x2c events; guard zero SCO buffer metrics; sco_mtu/sco_pkts in debugfs; the voice section of centauri.rst.
Evidence

Tested tree: cded55efa713 = this branch + #3207, #3459, #3460 and the AWDL branch. This head differs from what was tested only in commit messages (two commits were squashed into the third one above, same tree). Modules swapped live into J815 7.3.0-aurora-j815-dev (j815/prtest-r8 7b4bbe9), command line console=tty0 user4k=on pcie_aspm=off idle=nop arm64.nowfxt plus the image's root/ESP words, apple_sep.xart_writes=0 apple_sep.provision_keybag=0 (removed from main, logged as unknown and ignored) and aurora.untested_commit=0 aurora.alphasleep=0 (stop the test initramfs setting its opt-ins, so the module defaults are what run); no centauri or Bluetooth words.

PASS bt address = the DT's factory address
PASS bt powered:  powered bondable ssp br/edr le secure-conn wide-band-speech cis-central
PASS bt wideband speech supported
PASS bt scan: 37 advertisements/inquiry results
PASS bt: no HCI timeouts this boot
INFO headset: source bluez_input.<addr>, SCO events 2, Air Coding Format: Transparent Data
INFO headset mic: 1245228 bytes recorded (sox missing: level not checked)

Level computed afterwards from that recording (7.06 s, 44.1 kHz stereo): per-second RMS -35 to -46 dBFS while talking, peaks about -15 dBFS, -90 dBFS in the silent first second. The headset run was in the same boot as the rest, with no module reload in between.

…, and data path

Add full station telemetry, channel survey, band capability reporting,
ethtool firmware version reporting, and data-path improvements:

- Parse firmware statistics reports using packed wire structures with
  compile-time layout checks: TX retries/failures and live RX/TX bitrates
  (TLV 0xf901), beacon RX/loss (TLV 0xf915), TX power and rate history
  (TLV 0xf920), per-chain RSSI and noise floor (TLV 0xf923), station
  noise (TLV 0xf908), and CCA channel survey (TLV 0xf903).
- Populate wiphy->fw_version from firmware version query and wire
  ethtool_ops.get_drvinfo = cfg80211_get_drvinfo on both T8142/T8152 and
  T6050 Wi-Fi netdevs so ethtool -i reports the running firmware version.
- Populate HT, VHT, and 2.4/5/6 GHz HE band capabilities, decode
  disconnect reason codes, apply initial firmware regulatory country hint,
  and avoid restricting channel widths absent from 20 MHz-only lists.
- Add NAPI GRO receive processing, TX in-flight cap with bypass watchdog,
  and TCP pacing shift; add Centauri driver documentation.

Signed-off-by: Nick <[email protected]>
…, and factory address

Bring both btcentauri and btcentauri_t6050 to full audio, voice, and
provisioning parity:

- Open and wire SCO (rings 3/9) and LE Audio ISO (rings 5/11, H4 packet
  indicator framing) TX/RX rings on both drivers, with resilient
  per-frame error dropping that does not halt the transport.
- Advertise HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED and set
  HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN so the core uses Setup
  Synchronous Connection (0x0428) instead of Enhanced Setup Synchronous
  Connection (0x043d), which N1 firmware rejects with status 0x11.
- Implement hdev->set_bdaddr (vendor opcode 0xfc06) and hdev->reset
  timeout diagnostics on both drivers.
- Fix RX cookie handling, lock scope, and duplicate-filter fallback on
  btcentauri, and update centauri-scan-tests.py mock structs for the new
  T6050 auxiliary TX queues.

Signed-off-by: Nick <[email protected]>
…HCI voice routing

Connections established via vendor HRB ACL setup (0xff7b) report a
vendor link type (0xf0/0xf1) in Connection Complete, and Beta rejects
standard Setup Synchronous Connection (0x0428) with status 0x11 on
those handles.

Add matching HRB synchronous voice support to both btcentauri.c and
btcentauri_t6050.c:

- Track active HRB ACL handles and peer addresses from Connection
  Complete until Disconnect Complete, HCI Reset, or device close.
- Translate HCI_OP_SETUP_SYNC_CONN (0x0428, 17 B) to 0xfdc7 (18 B with
  24-bit packet type) and HCI_OP_ACCEPT_SYNC_CONN_REQ (0x0429, 21 B)
  to 0xfdf8 (22 B) for tracked HRB links, restoring the standard
  opcode in the matching Command Status event.
- Normalize Linux's 8-bit transparent voice setting (0x0003) to 16-bit
  2's complement transparent (0x0063) for mSBC/WBS setup.
- Send 0xfe10 (voice route = HCI rings 3/9) during post-init as a
  non-fatal setup step and expose voice_hci_routed and HRB SCO
  counters in debugfs status.
- Add tools/asahi/centauri-bt-sco-tests.py covering handle tracking,
  command translation, voice setting normalization, Command Status
  restoration, T6050 constant parity, and negative controls.

Signed-off-by: Nick <[email protected]>
…ded SCO events

Extended Setup/Accept Synchronous Connection commands (0xfdc7/0xfdf8)
on N1 Beta take a 24-bit packet-type mask. With bits 13:10 (0x3c00)
set there, the remote rejects eSCO negotiation with Unsupported LMP
Parameter Value (0x20), seen on the J815 against AirPods. Keep bits
13:10 clear on CVSD, mSBC and LC3-24kHz calls in both btcentauri and
btcentauri_t6050.

Also normalize vendor link types >= 0xf0 across Connection Complete
(0x03), Connection Request (0x04) and Synchronous Connection Complete
(0x2c) events in both drivers, guard against zero SCO buffer metrics in
Read Buffer Size replies, expose sco_mtu/sco_pkts in debugfs status,
and document the voice setup (HRB voice routing, transparent voice
setting, extended synchronous connections). Extend the host tests and
their negative controls.

Signed-off-by: Nick <[email protected]>
@m0d16l14n1
m0d16l14n1 requested review from a team and DjDeveloperr as code owners November 28, 2026 01:48
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at 00428666: not ready yet

Check Detail
CI at head ok 20 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at 00428666
Conflicts ok none
PR text ok Risk: two-way · every N1 board (shared transport through btcentauri, T6050 through btcentaurit6050). Headsets that negotiated A2DP only before now also offer HFP/HSP. The voice route command after init is non-fatal: if the firmware refuses it, Bluetooth comes up as before without SCO.

Areas: area:gpu

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at 00428666

Blockers: none in code (note: stacked on #3458 — merge after #3458 lands and remaining queued KUnit CI jobs finish green; a T6050 smoke row is recommended for the btcentauri_t6050.c changes).

Checked: no Apple material, no AI attribution, no new chip/board/firmware gates, no cmdline hacks, human Signed-off-by, SCO/ISO RX and TX length bounds (skb->len + 1 > cen_aux_specs[2].footer for H4-prefixed ISO TX, packet_length > length checks on RX dropping malformed frames without halting transport), HRB sync command length validation, parity across btcentauri.c and btcentauri_t6050.c, J815 AirPods mSBC headset mic + playback hardware row PASS, 22/22 Centauri host tests, apple-build, host-tests, and pr-text green.

Evidence
  • Inspected the incremental diff (625fd0f1...00428666) across btcentauri.c, btcentauri_t6050.c, and host test suites (centauri-bt-sco-tests.py, centauri-bt-arena-tests.py, centauri-scan-tests.py).
  • Verified TX bounds in both btcentauri.c and btcentauri_t6050.c: ISO TX checks skb->len + 1 > cen_aux_specs[2].footer before writing H4 indicator byte at descriptor[16] and copying skb->len bytes to descriptor + 17; SCO TX validates skb->len == HCI_SCO_HDR_SIZE + skb->data[2] and <= cen_aux_specs[1].footer; HRB SETUP_SYNC_CONN / ACCEPT_SYNC_CONN_REQ validate exact command length before rewrite.
  • Verified RX paths (cen_receive_sco, cen_receive_iso) reject truncated/malformed frames and increment err_rx without stalling the ring.
  • Hardware row: J815 (cded55efa713, identical diff, default cmdline) PASS: hci0 factory BDADDR, wideband speech reported, AirPods HFP mSBC mic recording + playback working with 0 HCI timeouts; 22/22 host tests pass.
  • CI at 00428666: apple-build, host-tests, pr-text, KUnit ane-boot..spi-hid-apple PASS; remaining KUnit jobs queued.
  • Merge order: merge #3458 first.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train status at 00428666 (App approval and J815 row noted). Under the 6-point rule this still needs: (a) green KUnit; (b) a regression row on a second family, since the centauri N1 driver also runs on T6050 (K114s) and T8152 (J873g). We'll ask for a K114s smoke covering this stack; (c) the code-owner ping, done here: @DjDeveloperr, merge earliest 16:52 AEDT once (a) and (b) are in. Stacked on #3458: merges after it, in order. Revert: git revert -m 1 <merge>.

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 30, 2026
@chrisohearn

Copy link
Copy Markdown
Contributor

K114s (Mac17,13, 14-inch M5 Pro, T6050) at 0042866636a6, on top of #3458 625fd0f15687: PASS. One boot from the Backup slot, compared against the r3g Main kernel on the same Mac.

  • Build: release 7.3.0-17.v272-18-k114s-r3g-pr3461-ARCH. aurora-silicon/linux main 2094ccb2a036, plus the local K114s patches (none touch Centauri or btcentauri), plus the four commits of this stack (wifi: apple: centauri: station statistics, band capabilities, ethtool and data path #3458's one and this PR's three), cherry-picked cleanly with the same content. OS firmware 27.2. No Centauri or Bluetooth options on the command line. The centauri host suite passed 22/22, and the SCO tests passed with their negative controls.
  • Bluetooth: hci0 powered, and btmgmt info lists wide-band-speech; the same kernel without this stack does not. The only btcentauri line is HCI Enhanced Setup Synchronous Connection command is advertised, but not supported, as expected with the quirk. No HCI timeouts.
  • Headset: with AirPods Pro, headset-head-unit-msbc activated and bluez_input appeared.
    • An 8 s capture from it was all real signal: 128,000 frames at 16 kHz, RMS −24.0 dBFS.
    • The owner then spoke for a 14 s capture. It showed voice bursts at −20 to −26 dBFS against a −86 dBFS noise gate, and the owner heard the recording played back through the AirPods.
    • 0 Failure in Bluetooth audio transport lines this boot. Before this stack, every headset-profile open on this Mac failed that way.
    • Switching back to a2dp-sink (AAC) worked, and playback carried on.
  • Wi-Fi and regressions: Wi-Fi associated throughout (signal 100), including after the SCO test. 0 N1 warnings or errors in the kernel log. Against r3g on the same Mac:
    • no new failed units (system or user);
    • no new error-priority kernel lines;
    • no GPU events;
    • panel at 120 Hz;
    • camera, ALS, SEP/Touch ID and trackpad unchanged.
  • Not checked: CVSD narrowband, LE Audio (no LC3 headset here), call-length stability, Bluetooth across suspend, and a reload of the driver while running. The N1 can't be restarted from a loaded driver without a power cycle, so this used a reboot, not a module swap.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Nov 30, 2026
@chrisohearn

Copy link
Copy Markdown
Contributor

@RyanTheTide the K114s (T6050) smoke you asked for is in the row above: PASS at 0042866636a6 on #3458 625fd0f15687. It covers wideband speech, AirPods HFP over mSBC with owner-heard speech, 0 transport failures, Wi-Fi intact, and no regressions against our previous kernel.

Since then this stack has also been running as the daily kernel on this K114s, and its first ordinary boot passed the same comparison. A Teams call now switches the AirPods to the headset profile and back to A2DP automatically, with WirePlumber's headset autoswitch.

One side effect for the record: hci0 now comes up about 2 s after the desktop shell starts (7.8 s vs 5.6 s). On the first boot, Omarchy's bar showed Bluetooth off until the shell was restarted. I don't think it's a driver issue; I'll raise it on the Omarchy side if it recurs.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging under the 6-point rule (Ryan 09:29, permanent), at 00428666. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J815;btcentauri-only. (5) There's no blocking review. (6) Dj was pinged here 3845 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit b158a19 into aurora-silicon:main Nov 30, 2026
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants