Question / Help 4-core 8-thread Xeon CPU 100% max using OBS - Insufficient hardware? Or Software config issue?

kmleon

New Member
Greetings,
We are trying to get a weekly show underway on Twitch.

Unfortunately, even on an 4-core 8-thread Xeon system, we are getting 100% utilization under OBS. That being said, it is a laptop.

We have a pretty complicated setup, so a lot of variables could be the culprit, I am hoping the OBS community can help us figure out the best options.

Hopefully this is just an operating system and/or OBS configuration issue that can be solved through tweaking parameters.

Or are we going to to buy a an even beefier system that is a desktop instead of laptop? Which is going to cost at least $1,500.00 minimum to be notably more than this 9 month old $3k laptop. We prefer the laptop because it would make it easier to take the show on the road. But if it is a laptop architecture (bus) issue, and only a desktop can address, then we need to know ASAP to budget to build replacement.

In the system monitor, RAM utilization is low. With the drive being 1 TB ssd, HD i/o is low (and fast), the only bottleneck appears to be the CPUs.

Once everything is loaded in OBS, and we are streaming to Twitch, we are running about 60-80% CPU utilization initially on all 8 cores! Then over a short time, it ramps up to 100% on all 8 threads in about 20-30 minutes. Then the viewers on Twitch say our audio starts getting "robot like", and the video stream starts to have choppy frames. We have to shutdown OBS and restart it to clear that up for about 5-10 minutes of streaming, or do a full system reboot to clear it up for another 20-30 minutes.

Operating System: Ubuntu 18.04 LTS with latest updates.

Hardware: Dell Precission 7720 laptop XCTO Base. 1 TB SSD drive
16 GB 2400Mhz DDR4 non-ECC SDRAM (upgradable to 128GB).
CPU: Intel Xeon e3-1505M v6 (Quad Xeon 3.00 Ghz, 4.00 Ghz Turbo, 8M B 45w)
Vid card: Radeon Pro WX7100 w/8GB GDDR5
17.3" UHD 3840x2160 laptop screen
1920x1080 HDMI to 50" big screen for local participants to see remte participants
1920x1080 D-port>HDMI to 20" external monitor for GM to view laptop from across the studio.
4 USB Logitech 920c cameras and 1 USB logitech 922c camera (local participants).
1 USB Audio input from Focusrite 2i
3 Remote people through Xwindow capture in OBS using Jitsi video conferencing instance using Firefox (remote participants).
1 remote person through Xwindow capture in OBS using G+ Hangout using Chromium (remote artists).

Appreciate any suggestions the community might have on how to make this (required complex) setup work.

Thanks!
 

Tuna

Member
Have you checked which process increases CPU usage over time? Is it OBS by itself or is maybe some of the other external processes causing it?
 

pkv

Developer
you should post the streaming settings:
- which encoder (x264, enc-amf )?
- which encoder settings ? bitrate, presets, etc
which resolution, which framerate ?
and paste your log to pastebin or gist and link or upload it.

Without this, it's not possible to be of any help
 

kmleon

New Member
Will do! I will grab that additional information and post it here shortly. Thanks for the guidance of what else is needed to troubleshoot this. I just didn't want to spend all the time digging deeper if you thought that it was just underpowered hardware issue. I am assuming from the response that this is not lack of sufficient hardware, and more likely configuration. That will be a great relief if so.
 
Last edited:

kmleon

New Member
I went through a lot of step-by-step, and it looks like the combination of OBS with _any_ videconferencing causes the issue. I tried it with G+ Hangout, Skype, and JitSi with similar results, eventually, by about an hour, it is up around 99%.
Running Hangout/Skype/Jitsi by themselves doesn't do this, nor does OBS, it is the combination of the two that becomes the problem. I hope this helps come up with some ideas to address. Thanks!

Here is a lengthy log of the step by step...
System baseline, just booted up, nothing else running gnome system monitor:
CPU1-8 around 0.0 to 5% idling. RAM at 2.4 GB (15%) swap 9. Network around 0.
Load mostly due to network monitor and compiz.
Starting OBS with everything disconnected (webcams, external Focusrite audio USB input, external monitors, etc. (but not streaming):
A fresh profile, fresh scene collection, no extrernal devices:
All 8 CPU threads fluctuating wildly, all bouncing around 5 -20% initially. Just sitting there, after about 5 minutes (still not streaming), CPUs fluctuating between 3% to 40%. Load due to (mostly) OBS. Some other light load from 1-2% each): compiz, pulseaudio, and system monitor, nothing else really even at 1%.
AFter about 10 minutes just leaving OBS open like this, still not streaming, no external hardware, appears to be steadiluy around 5% to 20% across all 8 cpu threads.
Adding just internal webcam and audio to sources:
Webcam: builtin laptop: Device: Integrated_Webcam_HD: Integrated. Input: Camera 1. Video Format: YUYV 4:2:2 Resolution: Leave Unchanged. Frame Rate: Leave Unchanged. Use Buffering checkmarked.
Audio: HDA Intel PCH, ALC3254 Analog. Rate: 44100 Hz.

Settings > Stream
Stream Type: Streaming Services
Service: Twitch
Server: US West: Portland, Oregon
Stream key (private).


Settings > Output:
Output Mode: Simple
Streaming: Video Bitrate: 3000
Encoder: Sofware (x264)
Audio Bitrate: 160
Enable Advanced Encoder Settings (not checked)
Recording (not recording currently, so irrelevant).

Settings > Audio:
Sample Rate: 44.1 Khz
Channels: Stereo

Settings > Video: Base(Canvas) resolution: 1920x1080
Output (scaled) resolution: 1920x1080
Downscale filter: Bicubic (shapened scaling, 16 samples)
Common FPS Values: 30


When start stream:
Gnome system monitor reports:
All 8 CPU threads jump to minimum 20% load, fluctuating between 20-40% load. Just one built-in webcam and audio.
Network steaming around 300-400IKB/s
RAM: 2.6 GGB (17%)
OBS reports load in the bottom of the window as: 17-21%, 30 fps, kb/s: 2700-3100, Dropped Frames 0.

Going to let it run for 45 minutes at this as baseline... started 1:47 pm
Stop 14:31.
Load still around %20-40% avross all 8 cpu threads. With OBS still running, but just stopping the stream, load dropped bak to around 3% to 20% across all cpu threads...
So, no misbehaving there.
Now to add devices only (no xwindow captures)...
Just adding webcams, not monitors or xwindow captures:

Before adding devices, clicked "Exit" for OBS. I just locked up OBS, unresponsive...
CPUs starting going crazy, spiking over 40% across all of them. Had to manually force OBS to kill.
Did a "Force Quit", CPU1 spiked to 100% for about 30 seconds, then CPU spioked to 40% for about 2 minutes then dropped.

Did a full system shutdown and reboot to clear that out...
Freshly booted up. Adding USB devices first before starting OBS...
Adding just usb powered hub and 5 webcams only (1x built-in camera, 3x logitech 920c, and 1x 922c), not external USB focusrite audio or external archive hard drive...
Added all 5 cameras viewable, using up about 1/6th of total space. For show, we need to be able to switch to scenes that have each camera by itself in full screen, but for initial testing all in one screen (see screenshot).
Without streaming, CPU around 5% to 22%.

Begin streaming 14:48:
Load after about 4 minutes around 20-40% on system monitor, OBS: 17%
Will let run for a while and check back on load...

15:23 load about the same. Stop stream.
Exit OBS went smoothly this time. CPU2 spiked for abi but eventually all cpus settled back down to around 0-3%.

Add focusrite audio usb to the usb hub: Scarlett 2i2 USB as Audio input Capture Device. Rate 44100 Hz. Caused OBS to blow up! CPU4 = 100% for about 1 minute, then OBS disappeared., Then CPU8 went to 100%.Then about 30 seconds later notification that OBS crashed by Ubunutu popup.Then CPUs dropped back to normal.

Restarted OBS. CPU spiked to 100% on all 8 for about 30 seconds. Then started streamingand cpus settled back down around 20-40%. Hmmm.
Jitsi in Firefox, CPUs now 40-60%. Not even Xwindow captured yet.
Now 5 minutes in, and appears to be Jitsi the culprit?
CPU 75 to 80%!!! 15:44

Just killing jitsi but not browser, CPUs dropped back to normal 20-40% (all of this while streaming).
15:47 joining over Chromium to G+ Hangout.
CPU jumped to 40-50% range...

15:50 CPU still okay.
15:51 hangup Google Hangout. Kill browser. Now going to test Skype alone...
NOTE: G+ Hangout was 6.4 MB/s network bandwidth

16:32 back from running errands. Now going to try Skype alone...
16:33 connected via skype, with OBS running, but not streaming. And not xwindow captured into OBS yet.

16:34 - system monitor: 20-55% OBS thinks only 2.8%.
Start stream, still without xwindow capture...
CPUS jumped: 40-60% immediately...
OBS reports: 20.5%

16:40 add xwindow of this skype instance...
Add > Window Capture (Xcomposite) of Skype window...
Window: Skype
Crops: 0

Swap red and blue: (checked)
Lock X server when capturing: unchecked
Capture cursor: unchecked
include X border: unchecked
User alpha-less tecture format: (Mesa workaround): unchecked.
Now in the 60-75% range on system onitor.
OBS reports: 25%
Resized from full size down to fit with the other 4 webcams on the stream scene.
huge fluctuations from down to 40% up to 80%

16:47 now stabilitized around 40-65%.
Now add G+ Hangout... with chromium...
just loading the browser and hangouts.google.com page, spiked up 10+% on bottom and top end.

connected with G+ Hangout and Skype running, and 4 webcams, and USB Audio:
16:49 System Monitor CPUS: 80-90%

16:55
Added xcomposite of the G+ Hangout. still in the 80-90% all 8 CPU threads range...
OBS thinks only 31.3 % load. 0 frames dropped. 2123 kbps

17:03
Killed skype completely. CPUs all dropped down to 40-60% (whil still streaming and still connected anx xcomposited G+ hangout)
OBS reports 33.2%

17:06:
Receiving video but not sending, cpus back up around 40% to 80% wild swings...

17:07:
Sending and receiving video over Jitsi, + G+ hangout, +OBS streaming: 80-95% CPUs in system monitor. OBS reports:

17:12
Still wildly all 8 cpus between 60-95%. even after adding xcomposite of the jitsi firefox browser instance. video latency okay. audio on stream still okay.

Going to leave running for a while.
Going to start setting up our own jitsi server.

21:57
After being on air streaming for 57 minutes, with G+ for remote, and 2 local webcams and USB audio, up around 85-99% between all CPUs.RAM at 5.8 GB (37% of 16 GB). Network: 200 KB/s receiving, Sending 330-550 Kbps.
OBS reports: 41.2%,25.16 fps, dropped frames 625 (0.6%), 3006 kbps

As soon as stopped video conference, dropped back down to about 60%, and OBS still around 40%.
 

Tuna

Member
That reads like a lot to put back the puzzle.. sounds to me like the overall CPU load is too high for what you are trying to do. I would check upon the following: Figure out what GPU driver are you currently using. Check whether it makes a difference to switch them (That is using the Opensource driver versus AMD closed source driver (Is there still such a thing? I missed AMD's development lately)). Check that your browsers and GPU drivers work together when it comes to hardware video decoding. It can make a huge difference if you have 4 HD video streams decoded in parallel on hardware versus in software.
 

kmleon

New Member
Thanks Tuna! That is helpful. I believe that AMD allowed their actually driver for their video cards, including the wx7100, supposedly native to the Linux kernel these days, but not sure, and not sure about performance tweaks. So will check that out.

If it is hardware inadequacy, any reecommendations for trying to do what we're doing?


We were trying to budget (we're a non-profit organization) to build the following in the hopes it would be enough to overcome the hardware issue (but sounds like might not matter if it is the same kind of software issues?):

Considering $1500 replacement with desktop hardware if current ($3000) laptop hardware is inadequate. But maybe this would not actually help?
* Asus ROG MB Crosshair VI Hero AM4 AMD X370
* Asus Geforce GTX 1050 2G (but if what you say is true about the video card and rendering video, maybe this would be backwards priority? We thought we needed more Motherboard bus throughput and CPU power, you are suggesting we need more GPU power?)
* AMD Ryzen 7 2700X 8-core 3.7/4.3 Ghz Socket AM4 105W CPU
* Samsung 860 Evo 500 GB Sata III V-NAND 3-bit MLC Solid State Drive (SSD)
* 32 GB DDR4 RAM
 

kmleon

New Member
Is throwing hardware at this the best or last option?
Keeping in mind we are not running video games for the stream. We are running tabletop role-playing games with remote players (over video conferencing like Jitsi/Skype/G+ 3x), plus one remote real-time drawing artist over G+ Hangout, and 4 local (in studio) players (each with their own webcam for zoom, as well as 1 group webcam) simultaneously.
Would the AMD Threadripper CPU be more helpful for what we are doing?
Or will the regular Ryzen be fine?
Should we put more into the GPU or the CPU?
Or does it seem the laptop hardware we already have (as specified earlier) should be sufficient for the task if we can just figure out all of the OS/OBS/Software/Browser/Driver tweaks?
 
Last edited:

Tuna

Member
First of all.. do your skype/hangouts also send video back to the remote person? Thats another CPU load. Is it possible to switch that off? But apart from that - and I hate to say that - your most cost effective way may be to try out Windows. The browser support on Linux when it comes to hardware video encoding and decoding is just very poor at the moment while on Windows it usually is pretty good (for decoding at least.. for encoding I don't know). So it may already help you to reduce the CPU load to handle your described scenario with the existent hardware. But no guarantees from my side..

Not sure if its possible - maybe you can hand over the video encoding inside OBS to the AMD GPU instead of using x264 software encoder. This may give you enough relaxation on the CPU to handle the other tasks well. But again I'm not sure whether OBS on linux supports this.

Of course you can try to fight poor software support with throwing money at the problem by buying better hardware - but again so guarantees from me if a specific system is enough for a certain task.
 

kmleon

New Member
As much as I hate to use Windows anywhere, whenever possible anymore, I will try installing a dual boot install on the same laptop to see if it addresses the issues sufficiently. If I recall from a few months ago, performance was much worse under windows, but that was with the built-in hybrid 5600 rpm hard drive, rather than the SSD I put in since. I'll give it a shot and report back. Thanks again!
 
Last edited:

kmleon

New Member
Oh, regarding the video sendreceive. One requires bidirectional, the other unidirectional.

Explaining the setup a little more:
Local Broadcast Studio (and tabletop RPG room):
Game Master (OBS/twitch webcam1)
Local Players group camera (OBS/Twitch webcam2)
Local overhead battle webcam (OBS/twitch webcam3)

later hoped to have one webcam per local player for zooming in on each as they spoke, but for now get by with the group cams until performance issues addressed.

Jitsi/Skype:
Local overall group webcam4 through JitSi/Skype. So the remote players can see the GM and local studio group players real-time (rather than high latency of Twitch view).
Remote players (3), each sending and receiving video.
Xcomposite of them (as group) into OBS scene.

G+ Hangout:
Remote real-time artist. Artist needs to be able to hear the game real-time (and would be even better if could see the group real-time as well, but that hasn't been absolutely necessary).
Artist shares their desktop of their drawing app. They draw the described events in the game real-time as they are happening.
Xcomposite of artist's drawing into OBS/twitch, for Twitch viewers to see happening either in background (greenscreened), or in a separate window.


I have succeeded with all of these pieces individually over the years, but trying to piece them altogether at once has been the challenge.
 

kmleon

New Member
Just out of curiosity, it isn't possible to do any of these things networked it it? Like VLC and others can share tasks between different computers and then route to hub broadcast system. OBS isn't capable of that is it? Because then I could offload each piece to separate computers (i have lots of other systems lying around in the i7+ range), but I am not aware of anything that can do that and work with Twitch. Anybody know otherwise?
 

kmleon

New Member
Hmmm, I wonder: https://www.videolan.org/vlc/streaming.html Could I have one computer with the artist with VLS, another computer with the remote players with VLS, and another computer with all the local cams/players with VLS. Have all 3 computers then send to the hub broadcast system. And then have the OBS hub broadcast system running VLC to receive from the other 3 systems and send that through OBS to Twitch? Seems like an awful lot of latency and complexity issues, and not sure OBS and VLC could even interoperate that way... hmmmm...
 
Top