mirror of
https://git.ryujinx.app/kenji-nx/ryujinx.git
synced 2025-12-12 19:37:06 +00:00
audio effects fix and audio object pooling
Revert and reimplement Float BiquadFilterEffect support, fixes infinite load issues in a few games like Splatoon 3. Fix incorrect string check with the new thread naming system. Implement object pooling for all Audio Commands and a few other audio related objects and use a growing error list for updating wave buffers instead of always allocating space for 8 errors.
This commit is contained in:
parent
86f47b8333
commit
cdbe568620
43 changed files with 763 additions and 602 deletions
|
|
@ -11,27 +11,32 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|||
{
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
public int NodeId { get; }
|
||||
public int NodeId { get; private set; }
|
||||
|
||||
public CommandType CommandType => CommandType.AdpcmDataSourceVersion1;
|
||||
|
||||
public uint EstimatedProcessingTime { get; set; }
|
||||
|
||||
public ushort OutputBufferIndex { get; }
|
||||
public uint SampleRate { get; }
|
||||
public ushort OutputBufferIndex { get; private set; }
|
||||
public uint SampleRate { get; private set; }
|
||||
|
||||
public float Pitch { get; }
|
||||
public float Pitch { get; private set; }
|
||||
|
||||
public WaveBuffer[] WaveBuffers { get; }
|
||||
|
||||
public Memory<VoiceState> State { get; }
|
||||
public Memory<VoiceState> State { get; private set; }
|
||||
|
||||
public ulong AdpcmParameter { get; }
|
||||
public ulong AdpcmParameterSize { get; }
|
||||
public ulong AdpcmParameter { get; private set; }
|
||||
public ulong AdpcmParameterSize { get; private set; }
|
||||
|
||||
public DecodingBehaviour DecodingBehaviour { get; }
|
||||
public DecodingBehaviour DecodingBehaviour { get; private set; }
|
||||
|
||||
public AdpcmDataSourceCommandVersion1(ref VoiceInfo serverInfo, Memory<VoiceState> state, ushort outputBufferIndex, int nodeId)
|
||||
public AdpcmDataSourceCommandVersion1()
|
||||
{
|
||||
WaveBuffers = new WaveBuffer[Constants.VoiceWaveBufferCount];
|
||||
}
|
||||
|
||||
public AdpcmDataSourceCommandVersion1 Initialize(ref VoiceInfo serverInfo, Memory<VoiceState> state, ushort outputBufferIndex, int nodeId)
|
||||
{
|
||||
Enabled = true;
|
||||
NodeId = nodeId;
|
||||
|
|
@ -42,8 +47,6 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|||
|
||||
Span<Server.Voice.WaveBuffer> waveBufferSpan = serverInfo.WaveBuffers.AsSpan();
|
||||
|
||||
WaveBuffers = new WaveBuffer[Constants.VoiceWaveBufferCount];
|
||||
|
||||
for (int i = 0; i < WaveBuffers.Length; i++)
|
||||
{
|
||||
ref Server.Voice.WaveBuffer voiceWaveBuffer = ref waveBufferSpan[i];
|
||||
|
|
@ -55,6 +58,8 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|||
AdpcmParameterSize = serverInfo.DataSourceStateAddressInfo.Size;
|
||||
State = state;
|
||||
DecodingBehaviour = serverInfo.DecodingBehaviour;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public void Process(CommandList context)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue