VOGONS


First post, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie

While experimenting with NT 3.51 on some real hardware that I could manage to install and run it, I noticed these audio issues.

1. Sound Blaster 16/AWE can't properly play some WAV files, particularly 16-bit ones. (Only on real systems)

Trying to play such audio files will make the player stuck, and different programs behave differently.
- Some games simply don't care. There would be no audio but the game keeps working, most likely the audio playback routine was asynchronous.
- Sound Recorder will simply stuck at the beginning -- the position slider will not move. It is possible in some cases to get out of the situation by stopping.
- Some games whose audio playback routine is synchronous would find itself freeze on spot, as it keeps waiting for the audio playback to complete which will never happen.

The behavior was originally observed on RUBY-9719VG2AR (LPC-ISA) with a SB16 (CT2950). However, the same behavior is also observed on my currently active NT 3.51 system, ANOVO AIMB-865 (PCI-ISA) with AWE64 Gold (CT4390).

On the other hand, this issue seems to only affect *real* Sound Blaster 16/AWE setups and does not manifest in VMs, such as VirtualBox's Sound Blaster 16 emulation. Additionally:
- Under the same hardware setup, Sound Blaster 16/AWE cards in question will work without problems on newer Windows versions like Win9x, 2000, XP.
- Some non-Creative sound cards like ALS007 can correctly play the files that SB16/AWE could not play properly. ALS007 doesn't use 16-bit ISA DMA channel, however.
- CMI8330 can also play the files correctly, although I need to use NT3.51's built-in SNDBLST driver as I can't properly set up its own NT4 driver (utilizing WSS portion) despite no issues according to Dependency Walker. CMI8330 does use 16-bit ISA DMA channel and is considered a SB16 by the SNDBLST driver.

I'm yet to find the exact cause. Perhaps Windows NT 3.51 likely had issues with 16-bit ISA DMA on relatively modern hardware that were somehow fixed with later Windows versions. It may be possible to work around the issue if the games' sound samples are simple and accessible (e.g. WAV files), by converting the offending sound files to 8-bit (using tools like Audacity). Since the ways games handle audio can be very different, your mileage may vary.

LATE EDIT: It seems to be an issue specific to Creative SB16/AWE, not those from other vendors. With CMI8330, which is fully SB16 compatible including high DMA, this issue does not manifest, just like VirtualBox.

2. MIDI startup delay issue (MCISEQ)

Sadly this MCI issue, which was well-known and already had patches for WinXP/2003, affects old Windows NT versions like 3.51 as well. So it appears pretty much all Windows NT versions are affected by this issue.

The symptom is that whenever a MIDI track finished and a new MIDI track is to start playing, there would be an apparent pause of about 1-2s. For games that use MIDI as background music, gameplay would freeze during the pause period until the next MIDI track actually begins.

By inspecting NT 3.51's MCISEQ.DLL I discovered the very same "Sleep(4)" pattern responsible for this issue. Patched the call into "Sleep(0)" as in the linked blog post and the pause disappeared.

I'm attaching a patched MCISEQ.DLL for Windows NT 3.51 in case someone's interested. For other Windows NT versions you need to open MCISEQ.DLL with a reverse engineering utility and search for relevant "Sleep" calls. Per the linked blog post, the Sleep call with value "4" passed into it, as well as being coupled with "LeaveCriticalSection", would be the likely candidate.

Last edited by LSS10999 on 2025-07-07, 08:38. Edited 2 times in total.

Reply 1 of 4, by javispedro1

User metadata
Rank Member
Rank
Member

This is completely unrelated to the two issues you mention, but while implementing my VirtualBox extensions I did notice that I had been simulating the "undefined" bits of the MPU-401 status register as zero..... which Windows NT 3/4 is _really_ picky about (it wants them to read as 1). I hadn't noticed this with any other OS until that point (tried 9x, XP, OS/2, etc.); they couldn't care less about the values of the undefined bits.

So the NT3/4 sndblaster driver may be particularly picky.

Reply 2 of 4, by myne

User metadata
Rank Oldbie
Rank
Oldbie

I'd suggest renaming this thread to something like nt3.51 sb16 midi patch.

It'll be easier to find

I built:
Convert old ASUS ASC boardviews to KICAD PCB!
Re: A comprehensive guide to install and play MechWarrior 2 on new versions on Windows.
Dos+Windows 3.11+tcp+vbe_svga auto-install iso template
Script to backup Win9x\ME drivers from a working install
Re: The thing no one asked for: KICAD 440bx reference schematic

Reply 3 of 4, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie
javispedro1 wrote on 2024-10-07, 20:35:

This is completely unrelated to the two issues you mention, but while implementing my VirtualBox extensions I did notice that I had been simulating the "undefined" bits of the MPU-401 status register as zero..... which Windows NT 3/4 is _really_ picky about (it wants them to read as 1). I hadn't noticed this with any other OS until that point (tried 9x, XP, OS/2, etc.); they couldn't care less about the values of the undefined bits.

So the NT3/4 sndblaster driver may be particularly picky.

Should point out that both Microsoft's built-in SB driver* and Creative's own PnP-capable SB16/AWE driver exhibit the same behavior on real hardware, and they both work without any issue with VirtualBox's SB16 emulation.

* Although Microsoft's built-in SB driver does not support PnP, if you have initialized the PnP sound card with e.g. UNISOUND at some point in the boot chain before finally booting to Windows NT 3.51, it will work with the sound card so long as the I/O, IRQ, DMA settings are the same as the ones provided during initialization.

As for MPU-401, it seems only real Creative cards can properly utilize it with Microsoft's built-in driver. When using a different ISA sound card like YMF718 there would be no MIDI output and in some cases hangs. For YMF718, however, its official driver (which appears to use WSS) did not work correctly for me as any sound playback would just loop the starting part of it for a few seconds. Sound only worked correctly with Microsoft's SB driver (requires prior initialization via UNISOUND or SETYMF) as that puts the card in SBPro mode, and like ALS007 it could correctly play files that real SB16/AWE could not play.

** EDIT: I just briefly tested Windows 3.11 on the same system with the AWE64 Gold (using Creative's driver), and the card works without the issue I'm having with NT 3.51. The wave files in question played fine. Probably the DOS-based Windows line (3.x/9x/ME) never had any issue with it.

myne wrote on 2024-10-08, 01:04:

I'd suggest renaming this thread to something like nt3.51 sb16 midi patch.

It'll be easier to find

Well, this thread is not really about SB16 MIDI. MIDI already worked there without any issue. The MIDI startup delay issue with MCISEQ due to the "Sleep(4)" call was well-known and there were already patched DLLs for WinXP/2003 (and there were patches for 32-bit Win7 also). I just discovered the issue also affected old Windows NT versions as well. The patched DLL here is for NT 3.51, but in theory other Windows NT versions like 4.0 and 2000 can also be patched in a similar manner.

The main issue with SB16 on Windows NT 3.51 is the inability to play 16-bit WAV files. It seems to only affect *real* SB16 cards and do not manifest in VMs like VirtualBox, as well as cards that do not use 16-bit DMA (usually non Creative ones).

Reply 4 of 4, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie

A bump on this. I think there really is something different between actual Creative SB16 implementation and third-party SB16 implementations (e.g. CMI8330, VirtualBox).

Recently I got myself a CMI8330 which is fully SB16 compatible including high DMA. While I could not get its NT4 driver working in NT3.51 despite Dependency Walker reporting no issues, I can use NT3.51's built-in SNDBLST driver after setting it up with UNISOUND before booting. MPU401 doesn't work (probably because of the need of an IRQ for these cards, similar to YMF71x) but it's not important as I can use FM for MIDI playback.

And this card has no problem playing 16-bit WAV files in this case, just like VirtualBox's SB16 implementation.

So I wonder if there are some quirks exclusive to Creative's ICs that are responsible for this erratic behavior, that other vendors, as well as emulations, don't imitate thus not affected.

EDIT: I've edited the OP to reflect this recent discovery.