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

Add hardware accel support under Linux #453

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tytan652
Copy link
Contributor

@tytan652 tytan652 commented Sep 11, 2024

Description

Requires:

Required by:

Add hwaccel support on Linux with CEF 6533 and later

Caution

NVIDIA might need to be blacklisted due to their inconsistency on supporting GBM and incomplete DRI3.
TLDR: Only latest generations with latest driver has a likelihood to work
NVIDIA driver has been blacklisted

Motivation and Context

Just wanted to try to make it somehow work for fun, ended up making it for real…

How Has This Been Tested?

Tested under Wayland and X11.

Types of changes

  • New feature (non-breaking change which adds functionality)

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.

browser-client.cpp Outdated Show resolved Hide resolved
@tytan652 tytan652 force-pushed the linux_hwaccel_pr branch 2 times, most recently from 3ee8f81 to 5496ec4 Compare September 12, 2024 11:35
jmickelonis added a commit to jmickelonis/obs-browser that referenced this pull request Sep 30, 2024
@RytoEX RytoEX requested a review from kkartaltepe October 17, 2024 19:11
Copy link
Contributor

@kkartaltepe kkartaltepe left a comment

Choose a reason for hiding this comment

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

Seems fine overall, i really wish we could pin down the modifier issue on x11 to something in cef's codebase... at least then we could see if it ever got fixed in the future.

@kkartaltepe
Copy link
Contributor

Doesnt compile with ENABLE_BROWSER_SHARED_TEXTURE set to 0 because this is used to avoid compiling the drm-formats stuff, but they are still referenced. Just remove the conditionals and always build these functions.

@kkartaltepe
Copy link
Contributor

kkartaltepe commented Oct 20, 2024

Maybe i'm missing something on how this was tested, but current master sets the BrowserHwaccel option to false so nothing here takes effect until https://github.com/obsproject/obs-studio/blob/master/UI/obs-app.cpp#L1268-L1278 is flipped.
--- edit
I see this is the dependent PR you mention.

@kkartaltepe
Copy link
Contributor

https://gist.github.com/kkartaltepe/ebf66527a38f188c8b07eb43b2d37de6 I dont remember if this happened as well on my original test months ago. But on my steamdeck tier setup there is significant rendering performance loss so rendering is twice as slow for a scene with 10 browser sources.

@tytan652
Copy link
Contributor Author

tytan652 commented Oct 20, 2024

Doesnt compile with ENABLE_BROWSER_SHARED_TEXTURE set to 0 because this is used to avoid compiling the drm-formats stuff, but they are still referenced. Just remove the conditionals and always build these functions.

#if ENABLE_BROWSER_SHARED_TEXTURE should have been #ifdef ENABLE_BROWSER_SHARED_TEXTURE, I fixed it.
The code relies on whether it's define or not, not its value.

I dont remember if this happened as well on my original test months ago. But on my steamdeck tier setup there is significant rendering performance loss so rendering is twice as slow for a scene with 10 browser sources.

This is why we test, I don't know I would be able to reproduce…

@tytan652
Copy link
Contributor Author

Changes:

  • Avoid linking libdrm but expose it's include directory since we only need DRM_FORMAT_
  • Blacklist NVIDIA driver since it does not work well on both Wayland and X11

@tytan652 tytan652 requested a review from kkartaltepe October 27, 2024 16:38
Testers have reported that CEF and NVIDIA driver does not seem to work
well together.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

3 participants