dingusdev / dingusppc

An experimental emulator
GNU General Public License v3.0
200 stars 21 forks source link

amic: don't reset cur_buf_pos if we've drained the DMA buffer #59

Closed mihaip closed 7 months ago

mihaip commented 7 months ago

Otherwise if pull_data is called again, it will think that it still has data available in the buffer (rem_len will be non-zero) and random data at the buffer location will be returned.

This manifested itself as noise being played back in the JS implementation of the SoundServer. The cubeb implementation was not affected because it stops polling once it's told it has no more data in the buffer. Both approaches are valid (the JS version pads data with silence), and the DMA buffer should support both.