2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #8941 from Kelebek1/single_core_sucks

Do not try to pause core timing from the audio thread when using single-core
This commit is contained in:
bunnei 2022-09-23 22:40:30 -07:00 committed by GitHub
commit 1b1b99fbd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -214,8 +214,13 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz
// video play out without attempting to stall. // video play out without attempting to stall.
// Can hopefully remove this later with a more complete NVDEC implementation. // Can hopefully remove this later with a more complete NVDEC implementation.
const auto nvdec_active{system.AudioCore().IsNVDECActive()}; const auto nvdec_active{system.AudioCore().IsNVDECActive()};
if (!nvdec_active && queued_buffers > max_queue_size) {
// Core timing cannot be paused in single-core mode, so Stall ends up being called over and over
// and never recovers to a normal state, so just skip attempting to sync things on single-core.
if (system.IsMulticore() && !nvdec_active && queued_buffers > max_queue_size) {
Stall(); Stall();
} else if (system.IsMulticore() && queued_buffers <= max_queue_size) {
Unstall();
} }
while (frames_written < num_frames) { while (frames_written < num_frames) {
@ -255,7 +260,7 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz
std::memcpy(&last_frame[0], &output_buffer[(frames_written - 1) * frame_size], std::memcpy(&last_frame[0], &output_buffer[(frames_written - 1) * frame_size],
frame_size_bytes); frame_size_bytes);
if (stalled && queued_buffers <= max_queue_size) { if (system.IsMulticore() && queued_buffers <= max_queue_size) {
Unstall(); Unstall();
} }
} }