[linux-audio-dev] Re: diskstream and jack

Juhana Sadeharju kouhia at nic.funet.fi
Thu Jul 20 20:05:02 UTC 2006

>From: conrad berhrster <conrad.berhoerster at gmx.de>
>Now the question: 
>- The worker thread is faster then the jackthread. (Sure, it should be). What 
>is the usual way to pause the workerthread and wake up again, when the 
>ringbuffer needs more data. 

My alsashmrec uses
  kill((pid_t)diskpid,SIGSTOP);  (in disk writer process)
  kill((pid_t)diskpid,SIGCONT);  (in A/D reader process)

Perhaps that could be replaced with semaphore but what if
multiple processes uses the same disk service process?
That increases the number of SIGCONTs but otherwise the
processes would be uncoupled. How it is with semaphores?

>- How should the ringbuffer be initilized when starting to play?

Fill it up if its size was selected optimally.
If you have multiple songs and you don't know which the user
would like to play next, then make one ringbuffer per song and
fill them all up. Then the playing can start instantly when user
presses the song button.

  for developers of open source graphics software

More information about the Linux-audio-dev mailing list