Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Bus system to replace naive Arc<Mutex<Buffer>> System #58

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

exa04
Copy link
Owner

@exa04 exa04 commented Dec 17, 2024

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:

  • Graph
  • Meter
  • Oscilloscope
  • Histogram
  • Lissajous

Other 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

  • Rustdoc (updated) comments
  • Updated Mdbook content
  • Examples such as peak_graph etc.

Breaking Changes

Stub.

Non-breaking Changes

Stub.

exa04 and others added 11 commits November 4, 2024 17:33
(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.
@exa04 exa04 linked an issue Dec 17, 2024 that may be closed by this pull request
@exa04 exa04 changed the title New Channel system to replace Arc<Mutex<Buffer>> System New Bus system to replace Arc<Mutex<Buffer>> System Jan 2, 2025
@exa04 exa04 changed the title New Bus system to replace Arc<Mutex<Buffer>> System New Bus system to replace naive Arc<Mutex<Buffer>> System Jan 2, 2025
@exa04
Copy link
Owner Author

exa04 commented Jan 5, 2025

Update: The core bus system is finished! I might add a downmixing option to turn a StereoBus into a Bus<f32> (i.e. a MonoBus) later down the line - after this has been merged. I'll add some docs for this system in the coming days.

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't use mutexes on the DSP thread
1 participant