flycast icon indicating copy to clipboard operation
flycast copied to clipboard

[Feature request] Support zipped .CDI files

Open fekir opened this issue 8 months ago • 7 comments

I've been informed that bugs for the retroarch flycast core should be reported here (see https://github.com/libretro/flycast/issues/1205)

Platform / OS / Hardware:

Debian Linux

Flycast version:

Current version shipped by retroarch (I'm not sure whre to find information about version number, I hope the BuildId is enough):

ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=c71369edf6a806bb72332b2f44815ae9ae948484, stripped

Hardware:

Description of the Issue

When I try to start a .cdi file from a .zip archive, the core crashes.

Debugging Steps Tested

  • From retroarch "Load Content"
  • Select .zip archive containing .cdi image
  • Select Browse Archive
  • Select .cdi file
  • retroarch crashes

Logs Gathered

logs have been created with retroarch -f -v --log-file

[INFO] [Environ]: GET_RUMBLE_INTERFACE.
[INFO] [Environ]: SYSTEM_DIRECTORY: "/home/df0/.config/retroarch/system".
[INFO] [Environ]: SAVE_DIRECTORY: "/home/df0/.config/retroarch/saves/Flycast".
[INFO] [Environ]: SET_SAVE_STATE_IN_BACKGROUND: yes.
[libretro INFO] File extension is: .cdi
[INFO] [Environ]: GET_PREFERRED_HW_RENDER, video driver name: vulkan.
[INFO] [Environ]: GET_PREFERRED_HW_RENDER - Context callback set to RETRO_HW_CONTEXT_VULKAN.
[INFO] [Environ]: SET_HW_RENDER, context type: vulkan.
[INFO] Requesting Vulkan context.
[INFO] [Environ]: SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE.
[libretro ERROR] shell/libretro/libretro.cpp:1228 E[BOOT]: Cannot stat /mnt/df0/data/games/dreamcast/gianas_return/gr-v110b-dc.cdi.zip#gr-v110b-dc.cdi
[INFO] [Environ]: SET_MESSAGE: Cannot stat /mnt/df0/data/games/dreamcast/gianas_return/gr-v110b-dc.cdi.zip#gr-v110b-dc.cdi
[ERROR] [Content]: Failed to load content
[INFO] [Core]: Content ran for a total of: 00 hours, 00 minutes, 00 seconds.
[libretro INFO] shell/libretro/libretro.cpp:1899 N[RENDERER]: retro_vk_context_destroy
[libretro ERROR] core/linux/common.cpp:68 E[COMMON]: SIGSEGV @ 0x7f20c09a5950 invalid access to 0x7f20c09a5950
[libretro ERROR] Fatal error : segfault
 in fault_handler -> /builds/libretro/flycast-upstream/core/linux/common.cpp : 81
[libretro ERROR] shell/libretro/libretro.cpp:3516 E[COMMON]: DEBUGBREAK!

Screenshots

(Replace this line with any issue screenshots)

Additional info

If I extract the game manually from the zip archive, the retroarch core starts the game successfully/without crashes. Since the .cdi file is over 700Mb and the archived file (without any particular settings) is under 10MB(!), I would prefer to keep this game (and others) archived.

In case the issue is not reproducible with all games, the game I've used for reporting this bug can be downloaded from here for free: https://www.gianas-return.de/?page_id=453 (direct link: https://www.retroguru.com/gianas-return/gianas-return-v.latest-dreamcast-cdi.zip)

fekir avatar Apr 14 '25 17:04 fekir

Flycast doesn't support zipped .CDI files.

flyinghead avatar Apr 14 '25 18:04 flyinghead

My bad then, in that case it would be a nice feature, since the zip archive massively reduces the size requirements (at least for some games)

From the documentation, it looks like it is supported, as .zipis listed as valid file extension (https://docs.libretro.com/library/flycast/).

Maybe it is only for the NAOMI Games? (I have no idea what those are)

Nevertheless I think it should stay labeled as bug. I do not think the whole retroarch application is supposed to crash on an invalid file...

fekir avatar Apr 14 '25 18:04 fekir

.zip is only supported for arcade games (Naomi, Naomi2, Atomiswave and SystemSP). In fact, it's used as a way to distinguish arcade ROMs from Dreamcast games. Consequently, supporting zipped Dreamcast disks is all but trivial.

flyinghead avatar Apr 14 '25 19:04 flyinghead

@fekir Please rename the issue title to something more accurate like [Feature request] Support zipped .CDI files.

Thank you.

gouchi avatar Apr 22 '25 09:04 gouchi

I guess this github issue summarizes two (or even three?) issues:

  1. the fact that the retroarch core crashes, and brings down the whole retroarch instance. A clean exist should be preferable
  2. being forced to extract a 10MB zip archive to a 700MB cdi file
  3. from the documentation, it seems that a zipped cdi file is supported (at least I understood the documentation that way).

The crash and documentation can be fixed without adding support for zipped cdi files.

If there is a way to keep the cdi file compressed... it does not have to be a zip file. I tried for example to convert it to chd, but with no luck.

@gouchi if there is a chance that such feature gets implemented, then I can rename it as you proposed (but from @flyinghead comment I guess that it is improbable) and create a separate flycast should not crash on zipped cdi file issue.

But if there is no chance, then it makes more sense to rename this one to flycast should not crash on zipped cdi file?

fekir avatar Apr 22 '25 16:04 fekir

The crash is unrelated to loading a zipped .cdi and only happens when using Vulkan. It's due to the Vulkan context not being fully initialized when it is destroyed. I'll push a fix for this soon.

flyinghead avatar May 02 '25 16:05 flyinghead

crash fixed

flyinghead avatar May 03 '25 09:05 flyinghead