fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] How to find the MIDI thread of a fluidsynth instance?


From: Ken Restivo
Subject: Re: [fluid-dev] How to find the MIDI thread of a fluidsynth instance?
Date: Sun, 28 Jan 2007 09:57:43 -0800
User-agent: Mutt/1.4i

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Jan 28, 2007 at 06:08:39PM +0000, Josh Green wrote:
> Hello Ken,
> 
> I would imagine the thread order will always be the same, at least
> that's a guess.  The thread that is using more CPU time is the audio
> thread.  In my case, the first thread is the audio thread, so the second
> is the MIDI.  You could also modify the priority values at the top of
> the fluid_alsa.c file, rebuild and install:
> 
> /* SCHED_FIFO priorities for ALSA threads (see
> pthread_attr_setschedparam) */
> #define ALSA_PCM_SCHED_PRIORITY 90
> #define ALSA_RAWMIDI_SCHED_PRIORITY 90
> #define ALSA_SEQ_SCHED_PRIORITY 90
> 

What exactly does that number "90" represent?

It's not the actual RT priority, and thankfully, because the PCM priority 
should be lower than that of JACK, and certainly lower than that of the 
soundcard itself.

For example, using fluidsynth-1.0.8.2006.12.24, I get the following set of RT 
priorities:

  PID CLS RTPRIO  NI PRI %CPU STAT COMMAND      
  807 FF      90   - 130  0.0 S<   IRQ 8        rtc
  856 FF      85   - 125  3.2 S<   IRQ 19       libata, uhci_hcd:usb3, ohci1394
  870 FF      80   - 120  0.0 S<   IRQ 20       ehci_hcd:usb1, uhci_hcd:usb2
    4 FF      50   -  90  0.0 S    softirq-high/0       
    5 FF      50   -  90  0.0 S    softirq-sched/0      
    6 FF      50   -  90  0.0 S    softirq-timer/0      
    7 FF      50   -  90  0.0 S    softirq-net-tx/      
    8 FF      50   -  90  0.0 S    softirq-net-rx/      
    9 FF      50   -  90  0.0 S    softirq-block/0      
   10 FF      50   -  90  1.0 S    softirq-tasklet      
   11 FF      50   -  90  0.0 S    softirq-hrtimer      
   12 FF      50   -  90  0.0 S    softirq-rcu/0        
   16 FF      50   -  90  0.0 S    softirq-high/1       
   17 FF      50   -  90  0.0 S    softirq-sched/1      
   18 FF      50   -  90  0.0 S    softirq-timer/1      
   19 FF      50   -  90  0.0 S    softirq-net-tx/      
   20 FF      50   -  90  0.0 S    softirq-net-rx/      
   21 FF      50   -  90  0.0 S    softirq-block/1      
   22 FF      50   -  90  1.0 S    softirq-tasklet      
   23 FF      50   -  90  0.0 S    softirq-hrtimer      
   24 FF      50   -  90  0.0 S    softirq-rcu/1        

  PID CLS RTPRIO  NI PRI %CPU STAT COMMAND
    2 FF      99   - 139  0.0 S    migration/0
 3274 TS       -   0  20  0.0 SLsl jackd
 3274 TS       -   0  20  0.0 SLsl jackd
 3274 TS       -   0  24  0.0 SLsl jackd
 3274 TS       -   0  20  0.0 SLsl jackd
 3274 FF      80   - 120  0.0 SLsl jackd
 3274 FF      70   - 110  2.3 SLsl jackd
 3274 FF      73   - 113  5.0 SLsl jackd
 3274 FF      73   - 113  4.3 SLsl jackd
 3274 FF      84   - 124  0.0 SLsl jackd
 3274 FF      74   - 114  6.5 SLsl jackd
 3285 TS       -   0  22  0.0 SLl  jack.plumbing
 3285 FF      69   - 109  0.4 SLl  jack.plumbing
 3285 TS       -   0  24  0.0 SLl  jack.plumbing
 3289 TS       -   0  23  0.0 SLl  fluidsynth
 3289 FF      69   - 109  2.0 SLl  fluidsynth
 3289 TS       -   0  24  0.0 SLl  fluidsynth
 3289 TS       -   0  21  0.0 SLl  fluidsynth
 3290 TS       -   0  21  0.0 SLl  fluidsynth
 3290 FF      69   - 109  1.0 SLl  fluidsynth
 3290 TS       -   0  24  0.0 SLl  fluidsynth
 3290 TS       -   0  20  0.0 SLl  fluidsynth
 3291 TS       -   0  23  0.0 SLl  fluidsynth
 3291 FF      69   - 109  0.9 SLl  fluidsynth
 3291 TS       -   0  24  0.0 SLl  fluidsynth
 3291 TS       -   0  20  0.0 SLl  fluidsynth


The priority 69 (heh) is what I want for fluidsynth's audio thread, but it'd be 
nice if there were a way to identify the MIDI-handling thread so I could bump 
that thread to *higher* than JACK, which is what is recommended by the guide I 
linked to.


> 
> Perhaps that should be permanently done, so that things are setup in an
> ideal manner for all users.
> 
>       Josh
> 
> 
> On Sat, 2007-01-27 at 18:18 -0800, Ken Restivo wrote:
> > This guide says: locate the MIDI threads of your softsynths, and give them 
> > a higher rtprio than JACK.
> > 
> > http://tapas.affenbande.org/wordpress/?page_id=40
> > 
> > OK, I have chrt, and a full RT system, and I have most of the priorities 
> > set up the way this guide recommends, except that I'm not sure how to find 
> > out what is the "MIDI thread" of a fluidsynth, so as to give it a higher 
> > priority.
> > 
> > Any ideas?
> > 
> > - -ken
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFvOQXe8HF+6xeOIcRAiO7AKDnxwJuihzF0E9bI/JBuYutm0Pj8gCfQ4/R
WLG8zurb+8QsfLo5QWBMOE0=
=kxk3
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]