-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
esp32s3 pdm rx录音多通道有杂音,不正常。 (IDFGH-12707) #13694
Comments
PDM_RX.PCM 是6通道,16bit,16000hz。录音文件。i2s_channel_read读取回来的数据保存在psram,读取到2194304字节后,再把2194304字节写入到sd卡 PDM_RX.PCM。 可以排出是写sd卡速度问题导致的。 |
如果要用6通道的话,那就是配3个dins信号,第四个GPIO配置为-1即可 .dins = {
EXAMPLE_PDM_RX_DIN1_IO,
EXAMPLE_PDM_RX_DIN2_IO,
EXAMPLE_PDM_RX_DIN3_IO,
-1,
},
// ...
pdm_rx_cfg.slot_cfg.slot_mask = I2S_PDM_RX_LINE0_SLOT_RIGHT | I2S_PDM_RX_LINE0_SLOT_LEFT |
I2S_PDM_RX_LINE1_SLOT_RIGHT | I2S_PDM_RX_LINE1_SLOT_LEFT |
I2S_PDM_RX_LINE2_SLOT_RIGHT | I2S_PDM_RX_LINE2_SLOT_LEFT; |
8通道也试过也是有杂音。我是慢慢减少通道数忘记去掉io配置了。i |
有没有试过交换通道,比如其中4个通道没问题的话,试试接到其他4个通道上,需要测试下这两种情况:
如果排除了上述两种情况,那应该最后的影响因素确实是通道数量。由通道数量增加引起的杂音问题,可能的原因是:
|
请问WROOM-1-N16R8 的psram读写速度各是多少? wifi+tcp发送能比直接写psram快吗? 当初就是跑网络阻塞导致音频丢失,才考虑使用8m的psram |
如果用的是R8的模组的话,menuconfig启用Octal Mode PSRAM ( 带宽不够导致丢数据也只是一种假设,可以通过 不知道前面其他的几种假设有没有排除掉?个人认为因为通道增多导致的杂音有比较大可能是线上的信号有问题,比如时钟信号驱动能力不够、时钟采样边沿和数据没对齐、线上的信号反射(阻抗匹配)、时钟信号被串扰等问题。 |
Answers checklist.
General issue report
参考i2s_pdm_rx.c代码,修改gpio为:
#define EXAMPLE_PDM_RX_CLK_IO GPIO_NUM_19 // I2S PDM RX clock io number
#define EXAMPLE_PDM_RX_DIN_IO GPIO_NUM_20 // I2S PDM RX data in io number
#if CONFIG_IDF_TARGET_ESP32S3
#define EXAMPLE_PDM_RX_DIN1_IO GPIO_NUM_11 // I2S PDM RX data line1 in io number
#define EXAMPLE_PDM_RX_DIN2_IO GPIO_NUM_12 // I2S PDM RX data line2 in io number
#define EXAMPLE_PDM_RX_DIN3_IO GPIO_NUM_13 // I2S PDM RX data line3 in io number
#endif
gpio初始化:
#if CONFIG_IDF_TARGET_ESP32S3
// Only ESP32-S3 can support 4-line PDM RX
.dins = {
EXAMPLE_PDM_RX_DIN_IO,
EXAMPLE_PDM_RX_DIN_IO,
EXAMPLE_PDM_RX_DIN_IO,
EXAMPLE_PDM_RX_DIN_IO,
},
#else
.din = EXAMPLE_PDM_RX_DIN_IO,
#endif
通道配置:
#if CONFIG_IDF_TARGET_ESP32S3
// Enable all slots for example
pdm_rx_cfg.slot_cfg.slot_mode = I2S_SLOT_MODE_STEREO;
//pdm_rx_cfg.slot_cfg.slot_mask = I2S_PDM_LINE_SLOT_ALL;
pdm_rx_cfg.slot_cfg.slot_mask |= I2S_PDM_RX_LINE0_SLOT_RIGHT | I2S_PDM_RX_LINE0_SLOT_LEFT;
pdm_rx_cfg.slot_cfg.slot_mask |= I2S_PDM_RX_LINE1_SLOT_RIGHT | I2S_PDM_RX_LINE1_SLOT_LEFT;
#endif
pdm_rx_cfg.slot_cfg.slot_mask只要使用超过4通道,录音回来就不正常, 失真,杂音。
用的是同一个pmd立体声mic板子。
The text was updated successfully, but these errors were encountered: