ejj28
Posts: 19
Joined: Tue Jun 10, 2014 10:28 pm

RPi Mic Preamp

Wed Sep 10, 2014 9:18 pm

Hi,
I am working on a project that involves a portable mini loudspeaker. I want to use a logitech usb microphone and a little battery powered speaker plugged into a pi (using the pi as a mic preamp).
Is it possible to do this without a usb soundcard or a powered mic?
Any help appreciated!

Speaker: Gadgetree portable mini speaker
Mic: Special Logitech Mic (made for Rockband)

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: RPi Mic Preamp

Wed Sep 10, 2014 9:42 pm

Do you intend to record with your microphone or to simply relay this into a loud speaker??

If you're using your USB microphone then there's no need to use a USB playback device the Pi's analogue output should suffice.
Just be aware that any simultaneous record / playback is going to add a delay to the loud speaker.
If delays are going to cause issues then you're probably better off using a dedicated microphone + pre-amp fed into the loud speaker amplifier.

Richard S.

ejj28
Posts: 19
Joined: Tue Jun 10, 2014 10:28 pm

Re: RPi Mic Preamp

Sat Sep 13, 2014 2:41 am

Hi,
I only want to use it as a relay, not recording and a small delay is okay.
Is there any free software for the pi that turns the pi into a preamp?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: RPi Mic Preamp

Sat Sep 13, 2014 8:45 am

To record and playback audio you can use arecord and aplay which come pre-installed on Raspbian as part of ALSA tools.

Assuming your USB device is assigned to hw:1,0 and output is the Pi's headphone port sysdefault:CARD=ALSA then use the following command:
arecord -r 48k -f S16_LE -c 1 -t raw -D hw:1,0 | aplay -r 48k -f S16_LE -c 1 -D sysdefault:CARD=ALSA

Richard S.

hippy
Posts: 5779
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: RPi Mic Preamp

Sat Sep 13, 2014 1:57 pm

Checkout the following page, particularly the 'alsaloop' command, about half way down -

http://www.pi-fun.com/index.php?cID=1039

That worked for me when I was playing with USB microphones yesterday, worked exactly as you seem to want, relaying microphone in to audio jack out. Didn't really notice any delay and some small delay may actually help avoid audio feedback.

Return to “Graphics, sound and multimedia”