Opened 18 years ago

Closed 18 years ago

Last modified 5 years ago

#2378 closed defect

MT32 emulation crashes

Reported by: SF/cirion81 Owned by: sev-
Priority: normal Component: Audio: MT32
Version: Keywords:
Cc: Game:

Description

ScummVM crashes as soon as the first note is about to be played when using the MT32 emulation.

I tested with older CVS versions and was able to pinpoint the week when this bug was introduced:

ScummVM 0.8.0CVS Oct 12 2005 does work ScummVM 0.8.0pre Oct 19 2005 and all later releases I have don't work

This could be because of the following change made in between Oct 12 and Oct19, according to the CVS changelog

2005-10-18 02:28 sev

* sound/softsynth/: mt32.cpp, mt32/i386.cpp: Backport fix for bug #1221549 "MT32emu: doesn't compile under gcc 3.4.2 / i386"

Platform: Win32 (Win2000)

Ticket imported from: #1365603. Ticket imported from: bugs/2378.

Change History (15)

comment:1 by SF/kaminari, 18 years ago

Have you tried with a recent build? Because I can't reproduce your crash with the latest 0.9 CVS. And make sure you've got the mt32_control and mt32_pcm roms somewhere in your path.

comment:2 by SF/cirion81, 18 years ago

the latest build I have tested is 0.9.0CVS 24.11.2005. The official 0.8.0 built doesn't work as well. The ROM files are in my ScummVM directory. There is already some discussion going on in the forum blaming the VIA chipset. http://forums.scummvm.org/viewtopic.php?t=263

comment:3 by fingolfin, 18 years ago

cirion81, you attribute this crash to the change made Tue Oct 18 04:28:58 2005 UTC -- but is this just a guess, based on the fact that it "worked before", or do you have hard facts? Like testing a build made from a snapshot just before and just after that patch?

It is possible to make a CVS checkout from any given moment in time, so one could make checkouts from 4:20 and 4:30, compile them and compare them, if needed....

It would be very helpful if you could provide us with some more details about the crash, too, but I assume that GDB is not installed on a normal windows method, so I have no idea how that could be done ... :-/ Eugene, any suggestions?

comment:4 by fingolfin, 18 years ago

Owner: set to sev-

comment:5 by sev-, 18 years ago

I need at least a backtrace. I cannot reproduce this.

comment:6 by SF/cirion81, 18 years ago

Hello,

no, I have no hard evidence the mentioned change from 2005-10-18 by sev is indeed the cause. I tested the above mentioned versions and then had a look into the CVS changelog. Since there has been only one change in the mt32 subsystem between Oct 12 and 19 I added this as a suggestion, hoping to give you an additional hint who might be the right person to look into this.

I don't have a compiler on my system, so I can't run any tests with a self compiled version. I executed scummvm with debug on, but sadly the program crashes without any output which could give a clue what happened. All I get is a pop up box stating: "Program error, <process already quit> has caused an error. Restart the program"

I would be willing to execute a special debug version if there exists any, so just contact me if I can do anyting.

comment:7 by sev-, 18 years ago

Okay, please, come to IRC when Kirben is online (usually it's 01-12 GMT). He is the person who usually makes win32 builds. So we could try to work this out.

comment:8 by lordhoto, 18 years ago

Ok I checked it with him and we got out that the mt-32 emulator tries to use SSE extensions but his CPU doesn't support those (Athlon Thunderbird), he always get's a "Program received signal SIGILL, Illegal instruction." in: iir_filter_sse (I guess the detection code is wrong then) here is his full backtracke:

0x006c7bf4 in MT32Emu::iir_filter_sse(float, float*, float*) (input=-17658, hist1_ptr=0x1a099c0, coef_ptr=0x2cb00fc) at sound/softsynth/mt32/i386.cpp:150 150 sound/softsynth/mt32/i386.cpp: No such file or directory. in sound/softsynth/mt32/i386.cpp (gdb) bt #0 0x006c7bf4 in MT32Emu::iir_filter_sse(float, float*, float*) ( input=-17658, hist1_ptr=0x1a099c0, coef_ptr=0x2cb00fc) at sound/softsynth/mt32/i386.cpp:150 #1 0x006c88e0 in MT32Emu::Partial::generateSamples(long) (this=0x1a07978, length=1) at sound/softsynth/mt32/partial.cpp:403 #2 0x006c8df1 in MT32Emu::Partial::produceOutput(short*, long) ( this=0x1a05740, partialBuf=0x3209c90, length=3) at sound/softsynth/mt32/partial.cpp:575 #3 0x006c2ed8 in MT32Emu::PartialManager::produceOutput(int, short*, unsigned) (this=0x18e4da0, i=1, buffer=0x3209c90, bufferLength=3) at sound/softsynth/mt32/partialManager.cpp:62 #4 0x006c29f6 in MT32Emu::Synth::doRender(short*, unsigned) (this=0x2c50020, stream=0x195e9fc, len=3) at sound/softsynth/mt32/synth.cpp:1139 #5 0x006c2970 in MT32Emu::Synth::render(short*, unsigned) (this=0x2c50020, stream=0x195e9fc, len=3) at sound/softsynth/mt32/synth.cpp:1127 #6 0x0068671f in MidiDriver_MT32::generateSamples(short*, int) ( this=0x1926988, data=0x195e9fc, len=3) at sound/softsynth/mt32.cpp:331 #7 0x00729758 in MidiDriver_Emulated::readBuffer(short*, int) ( this=0x1926988, data=0x195e9fc, numSamples=512) at ./sound/softsynth/emumidi.h:91 #8 0x0072ee25 in Audio::LinearRateConverter<true, false>::flow(AudioStream&, sh ort*, unsigned, unsigned short, unsigned short) (this=0x195e660, input=@0x1926988, obuf=0x2758070, osamp=4096, vol_l=192, vol_r=192) at sound/rate.cpp:148 #9 0x006775d4 in Audio::Channel::mix(short*, unsigned) (this=0x18e4ca8, data=0x2758070, len=4096) at sound/mixer.cpp:483 #10 0x006766b3 in Audio::Mixer::mix(short*, unsigned) (this=0x214df20, buf=0x2758070, len=4096) at sound/mixer.cpp:255 #11 0x00676776 in Audio::Mixer::mixCallback(void*, unsigned char*, int) ( s=0x214df20, samples=0x2758070 "", len=16384) at sound/mixer.cpp:265 #12 0x10001430 in _end__ ()

I guess that should be enough information then.

comment:9 by fingolfin, 18 years ago

What is the status of this item?

comment:10 by fingolfin, 18 years ago

What is the status of this item?

comment:11 by fingolfin, 18 years ago

Status: newpending

comment:12 by SF/sf-robot, 18 years ago

This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).

comment:13 by SF/sf-robot, 18 years ago

Status: pendingclosed

comment:14 by SF/dominikm, 18 years ago

Hi,

I've chosen this bug, because im having the same problems. I've isolated the portion of the code that causes the problem on my machine and I'm willing to help to resolve this.

The Bug manifests as a "Illegal Instruction" just when the first note from mt-32 should be played.

I've changed the function: atti386_Detect3DNow() in sound/softsynth/mt32/i386.cpp to return always false (not a fix, I know) and after recompilation mt32 works perfectly.

What information is needed from your side?

I'm running: (gcc -v) gcc version 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8) on (uname -a) Linux dawson 2.6.16-suspend2-r4 #1 Sun Jun 18 02:08:40 CEST 2006 i686 Intel(R) Pentium(R) M processor 1.80GHz GNU/Linux

My CPU is (as shown above) a Pentium M (Dothan). (cat /proc/cpuinfo) processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 13 model name : Intel(R) Pentium(R) M processor 1.80GHz stepping : 6 cpu MHz : 1800.000 cache size : 2048 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe est tm2 bogomips : 3603.91

comment:15 by digitall, 5 years ago

Component: --Unset--Audio: MT32
Note: See TracTickets for help on using tickets.