Es geschah am Wednesday 29 October 2008 als Chris Cherrett schrieb:
> When you say 3 engine instances being 3 audio output devices, I get a
> bit confused. Are you saying that if you create 3 audio output devices
> Fantasia, that would create 3 sampler engine instances each with it's
> own settings?

Exactly. It works like this: when you select an audio output device for a 
sampler channel, the sampler internally connects the respective audio output 
device with the respective sampler channel and in this situation it will 
check in a map, if there was already an engine instance for this audio device 
created. If yes, it will use the same engine instance. If there's no engine 
instance stored in the map for the given audio output device, then a new 
engine instance will be created and stored in the map, so next time the audio 
device is connected to another sampler channel, it will use the same engine 
instance.

Why do we create a separate engine instance for each device? Because usually 
each audio device is a separate independent thread. And most parts of the 
engine instance actually run by that thread of the respective audio device. 

This might sound like a suboptimal implementation. But everything has its pros 
and contras. Of course you could also implement it in a way that every audio 
device uses one and the same engine instance. But in this case we would have 
to make use of synchronization techniques which would decrease performance 
and / or even harm RT stability. Downside of current solution is that we 
waste more memory, because each engine instances needs a certain amount of 
memory on its own. And keep in mind, that every engine instance also has its 
own disk thread responsible for streaming large samples from disk. The big 
advantage however is that people can currently already make use of multiple 
CPUs / CPU cores by creating one audio device (e.g. multiple jack audio 
output devices, using jackdmp) for each CPU / core.

CU
Christian

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Linuxsampler-devel mailing list
Linuxsampler-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel

Reply via email to