Commit f627f6ca by PLN (Algolia)

fix(perf): keep CPU turbo ENABLED in perf mode (was capping at base clock)

Both --extreme and --optimize disabled intel_pstate turbo on the theory
that frequency changes cause jitter. On HWP-capable CPUs (i7-10875H) the
performance governor already holds clocks steady at the top; disabling
turbo only caps all cores at the 2.3GHz base (~64% of clock headroom
thrown away), starving SuperDirt's DSP and causing the very xruns/crackle
it was meant to prevent. Now pins min/max_perf_pct=100 with turbo on.
parent 070a86d0
...@@ -187,11 +187,12 @@ optimize_standard() { ...@@ -187,11 +187,12 @@ optimize_standard() {
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor > /dev/null echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor > /dev/null
echo "✓ CPU governor set to performance" echo "✓ CPU governor set to performance"
# Disable CPU Turbo - can cause audio stutters when frequency changes # Keep CPU Turbo ENABLED — see note in optimize_extreme(). Disabling turbo on
# an HWP CPU caps the clock at base and starves SuperDirt's DSP (causes xruns).
if [ -f "/sys/devices/system/cpu/intel_pstate/no_turbo" ]; then if [ -f "/sys/devices/system/cpu/intel_pstate/no_turbo" ]; then
echo "Disabling CPU Turbo (to avoid frequency changes)..." echo "Ensuring CPU Turbo is enabled..."
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
echo "✓ CPU Turbo disabled" echo "✓ CPU Turbo enabled"
fi fi
# Apply IRQ thread priorities # Apply IRQ thread priorities
...@@ -256,16 +257,22 @@ optimize_extreme() { ...@@ -256,16 +257,22 @@ optimize_extreme() {
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor > /dev/null echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor > /dev/null
echo "✓ CPU governor set to performance" echo "✓ CPU governor set to performance"
# Disable CPU Turbo and set min performance # Pin CPU to MAXIMUM sustained clock — turbo ENABLED.
echo "Disabling CPU Turbo and frequency scaling..." # NOTE: on HWP-capable CPUs (this i7-10875H has hwp), the performance governor
# already holds clocks steady at the top and P-state transitions are near-instant.
# Disabling turbo here used to "avoid frequency-change jitter" but it actually
# CAPS the CPU at base clock (2.3GHz vs ~4.3GHz turbo) — starving SuperDirt's DSP
# and causing the very crackling/xruns it was meant to prevent. Keep turbo ON.
echo "Pinning CPU to max clock (turbo enabled)..."
if [ -f "/sys/devices/system/cpu/intel_pstate/no_turbo" ]; then if [ -f "/sys/devices/system/cpu/intel_pstate/no_turbo" ]; then
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
echo "✓ CPU Turbo disabled" echo "✓ CPU Turbo enabled (full clock headroom available)"
fi fi
if [ -d "/sys/devices/system/cpu/intel_pstate" ]; then if [ -d "/sys/devices/system/cpu/intel_pstate" ]; then
echo 100 > /sys/devices/system/cpu/intel_pstate/max_perf_pct 2>/dev/null
echo 100 > /sys/devices/system/cpu/intel_pstate/min_perf_pct 2>/dev/null echo 100 > /sys/devices/system/cpu/intel_pstate/min_perf_pct 2>/dev/null
echo "✓ Intel CPU min performance set to 100%" echo "✓ Intel CPU min/max performance pinned to 100% (no downclocking, turbo reachable)"
fi fi
# Disable NMI watchdog (can cause stutters) # Disable NMI watchdog (can cause stutters)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment