stub/implement audren commands
This commit is contained in:
parent
0254a84f90
commit
908d296c1a
2 changed files with 60 additions and 8 deletions
|
@ -38,6 +38,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
|
||||||
|
|
||||||
private int Track;
|
private int Track;
|
||||||
|
|
||||||
|
private bool IsStarted;
|
||||||
|
|
||||||
public IAudioRenderer(
|
public IAudioRenderer(
|
||||||
Horizon System,
|
Horizon System,
|
||||||
AMemory Memory,
|
AMemory Memory,
|
||||||
|
@ -46,6 +48,10 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
|
||||||
{
|
{
|
||||||
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
||||||
{
|
{
|
||||||
|
{ 0, GetAudioRendererSampleRate },
|
||||||
|
{ 1, GetAudioRendererSampleCount },
|
||||||
|
{ 2, GetAudioRendererMixBufferCount },
|
||||||
|
{ 3, GetAudioRendererState },
|
||||||
{ 4, RequestUpdateAudioRenderer },
|
{ 4, RequestUpdateAudioRenderer },
|
||||||
{ 5, StartAudioRenderer },
|
{ 5, StartAudioRenderer },
|
||||||
{ 6, StopAudioRenderer },
|
{ 6, StopAudioRenderer },
|
||||||
|
@ -68,6 +74,38 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
|
||||||
Voices = CreateArray<VoiceContext>(Params.VoiceCount);
|
Voices = CreateArray<VoiceContext>(Params.VoiceCount);
|
||||||
|
|
||||||
InitializeAudioOut();
|
InitializeAudioOut();
|
||||||
|
|
||||||
|
IsStarted = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long GetAudioRendererSampleRate(ServiceCtx Context)
|
||||||
|
{
|
||||||
|
Context.ResponseData.Write(Params.SampleRate);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long GetAudioRendererSampleCount(ServiceCtx Context)
|
||||||
|
{
|
||||||
|
Context.ResponseData.Write(Params.SampleCount);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long GetAudioRendererMixBufferCount(ServiceCtx Context)
|
||||||
|
{
|
||||||
|
Context.ResponseData.Write(Params.MixCount);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long GetAudioRendererState(ServiceCtx Context)
|
||||||
|
{
|
||||||
|
Context.ResponseData.Write(!IsStarted);
|
||||||
|
|
||||||
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, $"Stubbed. Renderer State = {(IsStarted? "Started":"Stopped")}");
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AudioCallback()
|
private void AudioCallback()
|
||||||
|
@ -206,6 +244,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
|
||||||
{
|
{
|
||||||
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
|
IsStarted = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,6 +253,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
|
||||||
{
|
{
|
||||||
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
|
IsStarted = false;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ using Ryujinx.HLE.HOS.Ipc;
|
||||||
using Ryujinx.HLE.HOS.Services.Aud.AudioRenderer;
|
using Ryujinx.HLE.HOS.Services.Aud.AudioRenderer;
|
||||||
using Ryujinx.HLE.Logging;
|
using Ryujinx.HLE.Logging;
|
||||||
using Ryujinx.HLE.Utilities;
|
using Ryujinx.HLE.Utilities;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
using static Ryujinx.HLE.HOS.ErrorCode;
|
using static Ryujinx.HLE.HOS.ErrorCode;
|
||||||
|
@ -30,7 +31,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud
|
||||||
{
|
{
|
||||||
{ 0, OpenAudioRenderer },
|
{ 0, OpenAudioRenderer },
|
||||||
{ 1, GetAudioRendererWorkBufferSize },
|
{ 1, GetAudioRendererWorkBufferSize },
|
||||||
{ 2, GetAudioDevice }
|
{ 2, GetAudioDeviceService },
|
||||||
|
{ 4, GetAudioDeviceServiceWithRevisionInfo }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +163,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud
|
||||||
return Result / 8;
|
return Result / 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long GetAudioDevice(ServiceCtx Context)
|
public long GetAudioDeviceService(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
long UserId = Context.RequestData.ReadInt64();
|
long UserId = Context.RequestData.ReadInt64();
|
||||||
|
|
||||||
|
@ -169,5 +171,13 @@ namespace Ryujinx.HLE.HOS.Services.Aud
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private long GetAudioDeviceServiceWithRevisionInfo(ServiceCtx Context)
|
||||||
|
{
|
||||||
|
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
|
||||||
|
|
||||||
|
return GetAudioDeviceService(Context);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue