mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
fix: Steam client responds sooner and its sounds play on time (#1094)
- Pace the session at the rate the panel actually runs. When the system keeps a lower rate than the mode DroidDeck asked for (a vendor game assistant holding 120 Hz while 185 Hz was requested), gamescope, Xwayland and the compositor's presentation feedback were told 185 Hz, and Steam's interface drew every 10.8 ms out of step with the panel. - Build the DirectAudio PulseAudio sink from source (LGPL-2.1-or-later, The412Banner/directaudio v1.1.0) with its max request kept to its ring target. Advertising 100 ms made PulseAudio grow every client's buffer to about 112 ms, so Steam's interface sounds played that late.
This commit is contained in:
1 parent
123fbc723c
commit
7800d3d810
7 files changed
+1509
-6
No files matched your search
@@ -1609,8 +1609,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
glassesScreen?.hz?.takeIf { it > 1f }?.let { return it }
|
||||
val display = if (Build.VERSION.SDK_INT >= 30) display else windowManager.defaultDisplay
|
||||
val wanted = window.attributes.preferredDisplayModeId
|
||||
val hz = display?.supportedModes?.firstOrNull { wanted != 0 && it.modeId == wanted }?.refreshRate
|
||||
?: display?.refreshRate ?: 60f
|
||||
val requested = display?.supportedModes?.firstOrNull { wanted != 0 && it.modeId == wanted }?.refreshRate
|
||||
val running = display?.refreshRate?.takeIf { it > 1f }
|
||||
val hz = listOfNotNull(requested, running).minOrNull() ?: 60f
|
||||
val mirrorCap = mirrorRefreshLimit().takeIf { it > 0 }?.toFloat() ?: Float.POSITIVE_INFINITY
|
||||
val capped = minOf(hz, PerfMode.peakRefreshCap(this), mirrorCap)
|
||||
return if (capped > 1f) capped else 60f
|
||||
|
||||
Reference in new issue
Block a user