There seems to be a recurring issue where the MVL files in D2X-XL won't output any audio when played back, even though all other sound elements in the game work superbly.
I'm submitting this as a bug only due to the precedent established in this thread: http://www.descent2.de/forum/viewtopic.php?t=614
In a nutshell, I'm running into exactly the same issue Kamex is. Initially I thought the problem was with my Creative Labs X-Fi card (as this was consistent with Kamex's configuration), but I then threw the game onto my laptop with a different, integrated sound card and ran into the same problem. I then tried a third system (also with integrated audio - a Realtek AC'97 card) with exactly the same results.
Here's what happens: When the game is loaded for the first time, the intro movie plays with audio just fine. Immediately after this, if I go into "Play Movie" from the main menu and try playing any MVL file, the resulting playback has no sound.
After these steps are taken, any subsequent attempt to launch the game also yields no sound playback from the MVL files.
I then read Kamex's comment about how he 'renamed' the Descent 2 folder to something it had never been before to temporarily resolve the issue (only to have it return again when subsequent MVL files are played). I tried this, but only had about 50-60% success across a number of tests. Sometimes it would resolve the issue, sometimes it would not. It seems to be completely random on if MVL files will play back properly, but one thing is always consistent: Once the game has gone past the first intro movie, MVL files will never play with sound beyond that point.
One other interesting thing I wanted to add: If I run D2X-XL in windowed mode and hear audio from the intro movie, I can hit the X at the top right to close D2X-XL mid-playback, restart it, and still have sound from the intro movie. I can reproduce this 100% of the time. However, if I let the movie play all the way through, load to the main menu, then restart the game, the intro movie will generally not have audio.
This is definitely a strange problem, and I apologize if my description sounds long-winded - please let me know if you need any more specific details. I was initially prepared to attach a DXDiag file, the D2X log, and my INI, but was unsure if this would still be relevant after being able to reproduce it on three completely unique computer configurations. Regardless, if you would like these files, let me know and I'd be glad to upload them. I should also mention I've witnessed this issue since build 1.13.82 - but it's very probable the issue has existed prior to then, as that build is when I first discovered D2X-XL.
Thanks!
Hi - just wanted to follow up on this. I've done some extensive investigating and I believe I've found the root cause for this issue: Vista's new sound volume management.
Unlike XP, Vista has the ability to independently manage sound volume settings for individual applications, rather than needing to effect system-wide changes. For example, you can change the sound volume of Windows Media Player to be quieter than that of D2X-XL, and yet still have the overall Windows "Speaker" volume at maximum.
While monitoring the UI for this (SndVol.exe), I noticed something very interesting: D2X-XL launches at a standard volume setting, but as soon as a movie is played (and the "mute" effect occurs), the sound volume for D2X-XL instantly drops to zero (it doesn't show as muted, the slider just goes right to the bottom). As soon as the movie is over, the volume then returns to it's previous state. Hence, for some reason, some thread or process of D2X-XL is being identified separately by Windows Vista and is being purposely set to zero volume when movie playback is triggered - but not 100% of the time, as there are rare occasions where the intro movie will play with sound, per my previous post. I should also mention that if I change the music volume in D2X-XL, this same Windows Vista volume slider is effected (meaning changing the music volume causes the *whole* game audio system to be affected, not just the music) - but changing the sound effects volume seems to work normally. Technically however this may be a separate problem, and due for a separate venue of investigation accordingly.
To be honest, I'm stumped on why this is - I've picked apart every relevant registry call that both D2X-XL and SndVol.Exe make when the issue occurs to see if Vista is keeping 'memory' of this zero-volume setting (which would explain why movie playback is always broken after the issue is first triggered, even when the game is restarted), but can't find a thing. I'm also checking through the latest source code files to see if any weird calls might be triggering a volume change when movie playback is started or stopped, but also can't find anything (though my C++ knowledge is only rudimentary, and I'm mostly using this as a learning opportunity). Finally, I'm also not 100% sure if this actually IS the cause of the issue, only that it seems very likely (and explains why I can't reproduce the problem at all on the XP machine I just tested tonight).
Any thoughts? I'm going to keep digging into this and will post an update if I have any more insight, as I'm sure quite a few of your fans are based on Vista and are likely suffering the same problem (though myself and Kamex seem to be the only ones who have bothered to report it yet).
Good news - I've found the cause of this, and also have a workaround that seems to fix the problem.
The issue lies with two things: Descent 2's reliance on MIDI for music playback, and Vista's changes in how MIDI is handled. As I previously stated, Vista is unique in that it implements per-application volume controls; individual application can no longer make global changes to the system's volume levels - every application has it's own, separate volume "channel". Due to certain limitations in how this is implemented in Vista (discussed briefly here: http://blogs.msdn.com/larryosterman/archive/2007/03/06/how-do-i-change-the-master-volume-in-windows-vista.aspx#2788019\), applications using a software-based approach for MIDI rendering cannot set separate volume levels for general Wave and MIDI channels. This is why the problem occurs, and also why this is directly connected with the inability to reduce D2X-XL's MIDI volume slider in Vista without causing the rest of the game's volume level (i.e. sound effects) to be affected.
As for the fix, this lies in midi.cpp. For reasons that seem to be obvious (at first - more on this in a moment), Descent 2 makes a call to DigiStopCurrentSong() when a cutscene is initiated - two of the instructions in this method are "DigiFadeoutMusic ()" and "DigiSetMidiVolume(0)". The intent of this is to stop any playing MIDI music so that it doesn't interfere with the cutscene (by doing a "Fadeout", gradually reducing the volume, and then muting it completely), but this is what causes D2X-XL's per-application volume to be set to 0. Hence, this results in no cutscene audio. Interestingly, there is no sound even if you manually move the volume slider up in Vista's control panel *while* the movie is playing, but I don't know the cause of this - it seems if the movie starts playing with the volume at a "muted" level, it's never able to recover.
Additionally, the game does a "Fade Out" volume adjustment any time it's closed - this results in the game's volume being set to "0" when it shuts down (if you watch Vista's volume bar as you close the game, you can see it slowly drag down to zero right before it terminates). This is why the problem still occurs after restarting the game; Vista maintains memory of a program's volume settings, which is maintained upon the next launch. In this case, the volume is zero when the game is next run, which is why the cutscenes stop working right. A similar effect seems to happen when you escape any level; the volume slider jumps down to zero suddenly, and the "Escape" cutscene playes with no audio as a result.
Regardless, resolving the problem is as simple as commenting out the calls to DigiFadeOutMusic and DigiSetMidiVolume in the DigiStopCurrentSong () method, located in midi.cpp. After doing this and recompiling, all movies seem to work just fine (although the intro cutscene may not work the first time if you've previously seen the issue, due to Vista's "memory" of the previous volume setting; letting the game go to the main menu is enough to fix this permanently, as it resets the MIDI volume to a proper level after this and commenting out those calls stops it from muting the volume again on program exit). What's strange is that the movies will play without any of the background music cutting in over top - even the "Escape" cutscenes play exclusively. Because of this, I don't know what purpose the DigiFadeoutMusic and DigiSetMidiVolume calls are really supposed to serve here, as they don't seem to be necessary. It may have something to do with changes made to the sound code as part of the D2X project, but I'm unsure. It's also hard to say if this will have any deeper-rooted side effects without further testing, but so far I haven't found this to affect anything negatively.
On a final academic point, this issue is likely not specific to D2X-XL; I saw the same symptom during a recent playthrough of the "D1X-Rebirth" release (where lowering the MIDI volume caused the entire game to get quieter) and doubt there's any kind of easy fix to this. Unless Microsoft comes up with a way to adjust software-rendered MIDI volume levels in Vista without affecting the rest of the application, there probably isn't any way to make the MIDI volume adjustments independently work "as expected". The only bright side is that this doesn't seem to be really necessary, as the workaround I just described seems to fix cutscenes with no ill effects; the only real need to dive deeper into this would be to get the MIDI volume slider working correctly under Vista. In the long run it would probably be more practical to just expand the existing facilities for playing back sound / music in a different format, and rely on those instead.
I will see whether I can relieve the problem for Vista owners.
This is very detailled already, but I don't know whether I can fix that. I mean, what can I do if turning midi volume off turns off all sound for an app using different sound output devices on The Broken OS aka Windows Vista?
A very good question - I was pondering that myself, too. Since the 'fix' seems as simple as cutting out the loop to the Fade Out and MIDI volume change in DigiStopCurrentSong (), would it be possible to just throw an OS check into that method, and tell the game *not* to execute them if the OS is Vista? While this does mean the 'fadeout' effect would no longer function, I honestly didn't notice the difference that much (though I'm just one opinion in a sea of many).
Failing that, you could also just make the effects an optional toggle from the main menu - "Disable audio fade to fix movie compatibility" or somesuch, with an F1 help note that this can fix sound playback in D2's cutscenes, but may result in some slight sound anomalies due to the MIDI-specific changes this will invoke.
Both of these are hack-ish, I know =\ There should be a better way to approach this than chopping out pieces of the code, but I'm unsure what to suggest beyond that for the moment. I think so long as either approach is documented well in the code and the game, and is tested to make sure no other unexpected problems appear, these solutions shouldn't really have any negative side effects - though I only have my own experience thus far to go by.
The only other 'proper' fix that comes to mind for this would be to convert the entire game's audio system to use a non-MIDI format for music playback (and then rip out all of the existing MIDI calls to prevent the problem from happening) - but given how MIDI works just fine in Vista beyond this one issue, and how much of an undertaking that would be (mostly in terms of packing in converted music content with D2X-XL and having to change quite a bit of code), this likely wouldn't be practical right now.