So basically I load a .m3u with disc 2 first, then I select "New Game" so it asks me to insert disc 1, I open the tray (and resume to make sure the core registered the tray being opened), switch disc index and close tray. As you can see in the logs it properly switches index to disc 1, but the core still reads it as disc 2 (same serial and same CRC).
Exact same results without a .m3u, example with DW5XL which as a "Load Original" menu that asks you to insert the original DW5 disc:
[libretro INFO] isoFile open ok: F:\Roms\Sony - PlayStation 2\Dynasty Warriors 5 - Xtreme Legends (USA).iso
[...]
[libretro INFO] (SYSTEM.CNF) Detected PS2 Disc = cdrom0:\SLUS_212.99;1
[libretro INFO] (SYSTEM.CNF) Software version = 1.00
[libretro INFO] (SYSTEM.CNF) Disc region type = NTSC
[libretro INFO] Game CRC: a719d130
[...]
[INFO] [Disc]: Ejected virtual disc tray.
[libretro INFO] McdSlot 0 [File]: D:\programmes\RetroArch\saves\pcsx2\Slot 1\Shared Memory Card (8 MB).ps2
[libretro INFO] McdSlot 1 [File]: D:\programmes\RetroArch\saves\pcsx2\Slot 2\Shared Memory Card (32 MB).ps2
[INFO] [Disc]: Setting disc in tray: 2/2 - F:\Roms\Sony - PlayStation 2\Dynasty Warriors 5 (USA).iso
[INFO] [Disc]: Appended disc: Dynasty Warriors 5 (USA).iso
[INFO] [Overrides]: Redirecting save file to "D:\programmes\RetroArch\saves\Dynasty Warriors 5 (USA).srm".
[INFO] [Overrides]: Redirecting save state to "D:\programmes\RetroArch\states\Dynasty Warriors 5 (USA).state".
[libretro INFO] (SYSTEM.CNF) Detected PS2 Disc = cdrom0:\SLUS_212.99;1
[libretro INFO] (SYSTEM.CNF) Software version = 1.00
[libretro INFO] (SYSTEM.CNF) Disc region type = NTSC
[libretro INFO] Game CRC: a719d130
Disc is appended properly, disc index switches properly, but still shows serial and CRC from the previous disc.
Tested with 3 games: Shadow Hearts - Covenant, Star Ocean - Till the End of Time and Dynasty Warriors 5 - Xtreme Legends
Important parts from the logs with Shadow Hearts as an example:
So basically I load a .m3u with disc 2 first, then I select "New Game" so it asks me to insert disc 1, I open the tray (and resume to make sure the core registered the tray being opened), switch disc index and close tray. As you can see in the logs it properly switches index to disc 1, but the core still reads it as disc 2 (same serial and same CRC).
Exact same results without a .m3u, example with DW5XL which as a "Load Original" menu that asks you to insert the original DW5 disc:
Disc is appended properly, disc index switches properly, but still shows serial and CRC from the previous disc.
edit: Based on this reply on Reddit: https://www.reddit.com/r/RetroArch/comments/vllmpj/retroarch_pcsx2_disc_swap_function/idwwhwr/ looks like https://github.com/PCSX2/pcsx2/commit/8d92c0668c5e2a1acebbff93dc4bf241944ff2f9 would need to be backported.