Swordfish90 / Lemuroid

All in one emulator on Android!
GNU General Public License v3.0
2.73k stars 166 forks source link

AndroidTV/GoogleTV 11 permissions vs Lemuroid #498

Open branches78 opened 2 years ago

branches78 commented 2 years ago

Describe the bug Using Lemuroid is not possible because Android 11 has a bug where the permissions settings won't allow Lemoroid to read the device's storage.

Expected behavior To be able to add the folders where the roms are.

Smartphone (please complete the following information):

ShakZilla commented 2 years ago

i was running lemuroid on my TCL android tv and everything was working great. Had installed the app through the app store on the internal storage and had kept all the ROMS on an flash drive connected to the tv as external storage. However there was an update to the whole android OS a couple of days back and most of my apps on the tv got completely reset and some had to be re installed etc. When i put on Lemuroid all my games had dissapeared and i figured same thing must have happened so i did a factory reset once to the app and then tried adding the roms again but the app is just not able to access the storage....internal or external. I then went and changed the permissions so it would grant access to the app but that did not even work. I even reinstalled the app and tried a few times but the same problem persisted. I figured id take out the flash drive and format it once and then add the roms back on it and try it again but then i came across alot of posts complaining about the same thing because of the new update. So i figured id also let you know about what i experienced and see if there can be any solution to this issue. Honestly its so much better to be able to play directly off the tv even though i have lemuroid on my android phone as well. Even though games that are even slightly advanced glitch a bit on tv as the hardware struggles to play them i still think its just awesome that u can play most of these games directly off the tv and its just much simpler and easier so i really hope we can solve this issue soon! thanks!

RobertoMicheletto commented 2 years ago

I have a Mi stick 4k on Android 11 and the same thing happens. Mi Box is on Android 9 and doesn't have this problem.

Cacha21 commented 2 years ago

I'm having the exact same problem.

I was using the chromecast with google tv 4k on android 10 and everything was running great.

I've just updated to Android TV 12 and when I want to select a roms folder a toast message pops up on the bottom on the screen saying "You don't have an app that can do this".

This basically makes lemuroid unusable with the Chromecast with google TV with android version 12 :(

Just as a side note, I also have the samw problem with other apps such as Syncthing.

I hope there's a fix for this.

jeffreylunt commented 2 years ago

I'm having this issue as well with a TCL Google TV running Android TV 11. When trying to change the ROM directory I get the message "This device does not support the StorageAccessFramework file picker. Please manually copy uncompressed ROM files into /storage/emulated/0/Android/data/com.swordfish.lemuroid/files/roms and hit Rescan."

Unfortunately when trying to use FX file browser, I can't navigate to that directory because I get a permission problem. I seem to be totally dead in the water trying to use Lemuroid.

ffuugoo commented 2 years ago

Guys, I've figured a working solution for /storage/emulated/0/Android/data/com.swordfish.lemuroid/files/roms access.

PMHendrix commented 2 years ago

Many thanks for this workaround @ffuugoo! One issue I'm running into after carrying this out is that the terminal keeps writing my ROMS to the Chromecast's internal storage (which is extremely limited), even though I've formatted my external drive as internal storage in Google TV, and have installed the Lemuroid app on that drive. Any bright ideas on what I could be doing wrong?

ffuugoo commented 2 years ago

@PMHendrix Nah, that's sort-of intended. The /storage/emulated/0/Android/data/com.swordfish.lemuroid/files/roms part of the adb push command is a path on the Chromecast filesystem. And Lemuroid's default ROMs folder is in Chromecast's internal memory.

I don't use external storage, so I'm not 100% sure how it works... but if Lemuroid found the ROMs that you uploaded to internal memory, then it means that even if you install Lemuroid to the external storage, it still looks for ROMs in internal storage. And, considering that this whole workaround was invented because it's currently impossible to change ROMs directory, this probably (like, 98%) means it's simply impossible to use external storage for ROMs for now.

PMHendrix commented 2 years ago

It seems you are right @ffuugoo . I’ve tried in vain to push the roms via adb to the external storage path (action failed because drive is “read-only”), and have also loaded the roms on the drive manually after reformatting it from internal storage to removable storage, but Lemuroid is not able to detect the roms then (because it presumably only scans the chromecast’s internal storage).

Such a shame, considering the very limited space on the Chromecast renders playing psp or dreamcast games virtually impossible this way.

I really hope Google fixes this issue sooner rather than later, or for someone to find a workaround to load roms from an external storage device.

germanbv commented 1 year ago

the dev should use the folder /storage/emulated/0/Android/Media/Lemuroid instead of /storage/emulated/0/Android/data/com.swordfish.lemuroid/files/roms to read roms since it allows write and read via app... the fix should be quite simple

adrienjoly commented 1 year ago

the dev should use the folder /storage/emulated/0/Android/Media/Lemuroid instead of /storage/emulated/0/Android/data/com.swordfish.lemuroid/files/roms to read roms since it allows write and read via app... the fix should be quite simple

I have no experience developing Android projects, but I'm giving it a try.

So far, here are my findings:

adrienjoly commented 1 year ago

List of potential workarounds I found (but haven't tested yet):

adrienjoly commented 1 year ago

For reference, these issues are potential duplicates, or at least related to this issue: #560, #613.

germanbv commented 1 year ago

the dev should use the folder /storage/emulated/0/Android/Media/Lemuroid instead of /storage/emulated/0/Android/data/com.swordfish.lemuroid/files/roms to read roms since it allows write and read via app... the fix should be quite simple

I have no experience developing Android projects, but I'm giving it a try.

So far, here are my findings:

I'm not an Android developer either... but after reading a little bit about this... it looks like this issue has to do with the implementation of (the now required for Android >= 10) Scoped Storage instead of the now-deprecated Shared Storage...

adrienjoly commented 1 year ago

I'm not an Android developer either... but after reading a little bit about this... it looks like this issue has to do with the implementation of (the now required for Android >= 10) Scoped Storage instead of the now-deprecated Shared Storage...

So what can we do, in your opinion?

germanbv commented 1 year ago

I'm not an Android developer either... but after reading a little bit about this... it looks like this issue has to do with the implementation of (the now required for Android >= 10) Scoped Storage instead of the now-deprecated Shared Storage...

So what can we do, in your opinion?

first, I would verify that the theory is correct and check if this problem triggers on Android >= 11 devices... based on this Scoped Storage has become mandatory starting from Android 11... but as I said above, I'm not an Android dev so I might be wrong and the system might be indeed implementing scoped storage...

urielmon commented 1 year ago

Could anyone find a workaround to make it work on Google TV with Android 11/12?

Why can't Lemuroid use the same as used by Snes9X EX+ that by default reads the ROMs from: /android/media/ instead of the restricted /android/data/? Isn't it a very simple code change that would finally make it work?

branches78 commented 1 year ago

/android/media/ instead of the restricted /android/data/?

I would like /android/ROMS/ better.

urielmon commented 1 year ago

/android/media/ instead of the restricted /android/data/?

I would like /android/ROMS/ better.

Sure, that was just an example. Whatever location that is accessible and can work.

urielmon commented 1 year ago

@Swordfish90 , I know you are very busy, when you have a moment, appreciate if you can comment on this. I really want to be able to use Lemuroid on my Google TV device

350d commented 1 year ago

Same issue here. Philips Android TV.

image
4abhinavjain commented 11 months ago

Guys, I've figured a working solution for /storage/emulated/0/Android/data/com.swordfish.lemuroid/files/roms access.

  • Enable developer mode on the Chromecast
  • Open developer mode options and enable "USB debugging"
  • Install ADB (Android Debug Bridge) on your PC (it's available for Windows, macOS and Linux)

    • I think the package that contains ADB is called "Android SDK Platform Tools"
    • If you don't know how to install them, I think, your best bet would be googling "how to install Android Platform Tools on "
  • Make sure your PC and your Chromecast are connected to the same Wi-Fi network
  • Find your Chromecast IP address

    • Open Wi-Fi settings on the Chromecast, select active Wi-Fi network and a list will appear on the right, one of the items on the list should be "IP address"
    • The address itself looks something like 192.168.0.32
  • Open the terminal on your PC, type adb connect <your Chromecast IP address>, e.g., adb connect 192.168.0.32

    • Explaining how to work in "terminal" is a bit out of scope for this simple guide, so you'll have to google and figure it out yourself
    • ADB will tell you that connection failed...
    • ...but a pop-up menu should appear on your Chromecast saying something like "The PC something-something is trying to connect to ADB, allow the connection?"
    • Obviously, select "yes" on the Chromecast
  • And finally, now you should be able to "push" files from you PC to the /storage/emulated/0/Android/data/com.swordfish.lemuroid/files/roms folder on the Chromecast, to do so type adb push <path to file on your PC> /storage/emulated/0/Android/data/com.swordfish.lemuroid/files/roms

    • e.g., adb push "C:\Users\ChromecastHacker\Downloads\A Link to The Past.sfc" /storage/emulated/0/Android/data/com.swordfish.lemuroid/files/roms
    • Note, that if any path contains spaces, you'll have to enclose it with " symbols.

Unfortunately, this workaround is not working on Mi TV 4k stick (Android 11). It is a pity that the project seems dead as it is the right (and probably the only appropriate) emulator for Android TVs.

soyelmismo commented 6 months ago

Pls do something like RetroArch folder selector... Because in Google TV there's no system files app, so you can't go to a folder directory and "use this folder" to enable access to the app via scoped storage... It needs an implementation like RetroArch does to select folders in external storages (since a lot of devices have low storage for games)

Fusiummm commented 5 months ago

works only until lemuroid version 1.2.X

GronyRalph commented 3 months ago

bump

4abhinavjain commented 3 months ago

I finally managed to access the data directory using the app manager version highlighted in this post and paste ROMs in Lemoroid directory. Post in thread 'Google TV file manager problem!!' https://xdaforums.com/t/google-tv-file-manager-problem.4478099/post-89515842

I am using a Android 12 TV box with no adb access. I will share a tutorial later. Give it a try.

bsjut commented 2 months ago

I can also confirm that it is not possible to use Lemuroid on a Nokia 8010 Android TV Box - it is not possible to select a ROM folder - the folder selection view doesn't appear. There is also no error message visible in the case of the Nokia 8010 box. Basically, when trying to select a folder, nothing happens.

bsjut commented 2 months ago

Guys, I've figured a working solution for /storage/emulated/0/Android/data/com.swordfish.lemuroid/files/roms access.

this worked quite well for me on a Nokia 8010 Android TV Box. In addition, I used "ADB Explorer" from the Windows Store to get an easy GUI for the file transfers. this made it a lot easier, then writing out the commands for each ROM. Worked like a breeze. I only needed the command line for the initial ADB connect command, as ADB Explorer is expecting a port number, but the ADB connect to Android TV devices apparently works without a specified port.