You are not logged in.

#1 2024-01-14 14:17:15

ninja8910
Member
Registered: 2024-01-14
Posts: 17

[SOLVED] cpu frequency dropping after unplugging AC cable

Hi I'm using hyprland and it's my first time to install arch on my laptop(I had arch on my old pc).
When I unplug the AC cable the movement of cursor gets laggy and in btop I can see that cpu frequency drops to 400MH.
Does someone know how I can fix this?

Last edited by ninja8910 (2024-01-16 17:22:04)

Offline

#2 2024-01-14 14:36:41

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Does pinning the CPU scaling governor to "performance" help?

for i in $(seq 0 $(($(nproc) -1))) ; do echo performance > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor ; done

^ Run that from a root shell to test (it won't work if you just prepend `sudo`, use `sudo -i` or `su -` first instead).

I am presuming here that you don't have any power management frameworks such as TLP installed & running. If you're using TLP (or so) then try disabling that first.

Offline

#3 2024-01-14 14:43:03

ninja8910
Member
Registered: 2024-01-14
Posts: 17

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

yes I don't have any power management frameworks installed.

Last edited by ninja8910 (2024-01-14 14:51:25)

Offline

#4 2024-01-14 14:48:26

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

I did test the command before posting, are you sure you included all the parentheses? Copy&paste to avoid transcription error.

All it's doing is writing "performance" to /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor, where "$i" is the CPU thread number.

Offline

#5 2024-01-14 14:54:23

ninja8910
Member
Registered: 2024-01-14
Posts: 17

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

I entered the command again and it worked
So what now?

Offline

#6 2024-01-14 14:55:02

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Does it help at all?

Offline

#7 2024-01-14 14:57:12

ninja8910
Member
Registered: 2024-01-14
Posts: 17

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Nope it didn't change anything

Last edited by ninja8910 (2024-01-14 14:57:43)

Offline

#8 2024-01-14 15:05:11

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

You can set the minimum frequency level higher by altering /sys/devices/system/cpu/cpu$i/cpufreq/scaling_min_freq but it will probably kill your battery life.

Offline

#9 2024-01-14 15:10:48

ninja8910
Member
Registered: 2024-01-14
Posts: 17

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

So I can't fix it without killing my battery life?

Offline

#10 2024-01-14 15:17:37

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

That depends on whether the laggy cursor is actually caused by the low CPU frequency. My CPU also throttles to 400MHz but it doesn't make the cursor lag. I do have a pretty powerful CPU though (Ryzen 7735HS).

What is your hardware?

grep 'model name' /proc/cpuinfo | uniq

Offline

#11 2024-01-14 15:23:05

ninja8910
Member
Registered: 2024-01-14
Posts: 17

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

My cpu is Intel Core i5-11400H

Offline

#12 2024-01-14 15:24:36

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Hmm, that's pretty beefy. Perhaps something else is going on here. Is it just the cursor that lags or do you notice any other performance deficiencies?

Offline

#13 2024-01-14 15:30:28

ninja8910
Member
Registered: 2024-01-14
Posts: 17

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

The whole laptop gets laggy for example while watching youtube if I unplug the AC cable it starts to drop frames

Offline

#14 2024-01-14 15:45:22

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,598

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

You don't have xf86-video-intel installed, do you? You shouldn't with that processor.

Offline

#15 2024-01-14 16:01:22

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

If the laptop has a discrete GPU does disabling it help? Could be that the battery simply can't drive both the CPU and GPU at the same time.

I have a gaming laptop but it's always plugged in for maximum performance and the power supply is 240W (!) compared to 65W for my ThinkPads with just integrated graphics. Even the ThinkPads struggle with games on battery power but work fine when plugged in.

Last edited by Head_on_a_Stick (2024-01-14 16:01:43)

Offline

#16 2024-01-14 17:08:10

ninja8910
Member
Registered: 2024-01-14
Posts: 17

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Hmm that's a good idea. Yes it has a rtx 2050
That could be the cause because I didn't have that issue with windows 11.
Is there any way that I can make it automatically disable dgpu when the AC cable isn't connected and enables the dgpu agin when the cable is connected?

Offline

#17 2024-01-14 17:40:03

ninja8910
Member
Registered: 2024-01-14
Posts: 17

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Scimmia wrote:

You don't have xf86-video-intel installed, do you? You shouldn't with that processor.

Yes I have that installed.

Offline

#18 2024-01-14 18:50:12

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Remove xf86-video-intel. I'm surprised you can get to a desktop at all with that installed.

ninja8910 wrote:

Is there any way that I can make it automatically disable dgpu when the AC cable isn't connected and enables the dgpu agin when the cable is connected?

Sounds like a job for a udev rule. I'm allergic to NVIDIA but perhaps try something like https://unix.stackexchange.com/question … vidia-gpus.

Offline

#19 2024-01-14 19:16:04

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,598

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

ninja8910 wrote:
Scimmia wrote:

You don't have xf86-video-intel installed, do you? You shouldn't with that processor.

Yes I have that installed.

Which means your graphics system is broken and falling back to software rendering. That doesn't work well, and is terrible when the CPU goes to minimum.

Offline

#20 2024-01-14 19:28:36

ninja8910
Member
Registered: 2024-01-14
Posts: 17

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Head_on_a_Stick wrote:

Remove xf86-video-intel. I'm surprised you can get to a desktop at all with that installed.

ninja8910 wrote:

Is there any way that I can make it automatically disable dgpu when the AC cable isn't connected and enables the dgpu agin when the cable is connected?

Sounds like a job for a udev rule. I'm allergic to NVIDIA but perhaps try something like https://unix.stackexchange.com/question … vidia-gpus.

Nope disabling dgpu doesn't change anything

Last edited by ninja8910 (2024-01-14 19:28:58)

Offline

#21 2024-01-14 19:29:48

ninja8910
Member
Registered: 2024-01-14
Posts: 17

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Scimmia wrote:
ninja8910 wrote:
Scimmia wrote:

You don't have xf86-video-intel installed, do you? You shouldn't with that processor.

Yes I have that installed.

Which means your graphics system is broken and falling back to software rendering. That doesn't work well, and is terrible when the CPU goes to minimum.

So what should I do?

Offline

#22 2024-01-14 19:31:57

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,598

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

As we've both said, get rid of it. You should never have had it installed with that processor at all. If you have any configs in /etc/X11/xorg.conf or /etc/X11/xorg.conf.d/ that specifically reference the intel driver, get rid of those, too or change them to modesetting.

Offline

#23 2024-01-14 19:35:05

ninja8910
Member
Registered: 2024-01-14
Posts: 17

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Scimmia wrote:

As we've both said, get rid of it. You should never have had it installed with that processor at all. If you have any configs in /etc/X11/xorg.conf or /etc/X11/xorg.conf.d/ that specifically reference the intel driver, get rid of those, too or change them to modesetting.

I removed it and i also use Hyprland so i have Wayland
Still nothing changed

Last edited by ninja8910 (2024-01-14 19:38:12)

Offline

#24 2024-01-15 01:31:22

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,598

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Ah, I completely missed that you were on Hyprland, my apologies.

Offline

#25 2024-01-15 03:20:12

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,771

Re: [SOLVED] cpu frequency dropping after unplugging AC cable

Stuff like this is normally a lower level firmware bug. Check your UEFI whether there's some option to disable aggressive power saving/throttling, maybe check whether there's an UEFI firmware update. If neither is the case the firmware sometimes is in a buggy state. Shut the system down, and hold the power button during startup, that should™  reset the firmware state to something sane.

Offline

Board footer

Powered by FluxBB