XITRIX / Moonlight-Switch

Moonlight port for Nintendo Switch
781 stars 47 forks source link

[Bug] Freezing on playing with 1080p #7

Closed silkyclouds closed 5 months ago

silkyclouds commented 2 years ago

Hi,

I am using moonlight since ages and just got that nice hackable switch console. While my other devices (android, macos, android tv clients) are working fine, the switch version crashes once I try to connect to my gamestream server.

I can see the server and do enter the required pin, then the moonlight client displays me the following message : "problem with the local ssl certificate". then the app crashes. (the app only). and I'm sent back to the home screen.

Next time I will try to connect my GS server, it actually crashes atmosphere completely, with error code : 2168-0002 (0x4a8) Program 010000000000100D

I'm running firmware 12.1.0 and atmosphere M 0.19.5 Moonlight version is the latest 0.6

only option I then do have is to press the volume + button to restart my switch. any clue ?

Thanks !

XITRIX commented 2 years ago

Hi! You described the really strange case... Right now I removed /switch/moonlight folder, to run app from scratch, in case there is something broken, and I connected to host without any problem.

Try next steps:

Hope it will fix your problem, but right now, it looks like atmosphere issue.

silkyclouds commented 2 years ago

Well, I had no moonlight folder but indeed did have some weird moonlight file laying at the root of my switch folder. Removed it and now, it streams !

The strangest thing is I actually had this issue with two different switch(es).

By the way, can you eventually answer this "bonus" question? Are there a any wifi limitations with the nintendo switches ? GS works like a charm on all my devices except these devices. Even putting my network speed at 20 displays me "bad connection" all the time and games are not playable. Even sitting just next to my wifi router (wifi6, that shoots stable 300+Mbit to my other devices at home).

Both of the consoles I have here are having this "joycon randomly disconnect" issue. Could it be that the wifi/BT combo ship could be defect on both ? I try to debug...But can't find any decent LAN speedtest tool in the homebrews. I'll give a shot to that homebrew allowing to run python scripts...and might find something to run these tests on command line mode... :/

Sorry to go out of the topic, but it is disapointing. I bought that switch almost exclusively to have moonlight working on it.

XITRIX commented 2 years ago

Wifi is really a weak point in nintendo switch, I'm playing only at 10mbps, but it looks pretty well in handheld mode, so I'm ok with it. Also never tried to play with disconnected joycons, so I cannot tell anything about random disconnection, but I'll try it today's evening.

silkyclouds commented 2 years ago

Yes this is what I did notice when trying to transfer files using ftpd. The rate was more around 10Mbps. So this is a Switch limitation. That's unfortunate.

I'm quite surprised 1080p do stream fine using 10Mbps though. are you streaming in 720p? H265 then I guess?

Thanks for your answers by the way ! much appreciated ! :)

silkyclouds commented 2 years ago

By the way, I connected to wifi 5ghz and ran a 46Mbps download speedtest. (which is ridiculoud compared to my other wifi devices reaching 300+Mbit I agree).

Still, anything above 10Mbit will stutter when using moonlight on the switch. Could it be that moonlight "can't" get the switch full bandwidth for some reason ?

XITRIX commented 2 years ago

Hmm... To be honest I don't know :)

I'm more a frontend developer and I'm still learning all that hardware stuff. As a frontend developer, I tried to make this app as userfriendly as possible, but still I don't know a lot of stuff that lies under it. I'll try to find out is it possible to increase network bandwidth, but for now, "play on 10Mbps" is my only suggestion

XITRIX commented 2 years ago

I see, 1080p is unplayable, while 720p is good enough to play, I’m not sure, but may be there is not enough GPU performance to decode 1080p stream. I’ll try to investigate it, but now it seems like it’s better to remove 1080p quality from app…

silkyclouds commented 2 years ago

Well, the console is suppoed to output 1080p once docked. And the error message is quite straightforward (bad connection). As this is a port, and I guess there is some bandwidth analysis included with moonlight core, I think the issue really is that any time you push the app to use more than 10Mbit, it is not getting sufficient bw to play thing smoothly.

As I stated, speedests are crap (less than 50Mbit DL speed) when connected to a super stable wifi6 network at home. So my assumption would be that there is some kind of bw limitation on the switch. as an example, transfering data through ftpd also run at approx. 10Mbit. (so the same exact thing happens, it should be 5MB/s instead of 1MB/s).

This is an interesting topic to dig I guess ;)

Thanks again for all your answers !

XITRIX commented 2 years ago

Yes, error message is quite straightforward, but it was written by me, and not taken from Moonlight core part :) You can check it by setting h265 decoder, that works awful on switch, and it cause this "bad connection" error message appear like 1080p does.

Yes, switch supports 1080p output, but as I know, homebrews still have no full GPU acceleration support, and when I said "it's unable to decode", it doesn't mean "can not render", also, I'm not sure that decoding runs on GPU, it could run on CPU and that could also cause additional lagging.

Too many questions, not enough answers :)

renA21 commented 2 years ago

The video stream is decoded using the CPU/software. If you want to stream at 1080p or higher bitrates, you'll have to overclock the CPU to achieve a smooth experience and that's what I usually do when docked. Implementing CPU overclocking options in the menu would be welcome here.

silkyclouds commented 2 years ago

yes, in short, the switch is really disappointing when it comes to performance. Wifi is too slow, CPU is not beefy enough.

Performance of moonlight on an android phone blows up the switch, which makes me little confident about the fact I could ever use it to stream my pc games to it reliably. :(

renA21 commented 2 years ago

The deciding performance issues could be resolved when homebrew in general have access to GPU accelerated decoding (NVDEC), as far as I know, no-one seems to be actively working on such endeavor at the moment.

XITRIX commented 2 years ago

Thanks for information about that aspect, never overclocked my switch earlier, I'll experiment with it a bit and I think, will add a warning or instruction inside of app.

gricardo93 commented 1 year ago

If I am not wrong, high resolutions streaming works great when using Moonlight on Switch via Android version

XITRIX commented 1 year ago

Overclocking via Sys-clk and Tesla menu works perfectly fine, you should overclock your CPU, and 1080p streaming will not lag anymore

XITRIX commented 5 months ago

Fixed with FFMpeg HW decoding