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

A few linux behavior changes #68

Merged
merged 2 commits into from
Jun 23, 2022
Merged

Conversation

baconpaul
Copy link
Collaborator

A few changes which only impact the Linux implementation

  1. Call the timer register in a deferred callback launched from
    init
  2. implementsGui has a canUseTimerSupport check

Closes #63

1. Call the timer register in a deferred callback launched from
   init
2. implementsGui has a `canUseTimerSupport` check
Copy link
Collaborator

@jatinchowdhury18 jatinchowdhury18 left a comment

Choose a reason for hiding this comment

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

I'm not able to test on Linux at the moment, but the code changes look good!

defineAudioPorts();

haveCompletedDeferredInit = false;
_host.requestCallback();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to make sure I'm understanding correctly: The idea is that if init() is called on a thread that isn't the main thread, defer the timer initialization to a main thread callback?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A bit different. The idea is that in init the host doesn’t know if a plugin supports timers. So it’s not clear that we can call rather than just probe extensions. See free-audio/clap#111 (reply in thread)

#if JUCE_LINUX
if (_host.canUseTimerSupport())
{
_host.timerSupportRegister(1000 / 50, &idleTimer);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason for the number 1000 / 50?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

50 times a second seemed ok. I guess I could change it to 60 to be 60hz and will do so

@baconpaul baconpaul merged commit d4c2c05 into free-audio:main Jun 23, 2022
@baconpaul baconpaul deleted the linchanges-63 branch June 23, 2022 11:01
baconpaul added a commit to baconpaul/clap-juce-extensions that referenced this pull request Jun 23, 2022
This reverts commit d4c2c05.

For some reason in bws43b8 it causes a segv on macos
baconpaul added a commit that referenced this pull request Jun 23, 2022
This reverts commit d4c2c05.

For some reason in bws43b8 it causes a segv on macos
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.

A few linux <> host behavior changes
2 participants