mariotaku / moonlight-tv

Lightweight NVIDIA GameStream Client, for LG webOS TV and embedded devices like Raspberry Pi
GNU General Public License v3.0
877 stars 31 forks source link

Micro-stutter every 1.5 seconds #345

Closed leandroparischi closed 10 months ago

leandroparischi commented 1 year ago

Bug Description

I have an LG 50UR8750 TV, and I'm experiencing micro-stuttering every 1.5 seconds during streaming. Exactly 1.5 seconds into streaming, a micro-stutter occurs; just initiating the streaming is sufficient for the stutters to begin.

Reproduce Steps

Expected Behavior

Streaming without micro-stutter, that's all :))

Basic Information

Version: 1.6.2 Video decoder: ndl-webos5 Audio backend: ndl-webos5 System: webOS 8.1.0 (HE_DTV_W23P_AFADATAA) Screen resolution: 3840 * 2160 Refresh rate: 60FPS

I've tried with Sunshine and GFE Gamestream, the issue persists regardless of the service... I cannot connect to the host at the moment, but both are running the latest versions as of today (11/22/2023).

Additional Context

I'm using the following configuration:

1920 * 1080@60FPS (also occurs at 4k@60fps) HVEC 265 (also occurs with 264) HDR ON (also occurs OFF) Game Optimizer image option selected Host and Client at 60Hz G-SYNC OFF V-SYNC off in NVIDIA Control Panel

Specs: R7 5700G RTX 3070 Ti Both connected via LAN (100mbps full duplex on the host)

By the way, thank you very much for the effort in developing this app for LG TVs. It's really great to have the possibility to play games via streaming directly on the TV :)

leandroparischi commented 1 year ago

I set up a DMZ on my network where the client is located, and apparently it's resolved... I also did the TCP and UDP port forwarding for GameStream

mariotaku commented 1 year ago

This discovery is interesting. When you stream with other clients what's the performance?

leandroparischi commented 12 months ago

The performance has improved on Moonlight (Windows) and Parsec (Windows)... The major issues have been resolved in both the PC and WebOS versions:

80% of stuttering issues have been resolved, but there is still one occurring, which I suspect may be related to the decoder in my UR8750... In Moonlight's statistics, there are no network frame drops, but the decoder latency fluctuates between 15ms and 30ms

Proryanator commented 11 months ago

I've noticed this too, the micro-stutter appears to align/time with the stat update count.

On iOS I notice this behavior too; when the stats overlay is open, I see this micro stutter each time the overlay updates. But when it's closed (iOS) I don't get that.

I bet for LG, the stat counter is always running (since I see the micro stutter whether the overlay is on/off). Otherwise, 4K@120 looks amazing! Just the consistent micro stutter is off putting.

leandroparischi commented 10 months ago

So, I found out what was causing all my performance issues (periodic stutter/micro-stutter):

DPC LATENCY

The storahci.sys process was causing a lot of latency on the host, was causing stutter not only during streaming... I use internet streaming, so I have a computer that is a few cities away, and I discovered that the problem was on the host PC recently

What fixed everything was enabling the SATA settings in the host's BIOS and using AHCI mode

mariotaku commented 10 months ago

@ludwir This is by far the most interesting cause! I'll consider this issue has been solved.

Proryanator commented 8 months ago

Hmm that's interesting, if that was the cause other client types (iOS) would experience the same stuttering, which I did not see that on PC/iOS client devices.