espressif / esp-adf

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

ESP-ADF 2.6 plays audio on different channel on mono mp3 file with play_mp3_control example as compared to ESP-ADF 2.4's (AUD-5021) #1109

Open chewhs00 opened 10 months ago

chewhs00 commented 10 months ago

Environment

Problem Description

When running the example "play_mp3_control" from adf-2.4 and adf-2.6 on the same ESP32-LyraT 4.3 dev board where the channel format is 'I2S_CHANNEL_FMT_RIGHT_LEFT' as default, and play some mono mp3 files by converting the existing stereo mp3 files to mono, I noticed the following: On adf-2.4, only the right channel is played, while on adf-2.6, only the left channel is played. When running the above example with customized "my_board" running on ESP32S3, on adf-2.4, both channels are played regardless of channel format.

By changing to different channel formats while playing on ESP32-LyraT 4.3: adf-2.4:

adf-2.6:

Expected Behavior

I am not sure what the expected behavior should be given that the mp3 files used is mono, and with I2S_CHANNEL_FMT_RIGHT_LEFT, I thought it should play mono source on both channels, which it does on my custom ESP32S3 board. However, after updating to idf 5.1.1 and adf 2.6, only the left channel is played.

Actual Behavior

After updating to idf 5.1.1 and adf 2.6, only the left channel is played.

Goal

How do I setup I2S such that both channels get played if the mp3 source is mono?

jason-mao commented 10 months ago

@chewhs00 ADF v2.4 use IDF v4.4.0 and v2.6 use IDF v4.4.4. I remember some I2S related bugs had been fixed on v4.4.2. I think your problem is where the differences come from. Recommend adding a filter element after decoder like to suitable different channel music source.

chewhs00 commented 10 months ago

@chewhs00 ADF v2.4 use IDF v4.4.0 and v2.6 use IDF v4.4.4. I remember some I2S related bugs had been fixed on v4.4.2. I think your problem is where the differences come from. Recommend adding a filter element after decoder like to suitable different channel music source.

Is ADF v2.6 compatible with IDF 5.1? The readme file from ADF 2.6 gave me the impression that ESP-ADF Release/v2.6 is compatible with ESP-IDF Release/v5.1. By default, does the mono source from the mp3 get played at which channel? Both adf versions seems to play at different channels.