Hi,
Background: We are using IDF v3.2.2 with ADF pipelines for https and fatfs input streaming to I2S audio output. The I2C for configuring the external codec IC is shared with multiple peripherals, so we used a mutex to regulate access to this bus without the audio glitching. This required a modification in ADF mutex definition (in components/audio_sal/include/audio_mutex.h using extern), and it has been well tested and works very smoothly.
Now: I found the esp_audio library offers many features that could speedup our development. Unfortunately, it seems that the library doesn't use the same mutex so the audio glitches when other components try to access the same I2C bus. Do you know if the esp_audio exposes its I2C mutex/functions? Or we could somehow "extern" it in our project code?
Thank you,
Christos
esp_audio library mutex
Re: esp_audio library mutex
Hi chr1st0s,
Which I2C APIS did you used ? `esp-idf/components/driver/i2c.c` or `components/esp_peripherals/driver/i2c_bus/i2c_bus.c`.
Which I2C APIS did you used ? `esp-idf/components/driver/i2c.c` or `components/esp_peripherals/driver/i2c_bus/i2c_bus.c`.
Re: esp_audio library mutex
Apologies for the delay, I didn't receive a notification for your reply.
We are using `esp-idf/components/driver/i2c.c` in our project. Do you believe that esp_audio uses i2c_bus module? In that case, we can expose the `_busLock` since we already have the esp-adf modified.
Thank you,
Christos
We are using `esp-idf/components/driver/i2c.c` in our project. Do you believe that esp_audio uses i2c_bus module? In that case, we can expose the `_busLock` since we already have the esp-adf modified.
Thank you,
Christos
Re: esp_audio library mutex
Hi Christos,
The esp_audio only one situation could use i2c via audio_hal for get/set volume,not i2c_bus. The configuration of the esp_audio by the `esp_audio_cfg_t`,
If you can ensure the `audio_hal_set_volume` and `audio_hal_get_volume` use same lock, I think could fix your problem.
The esp_audio only one situation could use i2c via audio_hal for get/set volume,not i2c_bus. The configuration of the esp_audio by the `esp_audio_cfg_t`,
Code: Select all
cfg.vol_handle = board_handle->audio_hal;
cfg.vol_set = (audio_volume_set)audio_hal_set_volume;
cfg.vol_get = (audio_volume_get)audio_hal_get_volume;
Re: esp_audio library mutex
Hi jason.mao,
I added some log messages in the audio lock hooks and confirmed that esp_audio uses the same mutex. Tuning the variables in application layer cancelled the major audio distortion out.
Thank you,
Christos.
I added some log messages in the audio lock hooks and confirmed that esp_audio uses the same mutex. Tuning the variables in application layer cancelled the major audio distortion out.
Thank you,
Christos.
Re: esp_audio library mutex
Hi Christos,
We have modified the codec driver for use i2c_bus interfaces. Please refer to a91879f1144984ae7df8e6a6743bd08ca4c182eb.
Thanks.
We have modified the codec driver for use i2c_bus interfaces. Please refer to a91879f1144984ae7df8e6a6743bd08ca4c182eb.
Thanks.
Who is online
Users browsing this forum: No registered users and 52 guests