VOGONS


Sound Blaster Pro stereo bug

Topic actions

First post, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

When Sound Blaster Pro switches to stereo mode it halves the sampling rate from 44k.1Hz to 22.05kHz, only certain games use the stereo feature of the SB-Pro.
Some of these games will leave the SB-Pro in stereo mode after you quit the game but the problem is the sampling rate is still halved so other games will not sound right.

To quickly recreate this bug:

1. Enter Duke Nukem 3D setup, Choose SB-Pro 2.0 from Card Type.

The attachment 1.png is no longer available

2. Continue the setup and make sure you select Stereo:

The attachment 2.png is no longer available

3. Now the important part that actually creates this bug.
Play the Test Sound.

The attachment 3.png is no longer available

Exit the setup, save or not save, doesn't matter, the damage is already done, the sampling rate is halved.
All you have to do is play a game like Prince of Persia 1/2, Mortal Kombat 2, Supaplex, or any other game that don't have its own SB driver (not Doom),
you'll hear terrible low sampling rate sound effects, half of what it should be.

To fix this simply do the same but choose Mono in the setup and play Test Sound, now the SB-Pro should be back to normal.
Another fix is to run a more advance game that has it's own sound driver like Doom, Warcraft 1/2 that switches the SB-Pro back to mono.

Tested games that create the bug at exit:
Duke3D, Death Rally, Transport Tycoon, MPXPlayer.
All have to be set as SB-Pro with Stereo in their setup configurations.

I have tested this with ES1688F and YMF719 cards.

EDIT:
This can be recreated in DOSBox so the bug is actually the game not switching the SB-Pro back to Mono at exit.
Further down the thread Jepael created a small "sbpmono.com" program that brings the SB-Pro back to mono mode.
Sound Blaster Pro stereo bug

Last edited by James-F on 2016-08-27, 16:18. Edited 7 times in total.


my important / useful posts are here

Reply 1 of 23, by PhilsComputerLab

User metadata
Rank l33t++
Rank
l33t++

And Prince of Persia 1/2, Mortal Kombat 2, Supaplex would otherwise play at 44 KHz?

And I guess a reboot would also fix this? That's my standard process 😊

YouTube, Facebook, Website

Reply 2 of 23, by James-F

User metadata
Rank Oldbie
Rank
Oldbie
PhilsComputerLab wrote:

And Prince of Persia 1/2, Mortal Kombat 2, Supaplex would otherwise play at 44 KHz?

The sampling rate of the card has nothing to do with the quality of the game audio, the SB-Pro is 44.1kHz in mono and 22.05kHz in stereo.
The games themselves vary but most common is 11kHz sounds, halve that and you get 5.5Khz.
The bug is actually in the hardware.
I have included a fix without restarting the PC.

Last edited by James-F on 2016-08-27, 11:58. Edited 1 time in total.


my important / useful posts are here

Reply 3 of 23, by PhilsComputerLab

User metadata
Rank l33t++
Rank
l33t++

So everything gets halved?

A 11 KHz sample in Wing Commander 2, would then play at 5 KHz?

YouTube, Facebook, Website

Reply 4 of 23, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

If it's not one of the games that fix it, yes, the sound should be half as good as it already is in WC2. 😀

More games that affected by the bug: Prehistoric 2, Summer/Winter Challenge.

Last edited by James-F on 2016-08-27, 12:15. Edited 1 time in total.


my important / useful posts are here

Reply 5 of 23, by PhilsComputerLab

User metadata
Rank l33t++
Rank
l33t++
James-F wrote:

If it's not one of the games that fix it, yes, the sound should be half as good as it already is in WC2. 😀

Ah, ok, yes that's a bug alright 😀

YouTube, Facebook, Website

Reply 6 of 23, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

What for 25 years no one noticed? 😁

We need to find the games that create this bug, and create a quick fix for it.


my important / useful posts are here

Reply 7 of 23, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie

If your SB is at address 220H, please try this quick hack I just made:

Reply 8 of 23, by James-F

User metadata
Rank Oldbie
Rank
Oldbie
Jepael wrote:

If your SB is at address 220H, please try this quick hack I just made:

IT WORKS !
This little hack actually brings the SB-Pro back to mono and everything sounds normal again.
Well done Jepael, thank you.

Can you elaborate what it actually does?
I think it will be wise to write a small txt description in the zip along with the com file for DOS reading.

Do you mind if I repost it in the first post?

Last edited by James-F on 2016-08-27, 13:26. Edited 2 times in total.


my important / useful posts are here

Reply 9 of 23, by firage

User metadata
Rank Oldbie
Rank
Oldbie

I think it was just never considered a big deal to power cycle the machine between gaming sessions or whenever some weird glitches cropped up. 😀

My big-red-switch 486

Reply 10 of 23, by Scali

User metadata
Rank l33t
Rank
l33t

How is that a bug in the SB Pro though?
I mean, it sounds like the game just doesn't bother to take the SB Pro out of stereo mode after you exit it.
Since some games are written only for regular Sound Blaster, they don't even know about mono or stereo mode, so they never bother to reset it (they assume it's always in the correct mode, because there is only one).

Perhaps some background info:
The SB Pro has a very basic implementation of 'stereo':
Instead of sending 44.1k samples per second through a single channel, it sends 44.1k samples per second to two channels, the even ones go to the left channel, the odd ones to the right channel (it sorta ping-pongs them left/right).
So the card is still configured for 44.1 KHz sample transfers. Perhaps what happens is that games play eg 11 KHz mono samples, and set it to 11 KHz, but the 'ping pong' feature is still enabled as well, so effectively it sends 5.5k samples left and 5.5k samples right. Technically it is stereo, but if you play mono samples, you probably don't hear any stereo effects, because the difference between the two channels is purely accidental, and very minor.

If clones don't have the same behaviour, I say that's a flaw in their implementation. They didn't copy the functionality of the SB Pro DSP chip accurately enough.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 11 of 23, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

You are right Scali, this is not actually a bug of the SB-Pro but the game that doesn't bring it back to mono at exit.
Still, it is good to be aware of the games that create the bug, and affected by it.

EDIT:
I can actually recreate the bug in DOSBox.
Even though sbtype=sb16 when I setup the game with SB-Pro Stereo as in the first post I can recreate the bug.
So the SB-Pro emulation in dosbox is quite accurate.
Jepael's sbpmono.con fix also works in dosbox.


my important / useful posts are here

Reply 12 of 23, by PhilsComputerLab

User metadata
Rank l33t++
Rank
l33t++

It's funny, because I always knew to reboot the machine after playing Doom or Duke 3D. But I never quite new why 😁 But these games have often been mentioned to "screw things up". 😊

YouTube, Facebook, Website

Reply 13 of 23, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie
James-F wrote:
IT WORKS ! This little hack actually brings the SB-Pro back to mono and everything sounds normal again. Well done Jepael, thank […]
Show full quote
Jepael wrote:

If your SB is at address 220H, please try this quick hack I just made:

IT WORKS !
This little hack actually brings the SB-Pro back to mono and everything sounds normal again.
Well done Jepael, thank you.

Can you elaborate what it actually does?
I think it will be wise to write a small txt description in the zip along with the com file for DOS reading.

Do you mind if I repost it in the first post?

Glad it worked, I didn't even test it before posting 😁

I made a new zip file with DOS compatible description text (linux has different line endings). Go ahead and put that in your first post if you like.

Meanwhile Scali explained the issue; a game supporting SB Pro and using stereo mode, leaves the mixer in stereo mode, so next games that are not SB Pro aware do not control the mixer back to mono mode before playing samples.

This tool just sets the mixer back to mono mode, which is the default setting after reboot and mixer reset.

The thing is, I can't quite understand why the samples sounds halved. For example, when playing 44kHz mono or 22kHz stereo, DSP is configured to play 44kHz samples per second in either case. So playback time of X samples should be identical in mono and stereo modes and so the rate should not be halved, you should just hear maybe some weird phasing effects instead.

Reply 14 of 23, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

Here is an example straight from DOSBox.
It reflects exactly what I hear with the actual hardware.

It does sound like it has some phase effect but I can also hear some stereo separation in certain sounds, both are obviously side effects.
But the most obvious difference is the halved sampling rate.


my important / useful posts are here

Reply 15 of 23, by Scali

User metadata
Rank l33t
Rank
l33t
Jepael wrote:

The thing is, I can't quite understand why the samples sounds halved. For example, when playing 44kHz mono or 22kHz stereo, DSP is configured to play 44kHz samples per second in either case.

I think that is why:
If you set the DSP to 44 KHz, it is 44 KHz in mono, but 22 KHz in stereo, so that's why it is halved.
Namely, at 22 KHz the samples are 'twice as long'... You just have a left and right sample.

Mind you, listening to the samples from James-F, they don't sound 'halved' indeed... They sound a bit more 'muffled', because the sampling rate is lower, but indeed, not like it's downsampled. Speedwise/pitchwise they're still quite close, just some weird 'phasing'.
So I think that's what you meant.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 16 of 23, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie
Scali wrote:
I think that is why: If you set the DSP to 44 KHz, it is 44 KHz in mono, but 22 KHz in stereo, so that's why it is halved. Namel […]
Show full quote
Jepael wrote:

The thing is, I can't quite understand why the samples sounds halved. For example, when playing 44kHz mono or 22kHz stereo, DSP is configured to play 44kHz samples per second in either case.

I think that is why:
If you set the DSP to 44 KHz, it is 44 KHz in mono, but 22 KHz in stereo, so that's why it is halved.
Namely, at 22 KHz the samples are 'twice as long'... You just have a left and right sample.

Mind you, listening to the samples from James-F, they don't sound 'halved' indeed... They sound a bit more 'muffled', because the sampling rate is lower, but indeed, not like it's downsampled. Speedwise/pitchwise they're still quite close, just some weird 'phasing'.
So I think that's what you meant.

No, definitely not halved. I just assumed because the first post said so and I kept wondering why I don't get the reason it is halved. The MP3s sound just as I expected.

The sampling rate rate of the DAC itself is identical in mono and stereo modes. But when playing mono sample in stereo mode, for left channel, you get half the samples and so samples for each channel are twice as long, so the pitch is correct. You just get a bit different audio on left and right channels so it isn't mono, it sounds like stereo expansion. Plus, when playing mono sample in stereo mode, what the mixer is essentially doing is downsampling both channels by throwing away every other sample, is the worst way of downsampling so you get aliasing artifacts.

Reply 17 of 23, by superfury

User metadata
Rank l33t++
Rank
l33t++

Doesn't the left channel get latched, being rendered once the right channel is sent (updating both outputs each time the right channel data is received)? Like:
1. Sample #1 (left) received. Latched.
2. Sample #2 (right) received, right output updated, left channel updated from latch.
3. Sample #3 (left) received. Latched.
4. Sample #3 (right) received, right output updated, left channel updated from latch.
Etc.?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 18 of 23, by mkarcher

User metadata
Rank l33t
Rank
l33t
superfury wrote on 2025-05-25, 00:23:
Doesn't the left channel get latched, being rendered once the right channel is sent (updating both outputs each time the right c […]
Show full quote

Doesn't the left channel get latched, being rendered once the right channel is sent (updating both outputs each time the right channel data is received)? Like:
1. Sample #1 (left) received. Latched.
2. Sample #2 (right) received, right output updated, left channel updated from latch.
3. Sample #3 (left) received. Latched.
4. Sample #3 (right) received, right output updated, left channel updated from latch.
Etc.?

No, that is not how the Soundblaster Pro works. The Soundblaster Pro only has a single DAC that is used for both the left and the right channel. Every sample is sent to the DAC immediately after it has been receivced from the ISA bus. the mixer chip has two analog latches (called "sample and hold" because analog people use different terms). In stereo mode, it works like this:

  • Sample #1 (left) received and converted. Analog voltage of the DAC output latched into the left channel, right channel unchanged.
  • Sample #2 (right) received and converted. Analog voltage of the DAC output latched into the right channel, left channel unchanged.
  • Sample #3 (left) received and converted. Analog voltage of the DAC output latched into the left channel, right channel unchanged.
  • Sample #4 (right) received and converted. Analog voltage of the DAC output latched into the right channel, left channel unchanged.

The digital part of the Soundblaster Pro doesn't even know whether it is in stereo or in mono mode. That's the primary reason why the Soundblaster 16 with its stereo DAC does not provide SB Pro stereo compatibility: On that design, the digital part would need to know whether it should send stereo or mono data to the DAC, and the new Soundblaster 16 playback and recording command include that information. To make Soundblaster Pro stero work, Creative Labs would have needed to design an interface that the digital part of the SB 16 responds to a control bit sent to the mixer. This would have been possible, but it would add complexity to the bus interfacce unit of the SB16, which Creative Labs avoided. A possible conspiracy theory is that Creative Labs used the incompatibility to push software writers into SB 16 support for stereo (which would also add 16-bit support, or at least it would look like it), so the clone cards that only support up to SB Pro are inferior to the current original Creative Labs card.

Reply 19 of 23, by superfury

User metadata
Rank l33t++
Rank
l33t++

Doesn't that de-sync the left and right audio? Since in that case, the left and right audio outputs are always half a sample out-of-sync, time-wise (left half a sample too early or right half a sample too late)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io