cancel
Showing results for 
Search instead for 
Did you mean: 

How to replace the Audio input device by SAI/I2S inside demo case 'Audio_playback_and_record' by STM32F769I-Discovery?

jesson
Associate II

Hi,

'Audio_playback_and_record default uses INPUT_DEVICE_DIGITAL_MIC as Audio input.

I'd like to replace the Audio input by SAI's I2S with an external mic slave device.

I add INPUT_DEVICE_AUDIO_I2S as new Audio output. And run the flow as INPUT_DEVICE_ANALOG_MIC (Line-In1) does, which uses SAI1_BlockB's SD to receive Data.

I use GPIO AF6/PF6,7,8,9 (SAI1_BlockB pins) to connect an external Audio Input Device.

Init according to SAI_I2S_STANDARD.

After done SAI init, I can monitor the SCL/FS comes from STM32(Master), and Data transmitted from external Audio Device (Slave). But STM32 can't start recording.

Does it has SAI DMA troubles? How should I do to fix this issue?

To trace the flow, I try to use INPUT_DEVICE_ANALOG_MIC (Line-In1) as Audio Input. It also can't start record.

It's appreciate if anyone can provide the solution for it. Thank you.

1 REPLY 1
jesson
Associate II

Hi,

When I use LineIn1 as Audio Input, SAI1_B's SD is connected between Codec-wm8994 and STM32F769. But no similar Codec call function as LienOut used before doing receive DMA. It seems the reason why LineIn can't start DMA.

When I use external I2S Audio Input device, then I don't need take care the code dec.

But I need add DMA IRQ Handler. Now it is workable. Although sound noisy.