Have you tried using your microphone with Pulseaudio? Alsa is very much a tool of the past ( although it is still needed at times, especially w/ some of the microphones that are on the market these days ). Pulseaudio often takes care of a lot of the quality issues that are associated with microphone devices, and offers a number of really awesome features.
Basic installation steps below ( See my link at the end of this answer for more specific notes if you're trying to obtain the same configuration that I have on my RaspberryPi):
Install pulse audio / development packages
sudo apt-get install gstreamer0.10-pulseaudio libao4 libasound2-plugins libgconfmm-2.6-1c2 libglademm-2.4-1c2a libpulse-dev libpulse-mainloop-glib0 libpulse-mainloop-glib0-dbg libpulse0 libpulse0-dbg libsox-fmt-pulse paman paprefs pavucontrol pavumeter pulseaudio pulseaudio-dbg pulseaudio-esound-compat pulseaudio-esound-compat-dbg pulseaudio-module-bluetooth pulseaudio-module-gconf pulseaudio-module-jack pulseaudio-module-lirc pulseaudio-module-lirc-dbg pulseaudio-module-x11 pulseaudio-module-zeroconf pulseaudio-module-zeroconf-dbg pulseaudio-utils oss-compat -y
Change alsa to use pulse:
sudo \cp -pf /etc/asound.conf /etc/asound.conf.ORIG
echo 'pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}' | sudo tee /etc/asound.conf
Make sure your camera device loads on boot:
# Disallow module loading after startup. This is a security feature since it disallows additional module loading during runtime and on user request.
_DISALLOW_MODULE_LOADING=$(grep "DISALLOW_MODULE_LOADING=1" /etc/default/pulseaudio | wc -l)
if [[ "${_DISALLOW_MODULE_LOADING}" = "0" ]]; then
sudo \cp -pf /etc/default/pulseaudio /etc/default/pulseaudio.ORIG
sudo sed -i "s,DISALLOW_MODULE_LOADING=1,DISALLOW_MODULE_LOADING=0,g" /etc/default/pulseaudio
fi
Prevent PulseAudio from sending the audio hardware to sleep.
# This is the important part that prevents PulseAudio from sending the audio hardware to sleep.
sudo sed -i 's,#load-module module-suspend-on-idle,load-module module-suspend-on-idle,g' /etc/pulse/default.pa
Optimize the pulse audio daemon config:
sudo \cp -fvp /etc/pulse/daemon.conf /etc/pulse/daemon.conf.${_DATE}
echo "
# ScarlettPi added this
high-priority = yes
nice-level = 5
exit-idle-time = -1
resample-method = src-sinc-medium-quality
default-sample-format = s16le
default-sample-rate = 48000
default-sample-channels = 2" | sudo tee -a /etc/pulse/daemon.conf
Add your user to the pulse-access group. In my case, my user is pi.
# add pi user to audio groups
sudo adduser pi pulse-access
Reboot:
sudo shutdown -r now
When the system is up and running, make sure pulse audio is started:
/usr/bin/pulseaudio --start --log-target=syslog --log-level=debug --system=false
Now see if everything works!
Hope this helps you. If you need any more help troubleshooting just comment on answer and @ me.
More reading here: