moonlight-stream / moonlight-android

GameStream client for Android
GNU General Public License v3.0
3.23k stars 512 forks source link

Poor network connection on excellent network #79

Closed bridgewaterrobbie closed 5 years ago

bridgewaterrobbie commented 8 years ago

I have what I am pretty sure is the ideal system for streaming. I h ave an ASUS RT-AC87R router, a GTX 980 computer with a wired connection to said router, and a Nexus play with moonlight. I tried it yesterday and things were fine, but today I am getting "Poor network connection" issues. The router is only one room away from the Play, with nothing in between the two if I open the door(I know that shouldn't matter, but trying to completely reduce variables). Just a few yards of open air between router and nexus play. Any advice? A few notes: I dont have many other devices connected to the router, and none are doing anything. The router is wireless AC.

coraunderhill commented 8 years ago

Similar issue.

OnePlus One CM12.1n Moonlight 3.1.9 WNDR3400v2 5GHz 802.11n GeForce GTX 660

bynar010 commented 8 years ago

Try dropping your ethernet connection on your PC to 100MB full instead of gigabit full and see what happens....I'm curious to know if you've the same issue as me - basically unplayable when PC is using gigabit ethernet, at 100MB full I can gamestream at 1080p/60/100MB perfectly.

cgutman commented 8 years ago

@bynar010 What NIC, motherboard (if the NIC is integrated), and OS are you running?

bynar010 commented 8 years ago

It's a realtek integrated nic on a biostar tpower x58 mb. The os is windows 10, but was same on win 8 & 8.1.

coraunderhill commented 8 years ago

I'm running the following:

@bynar010 How do I drop the connection link max throughput?

bynar010 commented 8 years ago

Go to device manager, expand network adapters, right click properties on your nic. Go to advanced tab, find speed & duplex and change to 100mb full duplex.

coraunderhill commented 8 years ago

@bynar010 Changed the setting, still didn't help in my case.

Bite-A-Rock commented 8 years ago

I know this is an old thread. However, I just ran into this same issue.

As it turns out, bynar010 has a good workaround. I am at a loss to understand why dropping the network speed on the PC serving the stream resolves the poor connection issue.

Does anyone know why this would be, or is there a better fix? I would prefer to use the pc at full network speed because when it is not a gaming machine I have it doing some video conversions across the network.

Any ideas?

ghost commented 8 years ago

@bynar010 Change speed & duplex to 100 mbps full duplex also works for me, thank you!

cr08 commented 7 years ago

I've also ran into this issue. Windows 10 x64, i7-4790, GTX 950, Atheros Gigabit NIC on my Desktop. Nexus Player with a Gigabit USB ethernet adapter connected. Tried all kinds of settings configurations in the moonlight app. Once I tuned my desktop down to 100mb full duplex instead of Auto it all ran perfectly.

Any luck yet on tracking down why this is happening?

bynar010 commented 7 years ago

Funnily enough I don't have this issue anymore gone from -

PC -> Switch (GB) -> Router(GB) -> Homeplugs (200MB) -> Switch(GB) -> Nexus player

to (thanks to a very long cable run outside my house)

PC -> Switch(GB) -> Switch(GB) -> Nexus Player

I can now run my NIC at 1GBs and have no issues.

PappaSlask commented 7 years ago

I have the same problem guys. I'm on very recent hardware and a 5 Ghz router. Whenever I try to go past 70 Mbps @ 1080p or any of the 4K resolution streams I get playback lag on the stream :(

I already tried to lower duplex to 100 mbps trick, didn't help. By the way, why is it not possible to use USB Tethering with Moonlight? Shouldn't a USB 3.1 Tether deliver far better bandwidth and latency than 5Ghz Wi-Fi?

Help is appreciated!

bynar010 commented 7 years ago

70Mbps? Not suprised. I get noticeable lag at 25MB and higher, I keep my settings at 20MB. Think you are hitting decoding latency not network latency... Different problem to what's being described here.

PappaSlask commented 7 years ago

I don't think so. Because it can't be decoding "latency" The lag is so severe that the picture is freezing for a couple of seconds. There MUST be a way, otherwise the 4K @ 60FPS option shouldn't exist right?

My dream is to stream Crysis 1 in 4K with Moonlight at 4K natively on my Xperia Z5 Premium, which supports 4K. I love 4K :/

bynar010 commented 7 years ago

Unrealistic expectations of your device. Sorry. Turn down the quality until it runs properly, if you get no problems all the way up to 70MB then you don't have a problem. 20MB is more than enough even on my 55inch TV.

PappaSlask commented 7 years ago

I appreciate your concerns. But the expectations aren't unrealistic. Why would there be a 4K option if the video decoder can't handle it? And while 70mbps is something I can live with, I still would like to juice out more. Also 20mbps might be all fine on your big TV sitting far away from it, running that on a mobile device inside a VR headset is quite a different story, you'll easily notice the bitrate and quality penalty.

Any word on why USB Tethering isn't available by the way?

PappaSlask commented 7 years ago

Update: I've got the USB Tethering working (USB 3.1), I had to manually look up my USB IP in ipconfig and add a new device in moonlight. The problem is, it really doesn't seem to help the speed, only very little. I have now slightly less lag than over wifi.

Over wifi I get complete fluenty for like 10-20 seconds, then I get a freeze in the picture until I stop moving. Over USB 3.1 I get no freezes but a stuttering picture.

This is all at 1080p@60hz at 80mbps bitrate. It can't be decoding limitations since, if am on wifi, i get no freezes if I move and stare at a wall. But when I turn to look at areas with lots of objects and props I suddenly starts to freeze like I explained above. And all the time, it pops the windows telling me "poor network connection"

bynar010 commented 7 years ago

My final word -adjust your expectations. 80mb at 1080p is extreme quality. It is in no way suprising you are getting issues at that sort of bit rate. Your PC has to encode it, its sent over the network, then decoded on your reciever all the time dealing with your input requests. You could try reduce in game quality to support that bit rate or you could just reduce the bit rate.

For comparison xbox one game streaming at extreme high quality is less than 20mb bit rate, I game stream at 1080p 20MB on moonlight and the quality is beyond acceptable with no discernible input lag on a nexus player. Your device might be 4k but will hit limits in terms of the network bandwidth it can process and bitrate it can decode. You bought a phone, not a starship.

ulyssesrr commented 7 years ago

I ran into this issue and oddly enough @bynar010 solution of downgrading the connection from 1Gbps to 100Mbps in Windows worked. I decided to track it and borrowed a Netword Cable Tester from a friend. I tested the Windows PC <-> Router/Switch cable and it was bad, I took the oportunity to upgrade the old and faulty Cat5e cable with a new Cat6 and then reverted the "Speed & Duplex Mode" to "Auto Negotiation" again. Now the network status shows 1Gbps and Moonlight is working fine.

So if you are getting "Poor Network" messages AND downgrading the Windows network to 100Mbps solves your problem, its very likely that your network is indeed poor due to a faulty cable, Moonlight just makes it apparent,

@bynar010 @Bite-A-Rock @Reaper1610 @cr08 Give this solution a try and see if works for you.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Flemmard commented 3 years ago

I have the same issue when on my 10Gbit network. Dropping the NIC to 1Gbit solves it .. Something is weird here. I had the same issue on SteamLink when using one specific encoding thing (the NVIDIA one), with another it worked fine ..

jonathanmassehsj commented 2 years ago

I upgraded my PC to 10Gbit network using an SFP+ port and had the same issue, my TV is only gigabit and it stopped working 4k, 1080p was freezing.

The weird part is that the sound is still playing when the image freeze.

I needed to set my PC to gigabit and it work well.

floxigen commented 1 year ago

I upgraded my PC to 10Gbit network using an SFP+ port and had the same issue, my TV is only gigabit and it stopped working 4k, 1080p was freezing.

The weird part is that the sound is still playing when the image freeze.

I needed to set my PC to gigabit and it work well.

Same with a 2.5 gigs NIC

wirytiox commented 10 months ago

does this still hapen to this day? i have a 2.5NIC but 1gigabit connection

ubune commented 10 months ago

Same problem with my PC's 10Gb NIC - it's unable to reach speeds higher than 70+ Mbps. However, when I configure the NIC to 1Gb, everything works perfectly, and I get speeds of up to 150 Mbps.

What's even more intriguing is that speed tests to the WAN show no issues and reach up to 7 Gbps, ruling out any problems with the network itself.

cgutman commented 10 months ago

The problem isn't the aggregate bandwidth per second. It's the burstiness of the traffic. Rather than a smooth 70 Mbps over an entire second, game streaming generates bursts of traffic periodically (say a few hundred packets every 16 ms for 60 FPS). So even though you're not exceeding the capabilities of the networking equipment when you look at the bandwidth smoothed over a second, each burst of packets may still exceed buffers in the NIC or switches along the way.

There's not much we can do for GFE, but Sunshine can be modified to improve the way we throttle bursts of packets. It's a tricky balancing act because delaying packet transmission directly leads to increased latency but not delaying can lead to packet loss. The trick is to delay just enough to avoid severe enough packet loss to drop frames, but it's much easier said than done on a live network where bandwidth availability is changing all the time due to other load on the system and network.

wirytiox commented 10 months ago

is there a table or way we can more accurately determine the speed required? i don't know. maybe we can see the buffer size of each part in the network and determine how big this bursts can be?

floxigen commented 10 months ago

The problem isn't the aggregate bandwidth per second. It's the burstiness of the traffic

How is it then that it fixed everyone's problem changing bandwidth of the network interface ?

cgutman commented 10 months ago

is there a table or way we can more accurately determine the speed required? i don't know. maybe we can see the buffer size of each part in the network and determine how big this bursts can be?

Not really. Specifications like buffer sizes tend not to be published for commodity consumer networking equipment.

It's really something we have to fix on the host side in Sunshine.

How is it then that it fixed everyone's problem changing bandwidth of the network interface ?

Because the reduced link speed is acting like a basic send rate throttle. A 10Gb NIC can put the same amount of data onto the wire faster than a 1Gb NIC can, even if it doesn't exceed the maximum bandwidth of either NIC when smoothed over a second. Reducing the link speed means the data is sent slower, so hardware along the network path has more time to process the bursts of packets.

sambedingfield commented 9 months ago

Host: Windows 10 Pro x64, 3070, Sunshine 0.20.0 Client: Amazon Firestick 4k Max, Moonlight 11.0 Network: Wired Cat7 to everything

I've swapped routers, ethernets, tried so many configurations in Moonlight and Sunshine with no luck. The best I could get without dropping 50% network frames would be 4Mbps/30fps/1080p

Changing to 100mbps Full Duplex, I'm now at a buttery 50Mbps/60fps/4k with 0 dropped

🙏

NullVoxPopuli commented 1 week ago

I've tried all solutions here, and nothing has helped. What's goofy is I have buttery smooth streaming at 45-80+mbps (though, I keep this lower, because I don't want to tempt the stability anything -- I do have smooth (but slow) streaming and then stutters at 150mbps, so that's def too high) -- and I only have a 4fps slide for maybe 10s every 2-5 minutes. FPS on the host machine (shown via nvidia overlay) never drops belong my streaming refresh rate max (60fps in this case today)

So, this interval stutters is kinda telling me that either,


Update: turning real time protection off for windows defender has no impact on improving the periodic stutters.