Question / Help Streaming Half Life Alyx on Windows Mixed Reality headset - OBS monitor is all good, viewers say stream is buffering/slow/laggy

Balancer92

New Member
Hi all, I'm having sort of endless problems here with trying to stream Half Life Alyx. I've streamed it 3 times so far, and it seems like no matter what I do, the first 30 minutes of the stream consist of me kind of aimlessly clicking about until the stream is watchable. I'm really not sure why. From my own perspective, when I click on Half Life Alyx for Windows to "focus" on it, my performance in the headset is 10/10, and the "spectator view" on my PC monitor is 10/10, but even though OBS is showing no dropped frames and ~30% CPU usage, viewers say it looks like a slideshow. It seemed like when I clicked on OBS to put it in focus, the quality went back up for viewers, but then my PC struggled to run Half Life Alyx.

I don't really know what I changed, but at some point around 30 minutes into the stream, it seemed usable for both parties. It really feels like it is some kind of issue with minimizing/focusing on specific programs, but I really want to diagnose the issue if possible. If I understand correctly, my PC should be able to run and stream this game without a problem.

Before the most recent stream today, I had tried changing my encoder from NVENC to x264. But as soon as I started streaming, viewers said the stream was very choppy, so I hastily switched it back to NVENC after about 20 minutes. The video bitrate is at 4800 Kbps, audio bitrate is at 160. Base resolution is 1080p, Output resolution is 720p. [After looking at the logs, it seems like x264 encoding was used through the whole stream, so maybe OBS requires a restart to properly change from x264 to NVENC? Regardless, previous streams were using NVENC and had similar problems.]

Logs from the most recent stream: https://obsproject.com/logs/k_9x9iqFVzUaPwch

The stream starts at 16:33:59.225. At 16:52:16.318 and 17:08:24.563, I attempted to restart the stream hoping that would help the issue.

My set up is:

My PC specs are:
Intel i5 7600K 3.80GHz
16GB RAM
GeForce GTX 1660Ti 6GB
Samsung Odyssey+

Programs open at the time are:
Streamelements OBS
Streamlabs Chatbot
Elgato Streamdeck
Windows Mixed Reality Portal (the "preview" monitor is off)
Half Life Alyx
SteamVR
 

Narcogen

Active Member
You're overloading your encoder and your GPU.

16:52:16.318: Output 'simple_stream': Number of lagged frames due to rendering lag/stalls: 1890 (3.5%)
16:52:16.318: [rtmp stream: 'simple_stream'] Freeing 7 remaining packets
16:52:16.319: Video stopped, number of skipped frames due to encoding lag: 13918/54712 (25.4%)

19:45:14.078: Output 'simple_stream': Number of lagged frames due to rendering lag/stalls: 3319 (0.7%)
19:45:14.078: Video stopped, number of skipped frames due to encoding lag: 60882/470177 (12.9%)

17:08:24.564: Output 'simple_stream': Number of lagged frames due to rendering lag/stalls: 5506 (11.5%)
17:08:24.564: Video stopped, number of skipped frames due to encoding lag: 23792/47811 (49.8%)


I would reduce your canvas resolution to 720p. It is not surprising that a 1660 struggles to run Alyx and OBS. Making this change would likely improve both rendering and encoding performance.
 

Balancer92

New Member
Thanks very much Narcogen! I really appreciate the help. A couple more follow up questions if you don't mind:

Any thoughts on using x264 vs NVENC? Should I pick one or the other for better performance or would it not make a huge difference?

My OBS monitor pretty consistently showed a smooth experience, no dropped frames, and about ~30% CPU usage while viewers said the stream was like a slide show. Am I missing a warning or a flag somewhere that something is going wrong? If no one had said anything, I would've only assumed the stream looked great.

Also any thoughts on why the "focus" of Windows seems to affect the problem? Are more resources dedicated to OBS when focus is on that program? It's clear as day and night in the headset when the PC is or is not "focused" on Half Life Alyx.
 

Narcogen

Active Member
You should pick NVENC, but consider turning off psycho-visual tuning. NVENC is generally free; Alyx will use one session for VR but you should have one free for OBS, and otherwise you will be loading your CPU.

Make sure Windows Game Mode is on.

Try running in admin mode.

Set OBS process priority higher if you need to.
 

Balancer92

New Member
Narcogen, thanks so much again for this info. I've been at a loss so I'm very happy to have some direction finally. I just lowered my canvas resolution to 720p (and subsequently resized all my scene sources to the lower resolution). Windows Game Mode is on. I've changed OBS priority from "normal" to "above normal". I've confirmed OBS runs in admin mode, and I've changed Half Life to run in admin mode as well.

Regarding psychovisual tuning - I noticed that is only available under the advanced setup. I'm on the simple setup. I could switch to the advanced view and tinker with those settings, but for now I'll try what I have.

Out of curiousity - when you say "Alyx will use one session for VR but you should have one free for OBS" - what are you referring to?
 

Narcogen

Active Member
Simple settings do have that on by default. I'm not sure why, as it's become very common advice to suggest turning it off.

A consumer grade Nvidia card is capable of two simultaneous x264 hardware encoding sessions (the feature they call NVENC).

OBS running a stream is a session. OBS running a recording session, if the settings are different from the stream, is a session.

And VR apps and games use this feature as well. So users who generally run livestreams PLUS higher quality recording sessions, who then try to do this with a VR game, find they either can't start the game or can't start their 2nd output session in OBS because that's a total of three NVENC "sessions" and they can only do two simultaneously. You're not having that problem, I just mentioned it as an aside.
 

Balancer92

New Member
Ahhh I understand, thank you for the explanation. Yes to clarify I'm not recording, just streaming. I didn't realize NVENC was simply 2 x264 encoders running. Thanks Narcogen for your assistance here, excited to try out some new settings. I'll report back here if I'm still having similar issues.
 
Top