streams-i2s-i2s does not work with 16 bits #186
-
Hi, I tried Without changing pins I then tried streams-i2s-i2s example found in Arduino IDE and adjusted the pins, but it seems not to work, the mic is not forwarded to the DAC PCM102, I hear only noise at the speakers. /**
#include "AudioTools.h" uint16_t sample_rate=44100; // Arduino Setup // start I2S in // start I2S out Serial.println("I2S started..."); // Arduino loop - copy sound to out |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
This should work - though I and most others usually use the 1 port approach with sharing the ws and bck pins (see https://www.youtube.com/watch?v=D0EUDRo4Mx0) I suggest to split your problem up and that you test the input and output separately with these settings to figure out where the issue is using
|
Beta Was this translation helpful? Give feedback.
-
Did you really use the exact same I2S definitions in both of your tests like in the copy example ? Yes I checked it and tried it again, I have only noise no sound of the mic and a little noise every time the Serial.print is sended. I can use any pins for I2S right? starting I2S... |
Beta Was this translation helpful? Give feedback.
-
Hi Phil, After more than 1 month I still not get it working with your library, with micropython it took me 1h to do it. With your library the speaker produces some noise but not the sound captured by the I2S mic. What can I do to solve this? My project's purpose is to forward I2C sound captured by the INMP441 mic to the DAC MAX98357A try to avoid oscillation and add a digital volume control and a led indicator that indicates when someone is speaking. Is it normal that in both configurations config_in.is_master = true;? I would expect both devices are slaves and ESP32 is master? Can you help to solve this please? In micropython this works while True:
Below is what is printed in the serial montior Thanks for your help in advance! starting I2S... |
Beta Was this translation helpful? Give feedback.
-
I noticed that this microphone does not always provide proper data with 16 bits, so I suggest that you try to change the bits per sample to 32 both on the input and output side and I am surprised that you did not catch this when you tested the input. You can reproduce the issue if you display the 16 bit data as CSV. I am getting proper values on channel 0, but invalid values (instead of 0) on channel 1: this is creating the noise!
If you want to stick with 16bits you can use the ConverterFillLeftAndRight as follows:
This copies the values from channel 0 to channel1, so the invalid values are overwritten. But please double check that with your pin assignments the same channel is filled with the proper data! It is also a good idea to reduce the sample rate as you did in the Python example. ps. your microphone test to CSV was most likely also done with 32 bits.... |
Beta Was this translation helpful? Give feedback.
-
Good news, when I change from sample_rate = 44100 to sample_rate = 16000 it works fine, with bits_per_sample 16 or 32, but the sound is very quiet.
Will try to increase the volume now.
Thanks!
Van: Phil Schatzmann ***@***.***>
Verzonden: vrijdag 27 mei 2022 10:13
Aan: pschatzmann/arduino-audio-tools ***@***.***>
CC: wimverlindensa ***@***.***>; Author ***@***.***>
Onderwerp: Re: [pschatzmann/arduino-audio-tools] streams-i2s-i2s not works (Discussion #186)
I noticed that this microphone does not always provide proper data with 16 bits, so I suggest that you try to change the bits per sample to 32 both on the input and output side.
You can reproduce the issue if you display the 16 bit data as CSV.
It is also a good idea to reduce the sample rate as you did in the Python example.
And do not forget to change the log level to Warning if you see that the copy is working...
—
Reply to this email directly, view it on GitHub <#186 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AHHQX7AFSM3HOA4FA7JNVNLVMB7YTANCNFSM5UY4CMPQ> .
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
I noticed that this microphone does not always provide proper data with 16 bits, so I suggest that you try to change the bits per sample to 32 both on the input and output side and I am surprised that you did not catch this when you tested the input.
You can reproduce the issue if you display the 16 bit data as CSV. I am getting proper values on channel 0, but invalid values (instead of 0) on channel 1: this is creating the noise!