Skip to content

mac-virtualcam: Correct device timer firing rate#9768

Merged
RytoEX merged 1 commit into
obsproject:masterfrom
jcm93:mac-vcam-double-conversion
Oct 27, 2023
Merged

mac-virtualcam: Correct device timer firing rate#9768
RytoEX merged 1 commit into
obsproject:masterfrom
jcm93:mac-vcam-double-conversion

Conversation

@jcm93
Copy link
Copy Markdown
Contributor

@jcm93 jcm93 commented Oct 27, 2023

Description

Resolves the conversion to a Double in OBSCameraDeviceSource, such that the virtual camera device timer fires correctly every 1/60 seconds, instead of trying to fire every 0 seconds.

Motivation and Context

Resolves #9760. CPU use was very high with the new virtual camera extension at idle and while active because of the amount of polling the device timer was doing.

How Has This Been Tested?

Tested locally on my machine. Reduced camera extension process CPU use by roughly 10x.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@jcm93 jcm93 force-pushed the mac-vcam-double-conversion branch from 19ffb98 to 4fa8dfc Compare October 27, 2023 06:59
@jcm93 jcm93 changed the title mac-camera-extension: Correct device timer firing rate mac-virtualcam: Correct device timer firing rate Oct 27, 2023
@PatTheMav
Copy link
Copy Markdown
Member

That was indeed my mistake, the original example code correctly uses 1.0 / Double(kFrameRate) as the loop interval.

@WizardCM WizardCM added the kind/bug Categorizes issue or PR as related to a bug. label Oct 27, 2023
@felippenardi
Copy link
Copy Markdown

@PatTheMav Do you happen to know when a new release candidate with this fix is going to be published? I'd like to try it

@PatTheMav
Copy link
Copy Markdown
Member

It's a critical fix, so we'll probably try to get it in as soon as possible.

@RytoEX RytoEX added this to the OBS Studio 30.0 milestone Oct 27, 2023
@RytoEX RytoEX merged commit 311fb69 into obsproject:master Oct 27, 2023
@sebastian-s-beckmann sebastian-s-beckmann mentioned this pull request Oct 28, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Virtual Camera on OBS 30 is consuming more CPU than OBS itself

5 participants