On Sat, 23 Sep 2000, Benno Senoner wrote:

> On Sat, 23 Sep 2000, Juhana Sadeharju wrote:
> > 
> > The way I get always dropouts is to delete a large file (20 Mbytes do fine)
> > or directory. I'm not sure what are the changes when (i) soft-RT, and then
> > (ii) low-latency patch are added to the recorder. Could there be problems
> > even our A/D-to-disk buffer would be 16 Mbytes?
> >
> 
> no  the low-latency patch alone does not ensure a drop-out free operation.
> my experience says:
> - use a 2 thread approach (audio thread, disk thread)
> - you must use SCHED_FIFO for at least the audio thread 
> - use a lock-free approach to pass data back and forth between audio and disk
> thread 

Whether you need locks really depends on your app. In the cases I usually
deal with over/underrunning file IO is as serious error as having the same
happen to audio devices (=fatal error).

There is a LGPL C++ class (DI_AudioFileThreaded) that implement threaded
audio files in the DIVAIO library:

http://www.tml.hut.fi/~tilmonen/diva/

The DIVA libraries are about as compact and stand-alone as it gets.

The usual disclaimers: The API is fairly ok altough the internals are
still a mess. Plus the code is semi-experimental. 

Hope this also helps....

Tommi Ilmonen             Researcher
 >=> http://www.hut.fi/u/tilmonen/
  Linux/IRIX audio:       Mustajuuri
   >=> http://www.tml.hut.fi/~tilmonen/mustajuuri/
    3D audio:               DIVA
     >=> http://www.tml.hut.fi/Research/DIVA/


Reply via email to