Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

Audio reverting to default 16bits/48khz at new session

Open ftt-prod opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is your issue described in the documentation?

  • [X] I have read the documentation

Is your issue present in the latest beta/pre-release?

  • [X] This issue is present in the latest pre-release

Describe the Bug

Moonlight is on last version (same issue with the previous one) & Sunshine is updated too.

GPU doesn't have the last driver because last of us won't launch otherwise, but same issue with the last driver.

Host: I7-7700k 32g Full Nvmes and one dedicated for the OS, the other for games. Gigabit Ethernet

Client is a Thinkpad t460: I7-6600 (not sure) 12g SSD IGPU Hdmi output supports every audio format I need. Gigabit Ethernet

The issue:

Everytime I launch a session from the client (Win 10 laptop) to the host (Win 10 desktop), the host Steam audio drivers go back to 16bits/48KHz.

If i switch to 32bits/196KHz on the host while streaming, it works ok, no dropout, bug or whatever but if i exit the moonlight session and reconnect again, the host settings switch to the default (16bits/48KHz). Same behavior if i kill the session & start a new one. Same behavior from different hosts & clients, reverts back to default at launch of a session. Steam audio drivers are up to date, tried reinstalling from GitHub, reset settings etc... same behavior.

Is it possible to lock the steam audio drivers settings completely? What exactly interacts with the driver settings? The launch command from Moonlight? A backend script from Sunshine?

Moonlight's team told me it's a sunshine issue as moonlight has no control on the host audio.

Thanks!

(I'm sorry if this is not the right section but I wasn't really sure)

Expected Behavior

Steam streaming audio drivers should keep the defined user settings.

For example:

  • Setting them to 32bits/96Khz on host.
  • Launch a new moonlight session
  • The settings should stay at 32bits/96Khz and not revert back to 16bits/48Khz

Additional Context

_You'll tell me, what's the matter? 16bits/48KHz are ok! Maybe, but i have an audiophile setup, a dedicated & audio treated cinema room, 5.1, you can hear the difference between 32bits/196KHz & 16bits/48KHz.

And also, I can do it and have the setup for, so why not? :)_

Host Operating System

Windows

Operating System Version

Windows 10 Pro 22H2 Build 19045.4474 Feature Experience Pack 1000.19058.1000.0

Architecture

64 bit

Sunshine commit or version

0.23.1

Package

Windows - installer

GPU Type

Nvidia

GPU Model

RTX 2060 6go

GPU Driver/Mesa Version

522.44

Capture Method (Linux Only)

No response

Config

resolutions = [
    1280x720,
    1920x1080,
    2560x1080,
    2560x1440,
    3440x1440,
    1920x1200,
    3840x2160,
    3840x1600
]
gamepad = x360
nvenc_preset = 7
fps = [60]
sunshine_name = *private info*
nvenc_twopass = full_res
nvenc_spatial_aq = enabled

Apps

No response

Relevant log output

Useless but necessary for the form to work:
[2024:06:11:20:20:31]: Info: Sunshine version: v0.23.1
[2024:06:11:20:20:32]: Info: nvprefs: No need to modify application profile settings
[2024:06:11:20:20:32]: Info: nvprefs: Changed OGL_CPL_PREFER_DXPRESENT to OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED for base profile
[2024:06:11:20:20:33]: Info: Compiling shaders...
[2024:06:11:20:20:33]: Info: Compiled shaders
[2024:06:11:20:20:33]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:06:11:20:20:33]: Info: Trying encoder [nvenc]
[2024:06:11:20:20:34]: Info: ddprobe.exe [1] [] returned: 0x00000000
[2024:06:11:20:20:34]: Info: Set GPU preference: 1
[2024:06:11:20:20:34]: Info: 
Device Description : NVIDIA GeForce RTX 2060
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00001F08
Device Video Mem   : 5955 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 16364 MiB
Feature Level      : 0x0000B100
Capture size       : 2560x1440
Offset             : 0x0
Virtual Desktop    : 2560x1440
[2024:06:11:20:20:34]: Info: Active GPU has HAGS disabled
[2024:06:11:20:20:34]: Info: Using realtime GPU priority
[2024:06:11:20:20:34]: Info: Desktop resolution [2560x1440]
[2024:06:11:20:20:34]: Info: Desktop format [DXGI_FORMAT_R16G16B16A16_FLOAT]
[2024:06:11:20:20:34]: Info: Display refresh rate [144Hz]
[2024:06:11:20:20:34]: Info: Requested frame rate [60fps]
[2024:06:11:20:20:34]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
Bits Per Color     : 8
Red Primary        : [0.680664,0.320312]
Green Primary      : [0.265625,0.69043]
Blue Primary       : [0.150391,0.0605469]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.01 nits
Max Luminance      : 1499 nits
Max Full Luminance : 799 nits
[2024:06:11:20:20:34]: Info: SDR color coding [Rec. 601]
[2024:06:11:20:20:34]: Info: Color depth: 8-bit
[2024:06:11:20:20:34]: Info: Color range: [JPEG]
[2024:06:11:20:20:34]: Info: NvEnc: created encoder P7 two-pass rfi spatial-aq
[2024:06:11:20:20:34]: Info: SDR color coding [Rec. 601]
[2024:06:11:20:20:34]: Info: Color depth: 8-bit
[2024:06:11:20:20:34]: Info: Color range: [JPEG]
[2024:06:11:20:20:34]: Info: NvEnc: created encoder P7 two-pass rfi spatial-aq
[2024:06:11:20:20:34]: Info: SDR color coding [Rec. 601]
[2024:06:11:20:20:34]: Info: Color depth: 8-bit
[2024:06:11:20:20:34]: Info: Color range: [JPEG]
[2024:06:11:20:20:34]: Error: NvEnc: encoding format is not supported by the gpu
[2024:06:11:20:20:35]: Info: 
Device Description : NVIDIA GeForce RTX 2060
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00001F08
Device Video Mem   : 5955 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 16364 MiB
Feature Level      : 0x0000B100
Capture size       : 2560x1440
Offset             : 0x0
Virtual Desktop    : 2560x1440
[2024:06:11:20:20:35]: Info: Active GPU has HAGS disabled
[2024:06:11:20:20:35]: Info: Using realtime GPU priority
[2024:06:11:20:20:35]: Info: Desktop resolution [2560x1440]
[2024:06:11:20:20:35]: Info: Desktop format [DXGI_FORMAT_R16G16B16A16_FLOAT]
[2024:06:11:20:20:35]: Info: Display refresh rate [144Hz]
[2024:06:11:20:20:35]: Info: Requested frame rate [60fps]
[2024:06:11:20:20:35]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
Bits Per Color     : 8
Red Primary        : [0.680664,0.320312]
Green Primary      : [0.265625,0.69043]
Blue Primary       : [0.150391,0.0605469]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.01 nits
Max Luminance      : 1499 nits
Max Full Luminance : 799 nits
[2024:06:11:20:20:35]: Info: HDR color coding [Rec. 2020 + SMPTE 2084 PQ]
[2024:06:11:20:20:35]: Info: Color depth: 10-bit
[2024:06:11:20:20:35]: Info: Color range: [JPEG]
[2024:06:11:20:20:35]: Info: NvEnc: created encoder P7 10-bit two-pass rfi spatial-aq
[2024:06:11:20:20:35]: Info: 
[2024:06:11:20:20:35]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2024:06:11:20:20:35]: Info: 
[2024:06:11:20:20:35]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2024:06:11:20:20:35]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2024:06:11:20:20:35]: Info: Configuration UI available at [https://localhost:47990]
[2024:06:11:20:20:36]: Info: Registered Sunshine mDNS service
[2024:06:11:20:24:18]: Info: Web UI: [127.0.0.1] -- not authorized

ftt-prod avatar Jun 11 '24 18:06 ftt-prod

With the latest pre-releases the logs should have a line detailing the settings used for the Opus audio codec. You might want to check the logs again with a pre-release. (And post your results)

gschintgen avatar Jun 12 '24 05:06 gschintgen

With the latest pre-releases the logs should have a line detailing the settings used for the Opus audio codec. You might want to check the logs again with a pre-release. (And post your results)

Hey thanks for the reply! Sorry For this late reply, the notifications don't seem to work for me and i fortget.. i'm on holiday right now, so not able to check, but i'll do asap when i'll get home ;)

ftt-prod avatar Jul 16 '24 14:07 ftt-prod

Using anything other than 48kHz will be detrimental because opus codec can't do anything else. Why we prefer 16-bit over 24-bit I actually have no idea, since the same opus can consume and uses float under the hood. Maybe some cross-platform reasons.

ns6089 avatar Jul 16 '24 14:07 ns6089

Using anything other than 48kHz will be detrimental because opus codec can't do anything else. Why we prefer 16-bit over 24-bit I actually have no idea, since the same opus can consume and uses float under the hood. Maybe some cross-platform reasons.

Ok yeah i see, in fact, that's not a big issue, that's a minor thing. At least, Sunshine supports 5.1/7.1 audio for free, not like much of remote gaming apps ahah

I'll always be surprised that the latency is so low, that's really enjoyable

ftt-prod avatar Jul 16 '24 14:07 ftt-prod

https://github.com/LizardByte/Sunshine/pull/2873 will switch capture/encoding pipeline to floating point samples. Audio device bit depth is irrelevant because capture takes place before samples are converted from wasapi mixer to native device format, and wasapi uses floating point samples internally.

I think this issue can be closed.

ns6089 avatar Jul 17 '24 06:07 ns6089