Hello,
I’m working on an ADC-based audio capture use case on i.MX93 and would like to confirm whether continuous / scan mode is supported in the ADC driver, and whether our analysis is correct.
Goal:
Capture ADC samples at a stable 48 kHz to feed an audio processing pipeline.
Current situation
1) One-shot mode
Using imx93_adc_read_channel_conversion() the effective sampling rate is limited by CPU scheduling and context switches.
In practice, we only reach ~14 kHz, which is not suitable for audio.
2) IIO triggered buffer + hrtimer
We switched to an IIO triggered buffer with a kernel hrtimer trigger at 48 kHz (20.83 µs):
- hrtimer trigger @ 48 kHz
- trigger handler polls EOC
- samples pushed to IIO kfifo
- userspace reads /dev/iio:deviceX
Although the hrtimer is configured at 48 kHz, the effective capture rate is unstable (~47.xx kHz).
Our understanding is that this happens because:
- each trigger still starts a one-shot conversion
- conversion is retriggered every period
- software overhead and context switches occasionally miss deadlines
So the sampling rate is not strictly deterministic.
Hardware / RM analysis
According to the i.MX93 Reference Manual:
- ADC supports up to 1 MS/s
- Normal mode supports:
- One-shot
- Scan (continuous) conversions
This suggests that a continuous / scan mode could provide a stable 48 kHz rate, where:
- ADC is started once
- samples are generated continuously
- software only consumes data from a buffer (no per-sample retrigger)
Questions
- Is scan / continuous mode currently supported in the i.MX93 Linux ADC driver?
- If not supported:
- Is continuous / scan mode the recommended approach for stable audio-rate sampling (e.g. 48 kHz)?
- Are there any reference patches, examples, or guidelines from NXP?
Any feedback or confirmation would be very helpful.
Thanks in advance.