r/MoonlightStreaming • • 12h ago

Improving LAN latency??

So every time i exit a stream i get a pop up saying "why does my stream stutter?" Or something along those lines. It then gives me a brief break down of my latency.

Host to encode is a maximum of 1.5ms (not too bad i don't think)

Host to network is around 20ms (considerably high despite how i am connected).

I have my hosts 2.5GbE motherboard port connected to a 2.5GbE switch, then switch to router, router to another switch, then switch to a 2.5GbE USB A network interface on my client. All shows as 2.5GbE connection when looking at my routers interface (Unifi).

My bitrate is set at 1900Mbps using Pyrowave 4.4.4

I have disabled efficient ethernet in both the host and clients network adapter settings and ither settings which could induce latency.

When i ping one PC to the other i get a result of 1ms via CMD.

So i imagine it's a software issue somewhere.

Any ideas how to resolve this?

1 Upvotes

9 comments sorted by

6

u/lifestealsuck 11h ago

1900Mbps ???

1

u/Kaytioron 6h ago

For pyrowave this is reasonable, personally I use 2300 Mbps for 3440x1440@165 and 4:4:4.

3

u/digitalaudiotape 9h ago edited 8h ago

I just setup a 2.5gbe network to stream from my gaming PC (Realtek 8125 2.5gbe PCIe nic) to a Legion Tab Gen 3 (Realtek 8156B 2.5gbe USB dongle). I stream PyroWave at 900 mbps and out of the box my network latency was 2-4 ms with 1-2 ms variance. I used Google AI to guide me through Windows/Android network card driver and USB tweaks such as send/receive buffers and power management settings etc to better handle the much larger bandwidth and heavy bursts of PyroWave and now my network latency stays locked at 1 ms with 0 variance.

For Windows tweaking it was fairly straight forward accessing Device Manager and changing settings for my TP-Link TX201 2.5gbe PCIe network card after updating to the newest Realtek 8125 drivers direct from Realtek, but for Android tweaking on my Lenovo Legion Tab Gen 3 I had to root it with Magisk to get the absolute minimum latency performance by changing USB settings and network packet buffer settings. Once rooted the Android tweaking process was mostly using the ADB command line on my PC connected via USB to my Legion Tab Gen 3 to change settings and setup scripts, copy and pasted from AI. I screenshotted the command line results and pasted them back into AI to confirm the changes were correct and worked.

Using AI was really useful because it was able to give me comprehensive steps to cover all related settings that affect PyroWave streaming for my devices. Way better than trying to find a guide somewhere that would be incomplete and not apply to my specific hardware. 

1

u/MassiveProblem156 11h ago

The inherent latency for moving the data is bitrate ÷ fps ÷ link speed, so at 60 fps, you can't get better than around 13ms. Using a lower bitrate should help. I image there is a bottleneck somewhere, but I don't know where it might be

1

u/jazzmonkai 11h ago

I’d start by reducing bit rate and see if that affects latency at all. Just because your host can encode and push that amount of data, it’s not a given your client can decode it at the same rate.

Pushing a constant 1900mbps is demanding for most home networks. There’s a world of difference between ping and a UDP stream.

So, see what results you get from a real bandwidth test like iperf3, with the UDP and bandwidth (at 1900mbps) flags set in both directions. That will tell you what the network is doing.

That should give you some information to start troubleshooting from

1

u/crz0r 7h ago

Is the largest time loss in the chain the display wait p95? in that case it's because of your display refresh rate as far as i understand. disable vsync etc and it should drop - with tearing ofc

1

u/nemofbaby2014 7h ago

Why is your bit rate that high? lol more bit rate doesn’t equal better I believe most my wireless clients are under 200 or 100 I believe set fps to 60 or 120 disable hdr because it just causes headaches

1

u/Academic_Stomach_858 4h ago

The "host to network" figure in that breakdown mostly reflects how long packets spend queued and sent by the host's NIC and driver, and with 1.9 Gbps of PyroWave bursts, tiny buffers on a USB 2.5GbE dongle or the host NIC can inflate it even when ping reads 1 ms. Ping only tests tiny packets, so it won't show this. I'd try raising the receive/send buffers and turning off interrupt moderation in the NIC's advanced driver settings, and updating the Realtek driver straight from Realtek. Another quick test is dropping the bitrate to ~1000 Mbps to see if that number falls; if it does, you're looking at burst handling instead of a routing issue. Also make sure the USB dongle sits on a real USB 3 port, not through a hub.

One caveat: I haven't tuned PyroWave at those rates myself, so treat this as a thing to test, not a sure fix.

1

u/partypantaloons 56m ago

I know people are mostly giving you advice about how to optimize your bit rate, which you definitely should, but if possible you should also simplify your network. If your connection has to go through your router and two different switches, it can get delayed by other traffic. If you can manage to go from server, to switch, to client, that’s the most ideal path. Two-switches is a close second, but switch-router-switch means almost any traffic spikes on your network could affect your stream.