Skip to content

comma four: microphone pop fixes and audio quality investigation - #2454

Draft
sshane wants to merge 22 commits into
commaai:masterfrom
sshane:c4-mic-investigation
Draft

sshane wants to merge 22 commits into
commaai:masterfrom
sshane:c4-mic-investigation

Conversation

@sshane

@sshane sshane commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Comma four desk recordings exposed two microphone firmware defects: an uninitialized output buffer produces startup junk, and independent DFSDM/I2S clocks cause repeated 512-sample blocks about every 10.53 seconds. This initializes/clears the buffers and adds continuous clock matching with cubic interpolation and a startup fade.

This is a hackathon work-in-progress draft, including tools, listening reports and plots so we can document the investigation as we go. The muffled sound / weak upper-frequency music content is still unresolved, and the original driving/motion complaint has not been reproduced under normal on-road load.

Actual pop before/after

Startup
Repeated block

The fresh baseline repeats 512 samples at 10.521 s; the candidate does not. These are separate real acoustic recordings, not simulated distortion.

Quality investigation

The native digital transport passed a bit-exact 528,000-sample test through 22 kHz. The cubic resampler adds gradual high-frequency loss and residual distortion; it does not explain an abrupt cutoff by itself.

The built-in c4 speaker produced detectable tones through 22 kHz, but it has different acoustic/mechanical coupling than an external phone. The iPhone sweep recovers 16–17 kHz; 18–20 kHz remain close to the noise floor. The new music recording shows the same weak upper band. Raising file amplitude produces less than proportional recorded tone growth, so source/capture nonlinearity is another open question.

Same phone, source music and actual capture
Same phone, three tone levels

Validation and open work

  • Fresh-reset 300-second instrumented run: 28,127 output blocks, zero re-centering, repeats or capture overruns; max mic IRQ 531 µs against a 10.67 ms block period.
  • Final uninstrumented firmware through actual micd/loggerd with CPU load: 1,200 messages / 960,000 PCM samples matched the rlog byte-for-byte.
  • Saved final ARM build, intended MISRA checks and actual-C UBSan clock-offset simulations pass. New phone music and level captures have zero overruns.
  • Pending: normal on-road workload/motion validation, end-to-end latency, higher-quality interpolation, and separating external speaker response from mic/enclosure response. The companion openpilot PR covers native-rate capture and compressed logging; the firmware PR itself does not change micd or AAC.

Full investigation notebook · All plots · Embedded listening reports — download and open locally · Hackathon tools

Companion openpilot PR: commaai/openpilot#38967 — 48 kHz mono capture and one 48 kbps AAC encoder shared by qcamera and compressed rlog audio. Experimental EQ/denoise remains offline.

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