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

Enable sub quantum delay #198

Merged
merged 23 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a89438b
enable sub quamtum delay - first pass
b-ma Aug 5, 2022
a68c696
fixed sub-quantum delay + added tests
b-ma Aug 9, 2022
23dc519
cleaning
b-ma Aug 9, 2022
7ef0597
Remove AudioProcesor::can_break_cycle - handle it with control msgs
orottier Aug 11, 2022
21c3980
Merge remote-tracking branch 'origin/main' into feature/zero-delay
orottier Aug 11, 2022
5565b3b
More compile-time checked mutable borrows in graph render
orottier Aug 11, 2022
b30a0d8
Fix borrow/borrow_mut runtime exception in graph
orottier Aug 11, 2022
3596248
Merge branch 'main' into feature/zero-delay
orottier Aug 11, 2022
57b157a
Add integration test suite for graph ordering
orottier Aug 12, 2022
83ae26d
Make nice test framework for graph ordering - shuffle inputs
orottier Aug 12, 2022
aadd139
Merge remote-tracking branch 'oriGin/main' into feature/zero-delay
orottier Aug 12, 2022
b1498a2
Add test case for graph ordering with cycle breaker
orottier Aug 12, 2022
5a355e7
Pessimistically trigger a new graph sort when applying a cycle breaker
orottier Aug 12, 2022
34d9274
Add more graph sorting integration tests
orottier Aug 12, 2022
b85de76
Setup shared value so DelayReader knows when it runs before Writer
orottier Aug 13, 2022
b77f9b1
Simplify graph ordering logic when cycle breakers are applied
orottier Aug 13, 2022
01ec89e
Add one more tests case (and 3 more incoming) for graph cycle ordering
orottier Aug 13, 2022
05d28de
Add regression test for dynamic lifetime and cycle detection of delays
orottier Aug 14, 2022
39fb5d3
DelayReader: make the in_cycle property sticky
orottier Aug 14, 2022
8a2a6d9
Merge branch 'main' into feature/zero-delay
orottier Aug 14, 2022
d613130
applied clippy hints
orottier Aug 14, 2022
e088c95
removed redundant end time check
b-ma Aug 15, 2022
143d4b6
Add graph ordering tests for exotic cycles
orottier Aug 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/context/concrete_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@ impl ConcreteBaseAudioContext {
}
}

/// Inform render thread that this node can act as a cycle breaker
#[doc(hidden)]
pub fn mark_cycle_breaker(&self, reg: &AudioContextRegistration) {
let id = reg.id().0;
let message = ControlMessage::MarkCycleBreaker { id };

// Sending the message will fail when the render thread has already shut down.
// This is fine
let _r = self.inner.render_channel.send(message);
}

/// `ChannelConfig` of the `AudioDestinationNode`
pub(super) fn destination_channel_config(&self) -> ChannelConfig {
self.inner.destination_channel_config.clone()
Expand Down
17 changes: 14 additions & 3 deletions src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,28 @@ pub(crate) enum ControlMessage {
},

/// Clear the connection between two given nodes in the audio graph
DisconnectNode { from: u64, to: u64 },
DisconnectNode {
from: u64,
to: u64,
},

/// Disconnect this node from the audio graph (drop all its connections)
DisconnectAll { from: u64 },
DisconnectAll {
from: u64,
},

/// Notify the render thread this node is dropped in the control thread
FreeWhenFinished { id: u64 },
FreeWhenFinished {
id: u64,
},

/// Pass an AudioParam AutomationEvent to the relevant node
AudioParamEvent {
to: Sender<AudioParamEvent>,
event: AudioParamEvent,
},

MarkCycleBreaker {
id: u64,
},
}
Loading