Re: [linux-audio-dev] buffering, latency, cut-outs

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

Subject: Re: [linux-audio-dev] buffering, latency, cut-outs
From: Paul Barton-Davis (pbd_AT_Op.Net)
Date: la tammi  15 2000 - 09:59:58 EST


2 additional/followup points:

>you may use msgsnd() / msgget() in order to exchange data with the GUI thread.
>I would avoid the use of FIFOs pipe() , because the GUI thread could stall and
>
>if the fifo gets full, the audio thread could block = dropout assured.

FIFO's are 5KB long. In my apps, requests to the GUI are about 20
bytes. That allows room for about 256 requests from other threads to
the GUI before the FIFO fills up. If that ever happens in my apps,
something else has gone seriously wrong. So I use a FIFO.

>take care when working with mutexes, design the audio realtime thread
>in a such way that it will never "wait" on events, use shared memory
>and poll flags/messages at each iteration within the audio-loop

if you use pthreads, you can implement spin-then-block behaviour for
locks taken by the audio thread that are expected to only ever be held
by another thread for a very short time. or you can copy it from the
Quasimodo/libpbd sources.

--p


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

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:23:26 EST