Closed Huyyuh2000 closed 2 years ago
@PilnyTomas Please help me. Thanks in advance.
Hi @Huyyuh2000, thanks for creating the issue. Let me understand some things:
Hi @PilnyTomas, I soldered all the pin header for each sensor by myself, I config sample rate is 16kHz, 16 bit depth and 1 channel so that 256kbps, I don't change anything, after recorded I thought It was ok so move to another part of my project. When I get back to compile everything, I meet this problem
How did you manage to set up 16 bit depth on the microphone? Can you please send a block diagram of the connection for the microphone + a photo from the bottom side of the board with the microphone?
Hi @PilnyTomas ,
About set up 16 bit depth, I config .bits_per_sample = i2s_bits_per_sample_t(I2S_SAMPLE_BITS) which I2S_SAMPLE_BITS
is defined as (16).
Here are all the things that you require: link
That is a setup in the ESP I2S module. My question was about the microphone. How do you know the microphone is outputting 16 bits per sample?
Sorry, I don't know, Is there any way to check the output of the microphone?
Usually, the first thing is to read the documentation for the chip you want to use. I don't know the chip you are using. Please read the documentation and let me know what setup the microphone expects.
The datasheet said that the microphone output is industry-standard 24-bit I²S interface.
Cool. Is the picture from the documentation, because there is depicted 32 bit per sample format. Try setting up 24 and 32 to see which one works.
Hello, I tried change bit per sample and other parameters that come with it but there is still having noise.
I found the reason why there a lot of noise was the L/R pin unconected. I watch some instructions and said that the sensor will auto set to ONLY_LEFT_CHANNEL
if the pin is unconected. Seem like by unconecting the pin to Vdd or GND cause the problem.
Hello, please how do you solve this problem, i connect L\R pin to ground, I’m not getting any audio
Hello, please how do you solve this problem, i connect L\R pin to ground, I’m not getting any audio
If You are using Arduino Framework with ESP32 then try connecting the L/R pin with GND and then set the input channel .channel_format = I2S_CHANNEL_FMT_ONLY_RIGHT,
Using this approach worked for me, try the Left channel if the Right one doesn't work
Hello, do you remember if changing the bits_x_sample from 16 to 24/32 made any difference for you?
I'm receiving audio samples without problems and the quality is good (using a very similar configuration of the I2S as the one shown in the 1st post), but the "volume" of the samples is extremely low: The 4 "veritical lines" are 4 claps that I did just in front of the mic.
I don't know how to make it "louder".... of course I can "scale up" the signal, but the quality then is horrible.
Ok I'll answer myself, just in case this serves someone else: The problem was that I had configured the I2S in 16 bit mode, and then I was only capturing the MSB of the bit stream. If I configured 24 bits, then the stream was garbled. The solution is to configure I2S in 32 bits mode and when reading, each sample takes 4 bytes and one must be discarted. Like this:
REAL_BYTES_X_SAMPLE=4;
i2s_read(I2S_NUM_0, (void*)dataOrig, buffSizeOrig, &bytesRead, portMAX_DELAY);
uint16_t samplesRead = bytesRead / REAL_BYTES_X_SAMPLE;
for (int i = 0; i < samplesRead; i++) {
byteIndex = i * REAL_BYTES_X_SAMPLE;
int32_t value = ((int32_t*)(dataOrig + byteIndex))[0]>>8;
}
Board
DOIT ESP32 Devkit V1, WEMOS LOLON32 Lite, Wemos D1 R32
Device Description
All hardware plain on breadboard
Hardware Configuration
INMP441_WS connected to D15 INMP441_SD connected to D13 INMP441_SCK connected to D2 INMP441_VDD connected to 3.3V Pin INMP441_GND connected to GND
Version
v2.0.2
IDE Name
Arduino IDE
Operating System
Windows 11 Home Single Language
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
115200
Description
Hello, I recorded .wav file using INMP441 and the data was able to process (noise was at acceptable level). At the moment, when I am recording for collect data, the noise is very high. I have change wire, dev kit and sensor but the result are the same. Here are the link that I save 2 recorded file. The low noise is before I meet the problem. I have read #3939 and follow some suggestion like soldering 10K between SD and GND but still not working.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide