Problem loading from external sdcard on Nvidia Shield

Hey, I’ve noticed an odd problem loading roms from my external sdcard on Nvidia Shield.

When I try to load a rom from external sdcard, I see this in logcat and a blank screen: I/RetroArch [ERROR] :: (24855): ZIP extraction failed at line: 223. I/RetroArch [ERROR] :: (24855): Didn’t find any ROMS that matched valid extensions for libretro implementation. I/RetroArch [ERROR] :: (24855): ZIP extraction failed at line: 392. I/RetroArch [ERROR] :: (24855): Failed to extract ROM from zipped file: /storage/sdcard1/roms/SNES/ActRaiser.zip.

This affects SNES (all cores), Sega Genesis (all cores), but oddly enough, NOT the FBA core. I have only tried snes/genesis/neo geo/cps2 games.

However, if I use a file manager app on Android to copy the rom from external sdcard to internal /sdcard/, the same roms will just work. So I know that my external sdcard is OK (file manager was able to copy the file from it, so it means it was readable), and that my rom file is valid (it worked when it was on /sdcard/). Also, my external sdcard works fine for Android games that I have moved over.

I’m on Nvidia Shield 4.4.2 (stock ota, not rooted or modified in any way), running the default Dalvik VM. I’ve tested both on Retroarch in Play Store (the old March build) as well as the 2014-07-26 build by lordashram. Both of these have the same symptoms (although I couldn’t verify if FBA core works on the PlayStore version since that doesn’t have FBA support).

For now, I am using the workaround of manually copying the games into a temp directory in /sdcard/ and then deleting them when I want to play something else, but obviously having external sdcard just work normally would be much nicer.

Thoughts on what might be going wrong here? Thanks for the help!

Sidenote: I’ve done some Android development both Java and NDK and was going to try and see if I could poke around the codebase and fix it myself and contribute a patch, but I’m having issues with the build.

I followed the directions on https://github.com/libretro/RetroArch/w … m-Linux%29 and got everything to build successfully (or at least, not spit any obvious error messages). However, the resulting build is only 14mb and when I run the APK, it shows no cores. Pretty sure I did something stupid here and will kick myself once someone enlightens me, but it’s unclear how it went wrong since I ran all the commands in the code snippets on the instructions page and there were no error messages…

What you built is the frontend itself but it needs the core dynamic libraries to actually run anything. You’d need to compile them separately and then add them after compiling or just copy them from a working build. They don’t have to be compiled at the same time or anything.

I can tell you the problem: new sandboxing rules that started with jellybean(?) whereby programs can’t write to external media, so when it tries to unzip your files, it fails when it can’t write the temporary decompressed file. It doesn’t happen with FBA because that core uses the zip archives as its native format and skips the decompression phase.

IMO, the easiest solution is to decompress your ROMs prior to putting them on your SD card.