mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2025-02-02 21:12:55 -06:00
d4d0a48bfe
* Migrate audren to new IPC * Migrate audout * Migrate audin * Migrate hwopus * Bye bye old audio service * Switch volume control to IHardwareDeviceDriver * Somewhat unrelated changes * Remove Concentus reference from HLE * Implement OpenAudioRendererForManualExecution * Remove SetVolume/GetVolume methods that are not necessary * Remove SetVolume/GetVolume methods that are not necessary (2) * Fix incorrect volume update * PR feedback * PR feedback * Stub audrec * Init outParameter * Make FinalOutputRecorderParameter/Internal readonly * Make FinalOutputRecorder IDisposable * Fix HardwareOpusDecoderManager parameter buffers * Opus work buffer size and error handling improvements * Add AudioInProtocolName enum * Fix potential divisions by zero
63 lines
2.0 KiB
C#
63 lines
2.0 KiB
C#
using Ryujinx.Horizon.Arp.Ipc;
|
|
using Ryujinx.Horizon.Sdk.Arp;
|
|
using Ryujinx.Horizon.Sdk.Arp.Detail;
|
|
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
|
using Ryujinx.Horizon.Sdk.Sm;
|
|
|
|
namespace Ryujinx.Horizon.Arp
|
|
{
|
|
class ArpIpcServer
|
|
{
|
|
private const int ArpRMaxSessionsCount = 16;
|
|
private const int ArpWMaxSessionsCount = 8;
|
|
private const int MaxSessionsCount = ArpRMaxSessionsCount + ArpWMaxSessionsCount;
|
|
|
|
private const int PointerBufferSize = 0x1000;
|
|
private const int MaxDomains = 24;
|
|
private const int MaxDomainObjects = 32;
|
|
private const int MaxPortsCount = 2;
|
|
|
|
private static readonly ManagerOptions _managerOptions = new(PointerBufferSize, MaxDomains, MaxDomainObjects, false);
|
|
|
|
private SmApi _sm;
|
|
private ServerManager _serverManager;
|
|
private ApplicationInstanceManager _applicationInstanceManager;
|
|
|
|
public IReader Reader { get; private set; }
|
|
public IWriter Writer { get; private set; }
|
|
|
|
public void Initialize()
|
|
{
|
|
HeapAllocator allocator = new();
|
|
|
|
_sm = new SmApi();
|
|
_sm.Initialize().AbortOnFailure();
|
|
|
|
_serverManager = new ServerManager(allocator, _sm, MaxPortsCount, _managerOptions, MaxSessionsCount);
|
|
|
|
_applicationInstanceManager = new ApplicationInstanceManager();
|
|
|
|
Reader reader = new(_applicationInstanceManager);
|
|
Reader = reader;
|
|
|
|
Writer writer = new(_applicationInstanceManager);
|
|
Writer = writer;
|
|
|
|
_serverManager.RegisterObjectForServer(reader, ServiceName.Encode("arp:r"), ArpRMaxSessionsCount);
|
|
_serverManager.RegisterObjectForServer(writer, ServiceName.Encode("arp:w"), ArpWMaxSessionsCount);
|
|
}
|
|
|
|
public void ServiceRequests()
|
|
{
|
|
_serverManager.ServiceRequests();
|
|
}
|
|
|
|
public void Shutdown()
|
|
{
|
|
_applicationInstanceManager.Dispose();
|
|
_serverManager.Dispose();
|
|
_sm.Dispose();
|
|
}
|
|
}
|
|
}
|