First post, by awgamer
Thought others might find this experimentation of interest. Some games are currently not happy like msfs 5.x, stunt island, xwing, but works without a hitch for many. synthesized audio aka fm etc., dac processing, and mixer mixing should all be offloaded to the thread. Threading overhead can be dropped to nill but initial methods were heavy. Read comments in the diff. If it weren't for xwing which will start mute but occasionally plays fine, fm playback would be error free from what testing I've done, the other two have an issue with dac playback.
audio interfacing is done through the mixer, callback handler for an audio device is installed to mixer, the pic runs mixer_mix, mixer_mix runs the handlers after peeling away a couple of layers, callbacks all conform to the same pattern of generate synthesized data, mixer addsample. exception to the rule is mpu401 which does things differently, ignore that guy.
adlib
mixerchan.install
opl_callback
generate
opl2
adlib_getsample
addsamples_m16
opl3
adlib_getsample
addsamples_s16
mameopl2
ym3812_update_one
addsamples_m16
mameopl3
ymf262_update_one
addsamples_s16
dbopl DosBox opl?
generate
opl3
generateblock2
addsamples_m32
else
generateblock3
addsamples_s32
disney
mixerchan.install
disney_callback
stereo
disney_playstereo
buffer=
addsamples_s8
mono
buffer=
addsamples_m8
gameblaster
mixerchan.install
cms_callback
sound_stream_update
addsamples_s32
gus
GUS_DMA_Callback
r/w between system and gus ram
mixerchan.install
gus_callback
generatesamples
addsamples_s32
mpu401
operates diff from the rest
opl
adlib_getsample
pcspeaker
mixerchan.install
pcspeaker_callback
stream(mixtemp buffer)=
addsamples_m16
sblaster
mixerchan.install
sblaster_callback
none/pause/masked
mixer addsilence
dac
mixer addstretched
dma
generatedmasound
dsp_dma_2
decode_adpcm_2_sample
addsamples_m8
dsp_dma_3
decode_adpcm_3_sample
addsamples_m8
dsp_dma_4
decode_adpcm_4_sample
addsamples_m8
dsp_dma_8
stereo
dma.chan->read
!signed
addsamples_s8
signed
addsamples_s8s
mono
dma.chan->read
!signed
addsamples_m8
signed
addsamples_m8s
dsp_dma_16
dsp_dma_16_aliased
stereo
dma.chan->read
!signed
addsamples_s16
signed
addsamples_s16u
mono
dma.chan->read
!signed
addsamples_m16
singed
addsamples_m16u
tandy
mixerchan.install
SN76496Update
sound_stream_update
addsamples_m16