[audio_core] Slightly increase audio latency (#2944)
This slightly increases audio latency to prevent audio skipping in some games, such as Super Mario Odyssey when playing videos. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2944 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Co-authored-by: MaranBr <maranbr@outlook.com> Co-committed-by: MaranBr <maranbr@outlook.com>
This commit is contained in:
@@ -220,8 +220,8 @@ u64 SinkStream::GetExpectedPlayedSampleCount() {
|
||||
auto time_delta{cur_time - last_sample_count_update_time};
|
||||
auto exp_played_sample_count{min_played_sample_count + (TargetSampleRate * time_delta) / std::chrono::seconds{1}};
|
||||
|
||||
// Add 15ms of latency in sample reporting to allow for some leeway in scheduler timings
|
||||
return std::min<u64>(exp_played_sample_count, max_played_sample_count) + TargetSampleCount * 3;
|
||||
// Add 25ms of latency in sample reporting to allow for some leeway in scheduler timings
|
||||
return std::min<u64>(exp_played_sample_count, max_played_sample_count) + TargetSampleCount * 5;
|
||||
}
|
||||
|
||||
void SinkStream::WaitFreeSpace(std::stop_token stop_token) {
|
||||
@@ -231,9 +231,9 @@ void SinkStream::WaitFreeSpace(std::stop_token stop_token) {
|
||||
return paused || queued_buffers < max_queue_size;
|
||||
};
|
||||
|
||||
release_cv.wait_for(lk, std::chrono::milliseconds(8), can_continue);
|
||||
release_cv.wait_for(lk, std::chrono::milliseconds(7), can_continue);
|
||||
|
||||
if (queued_buffers > max_queue_size + 10) {
|
||||
if (queued_buffers > max_queue_size + 3) {
|
||||
release_cv.wait(lk, stop_token, can_continue);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user