What is the difference between LINE_IN and ENCODE/DECODE codec modes and how to play sound from AUX

spacebiker
Posts: 11
Joined: Mon May 24, 2021 10:23 am

What is the difference between LINE_IN and ENCODE/DECODE codec modes and how to play sound from AUX

Postby spacebiker » Mon Jun 07, 2021 10:42 am

I'm trying to send audio from i2s (AUX in) to bluetooth headphones. I made a pipeline i2s->bt, But if i type

Code: Select all

audio_hal_ctrl_codec(board_handle->audio_hal, AUDIO_HAL_CODEC_MODE_DECODE, AUDIO_HAL_CTRL_START);
or

Code: Select all

AUDIO_HAL_CODEC_MODE_ENCODE
, i hear sound from microphones, but not from AUX_IN. But when I type

Code: Select all

AUDIO_HAL_CODEC_MODE_LINE_IN
i hear no sound at all. Moreover, it works with wire headphones(https://github.com/espressif/esp-adf/tr ... e_passthru), but doesn't for wireless. What am i doing wrong?

Full code: https://pastebin.com/AEmCqPuT

Thank you!

spacebiker
Posts: 11
Joined: Mon May 24, 2021 10:23 am

Re: What is the difference between LINE_IN and ENCODE/DECODE codec modes and how to play sound from AUX

Postby spacebiker » Thu Jun 10, 2021 3:15 pm

Problem is solved. You should add lines below:

Code: Select all

audio_hal_ctrl_codec(board_handle->audio_hal, AUDIO_HAL_CODEC_MODE_BOTH, AUDIO_HAL_CTRL_START); // instead of AUDIO_HAL_CODEC_LINE_IN
es8388_write_reg(ES8388_ADCCONTROL2, ADC_INPUT_LINPUT2_RINPUT2);
es8388_write_reg(ES8388_ADCCONTROL1, 0x00);

Who is online

Users browsing this forum: No registered users and 86 guests