What's the difference between Charging, Official Charger, and USB Charger profiles in sys-clk manager?
-
In the Nintendo Switch homebrew overclocking application https://github.com/retronx-team/sys-clk , you can set different clock speeds based on 5 power profiles: Docked, Handheld, Charging, Official Charger, and USB Charger.
Docked and Undocked seem self explanatory, but the three charging profiles confuse me. I assumed the Official Charger profile would only be used when connected to Nintendo's official Switch charger, but it also gets applied when using my Lenovo-branded laptop charger.
What's the difference between the Charging, Official Charger, and USB Charger profiles in sys-clk? Why is the Official Charger profile applied when I use my laptop charger?
-
The https://github.com/retronx-team/sys-clk/blob/dcd0d5d34dbc2d57b5caade31b92c45ca2c48450/sysmodule/src/clocks.cpp#L203 for sys-clk seems to indicate that
SysClkProfile_HandheldChargingOfficial
is returned ifPsmChargerType chargerType
is equal toPsmChargerType_EnoughPower
if(chargerType == PsmChargerType_EnoughPower) { return SysClkProfile_HandheldChargingOfficial; }
If
chargerType
equalsPsmChargerType_LowPower
, it returnsSysClkProfile_HandheldChargingUSB
. If it is neither of these, it will returnSysClkProfile_Handheld
.https://switchbrew.github.io/libnx/psm_8h.html#a950035b62563a7469af439b38948ce82 that contains 4 different members, one for unconnected, one for low power, one for enough power, and not supported.
If you look at https://github.com/retronx-team/sys-clk/blob/6edada8fc2de2a7edbd542276f0243825bb81d7d/common/include/sysclk/clocks.h#L100 , it returns what I believe is the text seen in this interface. If the
profile
isSysClkProfile_HandheldChargingOfficial
it will return "Official Charger", which after looking at the other code, it simply means you have "enough power" (presumably "enough power" means you have an adequate amount of power to overclock, etc.).As far as I can tell in the code, there is no place where some variable or some thing is set to
SysClkProfile_HandheldCharging
. The only thing I can see in the code that actually uses this to set something is https://github.com/retronx-team/sys-clk/blob/dcd0d5d34dbc2d57b5caade31b92c45ca2c48450/sysmodule/src/clocks.cpp#L281 that checks if theprofile
is less thanSysClkProfile_HandheldCharging
, and if it is, it returnsSYSCLK_GPU_HANDHELD_MAX_HZ
which seems like some sort of limiter.Thus, I believe "Official Charger" will be the profile displayed if your Switch is being charged by a charger that meets or exceeds the power rating of Nintendo's official power supply. Anything lower will display "USB Charger" (aside from being docked or not charging at all).