Graphics stutter after starting audio capture

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Graphics stutter after starting audio capture

Postby NickChapman » Wed May 25, 2022 2:36 am

Hi all,
I'm running into an issue where I get a graphics stutter - a frame that takes ~50 ms to render, instead of the usual 1 ms or so.

I've tracked the cause down to audio capture of the browser.
When I return true from GetAudioParameters() to enable audio stream capture, then anywhere from 200 ms to 2.5 seconds after initiating capture, the application stutters, with a single frame that takes > 50 ms to render.

From previous experience, this type of graphics stutter is caused by the nvidia OpenGL drivers being blocked when trying to allocate or free memory, due to excessive memory alloc/frees on some other thread.

It's possible also some threading priority issue.

The stutter is relatively reliably reproduced - it happens maybe 80% of the time after initiating audio capture.

When I return false from GetAudioParameters(), no such stutter is caused.

For context, I'm using offscreen rendering in an OpenGL app, on Windows 10, GPU is RTX 3080. CEF build is 4951, built from source.

Any ideas / thoughts / workarounds?
NickChapman
Techie
 
Posts: 21
Joined: Sun Apr 24, 2022 2:42 am

Re: Graphics stutter after starting audio capture

Postby amaitland » Thu May 26, 2022 7:41 pm

Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Graphics stutter after starting audio capture

Postby NickChapman » Fri May 27, 2022 7:06 am

amaitland wrote:Possibly related to https://bitbucket.org/chromiumembedded/ ... acket-loss


Possibly, however it looks like the proposed change in that thread was committed to Chromium already: https://chromium.googlesource.com/chrom ... %5E%21/#F1
NickChapman
Techie
 
Posts: 21
Joined: Sun Apr 24, 2022 2:42 am

Re: Graphics stutter after starting audio capture

Postby amaitland » Fri May 27, 2022 2:49 pm

That's the only performance issue I'm aware of.

Have you confirmed the change is included in your local build?
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Graphics stutter after starting audio capture

Postby NickChapman » Sat May 28, 2022 5:54 am

amaitland wrote:Have you confirmed the change is included in your local build?


Yes, the change is in my local chromium src.
NickChapman
Techie
 
Posts: 21
Joined: Sun Apr 24, 2022 2:42 am

Re: Graphics stutter after starting audio capture

Postby amaitland » Sat May 28, 2022 6:15 am

- Load chrome://gpu in a CefBrowser instance, confirm GPU acceleration is enabled
- Try with an official spotify build, make sure it's not something specific to your source build.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Graphics stutter after starting audio capture

Postby NickChapman » Mon May 30, 2022 5:51 am

amaitland wrote:- Load chrome://gpu in a CefBrowser instance, confirm GPU acceleration is enabled


The issue happens with GPU acceleration, and also without (e.g. using --disable-gpu and --disable-gpu-compositing")
NickChapman
Techie
 
Posts: 21
Joined: Sun Apr 24, 2022 2:42 am

Re: Graphics stutter after starting audio capture

Postby NickChapman » Mon May 30, 2022 9:06 am

amaitland wrote:- Try with an official spotify build, make sure it's not something specific to your source build.


Tried with latest spotify build, same problem.
NickChapman
Techie
 
Posts: 21
Joined: Sun Apr 24, 2022 2:42 am

Re: Graphics stutter after starting audio capture

Postby amaitland » Mon May 30, 2022 3:50 pm

Are you using release builds? Antivirus disabled?

Does the problem reproduce with different hardware?

Perhaps Marshall has some other suggestions.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Graphics stutter after starting audio capture

Postby magreenblatt » Tue May 31, 2022 2:15 am

You could try the Chromium profiling tools, to see if that points to a possible culprit. https://chromium.googlesource.com/chrom ... troduction
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 47 guests