forked from falkTX/dssi-vst
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched to using shared memory for process communication.
The reason this was done is to improve the real time performance of dssi-vst. The old communication method used in the plugin was pipes, which are not guaranteed to have a bounded execution time, safe for a real time environment. Therefore, in this patch, we switch to using shared memory with a ring buffer as the data stream and semaphores for synchronization. Pros: - The plugin has no extra latency anymore, since the semaphores will properly wait for data to be processed in each call to run(). - If there are xruns, they will be filled with silence and properly reported to jack. Previously, jack would not get notified of the xrun, and there would be a terrible noise (which was because the old buffer data was not cleared and would be repeated several times over). - We can enable the LADSPA_PROPERTY_HARD_RT_CAPABLE flag, since the dssi-vst layer no longer introduces any function calls with unbounded execution time. It is still possible for a plugin to be badly coded and cause xruns, but then the problem is in the VST plugin and not in dssi-vst. Cons: - It is now harder to detect whether the remote side has shut down, since the semaphores will not detect this like a pipe does. - The ring buffer has a certain size, which could theoretically overflow. However, it is very unlikely, unless you send a huge amount of MIDI data at once. Some comments about things that were done in the patch: - Linking to a new library, -lrt, was necessary because we need to call clock_gettime when using semaphores. - "extern" was removed from functions because... well, I didn't see why they needed to be there, and they caused some problems with the templates. - The template functions were introduced mainly to save time, not having to reimplement the read/write functions for all the datatypes.
- Loading branch information
falkTX
committed
Aug 27, 2012
1 parent
2dda7dc
commit 2cefab1
Showing
10 changed files
with
349 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.