Opened 6 months ago

Closed 6 months ago

Last modified 5 months ago

#14703 closed defect (fixed)

iOS: Ultima 8 crashes when Fluidsynth has no soundfont

Reported by: DominusExult Owned by: OMGPizzaGuy
Priority: high Component: Port: iOS
Version: Keywords:
Cc: Game: Ultima VIII: Pagan

Description

with default configuration add Ultima 8 and then start it.
There will be a ScummVM message that Fluidsynth doesn't work without a soundfont and therefore music is disabled.
When you acknowledge this the intro of Ultima 8 starts. At the point when the Guardian lets the Avatar fall and the view would change to him falling into the water ScummVM crashes. Also crashes a lot if you skip the intro.

Xcode traces the crash back to
audio/mt32gm.cpp::985 _controlData[i]->sustain = false;

If I disable MIDI music in the general settings OR provide and set a soundfont Fluidsynth the game works without crashing.

My theory without knowing much of ScummVM's code is that music is not actually getting disabled after the message of missing soundfont but switches to the MT32 emulation and then for some reason crashes.

Change History (6)

comment:1 by somaen, 6 months ago

Priority: normalhigh

comment:2 by OMGPizzaGuy, 6 months ago

Owner: set to OMGPizzaGuy
Resolution: fixed
Status: newclosed

Fixed for Ultima8 by commit (2cbe9a4)https://github.com/scummvm/scummvm/commit/2cbe9a4235de11502e3c47028af8d037c7bb32d4

Considering how MidiDriver::open() is often used, it seems likely other engines might also have problems.

comment:3 by i30817, 5 months ago

They do.

Strangely, Indiana Jones and the fate of Atlantis shows the warning if you let it use the default device without a soundfont in the midi tab. That's not the strange part. The strange part is that it then opens the debugger in android... Which, you know. Might be confusing to get out without force closing to regular users.

comment:4 by criezy, 5 months ago

To add to the previous comment, this is one of the most common crash I have seen reported through TestFlight for the iOS port.

For scumm games, the crash is due to the call to error in case it fails to open the MIDI driver in IMuseInternal::initMidiDriver.

For sci games, there is a similar crash due to SciMusic::init() also calling error if it fails to open the MIDI driver.

I could probably find more engines by going through all the crash logs, but those two are by far the most tested.

comment:5 by OMGPizzaGuy, 5 months ago

Do we want a new ticket for a general case fix? Do we want multiple per engine known to not check open() and fail more gracefully?

As this ticket was specifically calling out Ultima 8, I wanted an isolated solution to the engine

comment:6 by criezy, 5 months ago

Yes, I think we should create one ticket per engine since different developers may look at each engine. I will try to go over the TestFlight crash reports over the weekend and open one ticket per engine with the crash callstack for each one.

Note: See TracTickets for help on using tickets.