Increase audio buffer size to 32768 samples (1024 ms) #10738
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes missing audio in various Datel titles; see https://bugs.dolphin-emu.org/issues/12281. They send a large number of samples at the same time, since they don't have to deal with an actual DSP program generating them.
It also fixes a crash when dumping audio on the Wii-compatible action replay, caused by an out-of-bounds array access in WaveFile. There was bounds-checking, but the bounds checking doubled the buffer size for the number of samples, when it should have doubled the sample count (I've changed it so that the actual buffer is twice as large, and the constant indicates the sample count, though). Also, that bounds checking logged a message and then proceeded to clobber memory regardless (it now returns without writing anything). After clobbering dolphin would show this and then crash since
basename
got overwritten.This PR does fix datel titles, but it seems to introduce other issues (in particular, audio gets desynced after holding tab to disable the speed limit - this may be fixable though). I'm also not sure if this buffer has any meaning on real hardware (its size was last bumped in #3200 from 2048 samples to 4096 samples). Also, on datel titles, sometimes sound effects get played twice; I don't know what causes this (nor is it something that happens all of the time).