Charging power limited with USB-C only when powered on

Hello,

I have a Samsung Galaxy Book 4 with NixOS 24.11 installed.
The charging port is USB-C. I cannot figure out why, but the charging is very slow when the computer is turned on.

Indeed, charging when the computer is turned off is fast, and draws about 40W from the power supply. However, plugging the charger while the computer is turned on slows the charging at a maximum of a 10W draw, but overall the computer discharges while plugged in (since it uses more than 10W of power when in use).
Interestingly enough, if I plug in the computer while its off, THEN turn the computer on, then the charging is fine, as long as I do not disconnect the cable…

I do not have the technical knowledge, but it looks like charging can be managed both by the hardware and the OS, and the hardware manages it fine while the OS clearly doesn’t.

For information, I boot with the following kernelParams :

boot.kernelParams = [
    ''acpi_osi=!''
    ''acpi_osi="Windows 2022"'' # fixes charging on Archlinux, maybe here too?
    "mem_sleep_default=s2idle" # should fix sleeping crashing the computer
    "snd-intel-dspcfg.dsp_driver=1"
  ];

That used to fix the charging issue on ArchLinux, but it doesn’t seem to fix it on nixOS…

I also have TLP enabled :

services.tlp = {
    enable = true;
};

Do you have any idea how to fix that problem? It’s a real pain to shut down the computer each time I wanna charge…
I can send other logs if needed.

Thanks,

–
Gurvan BK

Hello
So your config with these Kernel Params looks fine.
Can you post the output of this command journalctl -b 0.
Also are you dualbooting with windows? If so try updating the firmware trough windows (GitHub - jusqua/galaxy-book4-linux: Searching for solutions for Samsung Galaxy Book4 for Linux) and disabling battery saving features like that the battery only charges to 80% (https://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg6112514.html).
If you only have linux installed try it with these kernel parameters:

acpi_osi="Windows 2020" 
acpi_enforce_resources=lax 
usbcore.autosuspend=-1

Hello,

Thanks for your answer. Here’s the output of the command: https://0x0.st/8Zw_.txt

I only have Linux installed, so hopefully I don’t need anything on Windows :smiley:
I’m trying these kernel parameters right now then I’ll let you know.

Update : It looks like these kernel parameters didn’t change a thing.
Here’s the output of the command with them if needed : https://0x0.st/8ZwD.txt

OK that is strange.
Can you post the output of this command cat grub/grub.cfg | grep "acpi_osi".
After that try changing the params to that:

    ''acpi_osi=!''
    ''acpi_osi=\"Windows 2022\"''
    ''acpi_enforce_resources=lax''
    ''usbcore.autosuspend=-1''

Hello,

I just tried with these settings and it didn’t fix the charging issue either unfortunately :confused:

As for the grub.cfg, I’m unsure where I’m supposed to find that one? I have no /grub directory.

Oh sorry I meant /boot/grub/grub.cfg.

Here’s my grub.cfg : https://0x0.st/8NWh.cfg

However I’m very unsure this is the one used by my system, this one seems to be the one I used to have for my Archlinux system :sweat_smile:

I’ve played with some things and got it fixed for 1 GENERATION, but I can’t reproduce it…

I finally found a way to fix charging!

Adding this line to my configuration.nix file :

boot.blacklistedKernelModules = [ "ucsi_acpi" "typec_ucsi" ];

allows me to charge my computer at 40W!

From what I barely understood, if these modules aren’t available then the charging will be handled “as if” the computer was turned off, which in my case worked.
I have no idea however if I might encounter later issue with this configuration… maybe you know?

Cheers,

2 Likes

That’s great news.

These prameters only affect the usb-c charging. You should not encounter any issues with these.

1 Like