Skip to content

Abnormally high CPU usage for OBS 31.0.0-betaX versions caused by obs-browser #11485

@w0nd3r365

Description

@w0nd3r365

Operating System Info

Other

Other OS

Kali GNU/Linux Rolling 2024.3

OBS Studio Version

31.0.0-beta3

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/9BLCtWdbxYJWBBhM

OBS Studio Crash Log URL

No response

Expected Behavior

"Normal" CPU usage stats after creating a browser source. Normal in my case is about 3-5% when no other sources are present.

Current Behavior

After creating a browser source, OBS CPU usage spikes to 25-27% and does not fall down whatsoever until I delete the created browser source and restart OBS.

Steps to Reproduce

  1. I cloned OBS repo.
git clone --recursive --jobs 10 [email protected]:obsproject/obs-studio
cd obs-studio
git switch --detach 31.0.0-beta3
  1. I configured OBS using cef_binary_5060_linux_x86_64 from here.
cmake -S . -B build -G Ninja \
-DCEF_ROOT_DIR="/opt/repos/obs-studio/cef_binary/cef_binary_5060_linux_x86_64" \
-DENABLE_BROWSER=ON \
-DENABLE_WEBRTC=1 \
-DENABLE_FFMPEG_LOGGING=OFF \
-DENABLE_LIBFDK=ON \
-DENABLE_SNDIO=ON \
-DENABLE_JACK=ON \
-DENABLE_AJA=OFF \
-DOBS_BUILD_NUMBER=8 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
  1. I built OBS debian package and installed it.
ninja -j6 -C build
cmake --build build --target package
sudo apt install ./build/obs-studio-31.0.0-beta3-Linux.deb
  1. Launched OBS. Currently CPU usage is ~3% on an empty scene. I create a browser source with the default settings including URL. CPU usage spikes to ~26% and doesn't fall at all as time goes. I delete the dummy browser source and transition. Still the CPU usage stays at the high of ~26%. I restart OBS and it's CPU usage is now the normal of ~3%. If I create a browser source, the issue occurs again. In htop, obs process is maxing out 1 of the 4 logical CPU cores to ~100%.

Anything else we should know?

I have rebuilt OBS using several different CEF binaries from spotify and adamcake but CPU spike issue still occurs for every build. So maybe it's not caused by CEF but by OBS internals?

To be certain it's not an OBS regression, I tried building versions 30.2.3 and below but failed because of the configuration error below. I can only configure versions 31+ successfully. Thus I don't know more about the OBS regression hypothesis. How can I fix this build configuration error?

CMake Error at plugins/obs-browser/cmake/os-linux.cmake:23 (set_target_properties_obs):
  Unknown CMake command "set_target_properties_obs".
Call Stack (most recent call first):
  plugins/obs-browser/CMakeLists.txt:53 (include)


-- Configuring incomplete, errors occurred!

Maybe my build environment is to blame? I don't know yet how to ascertain this. I had older OBS debian pkg builds which were very good but couldn't install them due to missing deps thanks to dist-upgrade. I can't install from your PPA repo either because of dependency conflicts that can't be sanely satisfied. My only functional OBS instance is a flatpak installation ,version 30.2.3, which has no such CPU spike issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConfirmedThis bug report has been confirmed by project membersLinuxAffects Linux

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions