Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Open Forums » General Jazz Jackrabbit Talk

Tech questions about Jazz 1 audio engine

MrD

JCF Member

Joined: Jan 1970

Posts: 3

MrD has disabled reputation

Sep 29, 2020, 09:37 AM
MrD is offline
Reply With Quote
Tech questions about Jazz 1 audio engine

Hi I'm writing my own MSDOS sound stuff (SB driver, mod player / mixer, etc.) and I've got some questions about the nuts and bolts of Jazz' audio engine when it comes to Sound Blaster digitised audio.

In Jazz 1's setup screen, it has four SB options:
- Sound Blaster (Mono),
- Sound Blaster 16 (Stereo),
- Sound Blaster Clone (Stereo),
- Sound Blaster Pro (Stereo)

What's the difference between these drivers, technically speaking, in terms of their output?

I know that of the SB1(.5)/SB2/SBPro/SB16 series, only the SBPro and SB16 are capable of stereo output (~22kHz and ~44kHz respectively). Does JJ output at 44kHz with a SB16?

I'm surprised the Sound Blaster Clone is listed as stereo (as my first thought based on the name would've been a fail-safe clone driver would've been a legacy SB1 single-cycle mode driver), so I assume their Clone is just a super-safe variation of the Pro driver (or it might just be exactly the same, and just added as an option to satisfy anyone who has a Sound Galaxy, etc that's Pro compatible? But that wouldn't make sense as the help text for SBPro says it's for compatibles.)

In the Playback Quality page, there's four options:
- Ultra High Quality (Pentium)
- Very High Quality (486-50)
- High Quality (486-33)
- Medium Quality (386-33)

Given that the stereo is set by the driver, do these options just change the mixing+playback rate? (If so, to what?) Or do they also render the song mono internally to save on a few memory write accesses?
MrD

JCF Member

Joined: Jan 1970

Posts: 3

MrD has disabled reputation

Sep 30, 2020, 04:22 AM
MrD is offline
Reply With Quote


Luckily for me, the debug build of Dosbox shows a nice readable explanation of the Sound Blaster commands as they're sent to the DSP on the card, so I can write down the sample rates as they come up. These are the output sample rates of the various card and quality settings in JJ shareware 1.0, and Holiday Hare '94 and '95.

In short, the quality setting for Sound Blaster sound in Jazz selects between 22050 Hz, 16050 Hz, 10050 Hz and 6050 Hz, and the output is always 8-bit. (The SBPro could do 44100 Hz mono (but not stereo), and the SB16 could do 44100 Hz mono or stereo in 8 or 16-bit, but Jazz' drivers don't support these.)

Sound Blaster (Mono): All Sound Blasters support the interface this mode attempts, so this option ought to work with every Sound Blaster in the range and every clone that exists.

The very first revisions of the SB1 aren't capable of automatically restarting the data transfer when their block is empty - the driver has to continually kick the card back into life to eat up a little more sound (which can result in momentary pops). Jazz asks the card to identify itself, and goes into this manual mode only if it has to. If it detects it's capable of continuous ('auto-init') mode with no pops, it'll do that instead, which is nice.

For those clones that misbehave and mis-report themselves as being capable auto-init mode, Sound Blaster Clone (Stereo) forces the manual mode as if the card were an original SB1. Since it's using the most basic interface, 'Clone (Stereo)' never actually plays stereo sound, only mono. (That's the behaviour I got regardless of the card I used with it.) It really ought to be called Sound Blaster Clone (Mono) Failsafe or something.

Sound Blaster Pro: The Sound Blaster Pro and the Sound Blaster 16 have different interfaces for stereo output so they have to be programmed separately. (You can detect one from the other in code, but it's good to give the user a choice in case they have a strange clone.)

For some reason, in Holiday Hare 94 and 95 the Sound Blaster Pro option only works with an SB16, and dosbox acts exactly as it would if the Pro driver were made for SB16s. It's as if the drivers got mixed up and the Pro driver got overwritten by the SB16 one or something - dosbox is giving me unusual transfer values (listed in the ?? column as 'Hz (bytes)'). If this is right, both '94 and '95 don't support SBPro at all... (edit - found a thread on another forum from 2013 with the same weird sb16/sbpro behaviour!)

Sound Blaster 16 (Stereo): Nothing to say, it works.

There's a caveat that this is only the behaviour in dosbox, but if somebody would like to give me a bunch of SB cards I'll try it for real.

Last edited by MrD; Oct 1, 2020 at 01:38 AM.
Simon Simon's Avatar

JCF Member

Joined: Dec 2016

Posts: 58

Simon is doing well so far

Oct 2, 2020, 02:41 AM
Simon is offline
Reply With Quote
Quote:
Originally Posted by MrD View Post
In the Playback Quality page, there's four options:
- Ultra High Quality (Pentium)
- Very High Quality (486-50)
- High Quality (486-33)
- Medium Quality (386-33)

options just change the mixing+playback rate?
render the song mono internally
Very High Quality plays only 3 of the 4 tracker channels. This modification on the song seems to cost some extra waiting time during every level-loading screen.

It does not render the song mono; still, each of the 3 channels only comes either from the left or right speaker. E.g., if you capture only one speaker afterwards, the sound will sound like even more tracker channels were cut.

Disabling music altogether in the setup tool makes for extremely fast level-loading screens.

Very High and Ultra High also change how sfx sound in Dosbox. E.g., the pitched sound effect on shooting a 15-ammo container sounds nicer on Very High, and a tad jagged on Ultra High.

Haven't toyed with the other quality settings besides the highest two. Lovely topic, good luck on the research!

-- Simon
MrD

JCF Member

Joined: Jan 1970

Posts: 3

MrD has disabled reputation

Oct 2, 2020, 05:58 AM
MrD is offline
Reply With Quote
Quote:
Very High Quality plays only 3 of the 4 tracker channels. This modification on the song seems to cost some extra waiting time during every level-loading screen.
Oh didn't think of that! So it just omits one of the channels? Blunt but effective.
What would be clever is if it has a run through the song and collapses the four tracks into three while keeping as many notes as possible (by clever instrument-based rules or just 'channel X is more important and can interrupt channel Y so paste it on top'), which would explain the delay.
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT -8. The time now is 05:46 AM.