espressif / esp-adf

Espressif Audio Development Framework
Other
1.54k stars 676 forks source link

ADF VoIP exmaple does not configure dual mic (AUD-4917) #1080

Closed ukfasthands closed 1 year ago

ukfasthands commented 1 year ago

Environment

Problem Description

The ESP32-S3-Korvo-2 board has 2 microphone inputs and 1 referenace input into the ADC. The AFE documentation states that the audio input format configuration should be total_ch_num=3, mic_num=2, ref_num=1

The VoIP exmaple in esp-adf\examples\protocols\voip seems to incorrectly configure the AFE. In esp-adf\examples\protocols\components\av_stream\av_stream.c, it uses the macro ALGORITHM_STREAM_CFG_DEFAULT to configure algorithm_stream_cfg_t algo_config structure in av_audio_enc_start(). This defaults the algo_config.mic_ch to 1.

This results in the AFE been configured as 1 mic and 1 aec referance channel. Is this correct?
My assumption would be that the mic_ch should be 2 to make use of the dual microphone on the ESP32-S3-Korvo-2 board? Does the AEC algorithums using the second microphone to imporve performace of the AEC?

ahhfzhang commented 1 year ago

Hi @ukfasthands,

Yes, our AEC uses 1 mic and 1 reference channel, AFE uses 2 mic for better voice wake-up performance, but 2 mic won't help the AEC algorithm.

br.

EdHoldsworth commented 1 year ago

Hi @ahhfzhang,

Thankyou for the quick reply. Will enabling both microphones improve noise cancellation, or is the only real benifit for the wake-up performance?

Regards

ahhfzhang commented 1 year ago

Hi @ukfasthands,

We don't recommend enabling both microphones for noise cancellation and yes it will only benifit for the wake-up performance.

br.