Libretro-uae 2.6.1 (nee puae) segfault with SCSI

If I enable scsi=true in a custom .uae configuration in libretro-uae 2.6.1 (in order to allow an ISO image to be visible to a booted HDF hard drive image), I see this in the log:

[libretro INFO] FS: mounted CD unit CD0
[libretro INFO] Mounting uaescsi.device 0: (2)

followed by a segfault.

Is there any trick to this that I’m unable to figure out? =)

Hmm, working fine here on Windows with both cores when using the normal method of enabling “Global Boot HD”, which makes CD images to boot to AmigaCD mode instead of CD32. And also with manual uae conf with scsi=true added, which adds the CD LED to the statusbar.

After those log entries it should show the TOC of the image. What does your config look like? And how about the rest of the log, with debug level enabled?

Edit: I tried in Linux VM too, and no crash.

What I’m doing is (ab)using Retroarch a bit here to achieve a desktop-like environment.

This is my UAE file:

kickstart_rom_file=/home/pi/RetroPie/BIOS/kick40068.A4000
floppy0type=1
chipset=aga
chipset_compatible=A4000
a3000mem_size=16
bogomem_size=0
chipmem_size=4
cpu_model=68040
fpu_model=68040
hardfile=read-write,0,0,0,512,/home/pi/RetroPie/roms/amiga/AmigaDOS/wb31.hdf
filesystem2=rw,HD1:Work:/home/pi/RetroPie/roms/amiga-disks/Work,-128

It works great as a ‘desktop’, including arbitrary (single) floppy access.

I’m now trying to mount pure CD data (e.g. Aminet CDs) as ISOs on the Workbench.

If I Load/Insert an ISO from within the Core menu, it works fine, and shows up in the debug log thusly (and is pretty obviously not the desired goal):

[INFO] [Disc]: Setting disc in tray: 1/1 - Aminet 01 (Jun 1993) [!]
[INFO] [Disc]: Appended disc: Aminet 01 (Jun 1993) [!].iso
[INFO] [Overrides]: Redirecting save file to "/home/pi/RetroPie/saves/amiga/Aminet 01 (Jun 1993) [!].srm".
[INFO] [Overrides]: Redirecting save state to "/home/pi/Aminet 01 (Jun 1993) [!].state".
[INFO] [Disc]: Closed virtual disc tray.

If I append “scsi=true” to the above config, it looks like it ought to work (you see the proper CD0 device, and presumably uaescsi.device is now loaded), but it then segfaults (on a Pi 400), suggesting perhaps the reason for the crash is that the moment of bootup the “image” being mounted to CD is NULL? (The idea is that I’m trying to treat this like an actual CD drive, where I can insert/remove ISO images in the same fashion as ADFs.) Full log below:

Parameters: 
Executing: /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-puae2021/puae2021_libretro.so --config /opt/retropie/configs/amiga/retroarch.cfg "/home/pi/RetroPie/roms/amiga/AmigaDOS/Modern.uae" --verbose --appendconfig /dev/shm/retroarch.cfg
[INFO] RetroArch 1.15.0 (Git 1e5b1ba)
[INFO] === Build =======================================
[INFO] CPU Model Name: ARMv7 Processor rev 3 (v7l)

[INFO] Capabilities: NEON VFPv3 VFPv4
[INFO] Built: Apr  9 2023
[INFO] Version: 1.15.0
[INFO] Git: 1e5b1ba
[INFO] =================================================
[INFO] [Input]: Found input driver: "x".
[INFO] [Core]: Loading dynamic libretro core from: "/opt/retropie/libretrocores/lr-puae2021/puae2021_libretro.so"
[INFO] [Overrides]: Core-specific overrides found at "/home/pi/.config/retroarch/config/PUAE 2021/PUAE 2021.cfg".
[INFO] [Config]: Loading config: "/opt/retropie/configs/amiga/retroarch.cfg".
[INFO] [Config]: Appending config: "/dev/shm/retroarch.cfg".
[INFO] [Config]: Appending override config: "/home/pi/.config/retroarch/config/PUAE 2021/PUAE 2021.cfg".
[INFO] [Environ]: SYSTEM_DIRECTORY: "/home/pi/RetroPie/BIOS".
[INFO] [Environ]: CORE_ASSETS_DIRECTORY: "/home/pi/.config/retroarch/downloads".
[INFO] [Environ]: GET_SAVE_DIRECTORY.
[INFO] [Environ]: GET_CORE_OPTIONS_VERSION.
[INFO] [Environ]: RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2.
[INFO] [Environ]: SET_CONTROLLER_INFO.
[INFO] [Environ]: SET_SUPPORT_NO_GAME: yes.
[INFO] [Environ]: GET_LED_INTERFACE.
[INFO] [Environ]: GET_VFS_INTERFACE. Core requested version >= V2, providing V3.
[INFO] [Overrides]: Redirecting save file to "/home/pi/RetroPie/saves/amiga/Modern.srm".
[INFO] [Overrides]: Redirecting save state to "/home/pi/RetroPie/roms/amiga/AmigaDOS/Modern.state".
[INFO] [Environ]: GET_LOG_INTERFACE.
[INFO] [Environ]: GET_PERF_INTERFACE.
[INFO] [Environ]: GET_DISK_CONTROL_INTERFACE_VERSION.
[INFO] [Environ]: SET_DISK_CONTROL_EXT_INTERFACE.
[INFO] [Environ]: SET_SERIALIZATION_QUIRKS.
[INFO] [Environ]: SET_INPUT_DESCRIPTORS:
[INFO] [Environ]: SET_KEYBOARD_CALLBACK.
[INFO] [Environ]: SET_SUPPORT_ACHIEVEMENTS: yes.
[INFO] [Content]: Content loading skipped. Implementation will load it on its own.
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[libretro INFO] Model: 'A500'
[libretro INFO] Kickstart: 'kick40068.A4000'
[libretro INFO] --------------------------------------------------------------------------------
[libretro INFO] PUAE 2.6.1 da26944, Jul 20 2023 09:28:50
[libretro INFO] --------------------------------------------------------------------------------
[libretro INFO] RTAREA located at 00F00000
[libretro INFO] Known ROM 'KS ROM v3.1 (A4000)' loaded
[libretro INFO] Building CPU table for configuration: 68040/68040
[libretro INFO] 1883 CPU functions
[libretro INFO] Building CPU, 46168 opcodes (4 0 0)
[libretro INFO] CPU=68040, FPU=68040, MMU=0, JIT=CPU=0.
[libretro INFO] IMAGE driver open.
[libretro INFO] uaescsi.device:0 = IMAGE:'IMG:<EMPTY>'
[libretro INFO] hfd attempting to open: '/home/pi/RetroPie/roms/amiga/AmigaDOS/wb31.hdf'
[libretro INFO] HDF '/home/pi/RetroPie/roms/amiga/AmigaDOS/wb31.hdf' opened, size=107520K mode=0 empty=3
[libretro INFO] Reset at 00000000. Chipset mask = 00000007
[libretro INFO] NTSC mode V=59.9400Hz H=15734.2637Hz (227x262+0) IDX=11 (NTSC) D=0 RTG=0/0
[libretro INFO] hardreset, memory cleared
[libretro INFO] SNDRATE 262.0*227.5*59.940000=3572723.700000
[libretro INFO] SNDRATE 262.0*227.5*59.940000=3572723.700000
[libretro INFO] NTSC mode V=59.9400Hz H=15734.2637Hz (227x262+0) IDX=11 (NTSC) D=0 RTG=0/0
[INFO] [Environ]: SET_MEMORY_MAPS.
[INFO] [Replay]: Found last replay slot: #0
[INFO] [SRAM]: Skipping SRAM load.
[INFO] [Core]: Version of libretro API: 1, Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 44144.14 Hz.
[INFO] [Video]: Set video size to: 1920x1080.
[INFO] [Video]: Starting threaded video driver..
[WARN] [DRM]: Couldn't get device resources.
[WARN] [DRM]: Couldn't get device resources.
[INFO] [DRM]: Found 1 connectors.
[INFO] [DRM]: Connector 0 connected: yes
[INFO] [DRM]: Connector 0 has 20 modes.
[INFO] [DRM]: Connector 0 assigned to monitor index: #1.
[INFO] [DRM]: Mode 0: (1920x1080) 1920 x 1080, 60.000000 Hz
[INFO] [DRM]: Mode 1: (1920x1080) 1920 x 1080, 59.940201 Hz
[INFO] [DRM]: Mode 2: (1920x1080i) 1920 x 1080, 30.000000 Hz
[INFO] [DRM]: Mode 3: (1920x1080i) 1920 x 1080, 29.970100 Hz
[INFO] [DRM]: Mode 4: (1920x1080) 1920 x 1080, 24.000000 Hz
[INFO] [DRM]: Mode 5: (1920x1080) 1920 x 1080, 23.976080 Hz
[INFO] [DRM]: Mode 6: (1280x720) 1280 x 720, 60.000000 Hz
[INFO] [DRM]: Mode 7: (1280x720) 1280 x 720, 59.940201 Hz
[INFO] [DRM]: Mode 8: (1024x768) 1024 x 768, 75.028580 Hz
[INFO] [DRM]: Mode 9: (1024x768) 1024 x 768, 70.069359 Hz
[INFO] [DRM]: Mode 10: (1024x768) 1024 x 768, 60.003841 Hz
[INFO] [DRM]: Mode 11: (1440x480i) 1440 x 480, 29.970030 Hz
[INFO] [DRM]: Mode 12: (800x600) 800 x 600, 60.316540 Hz
[INFO] [DRM]: Mode 13: (720x480) 720 x 480, 60.000000 Hz
[INFO] [DRM]: Mode 14: (720x480) 720 x 480, 59.940060 Hz
[INFO] [DRM]: Mode 15: (720x480i) 720 x 480, 30.001110 Hz
[INFO] [DRM]: Mode 16: (720x480i) 720 x 480, 29.970030 Hz
[INFO] [DRM]: Mode 17: (640x480) 640 x 480, 75.000000 Hz
[INFO] [DRM]: Mode 18: (640x480) 640 x 480, 60.000000 Hz
[INFO] [DRM]: Mode 19: (640x480) 640 x 480, 59.940475 Hz
[INFO] [GL]: Found GL context: "kms".
[INFO] [GL]: Detecting screen resolution: 1920x1080.
[INFO] [EGL] Found EGL client version >= 1.5, trying eglGetPlatformDisplay
[INFO] [EGL]: EGL version: 1.4
[INFO] [EGL]: Current context: 0xaab28990.
[INFO] [KMS]: New FB: 1920x1080 (stride: 7680).
[INFO] [GL]: Vendor: Broadcom, Renderer: V3D 4.2.
[INFO] [GL]: Version: OpenGL ES 3.1 Mesa 19.3.2.
[INFO] [GL]: Using resolution 1920x1080.
[INFO] [GL]: Default shader backend found: glsl.
[INFO] [Shaders]: Specific shader preset found at "/home/pi/.config/retroarch/config/global.glslp".
[INFO] [Shader driver]: Using GLSL shader backend.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GL]: Loaded texture image from: "/home/pi/.config/retroarch/shaders/shaders/zfast_resources/zfast_iqlut.png" ...
[INFO] [GL]: Loaded texture image from: "/home/pi/.config/retroarch/shaders/shaders/zfast_resources/zfast_scanlut.png" ...
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GL]: Using 4 textures.
[INFO] [GL]: Loaded 1 program(s).
[INFO] [udev]: Pad #0 (/dev/input/event2) supports force feedback.
[INFO] [udev]: Pad #0 (/dev/input/event2) supports 16 force feedback effects.
[INFO] [Joypad]: Found joypad driver: "udev".
[INFO] [Video]: Found display server: "null".
[INFO] ALSA: Using floating point format.
[INFO] ALSA: Period size: 480 frames
[INFO] ALSA: Buffer size: 1536 frames
[INFO] [Display]: Found display driver: "gl".
[INFO] [LED]: Using driver: "sysled".
[INFO] [Playlist]: Loading history file: "/opt/retropie/configs/amiga/content_history.lpl".
[INFO] [Playlist]: Loading history file: "/opt/retropie/configs/amiga/content_music_history.lpl".
[INFO] [Playlist]: Loading history file: "/opt/retropie/configs/amiga/content_video_history.lpl".
[INFO] [Playlist]: Loading history file: "/opt/retropie/configs/amiga/content_image_history.lpl".
[INFO] [Playlist]: Loading favorites file: "/opt/retropie/configs/amiga/content_favorites.lpl".
[WARN] [udev]: Mouse grab/ungrab feature unavailable.
[INFO] [Input]: Game Focus => ON
[INFO] [Environ]: SET_GEOMETRY: 720x240, Aspect: 1.269.
[libretro INFO] SERIAL: period=372, baud=9600, hsyncs=1, bits=8, PC=f8012e
[INFO] [KMS]: New FB: 1920x1080 (stride: 7680).
[INFO] [KMS]: New FB: 1920x1080 (stride: 7680).
[libretro INFO] Filesystem: mapped memory @$e90000.
[libretro INFO]    Card 1 (ZorroII) done.
[libretro INFO] Memory map after autoconfig:
[libretro INFO] filesystem: diagentry called: 7000098
[libretro INFO] SNDRATE 263.0*227.5*59.940000=3586360.050000
[libretro INFO] NTSC mode V=59.9400Hz H=15665.4053Hz (228x262+1) IDX=11 (NTSC) D=0 RTG=0/0
[libretro INFO] /home/pi/RetroPie/roms/amiga/AmigaDOS/wb31.hdf:
[libretro INFO] Mounting uaehf.device 0 (0) (size=110100480):
[libretro INFO] RDB: RDB filesystem 444F5303 (DOS\3) version 40.1
[libretro INFO] RDB: 444F5303 (DOS\3) in FileSystem.resource version 40.1
[libretro INFO] RDB: FS in FileSystem.resource is newer or same, ignoring RDB filesystem
[libretro INFO] /home/pi/RetroPie/roms/amiga/AmigaDOS/wb31.hdf:
[libretro INFO] Mounting uaehf.device 1 (0):
[libretro INFO] FS: mounted virtual unit HD1 (/home/pi/RetroPie/roms/amiga-disks/Work)
[libretro INFO] FS: mounted CD unit CD0
[libretro INFO] Mounting uaescsi.device 0: (2)
[libretro INFO] FS: Work (flags=00000002,E=0,ED=1,EF=0,native='/home/pi/RetroPie/roms/amiga-disks/Work') starting..
/opt/retropie/supplementary/runcommand/runcommand.sh: line 1319: 26993 Segmentation fault      /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-puae2021/puae2021_libretro.so --config /opt/retropie/configs/amiga/retroarch.cfg "/home/pi/RetroPie/roms/amiga/AmigaDOS/Modern.uae" --verbose --appendconfig /dev/shm/retroarch.cfg

I can appreciate this is likely neither a common nor supported configuration…but it seems like it should work for what I’m trying to achieve. Maybe not. =)

Beats me, I have no issues booting without any CD inserted, and then use Disc Control to insert something into CD0:…

Could you try getting a proper crashing debug log by building the core with DEBUG=1 and running through gdb to know where it actually crashes?

Also why on earth are you mixing a3000mem_size with some A4000 setup and not Z3?

Ok, had a look at the SCSI CD mounting code, and indeed at one point it is doing strdup for the null volume string when SCSI is enabled if nothing is mounted. The outcome of doing that most likely differs between platforms.

And also the empty unit has a default native mountpoint of / which does not even make sense from Windows point of view, but looks especially bad for non-Windows.

So could you confirm that there is no boot crash if you add cdimage0=x,? That extra ending comma is needed if the path itself has a comma in it.

I have a rather simple workaround ready too.

Sorry for the late response…work’s been busy.

I tested cdimage0 against the ISO and it worked on the very first try! :slight_smile:

If I replace the actual path to the ISO with an invalid path, I get the same thing as before…instant segfault.

Okeydokey, I pushed a fix for both cores, so stay tuned for the core to update.

Building now directly from source, will provide test results shortly

Confirmed - works exactly as expected!

Thank you VERY much!

Excellent, thanks for pointing out that flaw!

Also why on earth are you mixing a3000mem_size with some A4000 setup and not Z3?

I forgot to respond to this.

As I understand it, a3000mem_size is misnamed (because that’s what it was first used for), and actually (generically) refers to any 32-bit motherboard memory that isn’t autoconfig, unlike Z3 RAM (which is treated like a Zorro board and is autoconfig). Thus, a properly-modeled A4000 with fully populated motherboard memory would indeed reflect as written.

Hi All,

I’m having a similar kind of problem and this is the closest kind of thread I can find where I can comment on it.

At the moment I’m trying out a new game I just picked up, Tales of Gorluth III. I’ve picked up the digital edition and it works fine in WinUAE, but I can’t get it to load in PUAE, which is generally the only way I play Amiga titles these days due to the shader support.

The reason I think it doesn’t work is because the file structure doesn’t include the libraries to run in it’s own folder and relies on workbench to load them in. To get it running in WinUae, you attach a Workbench ADF and attach the Zip file for the game as a hard drive folder - it boots into workbench and you double click the file/ executable and the game starts running.

In PUAE things are different, as you can’t just attach an ADF and a HD Folder the same time (or at least I’ve yet to work out how to do this in Retorarch or with a .uae file or .m3u file), so I haven’t been able to replicate the process.

So, if anyone can provide assistance - I consider there might four possible ways to solve this.

  1. M3U file - the correct formatting to allow both ADF and a HD Folder to run at the same time and then just change disk and have the HD folder show on the workbench desktop. I actually don’t think this is possible considering the limitations PUAE, but if it is, this would be by far the easiest solution.

  2. .uae config file - an example of a config layout for AGA 040, could allow first an ADF to be booted and allow the HD Folder to be seen on the workbench, and any recommended settings to be turned on in Retorarch to get this to work (Global Boot HD?).

  3. Manually create a .slave file (I don’t know how to do this), add workbench .s files as part of src folder, and libs folder with the correct libraries (which ones?), as add a start-sequence or asm file which then defines the load sequence and loads in the libraries on boot - and I’d assume this would allow for a workbench environment to be created where the file could be loaded from.

  4. Create a HDF file as a container for the HD Folder folder and it as part of it’s archive. This may or may not include step 3. I also wonder if this step would include turning on Boot Global HD? and using step 2 to get it to launch from a .uae config file?

Or is there a simpler way to do all this that I’m missing?

The folder structure looks like this:

Top level folder TOGIII-030-EN (Folder) TOGIII-030-EN.info

Sub level folder Pics (Folder) Levels (Folder) Files (Folder) TalesOfGorluthIII.info TalesOfGorluthIII (no association - this would be the executable?)

Thanks in advance for any help with this.

Does the folder necessarily have to be ZIPped, or can it be unzipped just sitting on the underlying filesystem as a series of files and folders? If the latter, I may have a solution.

The core does not care if the content is extracted or not. And this SCSI crash has nothing to do with this launch thing.

Understand the two are unrelated…but in local testing, at least the older/faster core does seem to care. I too can’t get it to mount a ZIP file of random files as a disk - the log looks clean, it says it’s mounted, info shows the device, but there’s no actual device presented. A raw directory works as expected.

If the zip contains recognized valid file extensions, an M3U will be created from them and launched. If not, the extracted temp dir is just a hard drive like any other directory, not a floppy disk. There is no difference between the core versions.

I put a zip inside a 7z, and when the “Global Boot HD” option is enabled, and a working Workbench is installed there, when the 7z is launched, the TEMP dir used for extraction is there as a drive.

Is there a max size limit on the extracted temp dir? As I said before, at least on RetroPie, the log looks very clean mounting a ZIPped directory of random content but nothing is actually presented in-emulator. It’s very easy to reproduce.

How do you determine what and how is something presented in emulation? Workbench won’t show any drive contents by default other than info files.

No, there is no max size limit other than your own local storage. Max file count for M3U generation is limited to 20.

.uae file:

floppy0=/home/pi/RetroPie/roms/amiga/amigados13.adf
filesystem2=ro,test:test.zip:/home/pi/RetroPie/roms/amiga/test.zip,0

So long as test.zip is big enough to pass the “too small” check, the log shows it mounted:

[libretro INFO] Mounting uaehf.device 0 (0):
[libretro INFO] FS: mounted virtual unit test (/home/pi/RetroPie/roms/amiga/test.zip)
[libretro INFO] FS: test.zip (flags=00000000,E=1,ED=0,EF=0,native='/home/pi/RetroPie/roms/amiga/test.zip') starting..

Opening a CLI in Workbench shows the test: device mounted (but with no disk inserted…however, that’s normal for uaehf), attempting “dir test:” results in an error that no disk with that name is mounted and no drive icon shows up on the workbench.

If you extract the contents of the zip and mount that in the .uae instead, it mounts and displays as expected.

1 Like

I was talking about the automagic core launch method and not uae conf method, which should still work the same, sure. But why the need for the uae conf trickery?

Also that E=1 there means that the drive is empty, which kinda does not make sense with zips…

In any case, I haven’t tested that internal direct zip filesystem reading stuff at all.