Open remyhx opened 2 years ago
May I ask which target you're using? ESP32 or ESP32S3?
And yes, the latest update has some breaking changes on PDM mode. We did an all-round test and fixed some bugs of the slot sequence, the PDM RX result can be find in the API Reference (ESP32 or ESP32S3).
BTW, have you checked if the i2s_record example works well or has same issue? I'll look into this issue next week
Hi @L-KAYA , thanx for the quick response!
I wasn't aware of the example, but just took a look in it and it was very helpful. I build for the ESP32.
In the previous version with the mono issue for the right channel I read chunks of 1024 each, in the example that's 161024. When I change this value to 161024 it's ok. But because this record task is inside a task pinned to one core, it also takes a huge toll on stack size.
NB I disabled this part:
chan_cfg.dma_desc_num = 3;
chan_cfg.dma_frame_num = 512;
First impression gain looks better, but so is the background noise now also. I can get rid of it if I extend this 161024 sized buffer 5 and out of the task (in favor of task stack). But reading in little chunks seemed to also do the trick.
Oh, forgot to ask for the sample rate.
And according to your description, the noise might be produced by the incomplete data, which means the data might be lost, you can refer to the how-to-prevent-data-lost chapter to see how to avoid it.
Yesterday I updated to the new version of I2S_PDM.H(.C), because of the right channel mono issue. It seems now that this is solved, but the recording seems like a 2x speed. I had one time before, changing DSR was enough to change. But now it seems to not.
ESP-IDF v5.0-dev-4364-g36f49f361c
Microphone used is Vesper VM3011, PDM mode.
(I read 1024 bytes a a time)
Channel is enabled before reading:
And per reading:
Any idea?
The sound quality before this update was very good. Now I hear a lot of noise, hardware is not changed. Only problem was the MONO slot selection.