ValveSoftware / Proton

Compatibility tool for Steam Play based on Wine and additional components
Other
23.86k stars 1.04k forks source link

Audio latency when the audio output samplerate is default to higher than 48 KHz. #3574

Open laichiaheng opened 4 years ago

laichiaheng commented 4 years ago

Compatibility Report

System Information

I confirm:

Symptoms

There is a serious latency issue when the default output sample rate is higher than 48KHz, but the problem is gone if I have played other 96KHz music first, then there is no latency in game although the output format is resampled to 96KHz.

Reproduction

edid /etc/pulse/daemon.conf edid default-sample-rate to 96000 pulseaudio --kill pulseaudio --start

laichiaheng commented 4 years ago

The problem is gone if I drop the default-fragment-size-msec to 2, is it bad?

ghost commented 4 years ago

The problem is gone if I drop the default-fragment-size-msec to 2, is it bad?

If you have any audio problems in the future then remember that you changed that. It could cause problems for people if the value was incorrect for the hardware and you put in a bug report about something having audio problems.

However, it looks like its also possible for the default value to incorrect at times so changing it for you could be correct but if you just plopped in any old number then its likely to be incorrect, yet if a number fixes it perhaps it could be correct.

Fun times for you.

flibitijibibo commented 4 years ago

This may not work everywhere but some games may be fixed by setting SDL_AUDIO_FREQUENCY to the system's sample rate. FAudio for example defaults to 48000 simply because we don't have a way of getting the device spec and it's the most common, but I can see how that would degrade when the two rates are vastly different.

mAd-DaWg commented 3 months ago

This may not work everywhere but some games may be fixed by setting SDL_AUDIO_FREQUENCY to the system's sample rate. FAudio for example defaults to 48000 simply because we don't have a way of getting the device spec and it's the most common, but I can see how that would degrade when the two rates are vastly different.

@flibitijibibo 48000 is not the most common sample rate linux systems install with, its 44100. Perhaps a setting could be added to steams compatibility settings tab(in steam settings) to define/override what sample rate games should output?