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

Topic/nodeproxy bundling queue #4461

Merged

Conversation

telephon
Copy link
Member

@telephon telephon commented Jun 20, 2019

Purpose and Motivation

This fixes #3344.

It makes sure that:
a) SynthDefs have a unique name instead of a channel id
b) SynthDefs are freed even when the bundle is canceled

Not setting the nodeID to nil is ok, nothing substantial depends on it.

For some reason, addPrepare needs to be replaced by a direct adding.
I would have thought that either way should be OK, but addPrepare
will cause SynthDef not found errors under load (when bundles are
canceled). This may need further checking, including the server
behaviour.

Types of changes

  • Bug fix

To-do list

  • Code is tested
  • All tests are passing
  • This PR is ready for review

@telephon
Copy link
Member Author

There is a related problem that requires a fix: #4457

@telephon
Copy link
Member Author

@redFrik can you take a look if it solves the issues you've had? Thanks!

@mossheim
Copy link
Contributor

@telephon just a reminder to label your PRs when you submit them :)

@telephon telephon added comp: class library SC class library bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. labels Jun 21, 2019
@redFrik
Copy link
Contributor

redFrik commented Jun 25, 2019

@telephon if you mean this https://www.listarc.bham.ac.uk/lists/sc-users/msg64271.html
then sorry no - still there with the above changes it seems.

//recompile
s.boot;

//run this multiple times. stop with cmdperiod. sounds only first time
(
Ndef(\out, {Ndef.ar(\saw)}).play;
Ndef(\saw, {VarSaw.ar([400, 400.4], 0, 0.2, 0.1.poll)});
)

//this one will sound each time
(
fork{
	Ndef(\out, {Ndef.ar(\saw)}).play;
	0.1.wait;
	Ndef(\saw, {VarSaw.ar([400, 400.4], 0, 0.2, 0.1.poll)});
}
)

Copy link
Contributor

@muellmusik muellmusik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to do what's advertised. One query about the added test below.

@mossheim
Copy link
Contributor

this branch has conflicts FYI @telephon

test: make sure that a status message has been sent
This makes sure that:
a) SynthDefs have a unique name instead of a channel id
b) SynthDefs are freed even when the bundle is canceled

Not setting the nodeID to nil is ok, nothing substantial depends on it.

For some reason, `addPrepare` needs to be replaced by a direct adding.
I would have thought that either way should be OK, but `addPrepare`
will cause SynthDef not found errors under load (when bundles are
canceled). This may need further checking, including the server
behaviour.
@telephon telephon force-pushed the topic/nodeproxy-bundling-queue branch from 641b2dc to 490ccac Compare December 28, 2019 09:13
Copy link
Contributor

@muellmusik muellmusik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One OTT query on the test, but happy to approve if the answer to that is no.

@telephon
Copy link
Member Author

@telephon if you mean this https://www.listarc.bham.ac.uk/lists/sc-users/msg64271.html
then sorry no - still there with the above changes it seems.

//recompile
s.boot;

//run this multiple times. stop with cmdperiod. sounds only first time
(
Ndef(\out, {Ndef.ar(\saw)}).play;
Ndef(\saw, {VarSaw.ar([400, 400.4], 0, 0.2, 0.1.poll)});
)

//this one will sound each time
(
fork{
	Ndef(\out, {Ndef.ar(\saw)}).play;
	0.1.wait;
	Ndef(\saw, {VarSaw.ar([400, 400.4], 0, 0.2, 0.1.poll)});
}
)

Thanks @redFrik I'll see what I can do about that silly problem.

@muellmusik
Copy link
Contributor

What's the status of this @telephon? Are we awaiting further changes or will that be another PR?

@telephon
Copy link
Member Author

telephon commented Jan 3, 2020

@muellmusik that should be another one. It might be related, but I'm not sure.

@muellmusik
Copy link
Contributor

Okay, then any reason not to merge this? @brianlheim or @jamshark70 should we hold off for reviews from either of you?

@jamshark70
Copy link
Contributor

I think it looks ok -- after updating the unit test, did you try the unit test without the code fix? It should fail w/o code fix and pass with it.

@telephon
Copy link
Member Author

telephon commented Jan 3, 2020

It's long ago, but I usually do something like that.

var numBefore, numAfter;
server.sendStatusMsg;
server.sync;
numBefore = server.statusWatcher.numSynthDefs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since these few lines of code consumed quite a bit of time in discussion, could you please add a brief comment indicating why server.sendStatusMsg is here so the next person to read it understands it more readily?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!

@mossheim mossheim merged commit 552f720 into supercollider:develop Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. comp: class library SC class library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NodeProxy bundling is broken
5 participants