Skip to content

ROCK 4D Microphone Input Problems

In my ROCK 4D audio series, I left a note about how the differential microphone input currently does not appear to work, despite the DT seemingly being correct as of that series.

In particular, with arecord -f dat, you're going to produce a .wav file that's full of just 0xff. This indicates that we're not just struggling to pick up sound, we don't even pick up noise.

I currently suspect that either the mainline rockchip-sai driver is broken, or that the es8388 codec's driver (es8328.c) is broken (again). I already know that the driver deviates from the ES8388 (and, for that matter, ES8328) datasheet's register layout occasionally in unrelated ways. It's worth looking into whether there are related ways in which it deviates in as well, such as:

  • a digital ADC mute flag being set
  • PGA parameters being set wrong
  • the differential mux and other mux registers being set wrong

You will need:

  • ES8388 datasheet
  • ES8328 datasheet (check share.) to cross-reference
  • RK3576 TRM Part 1, specifically the SAI section
  • Radxa ROCK 4D schematic and board layout files
    • Note: mass production version linked here will differ in audio significantly from some of the pre-production boards Collabora has
  • a TRRS headset with microphone
  • Perseverance

Good ways to figure out what's going on is by dumping the codec registers. If that doesn't lead to any results, adding debugging to the SAI driver would be a good second step. Failing that, the difficult option is checking whether any digital data makes it to the SAI; one could do this by probing the tiny pins on the board, or by having an external codec module that is connected over the 40-pin header to a different SAI and is more easily probe-able.

Edited by Nicolas Frattaroli