User avatar
Jargon
Posts: 2
Joined: Sun Sep 01, 2013 8:15 pm

Real-time playback from microphone is delayed, solutions?

Mon Sep 02, 2013 6:10 pm

Hello people :)

I've been trying to get my Pi to play back audio from the microphone directly through a powered speaker connected to the onboard audio output in order to add effects such as a vocoder to it, but I've been semi-unsuccessful so far. My intent is to use JACK with a vocoder to replicate a Geth voice effect in real time, but I'm a complete noob at everything audio in linux >.=.>

The microphone I'm using is a Logitech USB headset, connected along with a nano WiFi plug to the Pi. I'm planning on buying a throwaway USB sound card for both output and input later.

Using this command, I can get the sound through but with roughly 1-2 seconds of delay.

Code: Select all

arecord -fS32_LE -r 22050 -Dplughw:1,0 - | aplay -
My Pi is overclocked to 1 gHz and doesn't run any desktop environment, so computing power shouldn't be an issue. I assume there's a better program for doing this out there, but my googling skills have failed me so far. If anyone here could offer some input and/or suggestions, I'd be very grateful.

karlkiste
Posts: 189
Joined: Tue Jan 22, 2013 8:50 am
Location: berlin, germany

Re: Real-time playback from microphone is delayed, solutions

Tue Sep 03, 2013 7:11 am

I'm no sound expert, but from my knowledge about computers and electronics I would say:

For low-latency realtime effects, input and output must be on a single "device". The same clock source must be used for input and output. This is the only way to ensure that the clocks will not get out of sync.

If input and output are clocked from different sources, and by chance the output clock is 1 Hz faster than the input clock, you need a buffer to read the additional sample per second from. This buffer is causing a latency, but it's needed if the clocks are not the same. Therefore, I'd suggest you get the "in and out USB sound device", for while using input from USB and internal output, you will probably not get anywhere.

User avatar
Jargon
Posts: 2
Joined: Sun Sep 01, 2013 8:15 pm

Re: Real-time playback from microphone is delayed, solutions

Wed Sep 04, 2013 4:55 pm

Hey, sorry for the late reply.

Thank you for the suggestion, I really appreciate it. I'll try routing the sound out through the headset first while I'm waiting for the USB sound card to arrive to see if it works better.

This is the card I'm going to buy, by the way: http://dx.com/p/usb-3d-sound-adapter-co ... orted-5831

CharlieCPH
Posts: 1
Joined: Sun Apr 19, 2015 4:19 pm

Re: Real-time playback from microphone is delayed, solutions

Sun Apr 19, 2015 4:29 pm

Hey Jargon.
How did your project go?
I've been apointed to the task of building the exact same thing, but well, im a complete noob.
So far I've got my rpi set up with raspbian and audio in and out.
What im interrested in is mainly the software needed in order to achieve the vocoder effect?

So I was wondering if you would share your solution?

Teledroid
Posts: 2
Joined: Fri Jul 17, 2015 6:04 pm

Re: Real-time playback from microphone is delayed, solutions

Fri Jul 17, 2015 6:08 pm

Hello, i have the same problem.
I use Raspberry Pi model A and usb sound card SoundBlaster Play!
What should i do to get my voice from microphone directly in phones in real time?
So i would like to speak and hear myself in phones in real time.

Teledroid
Posts: 2
Joined: Fri Jul 17, 2015 6:04 pm

Re: Real-time playback from microphone is delayed, solutions

Thu Jul 30, 2015 4:48 pm

So can anybody answer to the problem of this question?
arecord -fS32_LE -r 22050 -Dplughw:1,0 - | aplay - - this solution has a delay
Is any other solution for real-time playback from microphone in raspberry pi

Return to “Graphics, sound and multimedia”