ASUS ROG Strix X570-i Gaming motherboard chipset fan you need to calm down

TL;DR If you have an ASUS ROG Strix X570-i Gaming motherboard (or similar) and are having issues with a constant high-pitched fan noise, try the instructions here to enable ASPM and then these instructions to alter the fan curve.

A very niche post, but here it is.

I recently flashed the latest BIOS on my motherboard. It all went fine, but then the sound was back again. I'd completely wiped it from my memory, the huge saga that I went through when I first got the board. The chipset runs real hot, and the fan runs real loud.

I'd fixed it before, so now I'm just writing it up for next time, or for anyone else who's having the same issue. I make no guarantees that you won't brick your motherboard, but I've done this twice now and it's been fine.

Step 1: Enable ASPM.

Using information from this Reddit post, follow the steps below:

  1. Download this boot file: bootx64.efi.zip
  2. FAT32 format a USB drive and create a folder /efi/boot.
  3. Unzip the file and put it in the boot folder.
  4. Restart your PC and boot from the USB drive from your BIOS.
  5. You will get a GRUB screen and a command prompt.
  6. Type setup_var 170 37 and press enter.
  7. Power off and restart Windows.
  8. Check HWiNFO64 and search for ASPM settings.
  9. It should say L1 Entry instead of disabled.

To reset back to default:

  1. Do the same kind of thing until you get to the GRUB cli.
  2. type setup_var 170 00 and press enter.
  3. Reboot.

Step 2: Tweak the fan curve.

Using instructions from this Reddit post, follow these steps:

  1. Download modGRUBShell.efi and put it in /efi/boot on your USB drive.
  2. Delete bootx64.efi and rename modGRUBShell.efi to bootx64.efi. (They may actually do the same thing, but I'm not sure. Better safe than sorry.)
  3. Boot from the USB drive and you'll get a GRUB screen and a command prompt.
  4. Type setup_var_cv QFan 0x3a and press enter. You should see offset 0x3a is: 0x3c which means the PCH Fan Middle Temperature is set to 60 degrees. If it doesn't say this, go back to the Reddit post and do "Phase 1: Getting the correct variable offset for your BIOS".
  5. Type setup_var_cv QFan 0x3a 0x01 0x50 and press enter. This sets the fan curve to 80 degrees, which means it will wait until the chipset is 80 degrees before it starts ramping up the fan speed.
  6. Reboot and you should be golden.

Note: Use LibreHardwareMonitor to get the real chipset temperature and fan speed.

That's it. Remember, I'm not responsible if you enter the wrong values and your motherboard explodes.

Enjoy the quiet!

In-browser WebAssembly we trust

Rust compiles to machine code, which runs as an executable file on your computer. You can also compile it to WebAssembly (Wasm for short) and have it run in the browser.

Until recently, if you wanted to add interactivity to a web page, or do a bunch of calculations in-browser, you'd use JavaScript. Now that Wasm is supported in all modern browsers, we can use Rust (or another compatible language) and run much closer to the metal.

Good times! Here's how to do it.

Firstly, install wasm-pack. It's a tool that helps build Rust code for the web.

Then, create a new Rust project with wasm-pack new my-wasm-project. This will generate a basic Rust library for you.

We only need to worry about src/lib.rs for now.

mod utils;

use wasm_bindgen::prelude::*;

#[wasm_bindgen]
extern "C" {
    fn alert(s: &str);
}

#[wasm_bindgen]
pub fn greet() {
    alert("Hello, my-wasm-test!");
}

The extern "C" block pulls the alert function in from JavaScript and we "export" the greet function using pub so we can call it from JavaScript.

Those #[wasm_bindgen] annotations are what bind our Rust code to JavaScript. They tell the compiler where the Wasm module should interface with JavaScript.

The alert function ... shows an alert box on the page. Cool. Let's do something a bit more interesting!

mod utils;

use wasm_bindgen::prelude::*;

#[wasm_bindgen]
pub fn fibonacci(n: u32) -> u32 {
    match n {
        0 => 0,
        1 => 1,
        _ => fibonacci(n - 1) + fibonacci(n - 2),
    }
}

This function calculates the nth Fibonacci number. Now we can hook it up and call this function from our page. But first, we need to compile it into WebAssembly.

Build your Wasm module with wasm-pack build --target web in the root of your project. This will create a pkg directory with a wasm.js file and a wasm_bg.wasm file.

We'll need an index.js file at the root of our project to import our Wasm module.

import init, { fibonacci } from "./pkg/my_wasm_project.js";

await init();
let result = fibonacci(32);
console.log(result); // 2178309

And an index.html to load our script.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Hello World!</title>
    <script type="module" defer async src="./index.js"></script>
  </head>
  <body>
    Hello World!
  </body>
</html>

Now serve your root directory with miniserve (or your favourite local static file server) and open index.html in your browser. You should see the result of the fibonacci function in the console.

The 32nd Fibonacci number is 2178309 btw.

And there you have it. Wasm running in-browser.

'Till next time. ✌️