Skip to content
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

Implement cover art caching to improve performance for large number of ISOs #52

Open
the8thsign opened this issue Mar 17, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@the8thsign
Copy link

Description:
When a large number of files are present in the ART folder, cover art no longer displays correctly in NHDDL. I currently have 19 games installed on my MMCE device. If I only include the specific cover files needed for these games (sourced from OPL), NHDDL remains responsive, and the cover art displays as expected.

However, when I use a complete ART file dump from this reference set, NHDDL stops displaying any cover art, despite the files being correctly named. Additionally, there's approximately a 2-second delay when navigating between game selections.

Expected Behavior:
NHDDL should ignore ART files not directly associated with the installed games, thus maintaining performance and displaying relevant cover art correctly.

Steps to Reproduce:

  1. Install approximately 19 games on an MMCE device.
  2. Populate the ART folder with the complete OPL cover art set from this archive.
  3. Launch NHDDL and observe behavior (missing cover art, lag in navigation).

Current Behavior:

  • Cover art does not display.
  • A noticeable lag (~2 seconds) occurs when moving between games.

Environment:

  • NHDDL version: nhddl-mmce-hdl-4-19-gf8af04e
  • MMCE device type: MemCard Pro 2 using 1.4.0 firmware
@pcm720
Copy link
Owner

pcm720 commented Mar 17, 2025

NHDDL should ignore ART files not directly associated with the installed games, thus maintaining performance and displaying relevant cover art correctly.

If you read the source code, it simply opens the /ART/<title ID>_COV.png.
So all the delays you observe are caused by the lower-level FAT driver and the fact that there are too many files in the FAT for the ART directory.

Since with MMCE all file access is handled by the MMCE device, you can submit an issue to MemCard Pro 2 developers.

But this will be true for BDM backends as well since the poor little 37 MHz IOP with its 2 MB of RAM has to parse through the table every time it gets a request to open a file.

Also, if you read the notes on this reference set:

Also, you can't install the entire pack on a FAT32 USB, there are just too many files. Sorry guys, you gotta choose art for certain games on USB. There is a limit of around 21,000 or 22,000 files in a folder in the root of a FAT32 filesystem

So I suggest not trying to overload the file system with a bunch of unused files.

Another way of fixing it would be by preloading the cover art in a separate thread and/or caching it in a separate file, but don't have the time to do it yet, especially since the benefits are pretty slim for normal usage.

@the8thsign
Copy link
Author

the8thsign commented Mar 17, 2025

Thank you for the detailed explanation. It makes sense that the issues are due to the FAT driver. I'm fully aware having 60k files is not optimal. Truth is I was just being lazy and trying to avoid getting access to a Windows machine to run OPL Manager all the time for new cover art.

Based on your suggestion, I'll consider raising this issue with the MemCard Pro 2 developers to see if there's potential for optimization on their end.

Your idea regarding preloading or caching cover art sounds promising for scenarios like mine tho. If at some point you find the time to implement it, I think it could definitely enhance speed and usability for larger collections. Even with using just a COV, I notice a delay in the interface when using hundreds of games vs 20 or so.

Thanks again for your great work!

@pcm720 pcm720 changed the title Cover Art fails to load with large ART folder Implement cover art caching to improve performance for large number of ISOs Mar 17, 2025
@pcm720 pcm720 added the enhancement New feature or request label Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants