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

Aux input only redirect to speakers when sound card initialized with AUDIO_HAL_CODEC_MODE_LINE_IN (AUD-2419)

Open jujax opened this issue 5 years ago • 7 comments

Hello,

I try to use my ESP32-LyraT 4.3 to send sound to Bluetooth headset from line input. Actualy ESP-ADF library enable line input only when sound card is initialized with :

audio_hal_ctrl_codec(board_handle->audio_hal, AUDIO_HAL_CODEC_MODE_LINE_IN, AUDIO_HAL_CTRL_START);

with this mode, sound is redirected only to speakers or line output. Pipeline doesn't send sound to writer streams.

To bypass this limitation I use directly ES8388 driver library with this function located in es8388.h :

es8388_write_reg(ES8388_ADCCONTROL2, ADC_INPUT_LINPUT2_RINPUT2);

By the way, sound is really dirty without setting PGA gain to 0db :

es8388_write_reg(ES8388_ADCCONTROL1, 0x00); // value is 0xbb when card is init

It works very well with these modifications, and I create a github deposit to make an example. Maybe I disrespect some coding and github conventions (bad licensing for code, bad README.md), every improvements are welcome. And sorry for my english.

jujax avatar Oct 22 '20 08:10 jujax

If line_ in is used as input, setting the gain to 0 is correct.

Gaochenchang avatar Oct 27 '20 06:10 Gaochenchang

This topic has become inactive so I'm going to close the issue. Please reopen this if you have any questions or need any further assistance.

jason-mao avatar Feb 08 '22 06:02 jason-mao

The man is right. His error description is correct, and it needs to be fixed.

TAMHAN avatar Nov 17 '23 23:11 TAMHAN

Please reopen this issue as it is valid and prudent

TAMHAN avatar Nov 17 '23 23:11 TAMHAN

As @TAMHAN suggested, reopen it.

jason-mao avatar Apr 07 '24 09:04 jason-mao

Thank you, @jason-mao

TAMHAN avatar Apr 07 '24 10:04 TAMHAN

Hi, Thanks to @jujax 's exmple project I got my Lyrat 4.3 board working as well. The only issue in my case is extremely low volume at the paired bluetooth speaker. I spend hours looking for solutions with no luck at all. Would be great if someone can provide me some hint to fix it. Any suggestion is highly appreicated.

t36512 avatar Apr 21 '24 12:04 t36512