espressif / esp-adf

Espressif Audio Development Framework
Other
1.55k stars 685 forks source link

esp_codec_dev I2S PHILIPS MODE (AUD-4610) #1002

Closed tore-espressif closed 1 year ago

tore-espressif commented 1 year ago

Environment

Problem Description

I can see that esp_codec_dev always reconfigures my I2S slot to MSB mode https://github.com/espressif/esp-adf/blob/master/components/esp_codec_dev/platform/audio_codec_data_i2s.c#L75 How do I configure it for PHILIPS mode?

TempoTian commented 1 year ago

You can change the mentioned line to i2s_std_slot_config_t slot_cfg = I2S_STD_PHILIPS_SLOT_DEFAULT_CONFIG(fs->bits_per_sample, fs->channel); and have a try. We will commit a new verison of esp_codec_dev it will add support for TDM mode, the default STD slot config will change to PHILIP mode.

tore-espressif commented 1 year ago

Thank you for the quick response @TempoTian !

Just an FYI: I am attaching my changes that I had to do to get playback working on ES8311 with various sampling frequencies: https://github.com/espressif/esp-adf/compare/master...tore-espressif:fix/esp_codec_dev

TempoTian commented 1 year ago

Thanks! Yes, you are right, add codec format setting is necessary, if use PHILIP mode, need not change to left align inside codec also.