-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32P4 I2S-TDM模式下,BCLK频率最大不超过6.66MHz,MCLK频率最大不超过20MHz; (IDFGH-13559) #14448
Comments
羡慕有P4的 |
APLL正在支持中~ P4的I2S时钟源在不支持APLL的情况下最高只能到40M(即XTAL频率),MCLK至少2分频,所以MCLK只能到20M。 需要尽快测试的话可以先尝试一下这个patch: |
打了补丁了,成功实现16位,16通道,48K采样,感谢 |
这个问题的修复已经提交了,审核中~ |
After patching, I still see:
|
Answers checklist.
IDF version.
ESP-IDF v5.3-dirty
Operating System used.
Windows
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
CMD
What is the expected behavior?
SP32P4 I2S-TDM模式下,设置48K采样率,16通道,16位数据,BCLK时钟应该为480001616=12,288,000Hz,实际上不论如何设置,BCLK时钟最大不超过6.66MHz
What is the actual behavior?
1、ESP32P4 I2S-TDM模式下,BCLK频率最大不超过6.66MHz,MCLK频率最大不超过20MHz;给MCLK以40MHz的外部时钟,BCLK频率也只会是6.66MHz,在这这个时钟下TDM无法支持48K,16比特,16通道采样,采样率大约只有26K;
2、降低位数,改为8位会导致BCLK也降低为3.33MHz,也就是采样率同样大约只有26K;
3、降低通道数改为8通道(连续的),位数为16位,BCLK反而可以达到6.66.采样率大约为48K
4、I2S_CLK_SRC_APLL不支持,会出现:esp_clk_tree: esp_clk_tree_src_get_freq_hz(82): freq shouldn't be 0
5、i2s_chan_config_t中dma_desc_num 默认值为6,dma_frame_num 默认值为240,不修改用默认值会提示dma_frame不能超过127,会自动修改为127
Steps to reproduce.
static i2s_chan_handle_t i2s_tdm_init(void)
{
i2s_chan_handle_t rx_chan = NULL;
ESP_LOGI(TAG, "Create I2S receive channel");
i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(0, I2S_ROLE_MASTER); // I2S_ROLE_SLAVE);
chan_cfg.dma_desc_num = 8;
chan_cfg.dma_frame_num = 120;
ESP_ERROR_CHECK_WITH_LINE(i2s_new_channel(&chan_cfg, NULL, &rx_chan));
}
i2s_channel_enable(rx_chan);
static int16_t i2s_readraw_buff[1024];
size_t bytes_read = 0;
i2s_channel_read(rx_chan, i2s_readraw_buff, sizeof(i2s_readraw_buff), &bytes_read,pdMS_TO_TICKS(1000));
...
Build or installation Logs.
No response
More Information.
No response
The text was updated successfully, but these errors were encountered: