Re: [linux-audio-dev] sound/gui interaction

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

Subject: Re: [linux-audio-dev] sound/gui interaction
From: Benno Senoner (sbenno_AT_gardena.net)
Date: Thu Jul 20 2000 - 20:30:15 EEST


Hi Douglas, glad to see you here too :-)

Your problem is a typical latency problem:

see my small (outdated) HOWTO for how to improve latencies:

http://www.crosswinds.net/~linuxmusic/lowlatency.html

Perhaps you are aware that standard latencies on linux under high
load suck quite a bit ( up to 130msec with DMAed HDs) and
up to a few seconds on non DMA HDs.
Linux with the lowlatency patch applied delivers an outstanding
RELIABLE 2.1msec latency under high system load.

That means if your audio buffer is bigger than 100msec then you have
good chances to achieve dropout-free operation
(assuming that you used the "right" programming technique).
If the buffer is shorter then you have to use a low-latency patch
(see link in the HOWTO).

The main problem is that you should not make any system calls
except audio IO within the DSP thread.
So avoid any mutex , disk I/O , X-windows call etc.
You get the best results using shared memory and/or lock-free
FIFOs. ( disksampler gets 2.1msec latencies with this approach
while doing full disk IO within a lower priority disk thread)
see here for C++ source code http://eca.cx/lad/2000/Jul/0285.html

Do not forget to set your DSP thread SCHED_FIFO ( = realtime priority)
because the DSP thread requires higher priority than all other
"disturbing" threads. The howto contains code how to set SCHED_FIFO
policy. ( you must run the app as root or you won't be able to grab
realtime privileges)

hope this helps.

Benno.

On Thu, 20 Jul 2000, douglas irving repetto wrote:
> hi there linux-audio-dev from a new subscriber,
>
>
> i'm working on a linux sound app. my signal processing loop runs in its
> own thread. whenever i do a full drawing update of my GUI, i get a
> glitch in the sound output. my CPU usage goes up during the redraw, but
> not very much. does anyone know what's happening and how i can avoid it?
> i would think that doing the graphics and the sound in seperate threads
> would shield the one from the other, but apparently that's not the case.
> is this an XWindows issue perhaps?
>
> thanks,
> douglas
>
>
> --
> douglas irving repetto
> http://music.columbia.edu/~douglas
> the music-dsp mailing list and website:
> http://shoko.calarts.edu/musicdsp


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

This archive was generated by hypermail 2b28 : Thu Jul 20 2000 - 20:12:09 EEST