fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] New development


From: Bernat Arlandis i Mañó
Subject: Re: [fluid-dev] New development
Date: Tue, 27 Jan 2009 01:12:52 +0100
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

Josh Green escrigué:
On Mon, 2009-01-26 at 09:43 +0100, Antoine Schmitt wrote:
Le 25 janv. 09 à 23:14, Josh Green a écrit :
Things for the new 2.x branch:
About new development, there is an improvement to fluid that I had worked on two years ago in a private branch that I think should be integrated inside the main code base. I don't know if it should be integrated into 1.x or 2.x, because it changes the API a bit.

The bug is with the sequencer : in short, the sequencer uses the computer clock to trigger its sequenced events, whereas the audio buffers are requested and created by the soundcard when it needs them which may be ahead of realtime, resulting in events not being triggered at the right moment in the audio stream. The fact is that in real life, audio cards do request audio buffers ahead of time, sometimes a lot ahead, in bulk (like 16 buffers at once), thus not leaving time for the sequencer to trigger its events at the right moment in the audio stream.
I have fixed this by:
- making the sequencer use the audio stream as a clock
- calling the sequencer from the synth audio callback so that sequenced events are inserted in the audio buffer right before the audio is rendered This implied a small change in the API because now the sequencer depends on the synth to get its clock (which was not the case before).

How should I proceed to include it in the main code base ?

++ as


What you mention here addresses what I had listed as "Sub audio buffer
MIDI event processing" in that new things for 2.x branch list.  I had
not realized that there was any work done on resolving this.  Great!

Could you send me an archive of this branch?  Also, if you could
describe what part of the API it changes, that would be helpful, but I
could probably gather that from doing a diff on the sources as well.

This sounds like something that could be useful to integrate into 1.x.

Maybe I'm not understanding what he's done, but it sounds to me like
he's talking about simple and well-known sound card latency. I don't see
it related to what you're talking about.

I don't know why latency could be a problem playing midi files, maybe
it's another problem. It might happen that his system timer has a low
resolution and thus MIDI file playing is affected, I think fluidsynth
tries to get a 4ms period system timer. In Linux you can solve this
easily by setting up a higher system timer resolution in the kernel, I
don't know about other systems.

--
Bernat Arlandis i Mañó




reply via email to

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