kopia lustrzana https://github.com/espressif/esp-idf
i2s: fixed tdm mclk doubled issue
Closes: https://github.com/espressif/esp-idf/issues/10196pull/10391/head
rodzic
71968a4856
commit
22531d2a9f
|
@ -40,14 +40,12 @@ static esp_err_t i2s_tdm_calculate_clock(i2s_chan_handle_t handle, const i2s_tdm
|
||||||
clk_info->bclk = rate * handle->total_slot * slot_bits;
|
clk_info->bclk = rate * handle->total_slot * slot_bits;
|
||||||
clk_info->mclk = rate * clk_cfg->mclk_multiple;
|
clk_info->mclk = rate * clk_cfg->mclk_multiple;
|
||||||
clk_info->bclk_div = clk_info->mclk / clk_info->bclk;
|
clk_info->bclk_div = clk_info->mclk / clk_info->bclk;
|
||||||
/* While RECEIVING multiple slots, the data will go wrong if the bclk_div is euqal or smaller than 2 */
|
/* While RECEIVING multiple slots, the data will go wrong if the bclk_div is equal or smaller than 2 */
|
||||||
do {
|
if (clk_info->bclk_div <= 2) {
|
||||||
clk_info->mclk *= 2;
|
clk_info->bclk_div = 3;
|
||||||
clk_info->bclk_div = clk_info->mclk / clk_info->bclk;
|
clk_info->mclk = clk_info->bclk * clk_info->bclk_div;
|
||||||
if (clk_info->bclk_div <= 2) {
|
ESP_LOGW(TAG, "the current mclk multiple is too small, adjust the mclk multiple to %"PRIu32, clk_info->mclk / rate);
|
||||||
ESP_LOGW(TAG, "the current mclk multiple is too small, adjust the mclk multiple to %"PRIu32, clk_info->mclk / rate);
|
}
|
||||||
}
|
|
||||||
} while (clk_info->bclk_div <= 2);
|
|
||||||
} else {
|
} else {
|
||||||
if (clk_cfg->bclk_div < 8) {
|
if (clk_cfg->bclk_div < 8) {
|
||||||
ESP_LOGW(TAG, "the current bclk division is too small, adjust the bclk division to 8");
|
ESP_LOGW(TAG, "the current bclk division is too small, adjust the bclk division to 8");
|
||||||
|
|
Ładowanie…
Reference in New Issue