-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Game card launch error after using the application. #5
Comments
This has been a tough nut to crack so far. I have spent hours trying to find the source of the problem (which is definitely related to fsp-srv) to no avail. Any help on this matter will be greatly appreciated. |
According to some tests, it seems that the source of the problem are the calls to GetGameCardHandle (IDeviceOperator cmd 202). If it isn't called at least once, the game card launching bug isn't triggered. However, it is crucial to get any of the dump procedures to work, so we can't just skip that. Even though the IDeviceOperator instance is closed and the fsp-srv service handle is deinitialized, I believe these game card handles are not closed properly. Ejecting and re-inserting the game card while on Horizon probably invalidates the handles that were previously opened, thus fixing the problem. That's my current guess, at least. The original codebase from MCMrARM also had this problem. The difference is that it was only triggered after starting a partition dump. However, since gcdumptool actually relies on the root HFS0 header information from the game card to create precise HFS0 partition dumps and not complete IStorage interface dumps, GetGameCardHandle is called right when a new game card is detected. It seems there are no IDeviceOperator calls to invalidate game card handles. I tried calling FinalizeGameCardDriver (IDeviceOperator IPC cmd 204) but instead of helping, it seems to turn off all game card I/O, making the problem even worse. I'll keep looking into this matter. Any kind of help will be greatly appreciated, as usual. |
Upon further inspection, it seems the source of the problem is not the GetGameCardHandle IPC call, but rather the OpenGameCardStorage call (IFileSystemProxy cmd 30). It doesn't matter if at least a single call fails, the error can still be triggered after going back to Horizon. I compared the argument order used in the OpenGameCardStorage call (which has remained largely untouched since the original codebase by @MCMrARM, as well as the other fs functions) with the information from SwIPC and, since the order doesn't match, I thought the code was somehow at fault in this case. I swapped the argument order and got an invalid argument error, so I'm back to zero. Then again, any kind of help will be greatly appreciated. |
I have a note about this topic: |
Why not just do reboot to payload? |
@DanielC-08 It's out of the question. In the end, it's faster to just take out the gamecard and reinsert it. A proper fix would be preferred. |
After asking SciresM about the potential source of this problem, he said:
Fixing this issue will probably require messing with the fs sysmodule to interact directly with the gamecard ASIC. |
@Thealexbarney let us know about the internal The gamecard handle itself is incremented if an action that deactivates the gamecard ASIC is performed. One of these actions is performing a secure -> normal mode transition, which is (sadly) done by nxdumptool right after a new gamecard is detected, in order to parse information from it that's not provided by FS IPC calls. Furthermore, @shadowninja108 also explained that whenever a secure -> normal mode transition is required, the LAFW just resets the whole driver -- there's no real handling for this particular scenario. The proposed solutions include:
But hey, at least we're no longer threading the unknown, which is certainly nice! Progress is progress. |
This is a known bug and it's related to fsp-srv. The error displayed by Horizon is not a kernel panic and doesn't get logged in the error history. It doesn't force the user to reboot the console.
Just reinserting the game card seems to do trick. But an alternate solution would be preferrable.
The text was updated successfully, but these errors were encountered: