How to configure the audio server to use I2S1 as input

Chip model: SF32LB58
Board: sf32lb58-lcd_a128r32n1_a1_dsi

SDK version: latest from main branch

I2S microphone connected to I2S1, model: ICS43434

Modified based on the example\multimedia\audio\4pdm example

Modified proj.conf file as follows (no other changes):

Compilation error: “rt_device_set_i2s_dma_rx_callback” implementation not found:

According to the source code, this function doesn’t seem to be used, so I commented it out:

Compilation succeeded. After downloading and sending the recording command, the recording callback function is only entered once, which is abnormal:

Tried SDK V2.4.5 — the recording callback is entered stably, but the recorded data is all zeros (V2.4.5 doesn’t have the 4pdm example, so I used the record example instead):

Additionally, using the rt-device API to operate I2S1 can correctly read data:

I’ve been debugging for several days and still can’t find the root cause. Really need help.

Upvoted, waiting for the experts to answer

You can first implement it based on the driver and get I2S working, refer to example\rt_device\i2s\src.

If you want to use I2S through the audio_server.c interface, you need to configure this.

Do not use the I2S_MIC macro.

Disabling the I2S_MIC macro still doesn’t work. The rt_device driver has already been tested and can normally read recording data.

Here is the test code. Please check if there are any issues:

See here,

https://docs.sifli.com/projects/sdk/latest/sf32lb52x/middleware/multimedia.html

In audio_server.c, where the AUDIO_RX_USING_I2S macro is used, has the I2S master/slave mode configuration been updated to match the mode using the driver interface?

Also, which version are you using? Older versions might not have properly adapted AUDIO_RX_USING_I2S. Please compare and update the section using the AUDIO_RX_USING_I2S macro in audio_server.c from the main branch.

It’s working normally and retrieving data now, thank you so much!