I2S MEMS SPH0645 Microphone - Volume way too low

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
RickTracer
 
Posts: 5
Joined: Tue May 23, 2017 3:39 am

I2S MEMS SPH0645 Microphone - Volume way too low

Post by RickTracer »

Hi, I recently bought the SPH0645 I2S MEMS microphone breakout and have hooked it up to a Raspberry Pi 3. I followed the tutorial but at the final step of recording rather than seeing a nice high volume indication I'm getting between 3 and 7 %. When I play back the recorded file I have to turn the speakers way up to hear anything.

Any guidance to increase the volume? There's no volume control in ALSAMIXER by default, I did try a bunch of stuff from Google on "Soft Vol" and "Mic Boost" and at one point had volume controls showing in ALSAMIXER but nothing actually changed anything and not sure that it was configured correctly.

I have 2 modules and both give the same, tried on 2 different Pi 3's as well as a clean Raspbian image.

Thanks!

User avatar
dlleigh
 
Posts: 208
Joined: Wed Jan 30, 2013 8:08 pm

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by dlleigh »

Look at the audio port on the bottom to see if it might be clogged. It's small so you might want to use magnification and a good light.

What voltage are you powering the microphone board with?

User avatar
RickTracer
 
Posts: 5
Joined: Tue May 23, 2017 3:39 am

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by RickTracer »

Hi, thanks for responding. Port is clear and I've 2 brand new units, tried both with the same result, on 2 separate Pi 3's and with 3 images (1 older Raspbian, 1 clean Raspbian, 1 Google AIY project image).

It's powered by the 3v3 pin on the Pi, which in turn I've powered from a (plugged in) laptop as well as an iPad USB charger.

I bought these as I understand they're the same MEMS microphone used in the Google AIY Voice Kit. Wiring it direct to the Pi running the AIY Voice Kit (with the hat removed) gave the same results. Trying to wire directly to the Mic input (https://www.element14.com/community/ser ... ematic.png) on the AIY Voice Kit HAT results in a very crackly noisy record (and volume on the arecord shows 50% constant).
Plugging the Google Microphone board directly to the Pi in the same configuration as the SPH0645 breakout also results in the same low volume.

So hardware wise it seems to be ok, just something needs to boost the recording volume somehow...

User avatar
meetri
 
Posts: 1
Joined: Sat Oct 24, 2015 2:34 am

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by meetri »

i'm having the same problem. When gathering voltage details on the audio stream coming from this mic, i read consistent high numbers for the min and max values.

when the room is quiet i get values like min: 63830 - max: 63850 ( 16 bit values )

Are you getting similar values? Also the audio peaks out really easy too. Any suggestions on what I can do?

Overall, I am getting audio out, it's just quiet and peaks out easy.

User avatar
adafruit2
 
Posts: 21533
Joined: Fri Mar 11, 2005 7:36 pm

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by adafruit2 »

the guide we have right now is hand-adding i2s mic support, and its cribbed from another source. it could be we're dropping significant bits. we *could* change the code to bump the volume in th driver but its a little tacky :)

if google+pi foundation added support for the AIY kit, they probably did a better job and it doesn't require compiling. but the docs for AIY are not very detailed... :/
https://aiyprojects.withgoogle.com

does anyone in this thread happen to have an AIY kit?

User avatar
rockman55
 
Posts: 100
Joined: Tue Apr 14, 2015 6:17 pm

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by rockman55 »

I have an AIY kit and also have just purchased two of th i2s MEMS SPH0645 Mic's. I have the same low volume recording as mentioned by the other users. Any help on this problem would be appreciated.

User avatar
adafruit2
 
Posts: 21533
Joined: Fri Mar 11, 2005 7:36 pm

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by adafruit2 »

try installing the aiy kit and see if the arecord is still quiet?

User avatar
rockman55
 
Posts: 100
Joined: Tue Apr 14, 2015 6:17 pm

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by rockman55 »

I have the kit that came with my subscription of MagPi and the entire kit is built. I can take the SD card that I made for the i2s MIC and install it with the AIY kit. So should the AIY kit work with the software used for the Adafruit i2s MEMS mic?

User avatar
adafruit2
 
Posts: 21533
Joined: Fri Mar 11, 2005 7:36 pm

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by adafruit2 »

no the other way around, the AIY pi should have the driver for the i2s mic installed

User avatar
hystrix
 
Posts: 8
Joined: Sat Nov 19, 2016 4:11 am

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by hystrix »

Did anyone solve this low volume issue? I also have the SPH0645 I2S MEMS microphone breakout, and cannot get the recording volume very high at all.

User avatar
maby
 
Posts: 8
Joined: Tue Jul 18, 2017 6:02 am

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by maby »

Can I add my name to this list? I've plugged up an Adafruit I2S microphone to a RPi and the audio quality is fine, but the level is very low - with no obvious way of turning it up - has anyone made any progress with it yet? I really don't have the time to learn I2S kernel programming from scratch in order to work out how to fix it which would be a shame since it seems to be a good option.

User avatar
RickTracer
 
Posts: 5
Joined: Tue May 23, 2017 3:39 am

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by RickTracer »

Ok, I think I have it licked after much on and off trying!

The solution comes from https://www.raspberrypi.org/forums/view ... 71#p607371 solution dated Tue Sep 02, 2014 6:51 pm but hopefully I can help the newbie a bit better with all steps (adjusting the volume in mixer and changing the arecord options to use the soft volume device).

First you need to edit your alsa configuration file

Code: Select all

sudo nano ~/.asoundrc
asoundrc.txt
(1.47 KiB) Downloaded 1166 times
Update it like the file attached here which is also repeated at the bottom of this post. What this does is add in a reference to your I2S Mic and then create a software mixer.

Once you've done that you then have to use the alsa mixer to turn up the volume :

Code: Select all

alsamixer
F6 and select your I2S mic "snd_rpi_simple_card"
F4 to set the capture volume
Arrow up until about 50% (if you do too much and the recording hits MAX too much you won't have a recording)
AlsaMixer.JPG
AlsaMixer.JPG (40.21 KiB) Viewed 6142 times
Now you can record using arecord, you have to use

Code: Select all

-D dmic_sv
to use the soft volume and must also specify the channels as 2 (yet to figure out how to make it fully mono) - note very case sensitive

Code: Select all

arecord -D dmic_sv -c2 -r 48000 -f S32_LE -t wav -V mono -v myfile.wav
Watch the volume bar, if it goes up to max and stays there turn the volume down in the mixer and record again or you won't hear anything on playback.

Now

Code: Select all

aplay myfile.wav
And you should have a louder recording!
You can record without the software volume using

Code: Select all

arecord -D dmic_hw -c2 -r 48000 -f S32_LE -t wav -V mono -v quiet.wav
aplay quiet.wav
Hope this helps! Here's the .asoundrc - if anyone can help with how to set different default recording and playback devices please post! :

Code: Select all

#The below 2 sections are commented, they control the default sound card to use
#This set up is for a Pi with an I2S microphone attached using the guide
#from adafruit at
# https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout
#Uncomment and the I2S will be your default card (assuming same setup)
#but you won't get audio playback because both recording and playback will be
#defaulted
#TODO - Figure out how to set default for recording separately
#To adjust use aplay -l to work out the devices you have and their card number
#For recording devices use arecord -l

#pcm.!default {
#	type hw
#	card 1
#}

#ctl.!default {
#	type hw           
#	card 1
#}

#This section makes a reference to your I2S hardware, adjust the card name
# to what is shown in arecord -l after card x: before the name in []
#You may have to adjust channel count also but stick with default first
pcm.dmic_hw {
	type hw
	card sndrpisimplecar
	channels 2
	format S32_LE
}

#This is the software volume control, it links to the hardware above and after
# saving the .asoundrc file you can type alsamixer, press F6 to select
# your I2S mic then F4 to set the recording volume and arrow up and down
# to adjust the volume
# After adjusting the volume - go for 50 percent at first, you can do
# something like 
# arecord -D dmic_sv -c2 -r 48000 -f S32_LE -t wav -V mono -v myfile.wav
pcm.dmic_sv {
	type softvol
	slave.pcm dmic_hw
	control {
		name "Boost Capture Volume"
		card sndrpisimplecar
	}
	min_dB -3.0
	max_dB 30.0
}



User avatar
adafruit2
 
Posts: 21533
Joined: Fri Mar 11, 2005 7:36 pm

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by adafruit2 »

oooh thanks for the note, we added it to the guide in case others bumped into it!

User avatar
maby
 
Posts: 8
Joined: Tue Jul 18, 2017 6:02 am

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by maby »

Hmmm, not working here... I make the changes to .asoundrc, but alsamixer still believes that the i2s card has no controls - any suggestions?

Martin

User avatar
rockman55
 
Posts: 100
Joined: Tue Apr 14, 2015 6:17 pm

Re: I2S MEMS SPH0645 Microphone - Volume way too low

Post by rockman55 »

I am having the same problem, no controls.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”