Skip to content

v5.1

Choose a tag to compare

@nuxcodes nuxcodes released this 12 Mar 00:54
· 52 commits to master since this release

v5.1 — Glitch-free dock audio streaming

Fixes the periodic ~1-second audio pop/click when streaming via MFi docks (e.g. Onkyo ND-S1) that persisted through all v5.0 releases.

Root cause

The dock polls iAP button status every ~1 second via USB HID SET_REPORT. Each poll is processed by iap_handlepkt(), which contained a 64KB memmove with interrupts disabled to shift the RX buffer. At 54 MHz unboosted, this took 1–5ms — long enough to miss the 1ms USB SOF frame deadline. The USB controller found no ISO IN transfer armed, resulting in a silent NAK frame (audible as a pop/click). No IISOIXFR was generated because the endpoint was simply idle, not incomplete.

This also explains why cpu_boost=true masked the glitch: at ~200 MHz, the memmove completed within ~200µs, fitting inside the 1ms frame window.

Fix

  • Bounded memmove in iap_handlepkt(): only copy the remaining used bytes instead of the full 64KB buffer. For typical dock HID packets (~10 bytes), the IRQ-disabled window shrinks from 1–5ms to <1µs.
  • Removed iap_hid_extract_buttons() workaround from v5.1-alpha.0 that bypassed the iAP stack during streaming. Full iAP processing is restored — dock controls work through the standard Lingo 2/4 handlers with no custom parsing.

Result

  • Glitch-free USB audio streaming on MFi docks without CPU boost
  • Dock remote controls (play/pause, next/prev, volume) work during streaming
  • Stable MFi handshake (ARPEN + synchronous iAP init preserved)
  • HA-2SE DAC regression: passes