Client app packet loss over time.
EDIT 2: Updated the title since the issue and solutions in this thread have deviated to the packet loss issue rather than the frame drop issue. (Which are two separate issues)
I've been using the original authors ALVR alpha 5 for the past two days, but because the controller jitter and misalignment was getting too annoying, I searched and found a solution in this fork.
Now that preface is important because original alpha5 worked flawlessly with the exception of the controller issue. H.265, 50Mbps, 200kb buffer, audio.
With experimental v6 the controller issue is resolved. Right after the start of the app and server, everything is fine except for maybe a little head-tracking stutter. However, after letting it run for 5~10 minutes, the server is still reporting 72 frames, but the client frames drop down to around 40. Same settings as above.
Seems like an issue with the mobile app.
Wifi is 1300mbps 5Ghz with 40Hz band. I live at the edge of the forest so there's no congestion. My dedicated 5Ghz access point for the Quest is the only 5Ghz in town.
EDIT: Clarified versions.
There where no changes in network code between alpha 5 and the experimental releases. While the problem you describe is still occurring , its still not reproducable all the time for me. It happened with alpha 5 as well.
That said, I still suspect a network problem with your wifi if you get this error all the time. There are a few things you could check:
- Some wifi router have problems handling the high throughput of ALVR on 5ghz and get very hot. A firmware could also help.
- If you have the 2.4Ghz Wifi and the 5Ghz wifi on the same SSID, the Quest will switch between them. Use dedicated names for both
The suggestion from John Carmack to maybe sell a dedicated Quest wireless usb adapter for the pc sounds like a good idea
I just tried your alpha5 experimental v1 and (since it was the first one to feature fixed controller offset) and after one hour of play both client and server still had 70~72 frames. Riftcat running at 50Mbps doesn't have this problem either. Tracking on it is much slower though.
As I mentioned I have a dedicated 5Ghz AP for the Quest, 2.4Ghz radio is completely disabled on it. It's a tplink R450 running on a Qualcomm Atheros QCA9558 chip @720Mhz. It's well ventilated and doesn't seem to get crazy hot. Can't say for sure of course as it doesn't have a chip temp readout.
I'll try my way through v2, 3, 4 and 5 today or tomorrow and see if the issue pops up before experimental v6 so maybe I can narrow it down for you.
I didn't think it's a netcode issue to begin with, it looks more like an issue with the apk build.
So after a day of testing, it turns out experimental v1 is the only one not causing the issue. v2 I couldn't get running. v3 dropped frames after a couple of minutes. v4 app and server versions in the download mismatched, couldn't try. v5 dropped frames after a couple of minutes.
I continued experimenting with v6, and it turns out the frame drops coincide with packet loss, and the packet loss is caused by sharp or loud noises being streamed. For consistency I've been using h3vr, everything runs fine for 5 to 10 minutes, then tracking starts slowly failing and every gunshot sound causes a couple hundered packets to be lost and fps dip below 50.
Now I've been using my keyboards audio output for VR sound, because my main audio driver is my Astro A50, and that has been causing crackling in VRidge/Riftcat as well as the original ALVR alpha 5.
I changed steam to use my Astro audio again, and it actually worked on experimental v6, however, there was roughly a 2 second delay in audio. I've tried all other audio adapters, Nvidia hdmi, optical, mainboard aux for streaming, they all cause either packet loss or a 2 second delay, at random.
When not streaming audio at all, the same issue persists.
To be honest, your description still sounds more like a messed up system. All experimental versions do work, some without the controller fix after the oculus firmware update. They where downloaded hundred of times. If you switch versions like you did, you have to properly uninstall the old versions on the quest and in steamvr.
Sound streaming does not depend on the volume of the sound at all and if you say that the problems persist even when sound is disabled, that can not be the problem.
What are your system specs? Do you get constant 72fps on the pc? Loud noises in games could mean that there is a lot of action, your framerate could dip and causing lost frames.
I have two more Quests laying around, I'll try it on another one. My system is an i9-9900k, 32gb ddr4 and a gtx 1660ti. I guess that could be the bottleneck but why only on some versions and not others... and yea the server always reports 71~73fps, it's just the client fps that are going down.
I've actually tried it in a really calm and quiet scene, I held a gun behind me, where it wasn't being rendered, and when I shot it the packets just dropped.
Also I was really careful to first uninstall the apk from the quest before installing a new one, same with the ALVR driver from SteamVR.
I also have another VR capable PC that I can try.
I realize how crazy this sounds, but I've spent over an hour playing on experimental v1 yesterday and only had maybe 100 lost packets, as opposed to the 10k I would get within minutes on the other versions. Same games, same system, same settings (except for 150% resolution).
On that note, is there any way I can change v1 to stream the correct resolution for the quest? It's the only version that works for me and when using 100% it does look a bit wonky.
I have the exact same problem on all JackD83 versions. I tested it in all and every configuration. Having a perfect WiFi, with a dedicated high performance AP for ALVR, pc Ethernet cabled to it, and ac only 40mhz 5ghz WiFi, just mitigated and postponed the problem. After about 20-30 minutes the performances starts deteriorating.
It’s almost 3 weeks of tests in search of this bug for me now (I’m a VR dev and actually use ALVR to test my unity envoronments, so hours of VR). I enabled all logs on server. No particular error. Also, I tested the compiled apk using Android Studio Profiler. I am not an Android dev, but from what I could see there is no EVIDENT memory leak. However there are LOTS of allocations with a very steep curve. CG obviously is correctly destroying objects and used memory stays around 265Mb.
I’m deeply studying the app code. I think that especially in the queue system for the frame buffer the performance could be optimized. But I do this analysis in my spare time, so...
@FingrMastr Fixing this bug is pain in the a**. I rewrote many parts of the software in different ways and still ended up haven the same issue. I currently suspect the server side socket polling to be the culprit. I'm still not sure why it was implemented this way. There could be a buildup of old packages on the socket that are leading to the problem if you play longer. The mic streaming did not help either, cause it adds just more packages that should be processed right away.
@Susanoo1337 Your PC is more that capable to play most games without problems. I still think there could be a problem. The only big change starting with v3 is the increase in render resolution that the client has to render. This can put a lot of stress on the GPU. Can you try this: Use ev6 (or upcoming ev7) and set video to 100% and in steamvr, set super sampling to manual and 50%. Try a few rounds. It will look ugly :)
I really appreciate you taking the time to work on this project at all. Just wanted to say that.
I've tried 100% with 50% SS in steamvr. Same problem occured after a while, but it might have been a bit longer. I used a completely fresh out-of-the-box Oculus Quest with the only app installed being ALVR experimental v6. The next days I'll try a different PC, make sure it's not that.
Next I've tried Virtual Desktop, unfortunately the quality of the tracking and streaming on that is a bit arse, at first it streamed 78Mbps but after a restart it wouldn't go over 30ish. There is sadly no way to actually set the streaming rate in the app, plus it requires a constant internet connection which is a hassle with my setup. However the same problem never cropped up, even after over an hour of playing.
Is there a way for me to edit(hex or otherwise) experimental v1 to use the correct Quest resolution meanwhile? That seems to be my only option for now.
It seems strange to me that V1 is working without hassle for you, since I tested it (as all the other versions), and for me the performance degradations is still there even with v1. However, in that version JackD83 did not resolve yet the resolution problem. On that version, 1216x1344 per eye is the default 100% resolution used by the Quest. You can change it by entering adb shell setprop debug.oculus.textureWidth 1440 adb shell setprop debug.oculus.textureHeight 1600 This setting will stay there until you restart the quest.
@JackD83 is the client from V1 equal to that of versions prior to V5? I see in the Client repo that you marked with the “v” notation only by the V5... it would be useful for me to have some changelog for the client app in respect to polygraphene’s alpha5... today I’ll test the “compatibility fixed” alpha5 and your V1 (maybe I missed something)
is the client from V1 equal to that of versions prior to V5
Unfortunately no, I forgot to tag the client repo.
I just made a debug version of ALVR with an async communication option in the "other" tab. I don't have the time to test it properly so here is a direct link: ALVR_debug
Its compatible with the ev7 client on the HMD. I'm on vacation the next weeks, so no updates from me.
Edit: never mind, has the same error :(
I think I found and resolved the problem. Some more tests are needed, but I played around 1 hour with Arizona Sunshine (Only for scientific reasons of course), and no performace dropping!
I'll explain here for completeness sake: In a very old commit, the NalQueue class had a "refactor", from a normal queue to a java.util.concurrent.ConcurrentLinkedQueue. The problem here is that queue calls are thread safe only when they are atomic. So I moved back some "synchronized" statements as in the original master branch. This could explain some strange counts on that queue I saw in debugging and profiling. And maybe performance degradation.
Now we need to test it. Please @Susanoo1337 could you test this apk with V6 server app: https://drive.google.com/open?id=1TEBEWF-_TiKHyv0s4lYa5CQRRBZpOtoT
Ok I'm a little... irritated at this point. Not by my first point, but by the second.
-
@FingrMastr I've tried your version. The issue still cropped up within roughly the same timeframe.
-
I've tried both FingrMastr's fixed v6 and JackD83's v6 while connected to a different PC and there were no issues whatsoever within a timespan in which I was comfortable staying in VR.
This is the irritating part: The second pc is a Win7, i7-3770k, 16GB DDR3, GTX970ti As opposed to my Win10, i9-9900k, 32GB DDR4, GTX1660ti
The Win7 machine has also not been wiped in a long time, so it should be nice and ripe with malware and stuff. It's abysmally slow in most situations, takes a few minutes to boot up.
So the problem with all versions above experimental v1 are either an issue with Windows 10, or an issue with my specific network configuration. And I have no idea which. There is one more thing I can try, but otherwise, short of installing Win 7 on my main machine, I'm all out of experiments.
Incredible. Simply incredible. However, as I said, I’ll test some more my very little fix and also try some other optimizations I have in mind. Anyway, I have only a win10 PC, pretty high-end, so I cannot try with other PCs at the moment.
I’m sort of “hating and loving” this issue because it’s nasty and maybe not caused by a single problem. ALVR is a complex and technologically awesome piece of software and at the moment the ONE AND ONLY wireless solution with sliced fixed foveated encoding, and a FREE one, even before the wired official Oculus Link. With some more work it’ll also become the most polished solution for Quest streaming PC VR. I’m sure about this.
Confirmed, still occurring, even with my little fix, but a little mitigated.
Very nasty bug. Starting to think that’s not strictly related to software optimization...
So after a day of testing, it turns out experimental v1 is the only one not causing the issue. v2 I couldn't get running. v3 dropped frames after a couple of minutes. v4 app and server versions in the download mismatched, couldn't try. v5 dropped frames after a couple of minutes.
@Susanoo1337 @JackD83 I'm getting the same result on my system: QUEST - WIN10 (i5 8400 + GTX1070 16 GB DDR4) - WIFI AC 5 GHz (@868Mb/s)
-
V1 is working like a charm => with manual resolution correction via ADB: adb shell setprop debug.oculus.textureWidth 1440 adb shell setprop debug.oculus.textureHeight 1600
-
V2 => V7 ultimately (after 15 minutes) starts deteriorating into a lag fest.
It sure would be nice if one could take the V1 APK and add just the resolution correction. I'm very much willing to test ALVR and provide feedback.
Kind regards, TC-VR
So I was just scrolling through the issues list and reading them just because, welp, curiosity :P and found this one quite interesting because I don't have it but I also have Win7 which means that could be completely related with Windows. I also have another computer with the exact same hardware but running Windows 10 instead. I didn't test on the Win10 machine yet but on the Win7 one I play for hours and hours and never had this issue. I will try to give it a try on the Win10 one as soon as possible and report back then we could guess that it's indeed related with Win10. But we also should take into account that drivers may be different too, I don't update my nvidia drivers everytime since all works fine. I am still on ALVR v6 btw.
A small update. I made some more optimizations on the client App, basically static thread priority assignments. None of these optimizations however did resolve the performance degradation issues.
Since also in my case in V1 this problem is not appearing, I’m comparing the commits made to client and server just after that release. The only ”major” change could be the NVENC intra-refresh elimination. I’ll try to compile a V7 with this function back in and I’ll do some test.