Skip to content

Experimental direct Android Auto audio over USB - #7

Draft
mbalous wants to merge 10 commits into
mainfrom
feature/usb-direct-audio
Draft

mbalous wants to merge 10 commits into
mainfrom
feature/usb-direct-audio

Conversation

@mbalous

@mbalous mbalous commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • USB sessions use direct Android Auto PCM only. A route, PCM or protocol failure stops/refuses the USB session and blocks retries until the service is restarted; there is no USB Bluetooth-media or legacy Browser-source fallback. Wireless Bluetooth media and factory Bluetooth hands-free calls remain separate.
  • Add the 16-kHz mono system-audio sink, keep guidance on the native prompt route rather than mixing it into music, open the prompt PCM on demand, retain short prompts across STOP, and clear queued audio on session end.
  • Bound playback queues, trim accumulated music to 200 ms when the media route is granted, pace ACKs by per-stream mixer dequeue/discard progress, and log ALSA underruns. ACKs are forced after one second if progress stalls; dequeue can precede physical playback by the worker's in-flight block.
  • Add focused fake-phone, mixer, routing, ACK lifecycle and failure-path tests.
  • Keep the guidance route until ALSA reports the prompt tail played; wait for the full vMOST preflight window without blocking retries on a user-requested stop.

Status and limitations

Draft; incomplete and not verified on the target car. A previous deployment of this branch produced no audio. The code still attempts ALSA entertainment/connection 0x315 and carplay_alt/0x31a without firmware detection. Jiraiya43/EntryNav2-Android-Auto#143 reports that pairing audible on an X1 F48, but it does not establish compatibility with the target EntryNav2. A table response, route grant or PCM open does not prove audible output. Supra's QNX 0x1d0 and A2I endpoint cannot be assumed to map to those Linux interfaces.

Remaining implementation work: verify and gate the target profile; support simultaneous media/navigation focus and native navigation-volume semantics; validate and correct long-term drift; handle audio-triggered HMI transitions; establish mic/focus compatibility. The current prompt path switches between routes and is not equivalent to upstream's simultaneous routing. This PR must not be considered full Supra audio parity.

Verification

CI passed on cf1663a: style and PC tests, PC sanitizers, and the ARM link-only SDK build. The latest fixes were not built or tested locally at the user's request. Added tests cover system discovery, ACK progress/timeout/restarts, bounded queues and trimming, short prompts, missing prompt PCM, route cleanup and refusal without fallback. Parked-car results are pending.

Checking the ALSA devices and vMOST route IDs on the car

With the car parked, SSH into the head unit. Run the matching ARM evo-check from the directory where you copied it; it is a development tool and is not installed with the service.

  1. Run ./evo-check --context. Record the firmware (/etc/version) and inspect /etc/asound.conf and /proc/asound/pcm. The branch expects entertainment (48 kHz S16LE stereo) for music/system audio and carplay_alt (48 kHz S16LE mono) for guidance. Check the ALSA configuration, including any files it loads, for those PCM names; /proc/asound/pcm lists kernel devices, not necessarily the configured ALSA aliases.
  2. Run ./evo-check --audio-routes with Android Auto stopped to capture a baseline. Start wired Android Auto and run it while playing music (look for route 0x0315 status 0), then repeat during a navigation prompt (look for route 0x031a status 0; a short prompt may be too brief to sample). Repeat after Stop/unplug and check that any route claimed by the service was released. The command only reads the ConnectionMaster table. An ID missing from the idle table does not mean the head unit cannot build it.
  3. Enable Keep logs and compare the results with /var/local/data/AA/service.log. Look for [AudioRoute] grant/release messages, [AudioOutput] open/configuration/write errors, and audio media(ch9) / audio guidance(ch8) messages. If the read-only probe misses a brief prompt or cannot run during playback, use the service log for route timing. Verify music and guidance are actually audible through the speakers; neither a route grant nor an ALSA open proves that. Redact network details and vehicle identifiers before sharing diagnostic output.

Before hardware acceptance

  • Identify the target firmware and native ALSA/source/connection pairing, and gate unknown variants.
  • With the car parked, verify audible music, volume and mute, radio and concurrent guidance, Assistant/mic and screen retention, HFP calls and resume, source changes, and Stop/unplug cleanup.

mbalous and others added 10 commits December 3, 2026 01:04
Add direct USB playback, native route ownership, and Bluetooth fallback. The candidate audio routes require verification on the target head unit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mbalous
mbalous force-pushed the feature/usb-direct-audio branch from cf1663a to ab6daac Compare December 3, 2026 00:14
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.

1 participant