VOGONS


First post, by seskanda

User metadata
Rank Newbie
Rank
Newbie

I know the newest version of DOSBox emulates SB PRO 2.0, but can it let a game's sound+music be heard from the computer's sound card? Because as anyone who has SOME SoundBlaster/Adlib-compatible devices, they would notice the acute differences between the FM synthesis of their soundcards from the FM device of SoundBlaster cards. If not, I think it would be a great feature to incorporate into the next release(s) of DOSBox.

Reply 2 of 23, by seskanda

User metadata
Rank Newbie
Rank
Newbie

I've never tried SoundFX 2000 (because when I downloaded the zip file Winzip & WinRAR said it was corrupt! also it ONLY works on Win2K, XP, & NT4, I believe, while I have Win98SE.), so I would'nt know what you mean. But I think your on the right track when you say "forward the instructions to the host sound card." I meant that DOSBox should have this as a feature, somehow be able to play a games' music+sound through the computer's sound card, and have the OPTION of enabling the SB PRO 2.0 emulation, and vice versa.

Reply 3 of 23, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Well if your willing write to kernel drivers and add all the controlling code to dosbox be my guest, but i'll stay nice and far away from it.

Reply 5 of 23, by seskanda

User metadata
Rank Newbie
Rank
Newbie

Now, that DOSBox 0.61 has just been released, in the new README file in the FAQ section I read this:

Q: What sound hardware does DosBox presently emulate?
...DosBox provides Soundblaster Pro level 8-bit stereo sound.

I never knew this before, although, I certainly noticed that the quality of the sound output definitely was NOT 16-bit. Well, I guess this is where the real problem lies. I think the next version should undoubtedly implement 16-bit stereo sound ASAP. I believe that what I proposed is probably unwieldy and impractical (especially because DOSBox currently does NOT emulate 16-bit stereo SoundBlaster Pro 2.0)

So, its most likely best to just incorporate 16-bit SB PRO 2.0, and defer what I have suggested; at least, until 16-bit emulation is available. I mean, maybe once DOSBox has 16-bit SB PRO 2.0 sound, those "acute differences" I mentioned between SB PRO/Adlib/FM/OPL2-3 clone and/or compatible devices might be only trivial, at best. Particularly, because I was writing from the perspective of a generic 16-bit SB PRO 2.0 & Adlib-compatible sound card.

Reply 7 of 23, by Darkfalz

User metadata
Rank Member
Rank
Member

Oh, and SB PRO 2.0 didn't support 8 bit sound. It's not such a big deal, since most DOS games (pre-pentium era) are mostly using 8 bit samples anyway. All mixing is done in 16 bit though.

Reply 8 of 23, by Srecko

User metadata
Rank Member
Rank
Member

You wanted to say that it didn't support 16 bit mode?
Game usually use 8-bit samples. Maybe some of them SB16 also have
16-bit versions for SB16. Trackers (e.g impulse tracker) can benefit from 16-bit sample support at most but they usually support GUS too, and you get better performance with it in dosbox. So it's not very important to implement SB16.

Reply 9 of 23, by canadacow

User metadata
Rank Member
Rank
Member

Ok... to set things straight... DosBox does support the Soundblaster Pro in the stereo 8-bit modes. Furthermore, the Soundblaster Pro was unable to do 16-bit sound sampling. This functionality was not added until Creative Labs came out with the SB16. As for DosBox outputing in stereo, it does do this, however its still somewhat buggy. As the previous post suggested, just us GUS emulation when possible as its faster, has 16-bit support, and will take the burden off the emulated CPU by doing the mixing in native code.

Reply 10 of 23, by Darkfalz

User metadata
Rank Member
Rank
Member

Ultima Underworld 2 has stereo panning of sound effects (doors opening/closing etc). but it doesn't work in DOSBox. Ditto for Wolf3D.

It's just my observation, but this could very likely be because DOSBox is not supporting samples playing back at different volumes other than the default. See that's how panning is actually done, it sets a different volume for the left and right speakers. I don't think DOSBox does this. Another reason I think this is that in Wolf3D, even if you are miles from a door you just opened, the closing sound of it will be very loud. On a real system, it gets quieter the more you move away.

So stereo implementation may be there for anything discreetly playing volumes from the left or right, but stereo panning done with the mixer obviously doesn't work.

Reply 12 of 23, by canadacow

User metadata
Rank Member
Rank
Member

See that's how panning is actually done, it sets a different volume for the left and right speakers.

This is absolutely incorrect. The sound blaster played stereo through alternating left and right samples. Two samples for each speaker, one for the left one, one for the right. While later Sound Blasters had a mixer, this was not how stereo sound was accomplished.

Reply 13 of 23, by Darkfalz

User metadata
Rank Member
Rank
Member

canadacow, I think we are both right. Obviously the Sound Blaster is able to be told how to play a partciular sample, how loud or soft, and DOSBox is not currently emulating that. Naturally, it can send the same sample to both speakers and tell one side to play it loud and the other soft, to create a panning effect. Naturally at the moment since it's not properly supported, they just both play back full volume.

Reply 14 of 23, by canadacow

User metadata
Rank Member
Rank
Member

canadacow, I think we are both right. Obviously the Sound Blaster is able to be told how to play a partciular sample..

In most instances, I give people the benefit of the doubt, unfortunately, in this case I know you're mostly wrong. You're only right with regard to the exceptions you've listed. Wolf3D was able to do stereo by tweaking with the mixer volume. This is the equivalent to creating a stereo effect by adjusting the balance nob on your car's stereo. Normally, however, this is not how stereo sound is produced. It should be noted that DosBox does support stereo SB Pro output, just not the mixer settings that apparently Wolf3D is trying to use (or perhaps it doesn't even detect an SB PRO). Normally stereo sound is accomplished by sending to simultaneous PCM streams to the sound card. These bytes are placed side by side and the sound card plays them simulatenously for each speaker.

Reply 15 of 23, by canadacow

User metadata
Rank Member
Rank
Member

To get Wolf3D to output in stereo, if you have the source code, change lines 454 and 455 of sblaster.cpp in /src/hardware to read:

	(*stream++)=(sb.tmp.buf.m[pos] * sb.mixer.dac.left) >> 4;
(*stream++)=(sb.tmp.buf.m[pos] * sb.mixer.dac.right) >> 4;

That'll do it. Its not complete as what's really needed is a whole mixer step that combines all the sources (master volume, fm volume, dac volume, etc.), but this'll do for now.

Reply 16 of 23, by Darkfalz

User metadata
Rank Member
Rank
Member

It's not just the stereo panning of Wolf3D that's broken, it's distance loudness. Like I said, doors closing miles away make VERY LOUD sounds. On a real SB, they are quieter the further you are away from them.

UW2 must use a similar method for creating stereo panning, as it suffers from all the same problems.