Frame swap artifacts occurring when HW acceleration enabled and CPU under load #488
Labels
No labels
area/accessibility
area/dependency
Confirmed
Crash Report
Delayed
Design Issue
Duplicate
Feedback required
Good first issue
kind/bug
kind/cleanup
kind/enhancement
platform/linux
platform/macos
platform/windows
priority/high
Question
Request for Comments
Seeking Other Contributors
Seeking Testers
Won't Fix / By Design
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-obsproject/obs-browser#488
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Operating System Info
Windows 11
Other OS
Windows 11 & Windows 10
OBS Studio Version
31.1.0-beta2
OBS Studio Version (Other)
31.1.0-beta2 & 31.0.3
OBS Studio Log URL
https://obsproject.com/logs/HsUwuFk33D2Y1Yxw
OBS Studio Crash Log URL
No response
Expected Behavior
The browser source should be rendered artifact-free.
Current Behavior
Below are screencaps showing the 1-frame long artifacts affecting a browser source set to play a 4k60 video above a #00ff00 color source. There are patterns across the different screencaps, but the artifacts are not always the same. These images were captured by screen capturing the OBS preview, but can also be seen on recordings made by the OBS doing the rendering, as well as in decklink output.
Browser hardware acceleration must be enabled for the issue to arise.
The frequency of frames which are effected is proportional to the load that the CPU is under. The CPU core assigned to run OBS compositing is particularly sensitive.
The issue appears either infrequently or not-at-all if the GPU is running 100% (i.e. GPU bottlenecked). In this instance the video will slow/drop frames, but no artificing is minimized. This part was tested changing videos to ones that were hardware decoded vs software, higher and lower bitrates, and different resolutions to affect GPU usage.
The above was found by correlating HW usage in task manager while trying various combos of things we found to make the problem worse.
Things that exacerbate the issue:
Things that don't seem to affect the issue:
The issue was first noticed to happen occasionally on beefy renderer machines with identical hardware to each other, then reproduced on several separate machines, one of which is where the attached logs come from. On those we see several affected frames per second.
We have some renderer machines on slightly different hardware, but running the same software which don't show the issue at all.
Steps to Reproduce
Anything else we should know?
Obviously running CPU benchmarks in the background is not what we're doing in production, so I think its appearing in that scenario when the CPU scheduler puts too much work on one core, leading to more sporadic issues.
At least on the renderers we see the issue, it seems like the compositing, decklink output and browser source all work from one core, even on a 32 thread machine. My speculation is that some point the CPU takes too long to copy the browser texture from the GPU into RAM, and a partial frame is seen.
I'm very keen to explore the issue more with someone who understands the render pipeline better than I do, in the hope we can find a fix.