[Not ZDoom] MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Bugs that have been investigated and resolved somehow.

Moderator: Developers

MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Postby DabbingSquidward » Thu Dec 28, 2017 11:18 am

I was playing Silentzorah's Doom Gaiden, MAP13: Villa de Rais (the secret level) and at the end of the level there's a red-keyed door. It's set to repeatable action and triggers ACS_Execute to change the track D_VILLAD to D_NULL, an empty one second MIDI, essentially stopping the music. From then on, opening the door again results in one of three outcomes, depending on the selected MIDI Device.

#1 OPL Synth & GUS: Opening the door works fine.

#2 FluidSynth & Microsoft GS Wavetable Synth: Each time the door is opened (try spamming 'Use') causes a hiccup, lag or delay, while the former Device has a shorter than the latter.

#3 VirtualMidiSynth: The game locks up and freezes, forcing me to kill the process via Task Manager. An error log or crash report doesn't pop up.

I couldn't test Timidity or Wildmidi, as I don't have either of them.

As a side note, it also happened with Jimmy's recently released Project Kate (my sincere condolences :( ), which, after looking at the ACS source via SLADE, has scripts which make use of SetMusicVolume. This caused a lockup after ending MAP02, not transitioning to the intermission screen and at the end of MAP03, where you stand on a 20% Damage + Exit < 10 sector.
User avatar
DabbingSquidward
 
Joined: 08 Nov 2017

Re: MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Postby Cornelius Pobblegold » Thu Dec 28, 2017 11:37 am

I'd say that your D_NULL is badly made and causes playback problems. Why aren't you just switching the music off?

Also, can you post that D_NULL.mid file?
Cornelius Pobblegold
 

Re: MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Postby DabbingSquidward » Thu Dec 28, 2017 12:52 pm

As stated in the OP, the mod isn't mine, its Silentzorah's. So your assumption should be directed at him. The crash happens in any map, I just used MAP13 as an example because it offers a straightforward method of reproducing the crash. Also, why should I disable the music? I said that not all MIDI output devices are affected. Your suggestion was neither helpful nor related to the problem. I guess you didn't even properly read my post.

P.S. Happened on GZDoom v3.2.4, used CoolSoft's VirtualMIDISynth in conjunction with the Arachno Soundfont from Arachnosoft.

Edit: I apologize, you were right. D_NULL was faulty. I replaced it with Doom 64: Retribution's D_SILENT and now it works fine. Still, I don't know why VirtualMidiSynth crashes, Microsoft's Default Soundmapper and FluidSynth have hiccups and the rest works fine.
User avatar
DabbingSquidward
 
Joined: 08 Nov 2017

Re: MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Postby wrkq » Thu Dec 28, 2017 5:56 pm

DabbingSquidward wrote:Also, why should I disable the music?

That was also written with the assumption of this being your mod - instead of SetMusic("D_NULL") "you" (the modder) could have done SetMusicVolume(0.0) instead.
wrkq
 
Joined: 02 Apr 2016

Re: MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Postby wildweasel » Thu Dec 28, 2017 6:16 pm

wrkq wrote:
DabbingSquidward wrote:Also, why should I disable the music?

That was also written with the assumption of this being your mod - instead of SetMusic("D_NULL") "you" (the modder) could have done SetMusicVolume(0.0) instead.

That's as may be, but it doesn't fix the bug in ZDoom.
User avatar
wildweasel
I love the smell of sourdough in the morning
 
Joined: 15 Jul 2003
Location: avatar by kurashiki

Re: MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Postby Rachael » Thu Dec 28, 2017 6:49 pm

wrkq wrote:
DabbingSquidward wrote:Also, why should I disable the music?

That was also written with the assumption of this being your mod - instead of SetMusic("D_NULL") "you" (the modder) could have done SetMusicVolume(0.0) instead.

This is not helpful. The whole point of a bug report is not for you to provide work-arounds and telling people not to do things in order to not trigger the bug - they are reporting the bugs so they can actually be fixed and they don't have to.

Also, SetMusic(""); works just fine.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Postby DabbingSquidward » Thu Dec 28, 2017 11:39 pm

I'll see if I can attach the D_NULL.mid file. The thing is, it plays back fine in XMPlay with VirtualMIDISynth, but it's obviously empty. D64: Retribution's D_SILENT Lump is not recognized by SLADE, I can't even play it back with XMPlay. I also wasn't able to pinpoint the reason for Kate's Project freezing after finishing MAP02 or 03. It doesn't happen all the time, but then again, only with VirtualMIDISynth. I could try updating that, but that still leaves us with the hiccups from FluidSynth (with DoomSND.sf2) and Microsoft's Soundmapper. Has anyone tried reproducing the freeze with gaiden.wad?
User avatar
DabbingSquidward
 
Joined: 08 Nov 2017

Re: MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Postby DabbingSquidward » Thu Dec 28, 2017 11:48 pm

https://zorasoft.net/doom/gaiden.zip

Doom Gaiden by Silentzorah, I hope he doesn't mind me linking to it here. Anyways, here's a quick run down of the crash:

1. Open the console, load MAP13.
2. Optional: 'Kill Monsters' or start with -nomonsters enabled.
3. Grab the red key, AFAIK giving it through console doesn't work.
4. Go to the red door at the end of the level and save.
5. Open it, the music should now be set to D_NULL.
6. Using the opened door again or dying (which causes a Castlevania death sound unique to this level to be played) at this point causes the aforementioned freeze or hiccups.

Happened 100% of the time.

It seems like the game doesn't like to set D_NULL twice or play anything else after that.

EDIT: The best thing would be to ask the man himself directly. Since its his mod, he knows more about it than anyone else and should be able to provide some insights regarding D_NULL :P
User avatar
DabbingSquidward
 
Joined: 08 Nov 2017

Re: MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Postby Rachael » Fri Dec 29, 2017 5:20 am

My hypothesis with this problem is that the MIDI system does not like zero-time files due to its preference to loop them. I noticed when I played it in SLADE it was instantly done. So it goes to play it, it's already over, so it loops it, it's already over, it loops it again, it's already over.... etc.

Not knowing how to manipulate the MIDI system in GZDoom, myself, I do not really know how to fix this.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Postby _mental_ » Fri Dec 29, 2017 5:22 am

In the second case lag is caused by reloading of sound font. Exact duration of such freeze depends on the hardware, CPU and HDD/SSD combination in particular.
There is nothing we can do about it. Redesigning whole MIDI playback for such purpose is out of scope at the moment.

Cannot say anything about the third case because I don't use VirtualMIDISynth.
Please note that in general it's not a problem of GZDoom if it hangs or crashes inside thirdparty software.
We are responsible (to some extents) for libraries shipped with stable releases.
Although if some issue is caused by user installed drivers or software then it's a very low priority for us to work on it.
Time spent on this can be significant but the chance to fix it is quite slim.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: MIDI Device Output Freeze/Crash/Hard Lock (Memory Leak?)

Postby Graf Zahl » Tue Feb 27, 2018 7:04 am

The problem: There's nothing here to fix!
The entire effect is how a MIDI restart will affect the current player's runtime behavior.

With Timidity++ (the new one, that is), GUS, OPL and Wildmidi there are no problems here as these devices keep their sound fonts around for reuse by a later song.
FluidSynth depends a lot on the size of the sound font and its current file cache status, but seeing how the sound font must be added to the player as a file name, the actual loading is not controllable by GZDoom, and since the player will be recreated for a new song, the old sound font attachments will be lost.
And Windows's internal synth is entirely outside our control, so is VirtualMIDISynth. If VirtualMIDISynth chokes on otherwise valid MIDI event data it needs to be fixed in that project.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest