Repository navigation
API DMIC
DMIC records from a digital microphone array through the same /dev/dsp driver as the analog microphone. One
frame holds numPerFrm samples of every microphone, interleaved. The API mirrors AI: set the format, enable the
device, enable the channel, then poll and get frames.
Typical call order: SetPubAttr, Enable, EnableChn, optional SetUserInfo / SetGain / EnableAec, then
loop on PollingFrame, GetFrame, ReleaseFrame; stop with DisableChn, Disable.
Status in OpenIMP: the functions are implemented for T30, T31, T40 and T41. T31, T40 and T41 have been run as an API round trip only; T30 is checked by static audit. There is no DMIC hardware proof yet (no test camera with a digital microphone, issue #131), so recorded audio quality, the AEC result and the gain effect are not verified on a real microphone array.
Limits: only device 0 and channel 0 exist; at most 4 microphones (T30: one); 16-bit mono sound mode with
chnCnt microphones; numPerFrm must be a whole number of 10 ms at the sample rate. Calls fail with -1.
Beyond the vendor (T40 and T41): Enable refuses with -1 when the audio kernel module was loaded without
dmic_enable=1 (module parameter, read from /sys/module/audio/parameters/dmic_enable). Without that parameter the
driver's DMIC ioctls dereference a route that does not exist and the kernel oopses, which the vendor library
does not guard against. Load the audio module with dmic_enable=1 on a camera that has a DMIC.
Status columns: T10 T20 T21 T23 T30 T31 T40 T41. As of 2026-10-26. Part of the API reference.
- Device and channel (6)
- Frames (3)
- Volume and gain (2)
- Echo cancellation (6)
Status symbols are those of the feature matrix (API coverage tables):
-
✅works, device-tested -
✅+works, device-tested, better than the vendor -
✅rtAPI round trip on device, no visible effect expected -
✅rworks: called by the streamer on fleet cameras of this SoC that passed the fleet soak -
✅○vendor no-op, OpenIMP matches that -
🔧himplemented, host tests only (no camera run yet) -
🔧areally connected per static audit, no device test tracked -
🔧+API round trip in QEMU, no camera -
⚠cvalue only stored and read back, nothing applied -
⚠sreturns 0 without any effect -
❌eexported but fails or has a known defect -
❌not exported by OpenIMP -
·function does not exist on this SoC (not in that SoC's vendor API; not a gap) -
?state not determined -
📋no OpenIMP build for this SoC yet (planned)
int IMP_DMIC_GetPubAttr(int dmicDevId, IMPDmicAttr *attr);
int IMP_DMIC_SetPubAttr(int dmicDevId, IMPDmicAttr *attr);Sets or reads the capture format (sample rate, bit width, sound mode, number of microphones chnCnt, samples per frame numPerFrm, queue length).
Returns: -1 for a device other than 0, a NULL attribute, a chnCnt of 0 or above the limit, a sample rate or frame length of 0 or less, a frame length that is not a multiple of 10 ms, or (Set) a device that is already enabled.
Set it before Enable.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_Enable(int dmicDevId);Opens the sound device, programs rate, format and number of microphones, and starts the digital microphone stream.
Returns: 0 on success and when already enabled. -1 for a device other than 0, an unsupported format (the sound mode must be mono, 16 bit), when /dev/dsp cannot be opened, or when the driver refuses the stream (no DMIC support built into the audio driver, or no DMIC wired).
On T40 and T41 also -1 when the audio module runs without dmic_enable=1 (see the module introduction).
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
Difference from the vendor library: The dmic_enable check on T40 and T41 does not exist in the vendor library.
See Beyond the Vendor: Behaviour that differs from the vendor (better or deviating on purpose).
int IMP_DMIC_Disable(int dmicDevId);Stops the channel if needed and closes the device.
Returns: 0 on success and when not enabled; -1 for a device other than 0.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_EnableChn(int dmicDevId, int dmicChnId);Starts the record thread that fills the frame queue; when the application falls behind, the oldest frame is dropped.
Returns: -1 for an invalid device or channel or when Enable was not called.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_DisableChn(int dmicDevId, int dmicChnId);Stops the record thread.
Returns: -1 for an invalid device or channel.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_GetChnParam(int dmicDevId, int dmicChnId, IMPDmicChnParam *chnParam);
int IMP_DMIC_SetChnParam(int dmicDevId, int dmicChnId, IMPDmicChnParam *chnParam);Sets or reads the channel parameter usrFrmDepth, the number of frames the application may hold at the same time.
Parameters
-
chnParam:IMPDmicChnParam; onlyusrFrmDepthis used.
Returns: 0 on success; -1 for an invalid device or channel or a NULL pointer. Set also fails for a depth below 2 or above the frame count from SetPubAttr, and after EnableChn. Get also fails before Enable.
Call Set between Enable and EnableChn. Get fills the whole structure with zeros before it writes the depth.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_PollingFrame(int dmicDevId, int dmicChnId, unsigned int timeout_ms);Waits until a frame is queued.
Parameters
-
timeout_ms: Maximum wait in milliseconds.
Returns: 0 when a frame is ready, -1 on timeout or when the channel is not running.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
Difference from the vendor library: The timeout is honoured. The vendor library always waits up to 5 seconds and returns 0.
int IMP_DMIC_GetFrame(int dmicDevId, int dmicChnId, IMPDmicChnFrame *chnFrm, IMPBlock block);Takes the oldest frame (all microphones interleaved in rawFrame; aecFrame holds the echo-cancelled signal when AEC is on, else it is zero).
Parameters
-
block:BLOCKwaits,NOBLOCKfails at once when no frame is queued.
Returns: -1 when no frame is available, the channel is not running, or an argument is invalid.
Give every frame back with ReleaseFrame.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
Difference from the vendor library: NOBLOCK with an empty queue returns -1; the vendor library may return stale data.
int IMP_DMIC_ReleaseFrame(int dmicDevId, int dmicChnId, IMPDmicChnFrame *chnFrm);Gives a frame back to the queue.
Returns: -1 when the frame does not belong to the queue or the channel is not running.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_GetVol(int dmicDevId, int dmicChnId, int *dmicVol);
int IMP_DMIC_SetVol(int dmicDevId, int dmicChnId, int dmicVol);Software volume, half decibels, -30 to 120, 60 = unity (the same curve as AI).
Returns: -1 for an invalid device or channel or NULL; values outside the range are clamped.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_GetGain(int dmicDevId, int dmicChnId, int *dmicGain);
int IMP_DMIC_SetGain(int dmicDevId, int dmicChnId, int dmicGain);Gain of the digital microphone in the codec, 0 to 31.
Returns: -1 when the device is not open, the driver rejects the value, or the arguments are invalid. Out of range values are clamped.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_SetUserInfo(int dmicDevId, int aecDmicId, int need_aec);Chooses which microphone of the array is used for echo cancellation and whether AEC is wanted.
Parameters
-
aecDmicId: Microphone index, 0 to 3. -
need_aec: Non-zero when echo cancellation will be used.
Returns: -1 for a device other than 0 or an index outside 0 to 3.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_GetFrameAndRef(int dmicDevId, int dmicChnId, IMPDmicChnFrame *chnFrm, IMPDmicFrame *ref, IMPBlock block);Takes the oldest frame together with the playback reference frame (silence when the driver supplied none for that block).
Returns: -1 when reference frames are not enabled (EnableAecRefFrame), no frame is available, or an argument is invalid.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_EnableAec(int dmicDevId, int dmicChnId, int aoDevId, int aoChId);Starts echo cancellation on the microphone chosen with SetUserInfo, using the driver's playback reference as far end.
Returns: 0 on success; also 0 (no change) when AEC or reference frames are already on. -1 when the device or channel is not running, the audio processing library cannot be loaded, or the reference cannot be enabled.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_DisableAec(int dmicDevId, int dmicChnId);Stops echo cancellation.
Returns: -1 when the device or channel is not running or AEC is not on.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_EnableAecRefFrame(int dmicDevId, int dmicChnId, int audioAoDevId, int aoChn);Delivers the playback reference with each frame for GetFrameAndRef.
Returns: -1 when the device or channel is not running, AEC is already on, or the driver cannot enable the reference.
SoC: only in the vendor API of T30, T31, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | ✅rt | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T31: apitest dmic 2026-10-27 .26 + QEMU T31: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
int IMP_DMIC_DisableAecRefFrame(int dmicDevId, int dmicChnId, int audioAoDevId, int aoChn);Stops the delivery of the playback reference frames started with EnableAecRefFrame.
Returns: 0 on success; -1 for an invalid device or channel, when the device or channel is not enabled, or when the reference delivery was not enabled.
The AO device and channel arguments are accepted and ignored.
SoC: only in the vendor API of T30, T40, T41
| T10 | T20 | T21 | T23 | T30 | T31 | T40 | T41 |
|---|---|---|---|---|---|---|---|
| · | · | · | · | 🔧a | · | ✅rt | ✅rt |
Tested (tool, date, camera, what was checked):
- T40: apitest dmic 2026-10-27 .184 + QEMU T40: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
- T41: apitest dmic 2026-10-27 .34 + QEMU T41: API round trip (argument validation, Set/Get, not-enabled paths), no DMIC hardware on the test board
Used by: raptor.
Open Ingenic camera stack
- Home
- Supported SoCs and Sensors
- Per-SoC Status
- Feature Matrix
- Architecture
- Building
- Installing and Switching
- Module Parameters
- Environment Variables
- Beyond the Vendor
- API reference
- Memory
- Troubleshooting
- Testing
- Test Pattern
- Performance
- Changelog
- Release Scheme
- Release Gates
- Live feature matrix
- Project board
Current: RC2 (v2026.10.25-rc2); RC3 in progress