Performance degeneration / freezing / packet loss after some time
After the streaming is running for some time time (10-45min and longer) an issue occurs that results in:
- bad visual quality (macro blocks)
- lost packages
- complete freeze of the client app
Stopping the client on the HMD and restarting it helps for a shorter period of time (5-10min) and then the error reappears . There have been several issue reports (#64, #54, #51, #6) and I'm trying to bundle all information and work done (#66) to find this bug so far.
What we know so far:
- Issue is most likely on the client (Quest) side. The encoded video on the server side looks fine
- Sound is not the issue, even with sound enabled, the issue appears, but later.
- Changing the video encoder settings on the server did not help (intra refresh, number of reference frames and encoder low latency profile)
- changing power management on the quest did not help
- Using h264 seems to prolong the time until the error occurs
- Its not a buildup in one of the queues (NAL or encoder frames), flushing them does not help
- Freezing was probably fixed by changing the encoder profile to low latency
You didn't mention that once the issue starts to appear, the Quest app cannot be paused / resume / stopped properly (with menu button) :
- The screen becomes black on resume (but sound seems to still work, so does tracking)
- In this state if you try to stop the Quest app from the menu, a crash message appears after a little while (either a few seconds after the app is closed, or when you try to restart it).
Like FingrMastr said in the other thread, this suggests strongly that a thread becomes overloaded/stuck in the Quest, preventing the normal behavior which is to restore the stream on resume, or to close the threads properly on exit.
-
Is it possible to save the ALVR-server stream to a local drive? I would try to watch it with a media player within the QUEST (VLC-stream and Quest-local) and see if the QUEST reacts similiar to the ALVR-client.
-
Is it possible to let the ALVR-server stream pre-encoded (h.264/h.265) video? I would try to stream by ALVR a video encoded by seperate encoding software (with similiar parameter in resolution, fps, bitrate etc.) and see if the QUEST reacts similiar to the current ALVR stream decoding.
Is there a way to monitor the QUEST Hardware (CPU/GPU utilisation, RAM utilisation, Temperatures etc.) in some way?
Did some testing and analysing (focused on the decoding performance of the quest, independant from ALVR streaming but results could also be valid for ALVR), and I think I found settings which should work without "performance drops after a time". The problem is the encoding was performed by "OBS Studio", so maybe some of the settings need some translation to ALVR-Server settings....
my conclusion is that following encode setup of alvr should be fine as a input for the oculus video decoder: encoder: Hardware NVENC videobitrate: 50000kb/s (50 mbit/s) audiobitrate: 64 coderprofile: "low latency+quality" (!!) color format: @nv12 color range: 709; limited scale filter: bilinear resolution: 2560x1440 (!!) fps: 72
Please try the mentioned encoder settings in ALVR.
Some more optimization to the settings color format, color range and scale filter could lead to better image quality. To drive native resolution to/with oculus quest without issues, it is much more complicated to achieve, regarding my theory (how the decoder works).
Paket loss could be a seperate problem but could also depend on the performance issue!
_some kind of log/notes, what I did: start log: Playback on Oculus with oculus gallery, video streamed by Win 10 DLNA
recorded scene: auto-gameplay in assetto corsa recording SW: OBS Studio Some parameters: OBS encoder: Hardware NVENC videobitrate: 50000kb/s (50 mbit/s) audiobitrate: 64 coderprofile: see following explanations color format: see following explanations color range: see following explanations scale filter: bilinear resolution: scaled output = basic resolution; see following explanations
Playback on Oculus with oculus gallery, video streamed by Win 10 DLNA OBS Hardware NVENC
first Step used a ALVR like stream 2888x1600 @72 fps by OBS studio @low latency+quality @standard priority (RTX 2080 ti was in a kind of energy profile in MSI afterburner) big freezes about half a second (many/all of them are also visible on PC video playback, ingame they were not recognized by me), framerate is lowering over time, at the beginning of the video is smooth framerate (on pc it looks not that smooth on 60 Hz display but constantly), audio was perfect all the time. Summary of Quest behaviour: no frequent "network paket loss"-style failures identified within 40 minutes of streaming, but frame rate seems to decrease over time.
Maybe the freezes where a result of writing performance to HDD (5400rpm) or the encoder does not like the MSI afterburner profile. --> Recorded now to more performant storage in writing (HDD 7200 rpm; SSD), use performance profile @gfx and tested: Big Freezes are gone with HDD 7200 rpm and performance profile for gfx.
--> some theories on working process on the HW decoder (snapdragon 835 specifications) and made some decisions for the resolution and framerate setup...
2560x1440 @ 120 fps by OBS studio @low latency+performance @NV12; 601; limited @high priority (RTX 2080 ti with high performance MSI afterburner profile) for long-term decoding for evaluation of performance drops in decoding (test canceled by my self) it's not smooth! ugly frametimes... looks like 20 fps
2560x1440 @ 72 fps by OBS studio @low latency+performance @nv12 601; limited @high priority (RTX 2080 ti with high performance MSI afterburner profile) for long-term decoding for evaluation of performance drops in decoding (test canceled by my self) it's not smooth! ugly frametimes... looks like 20 fps
2560x1440 @ 72 fps by OBS studio @low latency+performance @nv12 709; limited @high priority (RTX 2080 ti with high performance MSI afterburner profile) for short-term decoding for evaluation to get smooth video experience it's not smooth! ugly frametimes... looks like 20 fps The difference between "@nv12 709; limited" and "@nv12 601; limited" not further investigated!
2560x1440 @ 72 fps by OBS studio @low latency @nv12 709; limited @high priority (RTX 2080 ti with high performance MSI afterburner profile) for short-term decoding for short-term decoding for evaluation to get smooth video experience looks smooth!
2560x1440 @ 72 fps by OBS studio @quality @nv12 709; limited @high priority (RTX 2080 ti with high performance MSI afterburner profile) for short-short decoding for short-term decoding for evaluation to get smooth video experience looks smooth!
*2560x1440 @ 72 fps by OBS studio @low latency +quality @nv12 709; limited @high priority (RTX 2080 ti with high performance MSI afterburner profile) for short-term decoding for evaluation to get smooth video experience looks smooth!
Last three videos were visually very similiar!
--> tried *marked video setup for longterm video decoding for evaluation of performance drops in decoding: smooth all the time (32 minutes video playback), some very minor frame drops, very enjoyable!
end Log_
@MPfaffe Could you compile the APK and server for testing with those settings? Txs
@TC-VR sorry, i watched today my first "C++ for beginners video" on youtube, but i can't compile yet :-D.
But I have some news for you after further testing.... I installed now the ALVR version "Experimental 1" to be more independent regarding the resolution of the video stream. But it turned out that every resolution (HEVC and H264; tried 603x336 up to 4256x2352 , at 60 or 72 Hz and 50 mbit/s leaded to performance decrease and sometimes to freezes of the client.
BUT! Than I tried 4256x2352 ( HEVC 175%, 72 Hz, 100 mbit/s (was ingame locked to 60 fps... I assume the nvidia encoder limited) and there were no performance decrease over time (30 minutes tested)! And nearly no packet loss! Also at 150 % HEVC resolution @72 Hz @72 fps gameplay (auto gameplay, can't say anything about movement latency ;-) ) there were no problems.
So at the moment I recommend to use at least 100 mbit/s videostream. (for stability in case of good network setup/performance)
I could imagine there is something going on with the network performance if it is "bored". Maybe something switches to a lower network performance mode after a time and then the high latency confuses the ALVR-Client...
Currently I tried to switch off some energy suspension modes of my gaming PC: ethernet card , set highest Performance in Win 10, set highest performance in the Nvidia setup programm and also I disabled a setting "WMM APSD" in my router. But with 50 mbit/s videostream the performance decrease always after about 15 minutes...
@MPfaffe thank you for testing!
The quest has an OLED panel with 2880 x 1600 resolution. Thats why we use it. Using a lower resolution will cause a blurry image. The used preset is "NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ" which is recommended for low latency application. Color format is nv12 for Windows 7 and RGB for 8 and 10. I have no idea why?! I forced nv12 on my Windows 10 and had no issues or bad image quality.
Is anyone using an AMD card?
Problem for me is, that I rarely get the issues at all. I played 1,5h Fallout without issues with settings others get problems after 10 min. Has someone a game that triggers the problems very fast?
@MPfaffe thank you for testing!
The quest has an OLED panel with 2880 x 1600 resolution. Thats why we use it. Using a lower resolution will cause a blurry image. The used preset is "NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ" which is recommended for low latency application. Color format is nv12 for Windows 7 and RGB for 8 and 10. I have no idea why?! I forced nv12 on my Windows 10 and had no issues or bad image quality.
Is anyone using an AMD card?
Problem for me is, that I rarely get the issues at all. I played 1,5h Fallout without issues with settings others get problems after 10 min. Has someone a game that triggers the problems very fast?
So this is with the released v7 experimental? Using ffr @ 50mb/s? Ik Will give it another shot with Skyrim and ED.
Txs!
@TC-VR No, current experimental + some small changes on the client
@TC-VR my latest tests were performed with experimental v1
@JackD83
The quest has an OLED panel with 2880 x 1600 resolution. Thats why we use it. Using a lower resolution will cause a blurry image.
I'm aware of this behaviour, but I imagine that feeding the Quest-decoder with higher resolutions than 2560x1440 @72 fps can lead to some issues. The most detailed information on Qest-decoder capabilities/modes found in the web:
The DPU is capable of outputting 2160p60 video with 10-bit color to a wide color gamut 10-bit internal or external display, although we have not seen any 10-bit panels for mobile devices yet. The DPU also supports Q-Sync, which allows a Q-Sync capable display to refresh as quickly as the GPU can render frames. Snapdragon 835 can also decode H.264 (AVC) and H.265 (HEVC) video at up to 2160p60, 1440p120, or 1080p240.
my Interpretation: --> I can imagine resolutions higher than 1440p (2560x1440) will be decoded only frame by frame (max 60 fps). Resolutions up to 1440p (half the pixels of 2160p) could be decoded with max 120 fps by decoding in a partly parallel and half-frame delayed way.
-->but the decoder seems not to be strictly limited to these supported modes/specifications as current Tests and common use of ALVR showed:
- Resolution 4256x2352 @60 client fps (@100 mbit/s) --> resolution is definitly not within the specification/supported modes but worked without performance decrease. The computing of the additonal pixels should lead to higher torture to the hw-decoder as with specified/supported settings.
- Resolution: 2880x1440 @72 fps (@ 50 mbit/s) --> performance decrease after some time (in my case 15 minutes with assetto corsa), sometimes freezes (I think it's a combination of an event in the network performance, maybe in combination with high torture to the decoder)
-->in my opinion the decoder could potentially handle 2880x1440 @72 fps not in one compute cycle but in two within performance-specification but maybe the way it has to proceed is not supported/realized. (some kind of parallel/delayed/partly-picture computing :-D)
My current assumptions/conclusion (just thoughts and theory):
-
at the moment: if the decoder computes at higher resolution than 1440p @72 fps, it could lead to additonal aging of the decoder HW and to computing failures due to use over specification/supported modes (like an overclocked CPU). --> recommenation: use resolution =< 1440p for vidoeo decoding @quest @72 fps. "2560x 1422" (try to use this setting vor encoded video) is about the same height/width ratio as 2880x1600 (quest native resolution).
-
I believe the major reason of instability is something within the network The performance decrease and Client freezes also occur @Resolution 603x336(!) @1mbit/s (!) after 15 minutes (!), but there are no (!) problems @about 4k resolutions @60/72fps @100 mbit/s .
"100 mbit/s" could be some kind of threshold.... e.g. pc ethernet adapter support modes: 1000/100/10 mbit/s --> maybe e.g. after a while with 50 mbit/s streaming, network adapter switches operation modes from 1000 mbit/s to 100 mbit/s (because it is enough for 50 mbit video streaming and leads to saving energy) but maybe with bad effects to network latency --> maybe it could lead to errors within ALVR Client...
As I said... just thougts and assumptions
@JackD83: could you compile your latest experimental? I would like to test it on my system. The released experimental V7 crashes after 10-15 minutes of Google Earth. Prior to that, image (with FFR slices) looks bl*dy brilliant and tracking is like native Rift S tracking.
Edit: nevermind; I installed Visual Studio 2019, Cuda 10.1 and Android Studio 3.5.1 and made the build myself :-)
You don't need to set a higher resolution on the client to get a sharp image. The screen is not fully used. The default resolution of the Quest is 1216x1344 per eye. Oculus Home and most games are using this resolution. Some games like Red Matter are using an even lower resolution and the image is not blurry. I patched the ALVR client to set 1216x1344 as the fixed resolution and then i set 150% for supersampling on the server and the image is super sharp.
I just compiled from the main experimental branch, both client and server. I ran it at 1440x1600 and have selected 100 MB/s. FFR Slices. Steam VR at 100% displaying 1440x1600:
-
The Lab: 30 minutes, 79 packets lost, constant 72FPS server and client side, no freeze, very sharp image, Total Latency no higher than 66 mostly round 62
-
Skyrim: 25 minutes, 105 packets lost, Server: 72/ Client 71-72, SS maxed out in-game, no freeze, very sharp image (in Fovea area, bottom as expected blurry when in menu and peeking bottom and top FFR slice, not so apparent left and right slice). Colors are very good (a lot better than Rift S).
@JackD83 : Maybe you could recompile V7 for release? Is it possible something went wrong with the compilation of this build at the time? Here's my build attached. ALVR_EV7_20191030.zip
@andy-d1969 I will try your settings for comparison... txs
@TC-VR I'm getting an error starting the windows client.
I'm on Win10 64 pro with a GTX 1080 ti
I would like to add a note and it's to not forget that not everyone have those "bugs" so we should be careful of what it gets fixed at client side because if it works for most people and fixeds are added it could lead to break for some others. So to assume that the bugs it's only on client side it's a bit mmm "dangerous?". Quest it's a very closed system so if the client were that buggy it's more likely to not work for anyone at all. Isn't like we can install or mod that much settings there. So whatever bug it's causing the poor performance and freezes it may be related with either server side or a combination of server and client but rarely only the client. I use v7 experimental everyday and it works flawlessly. The only issue it's that sometimes, for some weird reason, I get returned to HOME and I need to open the app again through unknown sources but then the app it's like still running. I mean, is not like it closes and I need to open it again and connect, it's more like it goes to background but I can't return to it untill I reopen it.
jackd83 made this comment to a build done by @LibreGit with a similar error
Builds made with the latest Visual Studio version require the latest vc runtime
jackd83 made this comment to a build done by @LibreGit with a similar error
Builds made with the latest Visual Studio version require the latest vc runtime Indeed, you could install cuda 10.1 and visual studio 2019 (free). This will install all latest dll's and drivers...
@andy-d1969 I have to disagree. Using any other resolution as the panel resolution will result in a scaled image. How well it will be scaled depends on the display and other factors. The lower resolution of home and other games is due the fact that the quest is not capable of keeping the frame rate and they have to compromise. We are rendering on the PC. That's why I chose the panel resolution as default.
If you do want to use a lower transmitted resolution, you don't need to patch anything. Just use the video resolution setting in alvr.
@all please keep this thread about the performance issue
But the image is rendered to a distortion corrected texture that does not fill the whole screen so it will be scaled. And afaik you are setting the resolution of this texture not the screen resolution itself. Maybe the resolution is too high for the decoder and this is the reason for the performance issue.