VOGONS


First post, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

When DOSBox is set to sbtype = sb16, the attached audio sawtooth 'pop' is generated at the ~4s mark during start up of the CD-Audio version of Monkey Island 1. (Graph units: x-axis is time in seconds, y-axes are left and right channels showing signed 16-bit magnitude sample values).

This doesn't occur (stays quiet) when other sbtype's are used. Depending on your audio equipment, you might have to turn up the volume to hear it (or in some cases, it comes through loud-and-clear).

The backtrace that generates it is:

MixerChannel::AddSamples<unsigned char, false, false, true> (this=0x55555a6f1fa0, len=1, data=0x555558733b00 <sb+64> "")
MixerChannel::AddSamples_m8 (this=0x55555a6f1fa0, len=1, data=0x555558733b00 <sb+64> "")
GenerateDMASound (size=1)
END_DMA_Event (val=1)
PIC_RunQueue ()
Normal_Loop ()
DOSBOX_RunMachine ()

(I don't have real hardware to check if this is just some nuance of the game itself causing this)

Attachments

Last edited by krcroft on 2020-05-25, 06:41. Edited 1 time in total.

Reply 1 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

A small DMA transfer is not unusual for SB detection / initialization when games start up. It can cause an audible pop depending on the sample(s) in the transfer. The difference between SB16 and other SB types is likely due to the speaker enable state. My use of the word "speaker" here refers to a SB DSP flag, not the PC speaker. A disabled speaker flag doesn't actually silence output on an SB16, but it does in older models. You can probably see this in DOSBox debugger log messages where the init transfer is logged as "Short transfer scheduling IRQ ..." for sbtype=sb16, and "Silent DMA Transfer scheduling IRQ..." for other sbtype= settings.

Reply 2 of 4, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

ripsaw8080, thanks for the explanation. Very interesting! I guess as part of the detection, some games (or drivers) verify operability using the small DMA transfer.
(Reminds me of those $1 credit card charges (and immediate refund) used by some smaller websites just to check that the entire payment loop is valid!)

I wonder if these could be safely discarded? ie: if it's the first-ever DMA transfer and if the size is less-than-some-threshold, then discard it one-time-only.

Reply 3 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I may have become relatively insensitive because there are games (usually not from big name developers, mind you) doing stuff during SB initialization that is much worse for the ears than a small pop. In any case, I can safely suggest not going too far with hacks. 😉

Reply 4 of 4, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

Good advice - and now that you mention it, I do remember some games really mangling the speaker on start up!
Around '93 I upgraded to a pair of speakers with a power-button on the front and wised-up to those games.. only powered on the speakers after the game was up 😀