From: Mark K. <mar...@gm...> - 2005-09-27 14:24:49
|
On 9/27/05, Tom Szilagyi <tsz...@us...> wrote: > On Mon, Sep 26, 2005 at 04:37:25PM -0700, Mark Knecht wrote: > > Running aqualung with the -R option, according to the help in Aqualung,= says: > > > > -R, --realtime: Try to use realtime (SCHED_FIFO) scheduling for ALSA > > output thread. > > > > My question is does it cause problems for me to run the server > > SCHED_RR if Aqualung is going to run SCHED_FIFO? Can jackd and > > Aqualung run at different priorities and everyone be happy? > > [...] > > Interesting question. > > First and foremost, I don't know if it's clear to you that the -R > option of Aqualung works only for Alsa output. It has absolutely no > effect if the program runs with OSS or Jack. I did not know this. So if I'm running with only Jack, as I always do, I should NOT use -R? This is different from alsaplayer and hence why I've been doing what I do. I've been learning a bit more about this on the ck-sources email list. > > In case of Jack output, the Jack server is the one that starts the > Jack output thread running within Aqualung (as with any other > Jack-ified program). This thread runs in the context of the Aqualung > process, but it inherits its realtime and other attributes from the > Jack process which actually started it. Very interesting. I had no idea jackd did stuff like that inside your progr= am. > > So to run Aqualung in realtime with Jack, just run Jack in realtime, > and start Aqualung as usual (just as you start Ardour, etc.). No > special options to Aqualung are needed (and there are in fact none). > > I think you may not necessarily see the realtime-ness of the Jack > output thread in Aqualung when looking with tools such as ps or top, > since it is a thread among other threads in a single process. AFAIK it > depends on kernel versions whether threads count as separate processes > on the OS level or not. Specifically, when running Aqualung on a > 2.4.28 kernel I can see all 4 threads of Aqualung in top as separate > processes (all named aqualung), while on 2.6.13 I only see *one* > aqualung process. In this latter case, information shown by ps or top > corresponds to the whole process and it is unclear to me as to what > extent this reflects the attributes of one particular thread within > the process. OK, that explains a bit. I know there are some tools to see all the threads on 2.6 kernels but I don't remember what they are. I'll go look. > > The bottom line is that if Jack runs in realtime, and Aqualung has > successfully connected to it, then it is in fact realtime (the Jack > output thread, that is). If it were unable to run in realtime, Jack > would have problems with it and starting up Aqualung as a Jack client > would fail. Is this what's happening when I run Jack at 64/2 and find Aqualung telling me that the Jack server has shut down? It seems that when Jack goes too fast Aqualung cannot get started. Thanks, Mark |