mmatyas / pegasus-frontend

A cross platform, customizable graphical frontend for launching emulators and managing your game collection.
http://pegasus-frontend.org
Other
1.29k stars 116 forks source link

Default Launcher on Retroid Pocket 2 not working before force close after reboot #750

Open yngwi opened 3 years ago

yngwi commented 3 years ago

The issue

Since the Android 6 update released at the beginning of December, Pegasus Frontend set as default launcher doesn't work directly after a device reboot. It only shows a blank screen (see screenshot below) that doesn't react to anything. After force closing the Pegasus Launcher app (for instance in the Android Settings -> Apps menu) it starts to work as expected until the next reboot.

System info

Retroid Pocket 2 (Android 6 update 1, released End of November / Start of December 2020)

Pegasus version

Nightly: alpha14-74-g27013ffd (2020-12-01) Same behaviour on alpha14-36-g49dd98b3 (2020-11-12)

Pegasus log

The lastrun log is empty (0B)

If possible, please attach the file to this bug report.

Screenshot: PXL_20201202_080315171

mmatyas commented 3 years ago

Hm, is there some documentation about what changed in the Android update?

yngwi commented 3 years ago

Hi, thanks for the reply. The changelog (I don't know how official it is, I have only started to use the device a few days ago and am no expert) is posted on the Retroid discord. For convenience I have uploaded it to this message.

ChangeLog.txt

mmatyas commented 3 years ago

This might be fixed now in the latest version. Could you take a look?

yngwi commented 3 years ago

Sorry have been away. I will have a look as soon as I can. Thank you!

PocketCloud commented 3 years ago

I found a temporary fix for this issue on the nightly version alpha14-87-g45353b0c (2020-12-17), same RP2 Android version. I disabled Logiqx in 'Settings > Enable/disable data sources...' and it seems to switch back as expected now. I also have a log file from when the bug was happening to me that could help.

lastrun.log

mmatyas commented 3 years ago

Hm, interesting! The log mentions eglSwapBuffers failed: 300d which seems to indicate a failure in accessing the device's drawing capabilities, but might also be just a temporary warning (the last half of the log seems to be missing?). I wonder if this workaround works for @yngwi as well? Anyway, thanks for testing!

yngwi commented 3 years ago

@mmatyas I'm trying just now to update with the updater apk included in retroid. I'll report back afterwards.

yngwi commented 3 years ago

@mmatyas Sorry for the delay. Unfortunately, for me the behavior is still the same. I've updated with the "official" updater, installed the latest version (alpha14-87-g45353b0c (2020-12-17)), disabled the Logiqx datasource but still, I need to force close Pegasus once after reboot to be able to use it, the behavior is the same for me as I've described in the OP.

sovietotaku commented 3 years ago

I'm having exactly the same issue, but RP2's Android version is 8.1 (v2) IDK how to collect logs from the app by the way. If you explain this to me, I wil collect them.

Trauma commented 3 years ago

Exact same issue here on 8.1v2 too. Was working fine for me on the previous Android release (6.0 v2), or i did not catch this bug.

I've tried to disable all data sources and that make no changes. While stuck pegasus just don't log anything in lastrun.log, so I doubt we can find anything interesting there. My lastrun.log, after forcing pegasus to stop, and then relaunching it :

2021-01-04T23:26:56 [i] Pegasus alpha14-36-g49dd98b3 (2020-10-20)
2021-01-04T23:26:56 [i] Running on Android  (8.1) (arm, android)
2021-01-04T23:26:56 [i] Qt version 5.15.1
2021-01-04T23:26:56 [i] Program settings loaded (`/storage/emulated/0/pegasus-frontend/settings.txt`)
2021-01-04T23:26:56 [i] Found locale `de`
2021-01-04T23:26:56 [i] Found locale `en`
2021-01-04T23:26:56 [i] Found locale `en`
2021-01-04T23:26:56 [i] Found locale `es`
2021-01-04T23:26:56 [i] Found locale `fr`
2021-01-04T23:26:56 [i] Found locale `hu`
2021-01-04T23:26:56 [i] Found locale `ko`
2021-01-04T23:26:56 [i] Found locale `pt-BR`
2021-01-04T23:26:56 [i] Found locale `ru`
2021-01-04T23:26:56 [i] Found locale `zh`
2021-01-04T23:26:56 [i] Locale set to `en`
2021-01-04T23:26:56 [i] Found theme `Pegasus Grid` at `:/themes/pegasus-theme-grid/`
2021-01-04T23:26:56 [i] Found theme `gameOS` at `/storage/emulated/0/pegasus-frontend/themes/gameOS/`
2021-01-04T23:26:56 [i] Found theme `Retroidflix` at `/storage/emulated/0/pegasus-frontend/themes/RetroidFlix/`
2021-01-04T23:26:56 [i] Found theme `RetroidStation` at `/storage/emulated/0/pegasus-frontend/themes/RetroidStation/`
2021-01-04T23:26:56 [i] Found theme `Retroid Pocket 2 RG351 Theme` at `/storage/emulated/0/pegasus-frontend/themes/RP-RG351/`
2021-01-04T23:26:56 [i] Found theme `RP2 RG351 - trauma's fork` at `/storage/emulated/0/pegasus-frontend/themes/RP-RG352/`
2021-01-04T23:26:56 [i] Found theme `RP Switch Theme` at `/storage/emulated/0/pegasus-frontend/themes/RP-Switch/`
2021-01-04T23:26:56 [i] Found theme `RP2 Pegasus Grid` at `/storage/emulated/0/pegasus-frontend/themes/rp2-pegasus-grid/`
2021-01-04T23:26:56 [i] Theme set to `RP Switch Theme` (`/storage/emulated/0/pegasus-frontend/themes/RP-Switch/`)
2021-01-04T23:26:56 [i] Gamepad: connected device 0x5 (generic)
2021-01-04T23:26:57 [i] Metafiles: found `/mnt/media_rw/1234567890/Roms/sega32x/metadata.pegasus.txt`
2021-01-04T23:26:57 [i] Metafiles: found `/mnt/media_rw/1234567890/Roms/nds/metadata.pegasus.txt`
2021-01-04T23:26:57 [i] Metafiles: found `/mnt/media_rw/1234567890/Roms/n64/metadata.pegasus.txt`
2021-01-04T23:26:57 [i] Metafiles: found `/mnt/media_rw/1234567890/Roms/genesis/metadata.pegasus.txt`
2021-01-04T23:26:57 [i] Metafiles: found `/mnt/media_rw/1234567890/Roms/gba/metadata.pegasus.txt`
2021-01-04T23:26:57 [i] Metafiles: found `/mnt/media_rw/1234567890/Roms/gb/metadata.pegasus.txt`
2021-01-04T23:26:57 [w] Metafiles: `/mnt/media_rw/1234567890/Roms/gb/metadata.pegasus.txt`, line 22: line starts with whitespace, but no attribute has been defined yet
2021-01-04T23:26:57 [i] Metafiles: found `/mnt/media_rw/1234567890/Roms/dreamcast/metadata.pegasus.txt`
2021-01-04T23:26:57 [i] Metafiles: found `/mnt/media_rw/1234567890/Roms/nes/metadata.pegasus.txt`
2021-01-04T23:26:58 [i] Metafiles: found `/mnt/media_rw/1234567890/Roms/snes/metadata.pegasus.txt`
2021-01-04T23:26:58 [i] Metafiles: found `/mnt/media_rw/1234567890/Roms/psx/metadata.pegasus.txt`
2021-01-04T23:26:58 [i] Metafiles: found `/mnt/media_rw/1234567890/Roms/neogeo/metadata.pegasus.txt`
2021-01-04T23:27:00 [i] Metafiles: finished game searching in 2911ms
2021-01-04T23:27:00 [i] Game list post-processing took 246ms
2021-01-04T23:27:00 [i] Games found in 3162ms
2021-01-04T23:27:00 [i] Metafiles: finished asset searching in 437ms
2021-01-04T23:27:00 [i] Assets and metadata found in 438ms
2021-01-04T23:27:01 [i] 1026 games found
2021-01-04T23:27:01 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:01 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:01 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:01 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:01 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:01 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:01 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:02 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:02 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:02 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:02 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:02 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:02 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:02 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:02 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.
2021-01-04T23:27:02 [w] file:///storage/emulated/0/pegasus-frontend/themes/RP-Switch/components/ListPage.qml:458:23: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.

I had the eglSwapBuffers failed: 300d warning in my previous logs too, but it do not seems to be related because this message are appended to the logs while pegasus is running.

protowlf commented 3 years ago

I'm also getting the same bug. Running Android 6. The Logiqx workaround also does not work for me (My pegasus version is pegasus-fe_alpha14-110-g89e3693b_android)

Shot in the dark, but could this be related to loading assets off an SD card formatted as internal storage? I noticed that assets from pegasus appear to be on my SD card despite the app being installed on internal storage.

protowlf commented 3 years ago

Update: still reproducing the bug with the sd card removed, so maybe disregard the above theory.

thomasdannenmuller commented 3 years ago

I've just tested with pegasus-fe_alpha14-110-g89e3693b_android.apk, no chance.. :(

djfumberger commented 3 years ago

It seems to be an issue with the updated version of Android 6. I have an older Retroid on the initial version that works great. The newer Android 6 version being shipped by Retroid has the issue out of the box.

mmatyas commented 3 years ago

I've heard there's a new firmware update for Retroids, does it have any effect on this issue?

notadeadmoth commented 3 years ago

I'm running the newest Retroid update 8.3 v3 (pegasus-fe_alpha14-110-g89e3693b_android.apk) and this is still an issue.

scobo commented 3 years ago

Same issue on stock Retroid 2 with Android 6. Issue persisted after I wiped the device and upgraded to Android 8.1. Tried both pegasus-fe_alpha14-135-g33920608_android.apk and pegasus-fe_alpha14-110-g89e3693b_android.apk. Current firmware version is RP2.02.2.2 (20210223).

Edit: It seems to happen reliably after launching a game. I can exit Pegasus and relaunch without issue (even close it and start it again), but launching a game puts it into an unrecoverable state.

yngwi commented 3 years ago

I have now changed my OS to LineageOS 15.1 created by someone on the Retroid Pocked Discord. It is based on Android 8.1 as well and has the same Problem so I guess the problem lies with Android 8.1?

mmatyas commented 3 years ago

I think it might be related to some Retroid-specific part of it, like the video driver or the storage handling, but it's hard to say without a device.

scobo commented 3 years ago

Do you accept bounties? I could cover the cost of a Retroid if that would help.

mmatyas commented 3 years ago

Thank you, I appreciate the offer, but because I cannot confidently say I'm able to fix this with a device, I'd be hesitant asking for such a large donation until we try out whatever we can remotely.

On the other hand, with Lineage there might be a way to dump the system logs properly -- I've found this in their official wiki: https://wiki.lineageos.org/how-to/logcat. If the Retroid runs Lineage 15.x, and it is rooted, the on-device instructions should work there too. They might work with the regular Retroid images as well; if they do, a comparison of both could be useful too.

If it works, then the logs should be taken like this: set Pegasus as the launcher, shut down the Retroid completely, start it up (noticing the blank screen of Pegasus), close Pegasus and finally save the logs as described at the link (ideally not running anything else). I don't know how much Retroid logs, but might worth giving it a try.

Trauma commented 3 years ago

Here is the logcat dump from Retroid's image v8.1. And following your instructions, hope it helps :) logcat.txt

mmatyas commented 3 years ago

Thanks! Looked into it, and while I'm not 100% sure, I see some permission errors and an EGL error. It seems as if either the storage or the video driver is inaccessible when Pegasus starts up? It might be useful to record a log file of a properly working Pegasus, for comparison.

hh3k0 commented 3 years ago

It seems as if either the storage or the video driver is inaccessible when Pegasus starts up?

Could that be solved by using a BroadcastReceiver to wait for BOOT_COMPLETED before launching the MainActivity?

mmatyas commented 3 years ago

The activity launching is handled by Qt,; I'm afraid we don't have such low level access, unless someone modifies the code there.

samdevega commented 2 years ago

I found a workaround in order to have Pegasus launched at startup. Just kept the default launcher for the Retroid Pocket 2 and used the app AutoStart to run Pegasus. I know it is not the same as having it as the default launcher but is better than nothing. I hope this can be of help to someone until the problem is fixed ✌️

samdevega commented 1 year ago

@mmatyas I saw other qt projects with the same problem and someone said that changing the android launch mode from "singleTop" to "singleInstance" in the android manifest file fixed the problem. I am having problems on building the app, have no experience with Qt so I cannot test it myself. Can you please try if it fixes the problem? Thank you.

mmatyas commented 1 year ago

Thanks for the info! I don't have a device to test, but I made a build that uses single instance mode:

singleinstance.zip

(You may have to uninstall the existing Pegasus if Android throws an error on installing.)

samdevega commented 1 year ago

It didn't work unfortunately.