Skip to content

fix: backport priority DiPlay audio and connection fixes - #11

Merged
fython merged 1 commit into
mainfrom
fix/upstream-priority-reliability
Oct 14, 2026
Merged

fython merged 1 commit into
mainfrom
fix/upstream-priority-reliability

Conversation

@fython

@fython fython commented Oct 13, 2026

Copy link
Copy Markdown
Owner

CarPlay's 16/24 kHz Opus streams were counted on the 48 kHz PCM clock, busy audio decoders discarded packets after one 10 ms wait, and position-only media updates repeatedly published album bitmaps. This ports five high-priority DiPlay fixes to WheelPlay's receiver while retaining its browser audio/microphone routing and WebRTC video path.

Changes and upstream references

Change WheelPlay behavior DiPlay reference
Audio and microphone clocks Keep Opus PCM capture/decoding at 48 kHz, but advance microphone RTP timestamps and report /feedback at the negotiated 16/24/48 kHz clock. Decoded packet presentation times also use that RTP clock. AAC/LPCM keep their existing rates. #295, #547, audio-feedback portion of #644; commits 3868eea3, 6dbde48f, 817ff3fa
Audio decoder backpressure Drain output and retry the same compressed packet with a 100 ms input-wait budget. Video retains its 500 ms budget. Audio portion of #618 and #644; commits daffd2de, 7d974f42
MediaSession metadata Publish metadata only when its displayed fields, decoded artwork, or source identity change. Continue publishing playback progress/state and notification updates; clear metadata on disconnect. #162, commit 54e5611f
Wired VPN scope Allow only the runtime application package before establishing the tunnel. Scoping failures follow the existing cleanup transaction without an unrestricted retry; wireless listeners continue to operate independently. #168, commit ffc93062
Bluetooth compatibility Retain legacy BLUETOOTH/BLUETOOTH_ADMIN declarations on Android 12+ for MIUI 13 firmware that still checks them; retain BLUETOOTH_CONNECT. #673, commit 5fb5d875

Validation

  • Test the actual audio SETUP, encrypted UDP RTP, microphone configuration, and feedback clock across 16/24/48 kHz Opus, PCM, and AAC, including unsigned timestamp wrap.
  • Check metadata publication counts across progress, pause, browser/local routing, disconnect, source replacement, and asynchronous artwork decoding.
  • Exercise the real VPN attachment transaction with controlled Android boundaries on API 28 and 33, including rejected scoping, revoked consent, resource cleanup, and wireless reattachment.
  • Check audio input retry/draining, its 100 ms limit, cancellation, and Bluetooth manifest declarations.
  • All 495 shared/App unit tests passed. Android Lint reported no errors and the debug APK built successfully.

Physical phone/head-unit validation remains pending for negotiated audio clocks and MIUI firmware behavior.

Correct CarPlay audio clocks, retry decoder input under backpressure, deduplicate MediaSession metadata, scope the wired VPN to WheelPlay, and retain legacy Bluetooth permissions for MIUI.
@fython
fython merged commit 5c5b080 into main Oct 14, 2026
2 checks passed
@fython
fython deleted the fix/upstream-priority-reliability branch October 14, 2026 02:32
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