-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
PPSSPP crashes on iOS in 64-bit builds with JIT (32-bit works) #9232
Comments
I'm going to look into it tomorrow. |
Ok thank you very much. Really appreciate a lot. |
Just managed to get it all building with XCode and running on my iPad, and I got it to crash with the debugger connected. Ready to debug tomorrow! |
@hrydgard thank you so much for taking care to fix the crash. |
Alright, here we go. There might be two problems here. First, we now build PPSSPP for both ARM32 and ARM64 on iOS, and our memory allocation mmap tricks (for "fastmem") do not work on 64-bit iOS. However, there may be a way out, the mach memory allocation APIs vm_allocate and friends. I'm looking into that now. If that doesn't pan out we'll have to do an uglier solution that will have to sacrifice some performance. Second, the mentioned culprit commit would seem to indicate that there's another crash that affects 32-bit or possible both 32-bit and 64-bit iOS. I can't debug that until I solve the first crash though, and this might actually not be a real crash, not sure yet. |
Yeah sir new builts have performance issues in some games |
Alright, vm_allocate+vm_remap can indeed do address space mirroring. But now I ran into a nasty issue. It turns out that iOS only uses 33 bits of each pointer, and also bans the lower 4GB from usage, meaning that the entire addressable address space is from 0x100000000 to 0x1FFFFFFFF. In there, I am unsuccessful in allocating a 0xE1000000 block of contiguous address space, which I need for the straightforward version of fastmem trick. Since we only really need a few rather small "islands" of that space, there's still hope, but I'm going to have to implement a probing solution to find a memory base pointer that can reach the offsets we need, similar to what we do on 32-bit Windows. Gah :( |
Sir im on android |
In this thread, I am talking about my iOS efforts. One thing at a time. |
@hrydgard We really appreciated whatever you did to fix these issues. Also I noticed the new JIT recompiler had some micro stutter. Maybe if you fix the issue of fastmem on 64-bit it gonna work again like the old JIT. Which is bug free and no stutter at all. |
Working on it, I think I have a promising approach now.. I will solve it :) Also I have a new suspicion about the cause of the stutter and this might just fix it... |
@hrydgard WOW all I can say WOW that's really great news I have ever heard. |
Don't want to promise too much, no guarantees for no stutter yet.. There's something strange and crashy going on still though.. |
OK so I've managed to get things running on iOS ARM64 if you turn off the CPU JIT. Though the vertex JIT is working, so the last bug should be fixable ... might have to wait until tomorrow though. I'll merge the above when the CI buildbot passes. |
@hrydgard ok We'll waiting for these fixes patiently. Hopefully it's gonna fix the micro stutter as well. (Just for knowing) before I updated my iPad Air 2 to 9 it was on iOS 8.4 with TaiG jailbreak and ppsspp running without any issues or even micro stutter at all. All games run at 30/60fps without any drop in the speed at all So the latest jailbreak which is for iOS 10.1.1 the creator (Loca) said he could bypass KPP successfully. Anyway I give you this information to be familiar on something maybe it missed from someone of you. Excluding @hrydgard because he has a deep knowledge on these stuffs. Thanks. |
New build with these changes should be coming to cydia when the buildbot feels like making it, it's a little unpredictable :) Again the main CPU JIT doesn't work yet so you'll have to go into tools/developer settings and change CPU core to IR Interpreter or Interpreter. |
I thank mr.henrik for his hard work |
Thanks again for your hard work. Are you going to bring JIT back after fixing its issue? |
Well the bug is the only thing stopping it, so yeah, of course :) Can't promise I'll find the bug soon though, but I'll try. |
@Sophie94 of course here you go. @hrydgard we all counting on you to fix it. So take your time. |
Anything new on the iOS micro stutter? |
this is not entirely true: the real range is from 0x10000 to 0x1ffffffff: you just need to change the __PAGEZERO segment size to be lower than the default 4GB. This should suffice to solve the fastmem issue. |
@kpwn Hm, interesting. Some linker magic to do that, I suppose? |
Yes: -Wl,-pagezero_size,0x10000 will do it for you. |
I actually think I am tripping and the smallest value can actually be 0x4000, but I may be tripping in my thinking I am tripping. I am not looking at code and not able to try right now. Am certain 10000 works however. |
Well, 0x4000 or 0x10000 shouldn't really matter for our purposes. Thanks for the tip, I'll try it when I next look at iOS again. |
@hrydgard thanks for taking care of that. |
@hrydgard nice to see you always trying to helping people here. |
Note to self for the next time I'm looking at iOS: I just figured at least one reason this isn't working. Our ARM64 backend currently assumes that the PSP memory space is aligned to 4GB. This is so that it can turn PSP pointers into emulator pointers by using the movk ARM64 instruction to poke the base of the PSP memory space into bits 32-48 of the pointer. When, like on iOS, we use an unaligned memory space, this will not work at all. |
still waiting for fixing |
Any chance till will be solved for the next official release? |
There's a semi-fix for this stutter. is while you play psp games just keep ppsspp running in background and go to cydia and download a big size app like (retoarch) then while you download it go back to ppsspp and you'll notice there's no stutter at all. You can enjoy until finished retroarch from downloading after that you'll notice the stutter is returning back again. If take this method maybe it'll open the door for permanent fix. |
I can get JIT to work if I set Xcode to only compile for Armv7. However, it hangs the system on exit on my iPhone 6s, is that expected? |
@hrydgard I suppose we shouldn't pointerize at all on iOS 64 - adding fallback paths around MapRegAsPointer, and error if address is not 48-bit and 4GB aligned. Looks problematic to try "temporary pointerization" with undo at the end of the instruction or anything, in cases of multiple reads or stores. We could add that somewhere in @atsumori666 not expected, but I think that's already been reported. PPSSPP could use someone to more actively maintain the iOS code. It's a small wrapper, but would benefit from someone interested in learning / already knowledgeable in iOS programming contributing. -[Unknown] |
Trying to play Persona 3: Portable on my iPhone 7. Using IR Interpreter. Does not run as smooth as it should at all, and over time starts to chug a lot. Any ETA when JIT will be back as an option that doesn't crash? |
@hrydgard hi there. As I mentioned above in the title. All later versions of ppsspp on iOS are crash when we select roms. and the last version which is working was 1.3-191 so please if you can see what's causing this crash we'll be thankful. Specially on the latest version of ppsspp you merge the important feature which is called (Hardware Tessellation). So if you can investigate about the issue of causing the crash.
Thanks a lot.
The text was updated successfully, but these errors were encountered: