VOGONS


First post, by James-F

User metadata
Rank Oldbie
Rank
Oldbie
Mixer   SBPro2   SB16

00,15 -48.5 -57.5
01,15 -48.5 -54.8 *
02,15 -27.3 -51.0
03,15 -27.3 -47.2 *
04,15 -21.5 -43.2
05,15 -21.5 -39.6 *
06,15 -15.7 -35.6
07,15 -15.7 -32.0 *
08,15 -11.0 -28.0
09,15 -11.0 -24.0 *
10,15 -7.0 -20.0
11,15 -7.0 -16.0 *
12,15 -3.0 -12.0
13,15 -3.0 -8.0 *
14,15 0.0 -4.0
15,15 0.0 0.0 *

These are mixer values from the hardware cards, true for MASTER, VOC and FM and normalized to 0db.
Unfortunately DOSBox is not even close.
It's here for future reference.

The * is what the SB16 gives at SBPro addresses 0x04 0x22 0x26 0x28 with write commands.
They (*) are also the 0-7 steps of the SBPro mixer.

Last edited by James-F on 2017-06-06, 14:58. Edited 5 times in total.


my important / useful posts are here

Reply 1 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

DOSBox's calculation of the volume steps uses a logarithm, and I've wondered for some time if it was modeled on perception of loudness rather than how samples should be scaled. I find that linear scaling of samples creates a more reasonable volume ramp in practice, although it's probably not correct. As it is now, the lower half of the scale is mostly inaudible unless external amplification is turned up to an unreasonable level.

I found "evidence" in the somewhat obscure adventure game "Trick or Treat", where the FM volume level set by the game can lead one to not realize there is intro music. It is possible to increase the FM volume using an in-game option, but only after the intro, and the game does not remember the setting from one session to the next. Currently, one must use the sbmixer=false setting in DOSBox to hear the intro music.

Reply 2 of 16, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

A simply look up table is all it takes, PCem uses LUT and it works great, I've tweaked it to match exactly the SB hardware.
I don't see why DOSBox should use an alternative, not according to the SB HW prog guide.

I've also tweaked in PCem the lowpass filters to match exactly the SBPro (Butterworth 2nd order, IIR), for PCM and OPL, and balanced between them, sound virtually indistinguishable from the real card.
Have a look, maybe something be relevant to DOSBox:
https://pcem-emulator.co.uk/phpBB3/viewtopic.php?f=2&t=729


my important / useful posts are here

Reply 3 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The SB MASTER channel is handled differently from the SB FM channel in DOSBox. So I am sure you will get some mind bogging results if you try to make sense of it.

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

Reply 4 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

btw, if we go with the values that you measured, then that specific game will be even more quiet.

wonder if we should boost the overall volume level. (as the mixer defaults in sb hw guide mentions -12- -14 as default)

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

Reply 5 of 16, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

No, don't boost the volume, DOSBox is way too loud as it is now.

Are you sure about the -12db defaults in doesbox? I see that the mixer is 100% at start on all addresses.
Also, when I send SBP-SET.EXE /M:15 I don't measure volume difference, so the mixer is already maxed at startup.


my important / useful posts are here

Reply 6 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

No, dosbox defaults to 0 db.
But the sb hw guide mentions -12 db as default.
btw if you should check the mixer for /FM:
then you should get better results. There should be regular steps for each value for that.
/M: is not recommended, if I look at the source as that is totally not similar to your measurements.

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

Reply 8 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author
James-F wrote:

According to the guide Master, Voc, and FM should behave the same.

I know, but we don't do that (currently), hence my remark to not test that any further, as it doesn't behave any where near the specs. So your tests will be in vain, as we don't use a LOG in there. (Which I will probably correct)

FM should behave better as that has at least a LOG scale 😀 although it will probably be off as well a bit

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

Reply 9 of 16, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

I tested changing FM volumes 0-15.
It does work but not up to specification as you said, sometimes there's more than 10db difference between the spec and dosbox.
I still suggest using a lookup table for the most accurate results.


my important / useful posts are here

Reply 10 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

corrected all mentioned problems in r4022:
1) master uses db scale as well.
2) sbpro1,2 use scale very similar to the one posted
3) sb16 uses a scale very similar to the one posted.

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

Reply 12 of 16, by Yesterplay80

User metadata
Rank Oldbie
Rank
Oldbie
James-F wrote:

Tested and Confirmed, SB16 and SBPro mixers now work 1:1 like the real hardware.
Thanks Qbix!

Yes, thank ou Qbix79! And thank you James-F for your meticulous work to improve Soundblaster emulation!

My full-featured DOSBox SVN builds for Windows & Linux: Vanilla DOSBox and DOSBox ECE (Google Drive Mirror)

Reply 13 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It is still necessary to set sbmixer=false to hear the FM intro music in Trick or Treat, so that mystery remains.

The game uses only SBPro mixer registers, so testing with sbtype=sbpro1, increasing host amplification until the FM music is at a normal level results in DAC volume that is far too loud. With sbtype=sb16 the situation is worse, with FM almost inaudible even at maximum host amplification.

These are the mixer register values used:

reg 0x22 (SBPro Master) = 0xEE
reg 0x04 (SBPro DAC) = 0xCC
reg 0x26 (SBPro FM) = 0x66

Is it really the case that the game's initial value of 6 should produce such a low FM volume level? If so then the lower half of the range seems rather useless. Again, the FM volume can be increased with an in-game setting, but the intro is stuck with the initial value.

Reply 14 of 16, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

I've tested the games on the hardware and it shows exactly the same results.
On SBPro2 the FM music is quiet compared to PCM but still audible.
On SB16 the FM is at -50db and pretty much non-audible.
It's a game programming problem, as DOSBox mixer is now 1:1 with the hardware.


my important / useful posts are here

Reply 15 of 16, by KainXVIII

User metadata
Rank Member
Rank
Member
Yesterplay80 wrote:
James-F wrote:

Tested and Confirmed, SB16 and SBPro mixers now work 1:1 like the real hardware.
Thanks Qbix!

Yes, thank ou Qbix79! And thank you James-F for your meticulous work to improve Soundblaster emulation!

And thank YOU for regularly uploaded dosbox ECE versions =)

Reply 16 of 16, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Perhaps the developers of Trick or Treat, not exactly on the A-list, had a SBPro clone card that behaves differently in the mixer. That would at least make sense, and then a hardware compatibility issue rather than bad programming in the narrow sense. So sbmixer=false remains the solution in this game's case, and it actually allows some music to be heard that otherwise could not be (FM volume set to zero in the mixer).