From 880fd3cfcb1c394b06bdb4cd3433e23379b4fbe7 Mon Sep 17 00:00:00 2001 From: Mary Date: Sat, 13 May 2023 09:15:16 +0200 Subject: audio: sdl2: Do not report 5.1 if the device doesn't support it (#4908) * amadeus: adjust VirtualDevice channel configuration reporting with HardwareDevice * audio: sdl2: Do not report 5.1 if device doesn't support it SDL2 5.1 to Stereo conversion is terrible and make everything sound quiet. Let's not expose 5.1 if not truly supported by the device. --- .../Renderer/Device/VirtualDeviceSessionRegistry.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/Ryujinx.Audio/Renderer/Device/VirtualDeviceSessionRegistry.cs') diff --git a/src/Ryujinx.Audio/Renderer/Device/VirtualDeviceSessionRegistry.cs b/src/Ryujinx.Audio/Renderer/Device/VirtualDeviceSessionRegistry.cs index 927e45ad..696af90f 100644 --- a/src/Ryujinx.Audio/Renderer/Device/VirtualDeviceSessionRegistry.cs +++ b/src/Ryujinx.Audio/Renderer/Device/VirtualDeviceSessionRegistry.cs @@ -1,3 +1,4 @@ +using Ryujinx.Audio.Integration; using System.Collections.Generic; namespace Ryujinx.Audio.Renderer.Device @@ -22,7 +23,23 @@ namespace Ryujinx.Audio.Renderer.Device /// The current active . /// // TODO: make this configurable - public VirtualDevice ActiveDevice = VirtualDevice.Devices[2]; + public VirtualDevice ActiveDevice { get; } + + public VirtualDeviceSessionRegistry(IHardwareDeviceDriver driver) + { + uint channelCount; + + if (driver.GetRealDeviceDriver().SupportsChannelCount(6)) + { + channelCount = 6; + } + else + { + channelCount = 2; + } + + ActiveDevice = new VirtualDevice("AudioTvOutput", channelCount, false); + } /// /// Get the associated from an AppletResourceId. -- cgit v1.2.3