skmp / reicast-emulator

Reicast was a multiplatform Sega Dreamcast emulator
https://reicast.emudev.org
Other
1.1k stars 345 forks source link

Reicasts restarting the device after upgrading to kitkat #200

Closed sergioroprado closed 10 years ago

sergioroprado commented 10 years ago

My phone was on android 4.3 and everything was working fine with the emulator but after I updated the device to 4.4.2, randomly when I try to run a game, sometimes it restarts the phone. In San Francisco Rush 2049 this problem ALWAYS happens before starting the race.

Note: I tested all the compiled commits that I have (I have all) to see if this problem appeared only in some more rescente version or if it's a problem with 4.4.2 and found that in all of them the problem happens.

My device: Galaxy note 3 SM N9005 (Snapdragon 800)

sorry for my bad english

mrcmunir commented 10 years ago

strange it's working fine on my device(Samsung Galaxy tab 2) With Kitkat 4.4 cyanmodgen with last version .

maybe you problem is you rom or hardware bug related

sergioroprado commented 10 years ago

This problem must surely be related to how the emulator communicates with the device drivers or something like that. The problem is not the hardware (like I said, it was working perfectly in 4.3) and also is not in the rom (I'm using official rom without any modification)

AbandonedCart commented 10 years ago

Just because it is the stock ROM doesn't mean it isn't the ROM, other software, the kernel, etc. KitKat uses an entirely different Open GL ES setup that has caused a lot of issues on a lot of devices, especially on stock ROMs.

I'll look into the Note 3 and see if there was anything specific to that going on.

MrPsyMan commented 10 years ago

It's the Adreno graphics drivers being broken. This happens on many Snapdragon devices. Until we can get our hands on an affected Snapdragon device and see why the heck the driver makes the device reset all you can do is revert/update to an Android version that works.

AbandonedCart commented 10 years ago

It seems to be the Samsung ones more than anything. I can get my hands on an S4 and and S3 and see if anything is logged somewhere. KitKat uses GLES 3 with backward compatibility for 2 (if the device supports it - S4, Note 3, etc). Google designed it so all the apps declare 2, but the system decides when and where to use the right version (No documentation really exists to even force 3). Part of it could be all the older EGL and GLES source that is being used for the emulator, too, because my Snapdragon devices have no issues using the updated source.

sergioroprado commented 10 years ago

Is there anything I can do to help?

AbandonedCart commented 10 years ago

If you want to try getting a logcat, the only way with a restart would be using adb.

You would need to go to settings, about, and click the build number until it said you're a developer (if you haven't) then go back to development options and enable usb debugging.

You'll need the drivers and adb (easiest is the section for the note 3 on xda-developers). Once that's all set, plug in the phone, open a command prompt / terminal enter adb shell logcat, then run the app how it normally restarts.

If an error publishes itself, it should be shortly before the prompt stops running because you rebooted.

stodag commented 10 years ago

I had a similar problem with my device(recently closed issue) as with newer builds for me at least its OK.. I would agree with psyman, I'm using an adreno GPU.. must be adreno related.. ppsspp is still having problems with snapdragon, maybe the same issue, and there has been reports of reboot in etc.

stodag commented 10 years ago

Fortunately Henrik got his hands on a few devices.. maybe he knows what the problem is??

AbandonedCart commented 10 years ago

That's what I was saying above. They updated for compatibility with GLES 3.

stodag commented 10 years ago

So because kitkat defaults to gles 3 and reicast to my understanding doesn't support gles 3, instead of looking for gles 2 it force closes? sorry I didn't read properly.

stodag commented 10 years ago

Not force closes.. I mean reboots.

AbandonedCart commented 10 years ago

reicast doesn't decide 2 or 3. The system decides what context to return. They designed it that asking for 2 is like playing roulette. You get whatever the ball lands on and only hardware can really make any definitive decisions on which that'll be. At least that is how they explained it.

weihan1102 commented 10 years ago

Works fine on Nexus 5 stock 4.4.2

AbandonedCart commented 10 years ago

Considering the graphical glitch reports, it would be a paradox if it didn't

MrPsyMan commented 10 years ago

Yeah, but the Nexus 5 has the same Adreno GPU and the same major Android version.

My guess is that the GPU driver has a bug leading to the crash. The crash doesn't happen before graphics init. Graphical output works (well, until the reboot sometime along the road) so OGL ES version detection doesn't seem to matter (it wouldn't start if there was an ogles detection problem).

It could also be something more major, like the changes on new Android versions making the SoC overheat and thus making the device restart.

The point however, as I already mentioned, is that without hardware, we can't be sure of the cause. That's pretty much it.

AbandonedCart commented 10 years ago

removed - Adding an experimental branch to the buildbot instead at /experimental

sergioroprado commented 10 years ago

By doing the procedure to grab the logcat I found that the emulator does not restart the device if it is connected to the PC. I tested it several times with the most problematic game I have (Rush 2049) and connected to the pc it does not have rebooted the device any single time.

AbandonedCart commented 10 years ago

One other thing specific to Samsung devices is the weird way they handle external storage. It is possible that with the phone attached to the computer, it is disabling the one that's causing issues.

sergioroprado commented 10 years ago

I've also tested using the internal and external storage to store the Game and the result was the same.

sergioroprado commented 10 years ago

I also I tested your version of the emulator (DreamcastEmu3.apk) and it force close when the game starts

AbandonedCart commented 10 years ago

... but now you have a log ;)

I need to update that log button in options to get the native ones.

AbandonedCart commented 10 years ago

The difference was instead of returning the best config (or null) of what was tested, this returns an error unless the best config is valid.

sergioroprado commented 10 years ago

Want to help identify the problem. Is there anything I can do to help?

some1new2 commented 10 years ago

There'll be newer revision of v@66 in couple of weeks for nexus 5, so far as I know they haven't or forgot to rename it on nexus 5 and it still shows as v@53. But Qualcomm is disaster, newer revisions could be worse than previous like it was v@45 vs v@53. But like I've mention before some titles does crash even on tegra 4,though not causing restart like on qualcomm's soc

sergioroprado commented 10 years ago

The problem is not related to the gpu drivers. Doing various tests here, I discovered that the problem disappears when the device is connected to the PC.

AbandonedCart commented 10 years ago

Have you tried moving the dc (or whatever you named it) folder and setting new paths?

sergioroprado commented 10 years ago

Yes, i tried.

AbandonedCart commented 10 years ago

If it doesn't happen when you are plugged in but it reboots when you aren't, it is almost impossible to determine a cause... I don't think even having the hardware would help there.

sergioroprado commented 10 years ago

If i get the logcat using one of these apps: (https://play.google.com/store/search?q=logcat&c=apps) this would help in something?

AbandonedCart commented 10 years ago

The logcat is going to be reset after a fresh boot. You would have to get the logcat after the error, which is going to be when the device reboots (and restarts logcat clearing the error).

I don't think there is anything that can be done but hope it gets fixed along the way.

mrcmunir commented 10 years ago

@sergioroprado With Logcat Extreme you can Log window floating point in background .

AbandonedCart commented 10 years ago

But does it save somewhere? If not, its not going to be there after the reboot either.

AbandonedCart commented 10 years ago

https://github.com/reicast/reicast-emulator/pull/221 Should be what we need to get something. Right now it will try to grab a fault as it happens, but if that doesn't work, I can try getting it to at least write the file and let you return to it later.

some1new2 commented 10 years ago

sergioroprado, I guess you have V@66.0 AU@04.04.00.006.055 (CL@) with your kitkat rom. I don't know what bugs are there,but on v@53 (current 4.3 driver) there are few known and reported, which qualcomm haven't fixed:glBlitFramebuffer,glBufferSubData/glMapBufferRange stall driver,glBufferSubData causes new internal buffer - OOM error,SIGABRT on usage of textureSize,glVertexAttributePointer with type UNSIGNED_BYTE broken,glGetShaderInfoLog returns max 1023 byte string

sergioroprado commented 10 years ago

zxcvbad,The problem is not related to drivers / gpu .. it seems to be related to something on the internal storage / sd card because when the device is connected to the pc via usb everything works perfectly

sergioroprado commented 10 years ago

Another user of xda forum have reported the same problem on other devices (S4, Nexus 7, Lg Pad 8.3) all in 4.4.2. This information helps in anything?

AbandonedCart commented 10 years ago

Nexus 7 doesn't have an external card and runs fine.

sergioroprado commented 10 years ago

@LoungeKatt This information is here (at the bottom): http://forum.xda-developers.com/showthread.php?p=50806171   I ask him to give more details of the devices / rom he used that had this same problem.

Sorry my bad english

AbandonedCart commented 10 years ago

That sounds more like a user issue if no phone and no version works for him.

Sephkateno commented 10 years ago

Also I'm confirming that the emu crashes after 10 maybe 15 minute of gameplay totally random crashes tried many betas tried tweaking the apps settings but nothing my phone is note 3 snapdragon on TouchWiz 4.4.2...Maybe on cyanmodgen it wouldn't crash but I'm just guessing here on every TW rom I have tried it the same problem exists but I didn't had the chance to try it on earlier version of android before 4.4.2 that is...at the present time I'm stuck on 4.4.2 there is not a way to downgrade due to the bootloader crisis we are having.

skmp commented 10 years ago

@sergioroprado can you try just plugging in into a charger? I suspect its more of a power management issue than something to do with pc communication. (In any case, phone rebooting is a serious hardware/driver flaw and qualcom and/or samsung are to blame here)

sergioroprado commented 10 years ago

@skmp The emulator also restart the device with the charger connected. Only connected to the pc it runs without this problem.

Sephkateno commented 10 years ago

@skmp File Stefane tried connecting to my laptop but still it crashes although I tried it with an older cable I had....will try with the one assigned for note 3 later on and report if something changes....

sergioroprado commented 10 years ago

@Sephkateno From what you said it seems the problem that u are having is different (the emulator is only crashing). In my case, when I try to run the game sonic adventure (pal) or san fransisco rush 2049 the emulator makes the device reboot. You can test these two games to see if the same problem happens?

Sephkateno commented 10 years ago

@sergioroprado Yeah sure thing pal just give me some time to unearth the games ;-)

Sephkateno commented 10 years ago

@sergioroprado Also are you on stock rom or custom what kernel are you on did you try changing any of these?

AbandonedCart commented 10 years ago

I'm wondering if it's a kernel or build filesystem issue. Like permissions that connecting somehow override.

skmp commented 10 years ago

Even if it is that, I don't see how a filesystem leads to a device reboot. Plus, we're not really using that many files or anything. Once the emu is running we only read from the gd and write to the vmu. And fails would just result to read errors.

AbandonedCart commented 10 years ago

At this point there is no logic to it...