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

DSP clicks/dropouts while patching #1949

Open
tmhglnd opened this issue Nov 17, 2024 · 5 comments
Open

DSP clicks/dropouts while patching #1949

tmhglnd opened this issue Nov 17, 2024 · 5 comments

Comments

@tmhglnd
Copy link

tmhglnd commented Nov 17, 2024

Hi! I'm encountering quite a lot of clicks/pops/dropouts in the sound while patching. The moments they occur:

  • When adding new objects or making connections, also when the objects added are just data-domain.
  • When selecting an object (just clicking on it).
  • It seems it has to do with my buffersize at 64 samples (even tho cpu is at 2%), but also occurs at higher buffersizes when the patches get a bit bigger.
  • I'm using plugdata v.0.9.2

I'm not sure what the reason for this would be. I've compared a bit with Pd 0.55, there the adding of new objects doesn't give me any clicks at 64 samples, also with some bigger patches (although at some point, yes), but I don't know how different plugdata is from Pd in this aspect, so don't want to assume it should be the same.

In any case it would be amazing if the "live patching" aspect could be improved in this aspect.

In any case thanks for all the work of course!

@timothyschoen
Copy link
Collaborator

timothyschoen commented Nov 17, 2024

Hi!

I think I get why that happens: if we need to make changes to the patch from the GUI thread, we need to pause the audio thread to make sure Pd doesn't touch these objects. If you set your block size to 64, we have very little time that we can pause the Pd thread without causing dropouts. Pd-vanilla works a bit differently, so they don't have this problem as much.

I'll look for places where we are holding the lock on Pd for too long (or too often). It makes sense that currently this is a problem for adding/removing objects and connections, but I think it definitely shouldn't happen while selecting for example.

@tmhglnd
Copy link
Author

tmhglnd commented Nov 18, 2024

Ah right, I see. Yeah if this can be improved for the selecting part that would be great already I think!

@timothyschoen
Copy link
Collaborator

Should be a bit better now!

Btw: there was an upload issue with nightly builds, causing them not to get updated on the website. This is why the save issue didn't get resolved for you before. That's now fixed!

@tmhglnd
Copy link
Author

tmhglnd commented Dec 7, 2024

Seems to work a bit better now indeed! But not entirely gone.

It seems to mainly happen if I click on an audio-object, but occasionally also still on data-objects. Interestingly it doesn't happen at all when I click-drag to select one or more objects. Also doesn't happen if I first click-drag to select one object, and then click on that object to change the text.

So there is a difference when clicking on a single object vs click-drag-selecting it seems?

@timothyschoen
Copy link
Collaborator

timothyschoen commented Dec 7, 2024

Ah, I see. When you click the object, it does some undo preparation for an upcoming drag event. And unfortunately that undo preparation even involved calling canvas_suspend_dsp(), so that would make it very clicky.

0663c61 should resolve it in 2 ways:

  • canvas_suspend_dsp() is no longer called when we create an empty undo sequence. I think this is gonna fix bunch of other clicks too.
  • Undo preparation for dragging now only happens when you actually begin dragging, not when you just click an object.

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

No branches or pull requests

2 participants