[Top][All Lists]

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

[fluid-dev] Changes on CVS, needles and threads

From: M. Nentwig
Subject: [fluid-dev] Changes on CVS, needles and threads
Date: Fri, 30 May 2003 11:39:54 +0300


committed yesterday, please test and comment.
I hope this doesn't interfere with the ongoing macOS work...
Josh, the 3rd "*" could be done in Swami as well (but doesn't have to):

   2003-05-29  Markus Nentwig  <address@hidden>

            * include/fluidsynth/voice.h: added fluid_voice_gen_incr to
            * src/fluidsynth.c: Added error message for command line
parameter handling
            * src/fluid_voice.c (fluid_voice_optimize_sample): Removed
loop peak detection
            at run time, because it caused dropouts. Now the sound font
loader or application
            is responsible to call fluid_voice_optimize_sample (if it
doesn't, the turnoff optimization is
            simply disabled).
 * src/fluid_synth.c (fluid_synth_one_block): Added a mutex that
provides a small degree of
            protection against noteons / noteoffs, when the audio thread
is working.

 The mutex thing is a design issue that should be thought through. If
it's bad, let's take it out again.

Here's my view, correct me if I'm wrong (admittedly not exactly a thread
expert speaking here)
When the MIDI or shell or cmd thread modifies voices in the synth, there
is a chance that the audio thread is just running. For example, a voice
could be killed and reallocated just while it's being played.
So far there hasn't been any evidence, probably the code is robust
enough to cope with that. Anyway, more and more threads are being added
(take LADCCA and shell), maybe this could be cleaned out.
Anyway, my solution will wait with a noteon, noteoff, cc etc until the
audio thread is through. There is no guarantee that the audio thread
doesn't start in the middle of a noteon 'event', though.

Now the 'jack' documentation says that pthread_lock_mutex is not allowed
in the process thread because it can delay for an indefinite time.
Any good ideas how to do this right?



reply via email to

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