jkheiser
Well-known member
MacKaboom’s sound framework uses KillIO before every sound so the Device Manager can stop whatever is playing in order to play what’s next. Without it, sounds cannot interrupt sounds. Instead, they pile up in the Device Manager’s I/O queue and wait their turn to be played.Tonight I did some more debugging with MAME and learned the culprit of the big nasty pop that plagues all the sounds on 128k and 512k Macs: it’s KillIO, which MacKaboom’s sound framework calls before every sound. It fills the buffer with $FF, the loudest byte there is.
What if... instead of calling KillIO, we pull a switcheroo on the Sound Driver while it is busy? Let’s give it a shot by setting up a common Parameter Block all sounds can share. Whenever the sound framework’s PLAY_SOUND_ASYNC routine is called, this block is updated accordingly:
- ioBuffer
ffSynthRec of next sound - ioReqCount
WaveByte length of next sound - ioNumDone
Reset this to zero
Did it work? Yes it did! No more nasty pop on a Fat Mac! In fact, I think this technique makes the transition between sounds smoother. No cycles are chewed up with KillIO. Instead, we’ve nearly instantly switched to a different stream of WaveBytes.
I need to do some more testing with this. Because sound generation is interrupt driven, there is some risk in meddling with these fields while the Sound Driver is busy. This switcheroo involves at least three operations, and any one of them could get interrupted, leading to unwanted side effects.
Last edited: