New Bus system to replace naive Arc<Mutex<Buffer>> System#58
Merged
Conversation
(Huge commit message incoming, very sry about that.) Rough first version of the new Inlet / Outlet system for audio IPC in Cyma. No mutexes or the like, just arc swaps, mpmc structs, and atomics. I also want to eventually add Outlets that can be shared by multiple visualizers. A system like that will definitely perform better than what Cyma currently has. Compared to the old peak graph example, this new one is actually a bit less performant. If my unscientific benchmarks are anything to go by, the avg. DSP load has gone up by 30%. The max. DSP load has already gone down by about 10%, though. The real gain is obviously that no mutexes are needed anymore.
Et voila, both the peak and avg. load have *halved* with this new system.
Also, there is no Inlet/Outlet differentiation anymore.
Channel system to replace Arc<Mutex<Buffer>> SystemBus system to replace Arc<Mutex<Buffer>> System
Bus system to replace Arc<Mutex<Buffer>> SystemBus system to replace naive Arc<Mutex<Buffer>> System
Owner
Author
|
Update: The core bus system is finished! I might add a downmixing option to turn a Both current example plugins have been updated to reflect the changes. They might still need some testing, especially on different OSes and hosts. @magnetophon (mentioning you here because you said you'd be interested in testing) |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
As per #55.
This branch introduces a new bus system, which sends raw audio data to the GUI lock-freely via crossbeam. The bus fans out new audio data to dynamically dispatched event handlers for visualizers.
Tasks
These visualizers use the new system:
GraphMeterOscilloscopeHistogramLissajousOther visualizers such as the Spectrum Analyzer are not affected and thus not listed. Some internal optimizations may still need to be made to many of these visualizers. However, these optimizations will not introduce any API changes, so they may be introduced later on. That also goes for some performance tweaks to the bus system itself, which may include some parallelization or async handling of events.
Some extras still need to be added
peak_graphetc.Breaking Changes
Stub.
Non-breaking Changes
Stub.