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.
adlibmixerchan.installopl_callbackgenerateopl2adlib_getsampleaddsamples_m16opl3adlib_getsampleaddsamples_s16mameopl2ym3812_update_oneaddsamples_m16mameopl3ymf262_update_oneaddsamples_s16dbopl DosBox opl?generateopl3generateblock2addsamples_m32elsegenerateblock3addsamples_s32disneymixerchan.installdisney_callbackstereodisney_playstereobuffer=addsamples_s8monobuffer=addsamples_m8gameblastermixerchan.installcms_callbacksound_stream_updateaddsamples_s32gusGUS_DMA_Callbackr/w between system and gus rammixerchan.installgus_callbackgeneratesamplesaddsamples_s32mpu401operates diff from the restopladlib_getsamplepcspeakermixerchan.installpcspeaker_callbackstream(mixtemp buffer)=addsamples_m16sblastermixerchan.installsblaster_callbacknone/pause/maskedmixer addsilence
dacmixer addstretcheddmageneratedmasounddsp_dma_2decode_adpcm_2_sampleaddsamples_m8dsp_dma_3decode_adpcm_3_sampleaddsamples_m8dsp_dma_4decode_adpcm_4_sampleaddsamples_m8dsp_dma_8stereodma.chan->read!signedaddsamples_s8signedaddsamples_s8smonodma.chan->read!signedaddsamples_m8signedaddsamples_m8sdsp_dma_16dsp_dma_16_aliasedstereodma.chan->read!signedaddsamples_s16signedaddsamples_s16umonodma.chan->read!signedaddsamples_m16singedaddsamples_m16utandymixerchan.installSN76496Updatesound_stream_updateaddsamples_m16