I move the window a tiny bit when it happens lol Fixes it every time.
When sound is enabled in FBA, it runs a new frame only when it needs more sound and it needs 60 sound chunks per second and so it ends up running at 60 fps. Think of it like one of those old record players with a circular disk but two cursors: the write cursor and the play cursor. FBA runs frames and writes its sound chunks behind the play cursor. Play cursor is a virtual cursor that points to the current sound being played. Thats the source of the audio lag in FBA. The write cursor which leads the play cursor reads the sound chunks written by FBA and sends them to sound hardware for outputting. Sometimes when the emulation/netplay slowly falls behind, the write cursor overlaps with where FBA is filling in the sound behind the play cursor for an extended period of time resulting in that weird sound.
Need to write something to detect when that happens and then insert silence and move along.