-
Notifications
You must be signed in to change notification settings - Fork 761
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
Quick fix for Pmono (and PmonoArtic) turning everything off in the default group #5027
Quick fix for Pmono (and PmonoArtic) turning everything off in the default group #5027
Conversation
…fault group Commit 83e4607 merged in PR supercollider#4787 exposed an underlying problem in Pmono's two-part cleanup setup, which can fire a `type: off` event with no `id` set, turning everything off in the default group. This is an "emergency fix" that prevents Pmono's cleanup from firing that `off` event if `id` is still not set by the time the cleanup is executed.
Per #5024 (comment), there's a very high likelihood that the stopgap proposed here wouldn't be necessary. So I'd suggest to hold off on merging -- I'm guessing >90% chance of closing this one without a merge. |
Per my subsequent comment there, your proposed alternative breaks The two-part approach to Pmono cleanups is alas not looking like it can be avoided, given that downstream filters of Pmono events, including the EventStreamPlayer, have a "chicken and egg" problem with Pmono cleanups: they need to register them, but before the I know I suggested a simple closure-based solution to Pmono's cleanup, but alas it looks not feasible within the constraints of how only events are used to propagate cleanups "downstream". There's no general callback mechanism in which all streams which may want to get a new cleanup can be notified to add one.. from a callback from Event. For a closure solution to work, we'd need a broadcast version of updatePmono in which every stream (or player) that depends on that Pmono will get notified to add a cleanup to their own copy of the cleanups, after the monoNote event has So, I will be basing my PR for the general cleanup dedupe assuming this solution (5027) is in place, simply because it's a minimalist fix to the problem introduced/exposed in #4787. |
FWIW, I just verified that the problem is not reproducible after merging #5030, with no other changes (and stopping a regular Pmono is not broken with #5030 in place) -- unsurprising as 5030 seems to incorporate the change here. I'll wait a bit for other feedback, but AFAICS this PR doesn't need to be merged. |
That was intentional because of (1) the potential edit conflict since they changed adjacent lines of code... and (2) I wanted to check that they work together. However, 5030 might take substantially longer to review/approve/merge. |
@eleses @jamshark70 should we close this then? |
Hm... "unsurprising as 5030 seems to incorporate the change here." So if we keep it in 5030, then this PR would be redundant. I suspect we want to keep it -- a cleanup event with a nil ID is not good, regardless of how we got there. |
@jamshark70 and @dyfer - OK to close? |
I confirmed that the issue is still reproducible in current develop, but it is not reproducible after applying #5386 (de-dup EventStreamCleanup). This was a fortunate accident -- I had applied 5386 locally to check the behavior of CallOnce().valueArray, and forgotten to switch back to develop before checking this case. It worked fine with 5386. So, if we have a commitment to merge #5386, then this one can be closed. |
Purpose and Motivation
Fixes #5024
Commit 83e4607 merged in PR #4787 exposed an underlying problem in Pmono's two-part cleanup setup, which can (now at least) fire a
type: off
event with noid
set, turning everything off in the default group, e.g. as in:This is an "emergency fix" that prevents Pmono's cleanup from firing that
off
event ifid
is still not set by the time thecleanup is executed. (The mechanism is also inherited by PmonoArtic.)
A better solution would be to rewrite Pmono so that it doesn't register an incompletely specified cleanup at all, but that is somewhat involved given the number of variables it would need to capture in a closure.
Also this PR will very likely cause a merge conflict with the solution currently envisaged for #4806 which needs to change the previous line in that Pmono cleanup setup code (to conform to the new API for cleanups), so please merge this PR as soon as practically possible.
Types of changes
To-do list