aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary-nyan <mary@mary.zone>2022-12-02 14:01:19 +0100
committerGitHub <noreply@github.com>2022-12-02 13:01:19 +0000
commitc25e8427aa40a4ae920496220fd1e1621eff178b (patch)
tree01175e77663d40a2eda0fe15c8333756b478fb59
parent21a081b1857cd8e93f191944479a2ca4b5fb98d7 (diff)
amadeus: Fix wrong SendCommands logic (#3969)1.1.412
* amadeus: Fix wrong SendCommands logic Might help with audio desync, might cause audio stutters, will see! * Address gdkchan's comment
-rw-r--r--Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs5
-rw-r--r--Ryujinx.Audio/Renderer/Server/AudioRenderSystem.cs19
2 files changed, 18 insertions, 6 deletions
diff --git a/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs b/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs
index 2f58957d..7bd0443c 100644
--- a/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs
+++ b/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs
@@ -116,6 +116,11 @@ namespace Ryujinx.Audio.Renderer.Dsp
};
}
+ public bool HasRemainingCommands(int sessionId)
+ {
+ return _sessionCommandList[sessionId] != null;
+ }
+
public void Signal()
{
_mailbox.SendMessage(MailboxMessage.RenderStart);
diff --git a/Ryujinx.Audio/Renderer/Server/AudioRenderSystem.cs b/Ryujinx.Audio/Renderer/Server/AudioRenderSystem.cs
index 34fdef8a..5116f7ca 100644
--- a/Ryujinx.Audio/Renderer/Server/AudioRenderSystem.cs
+++ b/Ryujinx.Audio/Renderer/Server/AudioRenderSystem.cs
@@ -670,14 +670,21 @@ namespace Ryujinx.Audio.Renderer.Server
{
_terminationEvent.Reset();
- GenerateCommandList(out CommandList commands);
+ if (!_manager.Processor.HasRemainingCommands(_sessionId))
+ {
+ GenerateCommandList(out CommandList commands);
- _manager.Processor.Send(_sessionId,
- commands,
- GetMaxAllocatedTimeForDsp(),
- _appletResourceId);
+ _manager.Processor.Send(_sessionId,
+ commands,
+ GetMaxAllocatedTimeForDsp(),
+ _appletResourceId);
- _systemEvent.Signal();
+ _systemEvent.Signal();
+ }
+ else
+ {
+ _isDspRunningBehind = true;
+ }
}
else
{