Skip to content

Commit

Permalink
Amadeus: Fix multi-channel PCM sources on REV8 (#1536)
Browse files Browse the repository at this point in the history
This add a missing offset on the output buffer of the DataSourceVersion2Command.

This fix music only playing on the left channel on Fairy Tail, Family Mysteries: Poisonous Promises, SEGA AGES Sonic the Hedgehog 2 and probably more.
  • Loading branch information
Mary authored Sep 6, 2020
1 parent e7d09a8 commit 6aef271
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public DataSourceVersion2Command(ref Server.Voice.VoiceState serverState, Memory
SrcQuality = serverState.SrcQuality;
CommandType = GetCommandTypeBySampleFormat(SampleFormat);

OutputBufferIndex = outputBufferIndex;
OutputBufferIndex = (ushort)(channelIndex + outputBufferIndex);
SampleRate = serverState.SampleRate;
Pitch = serverState.Pitch;

Expand Down
2 changes: 2 additions & 0 deletions Ryujinx.Audio.Renderer/Server/CommandGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ private void GenerateDataSource(ref VoiceState voiceState, Memory<VoiceUpdateSta

if (!voiceState.WasPlaying)
{
Debug.Assert(voiceState.SampleFormat != SampleFormat.Adpcm || channelIndex == 0);

if (_rendererContext.BehaviourContext.IsWaveBufferVersion2Supported())
{
_commandBuffer.GenerateDataSourceVersion2(ref voiceState,
Expand Down

0 comments on commit 6aef271

Please sign in to comment.