Skip to content
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

Open
3 tasks done
crl6 opened this issue Apr 25, 2024 · 1 comment
Open
3 tasks done

esp32s3 pdm rx录音多通道有杂音,不正常。 (IDFGH-12707) #13694

crl6 opened this issue Apr 25, 2024 · 1 comment
Labels
Status: Opened Issue is new

Comments

@crl6
Copy link

crl6 commented Apr 25, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

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;

//pdm_rx_cfg.slot_cfg.slot_mask |= I2S_PDM_RX_LINE2_SLOT_RIGHT | I2S_PDM_RX_LINE2_SLOT_LEFT;
//pdm_rx_cfg.slot_cfg.slot_mask |= I2S_PDM_RX_LINE3_SLOT_RIGHT | I2S_PDM_RX_LINE3_SLOT_LEFT;

#endif

pdm_rx_cfg.slot_cfg.slot_mask只要使用超过4通道,录音回来就不正常, 失真,杂音。

用的是同一个pmd立体声mic板子。

@espressif-bot espressif-bot added the Status: Opened Issue is new label Apr 25, 2024
@github-actions github-actions bot changed the title esp32s3 pdm rx录音多通道有杂音,不正常。 esp32s3 pdm rx录音多通道有杂音,不正常。 (IDFGH-12707) Apr 25, 2024
@crl6
Copy link
Author

crl6 commented Apr 25, 2024

PDM_RX.PCM 是6通道,16bit,16000hz。录音文件。i2s_channel_read读取回来的数据保存在psram,读取到2194304字节后,再把2194304字节写入到sd卡 PDM_RX.PCM。 可以排出是写sd卡速度问题导致的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

2 participants