esp-adf icon indicating copy to clipboard operation
esp-adf copied to clipboard

ESP ADF A2DP Sink and HFP example issue (AUD-6359)

Open RaresCon opened this issue 7 months ago • 1 comments

The A2DP Sink and HFP example present in the get-started directory, the codec is started in DECODE mode at line 390. From what I understand, it should be started in BOTH mode, to allow the I2S reader to read an I2S stream coming from the codec, decode it and then put the audio data in the Raw stream. Otherwise, the microphones would not be used by the codec. Am I missing something or not understanding the implemented flow?

Also, what is the purpose of esp_hf_client_outgoing_data_ready at line 248? It is just a way to let the Bluetooth service know that the Raw stream may have data to read?

RaresCon avatar May 20 '25 15:05 RaresCon

  1. Normally, BOTH mode is required to support both audio input and output. However, on some boards, the microphone does not go through the codec chip but instead uses ADC chip. So it can still work in DECODE mode. You can refer to the schematic to verify this in the code when using it.

  2. Yes, this function notifies the Bluetooth lower layer to send data.

Marcus-bot avatar Jul 17 '25 06:07 Marcus-bot