VOGONS


Wing Commander III - Sound issues

Topic actions

First post, by trickydicky

User metadata
Rank Newbie
Rank
Newbie

I'm running WC3 using Dosbox 0.70. It, like everything else I've tried thus far, runs very smooth. I'm having some issues with the audio though. It's not skipping, but I'm hearing these loud popping noises at random. I've tried setting WC3 to use the different SB cards, the Ultrasound, different cores, lower/higher cycles, loadfix, and reducing the audio acceleration in XP. I even tried switching the actual sound card I'm using between the onboard ALC850 and a PCI Sound Blaster. No matter what I do, it's still there. Any ideas?

Thanks,

RN

Reply 1 of 24, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Same problem here. Has been like that for ages. Search the forums. No fix, no workaround for DOSBox. Sound is fine when using SoundFX though.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 2 of 24, by trickydicky

User metadata
Rank Newbie
Rank
Newbie

Thanks for the tip about SoundFX 2000. It seems you can't buy it anymore, but regardless when I try that it locks at the installation. Right before the Victory appears in the video / CPU test it locks. I had the same problem with VDMsound. Glad to know I'm not the only one unable to run it properly in DOSbox though. I don't feel like an idiot anymore.

Thanks again,

RN

Reply 3 of 24, by dh4rm4

User metadata
Rank Oldbie
Rank
Oldbie

i played with my original WC3 4 CD version quite a lot last night - completed some missions and 'chatted' with some of the NPCs. I had no sound issues whatsoever. Two things to note:-

1. The WC3 SoundFX selection defaults to IRQ 5 for SoundBlaster cards, make sure you set it to IRQ 7 if you haven't changed it in your dosbox.conf - 7 is the default for DOSBox. An incorrect IRQ selection might explain the pops and clicks.

2. Once again the SoundFX selection, be sure to select SoundBlaster Pro instead of the default choice of SoundBlaster as the game makes extensive use of Stereo Audio. SoundBlaster cards can only handle 22khz mono and the game's soundtrack is 22khz stereo - maybe the WC3 Sound engine produces 'aliasing' errors like pops and clicks when the two stereo streams of left and right are interpolated into one mono stream?

Other than these two points I can't understand why WC3 is being so noisy for you guys. For me, playing last night via DOSBox gave better performance than the original DX4-100 PC I had at the time and that was a monster for it's day.

Reply 4 of 24, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

I should still have a thread about the noise somewhere here - with a link to some recordings I made.

Edit: Found it.
Crackling sound in Wing Commander III with SB-16 emulation
Try listening to the wave samples.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 5 of 24, by trickydicky

User metadata
Rank Newbie
Rank
Newbie

Dh4rm4, I had all the settings correct in WC3, though I did try moving them around in the .conf file to see if I got anything different the other day. I appreciate you taking the time to pull it out and try it as well as the advice.

MiniMax, after reading about all the work you put in this before, I do have a few things to add. I did try a different sound card instead of the onboard audio. I got the same thing. Also, I have a VIA chipset, not an Nvidia. Thanks for digging up the old thread as well as for the wave files. Sounds very familiar.

I just got home from work and I'm a bit exhausted. A little later on I'll type up a list of all the specs of my machine. Maybe we can see someplace where they jive so we can enjoy Wing Commander III in all her glory.

Thanks again!

Reply 6 of 24, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

A patch to fix most of the distortion. (There is still a periodic clicking but only on the flight deck and not nearly as annoying.)

When the DMA buffer gets empty the soundblaster code transfers one large block of data instead of three smaller ones. Apparently the WC3 mixer code doesn't provide enough data at that point.

Could be that the patch breaks other games though.

Index: src/hardware/sblaster.cpp
===================================================================
RCS file: /cvsroot/dosbox/dosbox/src/hardware/sblaster.cpp,v
retrieving revision 1.63
diff -u -r1.63 sblaster.cpp
--- src/hardware/sblaster.cpp 24 Feb 2007 21:07:22 -0000 1.63
+++ src/hardware/sblaster.cpp 13 May 2007 17:55:37 -0000
@@ -355,7 +355,7 @@

static void GenerateDMASound(Bitu size) {
Bitu read=0;Bitu done=0;Bitu i=0;
- if (sb.dma.left<=sb.dma.min) {
+ if (sb.dma.left<=size) {
size=sb.dma.left;
}
switch (sb.dma.mode) {

This is what the bug looks like:

Attachments

  • wc3soundbug.png
    Filename
    wc3soundbug.png
    File size
    2.94 KiB
    Views
    3524 views
    File license
    Fair use/fair dealing exception

Reply 9 of 24, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

maybe some minimum that covers both conditions. both conditions are bad for the resulting sound I think, so both might have to be tested for. (This is by looking at this snippet).

Water flows down the stream
How to ask questions the smart way!

Reply 10 of 24, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It sometimes causes clicking in other games.

Maybe this would be more correct? In autoinit mode we always get enough data.

if(sb.dma.autoinit) {
if (sb.dma.left<=size) size=sb.dma.left;
}
else if (sb.dma.left<=sb.dma.min) size=sb.dma.left;

Reply 11 of 24, by Jiri

User metadata
Rank Member
Rank
Member

This patch also fixes most of the distortion in Realms of the Haunting and Harvester. http://tinyurl.com/32nao4
H-a-l-9000, could you attach diff for "autoinit version" (or compiled DOSBox)? I would like to test it too but I am not a programmer and I am not sure what to replace.

Reply 12 of 24, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author
Index: src/hardware/sblaster.cpp
===================================================================
RCS file: /cvsroot/dosbox/dosbox/src/hardware/sblaster.cpp,v
retrieving revision 1.63
diff -u -r1.63 sblaster.cpp
--- src/hardware/sblaster.cpp 24 Feb 2007 21:07:22 -0000 1.63
+++ src/hardware/sblaster.cpp 26 May 2007 17:54:14 -0000
@@ -355,9 +355,12 @@

static void GenerateDMASound(Bitu size) {
Bitu read=0;Bitu done=0;Bitu i=0;
- if (sb.dma.left<=sb.dma.min) {
- size=sb.dma.left;
+
+ if(sb.dma.autoinit) {
+ if (sb.dma.left<=size) size=sb.dma.left;
}
+ else if (sb.dma.left<=sb.dma.min) size=sb.dma.left;
+
switch (sb.dma.mode) {
case DSP_DMA_2:
read=sb.dma.chan->Read(size,sb.dma.buf.b8);

Reply 14 of 24, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

*kick as I'm reviewing it*
.
Has anybody tested both patches with some more games ?

H-a-l-9000 you claim it causes some clicking in certain games. What causes clicking (The patch or my suggestion of checking on both conditions?)

Water flows down the stream
How to ask questions the smart way!

Reply 17 of 24, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Maybe test with this game (if you have it):

MAX: Mechanized Assault and Exploration
MAX Sound Crackling/Popping

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 18 of 24, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

second patch makes some sense (if I understand the code right.)
On a single cycle transfer issue the irq early (sb.dma.min) so the application can program a new transfer intime.

On automatic transfers: stay as close as possible to the dma control so that games (like wc3) can use the final moments on filling the buffer that is streamed to the sblaster

edit Max gets much better from it. (tested in setup.exe)

Water flows down the stream
How to ask questions the smart way!

Reply 19 of 24, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

On a single cycle transfer issue the irq early (sb.dma.min) so the application can program a new transfer intime.

So that's the purpose of sb.dma.min 😀

On automatic transfers: stay as close as possible to the dma control so that games (like wc3) can use the final moments on filling the buffer that is streamed to the sblaster

As to my understanding in autoinit mode we don't have final moments but instead the DMA buffer is used like a FIFO which is continually read by the soundblaster. Nothing special happens when it wraps. WC3 periodically monitors the DMA count in the DMA controller and fills the buffer accordingly (I never disassembled anything though).