rewrite much of timings stuff

This commit is contained in:
souldbminersmwc
2025-08-30 11:59:19 -04:00
parent b5b509c828
commit fd91bc07d8
120 changed files with 19886 additions and 578 deletions

View File

@@ -1,18 +1,114 @@
# sys-clk-OC
# sys-clk-oc
Switch sysmodule allowing you to set cpu/gpu clocks according to the running application and docked state.
Switch sysmodule allowing you to set cpu/gpu/mem clocks according to the running application and docked state.
## Exclusive Features for sys-clk-oc
## Clock table (MHz)
official means HOS official, unless specified
### CPU clocks
* 2397 → OC max for Mariko (with CPU UV)
* 2295 → OC max for Mariko
* 2193
* 2091 → OC max for Erista
* 1963 → official and safe max for Mariko
* 1887
* 1785 → official boost mode, safe max for Erista
* 1683
* 1581
* 1428
* 1326
* 1224 → sdev OC
* 1122
* 1020 → official docked & handheld
* 918
* 816
* 714
* 612
### GPU clocks
* 1305 → N/A
* 1267 → official max for Mariko (Tegra X1+ official max)
* 1228 → recommended max for Hiopt
* 1152
* 1075 → recommended max for SLT
* 998 → safe max for Mariko, max for Erista (Tegra X1 official max)
* 921 → safe max for Erista
* 844
* 768 → official docked
* 691
* 614 → recommended Mariko max for handheld
* 537
* 460 → max handheld
* 384 → official handheld
* 307 → official handheld
* 230
* 153
* 76 → boost mode
### MEM clocks
From Hekate Minerva module [sys_sdrammtc.c](https://github.com/CTCaer/hekate/blob/master/modules/hekate_libsys_minerva/sys_sdrammtc.c#L65)
- 3200 → l4t and closed version max for Mariko
- 2931
- 2665
- 2502 → max for Mariko
- 2400
- 2361 → l4t and closed version max for Erista
- 2131 → JEDEC. max for Erista and official max for Mariko. lpddr4(x) official max
- 2099
- 2064
- 1996 → OCS mariko default
- 1932
- 1894
- 1862 → JEDEC. official max for Erista; OCS erista default
- 1795
- 1728
- 1600 → official docked & official boost mode
- 1331 → JEDEC. official handheld
- 1065
- 800
- 665
## Capping
To protect the battery from excessive strain, clocks requested from config may be capped before applying, depending on your current profile:
### Erista (Safe)
| | Handheld | Charging (USB) | Charging (Official) | Docked |
|:-------:|:--------:|:--------------:|:-------------------:|:------:|
| **MEM** | - | - | - | - |
| **CPU** | 1785 | 1785 | 1785 | 1785 |
| **GPU** | 460 | 768 | 921 | 921 |
### Erista (Unsafe allowed)
| | Handheld | Charging (USB) | Charging (Official) | Docked |
|:-------:|:--------:|:--------------:|:-------------------:|:------:|
| **MEM** | - | - | - | - |
| **CPU** | 1785 | 1785 | - | - |
| **GPU** | 460 | 768 | - | - |
### Mariko (Safe)
| | Handheld | Charging (USB) | Charging (Official) | Docked |
|:-------:|:--------:|:--------------:|:-------------------:|:------:|
| **MEM** | - | - | - | - |
| **CPU** | 1963 | 1963 | 1963 | 1963 |
| **GPU** | 768 | 921 | 998 | 998 |
### Mariko (Unsafe allowed)
| | Handheld | Charging (USB) | Charging (Official) | Docked |
|:-------:|:--------:|:--------------:|:-------------------:|:------:|
| **MEM** | - | - | - | - |
| **CPU** | 1963 | 1963 | - | - |
| **GPU** | 768 | 921 | - | - |
### Real Volts
voltage readings from devices: CPU/GPU/MEM/SOC
### Real Temps
temperature readings from thermal sensors: CPU/GPU/MEM/PLL/AO
### Cpu volt bug fix
fixes bug present in official driver
### Reversenx sync
automatically changes profile when reversenx state is changed
## Installation
@@ -39,14 +135,10 @@ Copy the `atmosphere`, and `switch` folders at the root of your sdcard, overwrit
`/config/sys-clk/context.csv`
* sys-clk manager app (accessible from the hbmenu)
`/switch/sys-clk-manager.nro`
* sys-clk overlay (accessible from anywhere by invoking the [Tesla menu](https://gbatemp.net/threads/tesla-the-nintendo-switch-overlay-menu.557362/))
`/switch/.overlays/sys-clk-overlay.ovl`
* sys-clk core sysmodule
`/atmosphere/contents/00FF0000636C6BFF/exefs.nsp`
@@ -54,7 +146,7 @@ Copy the `atmosphere`, and `switch` folders at the root of your sdcard, overwrit
## Config
Presets can be customized by adding them to the ini config file located at `/config/sys-clk/config.ini`, using the following template for each app
Presets can be customized by adding them to the ini config file located at `/config/sys-clk/config.ini`, using the following template for each app
```
[Application Title ID]
@@ -79,7 +171,7 @@ handheld_mem=
A list of games title id can be found in the [Switchbrew wiki](https://switchbrew.org/wiki/Title_list/Games).
* Frequencies are expressed in mhz, and will be scaled to the nearest possible values, described in the clock table below.
* If any key is omitted, value is empty or set to 0, it will be ignored, and stock clocks will apply.
* If charging, sys-clk will look for the frequencies in that order, picking the first found
* If charging, sys-clk will look for the frequencies in that order, picking the first found
1. Charger specific config (USB or Official) `handheld_charging_usb_X` or `handheld_charging_official_X`
2. Non specific charging config `handheld_charging_X`
3. Handheld config `handheld_X`
@@ -87,7 +179,6 @@ A list of games title id can be found in the [Switchbrew wiki](https://switchbre
### Example 1: Zelda BOTW
* Overclock CPU when docked or charging
* Overclock MEM to docked clocks when handheld
Leads to a smoother framerate overall (ex: in the korok forest)
@@ -106,79 +197,16 @@ handheld_mem=1600
[0100BA0003EEA000]
handheld_cpu=816
handheld_gpu=153
handheld_mem=800
```
### Advanced
The `[values]` section allows you to alter timings in sys-clk, you should not need to edit any of these unless you know what you are doing. Possible values are:
| Key | Desc | Default |
|:-----------------------:|-------------------------------------------------------------------------------|:-------:|
|**temp_log_interval_ms** | Defines how often sys-clk logs temperatures, in milliseconds (`0` to disable) | 0 ms |
|**freq_log_interval_ms** | Defines how often sys-clk logs real freqs, in milliseconds (`0` to disable) | 0 ms |
|**power_log_interval_ms**| Defines how often sys-clk logs power usage, in milliseconds (`0` to disable) | 0 ms |
|**csv_write_interval_ms**| Defines how often sys-clk writes to the CSV, in milliseconds (`0` to disable) | 0 ms |
|**poll_interval_ms** | Defines how fast sys-clk checks and applies profiles, in milliseconds | 300 ms |
|**uncapped_clocks** | Removes clock cappings | OFF |
|**override_boost_mode** | Overrides official boost mode with user set profile clocks | OFF |
|**auto_cpu_boost** | Sets cpu clock to boost clock when core#3 load ≥ 90% | OFF |
|**sync_reversenx** | Overrides profile to match reversenx state | ON |
## Capping
To protect the battery from excessive strain, clocks requested from config may be capped before applying, depending on your current profile:
### Erista:
| | Handheld | Charging (USB) | Charging (Official) | Docked |
|:-----:|:--------:|:--------------:|:-------------------:|:------:|
|**MEM**| - | - | - | - |
|**CPU**| 1785 MHz | 1785 MHz | - | - |
|**GPU**| 460 MHz | 768 MHz | - | - |
### Mariko:
| | Handheld | Charging (USB) | Charging (Official) | Docked |
|:-----:|:--------:|:--------------:|:-------------------:|:------:|
|**MEM**| - | - | - | - |
|**CPU**| 1963 MHz | 1963 MHz | - | - |
|**GPU**| 768 MHz | 921 MHz | - | - |
## Clock table (MHz)
### MEM clocks
* 1600 → official docked, boost mode, max clock
* 1331 → official handheld
* 1065
* 800
* 665
### CPU clocks
* 1785 → max clock, boost mode
* 1683
* 1581
* 1428
* 1326
* 1224 → sdev oc
* 1122
* 1020 → official docked & handheld
* 918
* 816
* 714
* 612
### GPU clocks
* 921 → max clock
* 844
* 768 → official docked
* 691
* 614
* 537
* 460 → max handheld
* 384 → official handheld
* 307 → official handheld
* 230
* 153
* 76 → boost mode
**Notes:**
| Key | Desc | Default |
|:------------------------:|-------------------------------------------------------------------------------|:---------:|
|**allow_unsafe_freq** | Allow unsafe frequencies (CPU > 1963.5 MHz, GPU > 921.6 MHz) | OFF |
|**uncapped_clocks** | Remove CPU/GPU clock cappings | OFF |
|**temp_log_interval_ms** | Defines how often sys-clk log temperatures, in milliseconds (`0` to disable) | 0 ms |
|**csv_write_interval_ms** | Defines how often sys-clk writes to the CSV, in milliseconds (`0` to disable) | 0 ms |
|**poll_interval_ms** | Defines how fast sys-clk checks and applies profiles, in milliseconds | 500 ms |