Re: [linux-audio-dev] Help with LATENCY FULL DUPLEX AUDIO

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Help with LATENCY FULL DUPLEX AUDIO
From: Maarten de Boer (mdeboer_AT_iua.upf.es)
Date: Fri Apr 26 2002 - 10:26:00 EEST


On Fri, 26 Apr 2002 00:37:21 +0200 (CEST)
pavelni_AT_volny.cz wrote:

> Hello,
> I am just working (finishing) on modular realtime effect procesor. It
> is my thesis project. I would like to ask three questions:
>
> 1.
> How can I calculate the latency in ms with OSS driver?

I would strongly advice you to use ALSA (0.9) instead. The
alsa-lib/test/latency.c is a good starting point for realtime I/O, and
it tells you the latency!

> 2.
> My program do the effects on audio in realtime.
> So I added recording the sound to hard disk.
> This work ok. But when I play back the recorded sound (from HD), it
> changes me buffer length that latency is very big. My solution to
> this problem was to close device and initalize same device one more
> time after playing the sound.
> Is there better solution for me?

If you want low latency, you should never do playback and record to HD in
the same thread as you audio i/o! The access to disk can take too long.
Better to you a seperate thread for the disk i/o, and use some (circular)
buffers in between, the gets filled by the audio in, and emptied by the
disk out, or filled by the disk in, and emptied by the disk out. If you
search the list archives, you can find some more e-mails about this by
Paul Davis (though don't try to search just on "paul davis", the amount
of hits is dazzling ;-)

> 3.
> Is there some advices how to set the lowest latency?

The is a lot of advice about this on the LAD webpage. Mainly: Patch your
kernel.

Maarten


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Apr 26 2002 - 10:23:00 EEST