Opened 10 months ago

Closed 9 months ago

#14413 closed defect (fixed)

RetroWave OPL3 crashes all SCI games

Reported by: laurence-myers Owned by: sluicebox
Priority: normal Component: Engine: SCI
Version: Keywords: RetroWave OPL3
Cc: laurence-myers Game:

Description

Windows x64, stable build from buildbot.

ScummVM 2.7.1pre76-gc4f24b2f7e0 (Mar 6 2023 15:13:47)
Features compiled in: Vorbis FLAC MP3 RGB zLib MPEG2 FluidSynth Theora AAC A/52 FreeType2 FriBiDi JPEG PNG GIF taskbar TTS cloud (servers, local) TinyGL OpenGL (with shaders) RetroWave

When using the RetroWave OPL3 (original HAT + PotatoPi version) hardware, attempting to start any SCI game will cause ScummVM to hang and then crash without an error.

Running ScummVM with a high debug level give the last log line of either ADLIB: Starting driver in SCI0 mode or ADLIB: Starting driver in SCI1 mode, depending on the game.

Tested against:

  • Conquests of Camelot
  • King's Quest 4
  • Laura Bow 2: The Dagger of Amon Ra
  • Leisure Suit Larry 3
  • QFG1 EGA
  • QFG2
  • QFG4 CD

Non-SCI games are okay (Beneath a Steel Sky, Kyrandia 1, Indy 3, LOOM EGA).

Because this relies on specific hardware, I am happy to assist with testing.

Change History (6)

comment:1 by NMIError, 10 months ago

This seems to be an issue with the buildbot builds; SCI games work fine with the Retrowave OPL3 on my local builds from the same codebase.

comment:2 by sluicebox, 10 months ago

Hello and welcome! Congratulations on your SCI Companion fixes; I thought we might see you around here sooner or later. It's a slippery slope! =)

Thanks for reporting this. The crash is from a bug in the code that warns that the OPL driver won't work for the game. I've fixed this: https://github.com/scummvm/scummvm/commit/8db3779f7d5beb491b6be019b6dde6ae5e2a3a54

The fix will appear in the next daily build. The fix won't make RetroWave work, but now the program won't segfault when logging. That should make it a bit easier for the sound experts to figure out from here.

Last edited 10 months ago by sluicebox (previous) (diff)

comment:3 by sluicebox, 10 months ago

UPDATE: I now realize that this may have fixed the whole thing. SCI attempts to create a stereo driver first, and if it can't, then it attempts a mono driver. RetroWave is flagged for mono only. So it would have been normal for that warning statement to be logged on every SCI game during the stereo attempt, but the warning statement was buggy and crashed *if* certain other features weren't compiled in, because C is a nightmare.

Give it a try tomorrow; I think it will work.

comment:4 by laurence-myers, 10 months ago

Thanks for the quick fix, sluicebox! :)

I can confirm that in daily build 8db3779f, SCI games now start, and the logs just show some warnings.

WARNING: Your selected OPL driver "RetroWave OPL3" does not support type 1 emulation, which is requested by your game!
WARNING: No OPL emulator available for type 1!

I did encounter some hangs in a quick test in QFG1EGA. The first hang was during the intro sequence, when the red saurus chomps at the camera. The second hang, I watched the whole intro, created a hero, went into the Hero's Tale Inn, had a meal, and typed "kill" a few times, each time triggering a music sting. Both the music and game hangs.

Anyway, that could be anything, even a hardware issue. Laura Bow 2 was fine in a quick test. I'll work out a consistent way to reproduce the hang, and raise a new issue if it happens again.

Thanks very much NMIError for adding RetroWave support!

(Thanks for the welcome! It's good to be back. I made some contributions to the wiki and descumm a long time ago, when I was writing scummbler.)

comment:5 by sluicebox, 10 months ago

Welcome back indeed! I even searched the git repository to make sure I was on solid ground; didn't search the mailing list!

The SCI engine is quite stable these days so a hang is a big deal. But some scripts do wait on music cues, so an exotic sound config/device could be the cause. When you've got simple reproducible hangs for a new ticket, I can walk you through some script debugging commands that will narrow down the cause.

Meanwhile, NMIError is looking into if the RetroWave driver should have the stereo flag set or not.

comment:6 by sluicebox, 9 months ago

Owner: set to sluicebox
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.