CPU activity sometimes flatlines around 1Ghz resulting in audio stutter (AMD p_state?)

The new kernel updates got me to switch to AMD p_state which has been working well so far, however when I’m playing guitar through Reaper, the sound will start stuttering and cutting out.
Whenever I look at CoreCtrl or my System Monitor afterwards, my CPU activity can clearly be seen flatlining (being capped at?) 1Ghz.

This never happened before while using the acpi and the governor set to “ondemand”.
The issue doesn’t seem to occur if I use CoreCtrl to set the governor to “performance”.


Any suggestions?

You did the correct thing already by setting the governor to performance.

In the default state amd_pstate is designed to lower the clocks when not much is happening as low as it can.

Setting it to performance will ensure the clocks will ramp up faster and ramp down slower / not as low for low and medium workloads. IIRC the default governor for AMD is schedutil which is also not very good for those kind of workloads.

Since you are still using a Ryzen 3000 series CPU the support for amd_pstate is not as good as it is on 5000 series or 7000 series. So your other option is to switch back to acpi_cpufreq since I don’t think you will gain much from using amd_pstate on that CPU anyway.

I have a 7800X3D and the best setup for amd_pstate on kernel 6.11 for me right now is:

  • scaling_driver: amd-pstate-epp
  • scaling_governor: powersave
  • energy_performance_preference: performance
  • scaling_min_freq: 2982000

Note that these values are specific to using amd_pstate in active mode (= amd-pstate-epp).

In active mode the scaling_governor powersave is the default and it does not behave like it does for all other operating modes or when using acpi_cpufreq. For the other modes and when using acpi_cpufreq it just limits the clocks to a very low value. In active mode it behaves more like ondemand.

The value I set for scaling_min_freq is equal to the value of amd_pstate_lowest_nonlinear_freq and might be different for each CPU generation / model.

You could also try running amd_psate in passive or guided mode and see if that works better for you.

These modes behave a bit more like acpi_cpufreq in that you control their bias torwards performance or power saving only by setting the scaling_governor since energy_performance_preference only exists when amd_pstate is used in active mode.

Also make sure that you are on the latest version of your motherboards BIOS and that CPPC is enabled since that is required for amd_pstate to function properly.

Note that not all motherboards vendors expose this setting for the end user and might just enable or disable it by default.

My Asrock mainboard for example has no option to enable or disable CPPC and it appears to be always enabled by default.

You can check it by running cat /proc/cpuinfo | grep CPPC

It should show up there when it is enabled.

If no CPPC support is showing up but amd_pstate can still be loaded then it is properly being enabled through Shared Memory Support because you using a Ryzen 3000 series CPU. I have no idea if it will work as well as it does with CPPC enabled or how to check for that tho.

If all of that sounds like way too much effort just switch back to acpi_cpufreq with ondemand and enjoy your CPU working as you expect it to :wink:.

1 Like

Wow! Thank you very much for the detailed reply! I’ll be taking a closer look today and figure out what will work best for me.

Which isn’t the case for me. Running a Ryzen 5 5600 on an ASRock X300-ITX motherboard and CPPC enabled within the BIOS.

But the pstate driver is definitely active and in use.

cpupower frequency-info
analyzing CPU 2:
  driver: amd-pstate-epp
  hardware limits: 550 MHz - 3.50 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 550 MHz and 3.50 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.

Then it is most likely getting enabled via the Shared Memory Support method.

This is how the output looks for my 7800X3D on an ASRock X670E Steel Legend with AMD AGESA ComboAM5PI 1.2.0.2:

cpupower frequency-info
analyzing CPU 14:
  driver: amd-pstate-epp
  CPUs which run at the same hardware frequency: 14
  CPUs which need to have their frequency coordinated by software: 14
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 545 MHz - 5.05 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 2.98 GHz and 5.05 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 4.23 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    AMD PSTATE Highest Performance: 166. Maximum Frequency: 5.05 GHz.
    AMD PSTATE Nominal Performance: 138. Nominal Frequency: 4.20 GHz.
    AMD PSTATE Lowest Non-linear Performance: 98. Lowest Non-linear Frequency: 2.98 GHz.
    AMD PSTATE Lowest Performance: 14. Lowest Frequency: 545 MHz.

Same for a 7700X just with different frequency numbers.

Going from AGESA ComboAM5PI 1.1.0.3 to 1.2.0.2 raised the Lowest Frequency from 400 MHz to 545 MHz for the 7800X3D.

Which is actually the same output on my machine, I’ve only thrown out the lines of minor interest to keep the post short.

I switched out passive mode for active for testing purposes and putting the governor on powersave with a preference for power works just fine, didn’t have the CPU flatline again.

1 Like