[Gta04-owner] Low latency audio routing

Radek Polak psonek2 at seznam.cz
Thu Jan 19 22:39:46 CET 2012

On Tuesday 17 January 2012 21:27:21 Radek Polak wrote:
> Hi,
> i have now solved half of our problem with sound routing. This command
> works fine for me and routes sound from MIC to UMTS nearly in real time
> (10uS):
> arecord -B 10 -fS16_LE | aplay -B 10 -Dhw:1,0
> the important part seems to be the -B parameter which should be buffer time
> in uS.
> However i need similar command for other direction. I am now getting
> underruns for any lower values and with high value the sound comes with
> delay. I am going to continue with experiments, but any hints in mean time
> are highly appreciated.

I think i made some progress. Here are my current scripts:

arecord -B 4 -fS16_LE | aplay -B 4 -Dhw:1,0 &
arecord -Dhw:1,0 -B 4 -fS16_LE | aplay -B 150000 &

Basically i am trying to get the buffers as small as possible with the -B 

There is still delay in both directions. I tried to measure it and compare it 
with N900 delays. The second phone i used is sony ericsson Xperia mini. I did 
the measuring in audacity.

sound from GTA04->Xperia (first command) has delay 300ms
without -B option 731ms
sound from N900->Xperia has 240ms delay

sound from Xperia->GTA04 (second command) has delay 400ms
without -B option 708ms
sound from Xperia->N900 has 286ms delay

I also tried to make a call with my wife and the delays seem to be quite 
acceptable, but more testing is needed.

There is one thing i am still not understanding. If you try to use small buffer 
in the second command (e.g. 100000 instead of 150000), you will get underruns 
but with 150000 you don't get them. To me it looks like the soundcard does not 
like small buffers, but we need them for low latencies. Any ideas?



More information about the Gta04-owner mailing list