ndeadly / MissionControl

Use controllers from other consoles natively on your Nintendo Switch via Bluetooth. No dongles or other external hardware neccessary.
GNU General Public License v2.0
2.51k stars 138 forks source link

Freeze Error under Atmos 0.14.4 #93

Closed wii07 closed 4 years ago

wii07 commented 4 years ago

There is an error with 0.14.4 and Version 0.2.1 in some games. The new game Hades freezes for example, when you got the module active. Its working fine when you use a clean Atmos installation.

ndeadly commented 4 years ago

Yeah, some users over at gbatemp have also brought this issue to my attention. I've managed to verify there's something going on there with MC running, but my console is eventually loading the game after maybe 10-20 seconds. Not sure what could be causing it but I'm looking into it.

Do you know of any other games where this is happening? Which system firmware version are you on?

wii07 commented 4 years ago

For me only the game Hades so far. Im on Firmware 10.1.0 but in the gbatemp forum users also got that error under 10.2.0. Thx for looking into it, i waited over a minute with the modul active, even exiting with the home button does not work anymore than, only a hard reset.

But the game manages even in that state to put a save file of the game onto the switch, maybe it has something to do with that?

Or maybe it has something to do with the linked controller? I got the error using a Wii U Pro Pad.

ndeadly commented 4 years ago

Yeah I'm on 10.2.0 and it's not fully freezing, so I don't know what's going on there. If I close the game and restart it then it boots normally. Restarting the console, it hangs again on first run. I did also notice that if I connected the controller after starting the game then the input weren't being read and I had to use the joycons.

MC doesn't touch anything save file related so I'm not sure that could be to blame. I don't think the controller type should matter either, because I make them all look the same to the rest of the system. My best guess is the game is trying to send some command to the controller that I don't respond to so it sits there retrying over and over.

wii07 commented 4 years ago

Really strange i just tested some scenarios, always getting a full freeze and have to jig the switch again than. What i tested with MC running:

Starting the game with no save on the switch and no controller connected -> freeze

Starting the game with no save on the switch and wii u controller connected -> freeze

Starting the game with save on the switch from a clear atmos start and no controller connected -> freeze

Starting the game with save on the switch from a clear atmos start and wii u controller connected -> freeze

Tested many other games on my switch, no freeze at all.

ndeadly commented 4 years ago

This is a weird one. I'm using a WiiU Pro Controller too, and I see all the same behaviour you mentioned only it unfreezes after a while. Any other homebrew installed on your system that I should be aware of (sysmodules, custom themes etc)?

wii07 commented 4 years ago

No, just Atmos 14.4.4 and MC.

wii07 commented 4 years ago

I found out something weird. Looks like it has something to do with the airplane mode. I usually have my switch in the airplan mode in handheld mode.

Now i switched the airplane mode off and rebootet the switch with already active airplane mode and than, Hades works with MC and even the Wii U controller works ingame.

When i than activate the airplane mode and deactivate it again without rebooting, the game freezes complete at the switch logo, with both settings - airplane mode on or off.

Did you try starting the game with airplane mode on in the handheld mode and MC active? I bet the switch will also freeze complete than for you. I know that than external controllers dont work, would just be a test to reproduce the freeze.

Maybe an idea for a workarround: MC automatically deactivates, wenn you enter the airplane mode (than external controllers cant be used anyway), and when you leave the airplane mode, it automatically activates itself again, or is activating/deactivating a module without a reboot not possible on the switch?

ndeadly commented 4 years ago

Good find! I usually keep my switch in airplane mode too, but I just noticed it was switched off. I switched it back on, but allowed bluetooth controllers and now I can fully freeze the console. Still not quite sure what this means, but it looks like switching it off might be a workaround for now. Do you get the momentary hang during the loading screen when airplane mode is off too?

In theory some sysmodules can be stopped/started while the console is running, but this is not really possible with MC because it needs to intercept some system handles at boot time in order to work. If you were to restart it these are lost.

Interestingly, if you search the internet for things like Hades startup freeze you get some familiar sounding results from the PC version. I wonder whether it's possible that some bug has been ported over to the switch version... https://respawnfirst.com/hades-file-sync-error-fix/ https://github.com/ValveSoftware/Proton/issues/3312

wii07 commented 4 years ago

I have a black screen arround 3-4 seconds after starting the game. Than this loading bar at the bottom nearly loads 40 seconds untill the title screen pops up. But i see no diff between MC on or off in the loading times.

I did it in handheld mode and from a 512 GB Samsung Evo Plus sd card. I guess the game just has shitty loading times in general. Fastest it will have in Dock Mode and from the internal memory i guess but i cant test that, my internal is nearly out of space.

Lets hope its in "internal" problem/bug of the game and there will be a patch for that.

Maybe it also happens with an original Switch Pro Controller? I dont have one so i cant test that.

jang2ah2 commented 4 years ago

in my case: regardless the airplane mode is off or on. as long as wifi is turn on. Hades is working fine. and you dont need to be connected to internet either. just make sure that the wifi is turn on and Hades will work just fine along with MC. and once I turn off the wifi, freeze occurs. And this only happens with Hades.

Ti800 commented 4 years ago

i'm not sure if its relevant that the game Ori 2 ask to activate controller every start while patching this sysmodule.

~~system:10.2 atmosphere:0.14.4 airplane:turn on~~ resolved. https://github.com/ndeadly/MissionControl/issues/95

pubg430 commented 4 years ago

Hi i too have the same issue when i remove the content file then only the hades game is able to run, i believe there some code interference with games happening One more observation that the game which ever start with asking controllers to play is hanging

ndeadly commented 4 years ago

i'm not sure if its relevant that the game Ori 2 ask to activate controller every start while patching this sysmodule.

system:10.2 atmosphere:0.14.4 airplane:turn on

Probably not directly related to this issue, but good to know nonetheless. What do you mean by "activate controller"? Or is this literally what it says?

Ti800 commented 4 years ago

i'm not sure if its relevant that the game Ori 2 ask to activate controller every start while patching this sysmodule. system:10.2 atmosphere:0.14.4 airplane:turn on

Probably not directly related to this issue, but good to know nonetheless. What do you mean by "activate controller"? Or is this literally what it says?

like this 873990A0-2E2E-4C08-8838-8F05AE4B832B ask every time i start the game

ndeadly commented 4 years ago

@Ti800 Yeah I doubt this is a related issue. Have you checked that the game doesn't also do this without MissionControl installed? If you believe this is truly an issue with MissionControl, please open a new issue and I'll look into it.

Ti800 commented 4 years ago

@Ti800 Yeah I doubt this is a related issue. Have you checked that the game doesn't also do this without MissionControl installed? If you believe this is truly an issue with MissionControl, please open a new issue and I'll look into it.

Yep, i had checked it ,and a new issue opened.

pubg430 commented 4 years ago

any update ?

ndeadly commented 4 years ago

No sorry. I haven't had much time to look into this issue. I don't really consider it high priority at the moment since it only affects Hades and there's a workaround (see post by @jang2ah2 above)

ndeadly commented 4 years ago

So after talking with SciresM, I've managed to resolve this issue. The cause was a misunderstanding of how thread priorities were represented when creating new threads, resulting in some of my threads to be assigned much lower priorities than intended. This in turn caused some strange conflicts with other parts of the system, resulting in Hades freezing and possibly other unreported issues.

Here's the fix, see if it works for you :) MissionControl-0.2.1-thread-priority-fix.zip

wii07 commented 4 years ago

Confirmed working. Tested it with Hades and a Wii U Pro Controller. Tested it in handheld mode with wifi/bluetooth on and off and in tv mode with wifi on and off (looks like in tv mode bluetooth is always on because otherwise you could not use a controller). ;)

Everything is working fine now, thx alot.

ndeadly commented 4 years ago

This is now fixed in version 0.3.0