Try   HackMD

My Framework 13 AMD Edition

I try to maintain a good habit by recording everything technical every time when I own a new computing device (aka computer). Currently a scratchpad :(

Hardware & Accessories

  • AMD Ryzen 5 7640U with Linux (Pop!_OS)
  • Expansion cards: 2 USB-C (in the rear position), 1 Type A, 1 HDMI
    • Plan to buy a microSD card reader next time.
  • Charger: Gigastone 100W charger 2C + 1A

Linux kernel configuration

My current boot parameter /etc/kernelstub/configuration:

Severe bug: Adrupt reboot after waking from sleep

OS Installation

Official guides:

Filesystem setup (BTRFS)

Useful resources

Topics

Embedded controller (EC)

Tools (assuming no CrOS EC kernel module, see this) Update to kernel 6.12 to use them:

Note that you can drop --interface=lpc and --driver portio if using Linux Kernel 6.12, available for Ubuntu (Pop!_OS?) 22.04 around March 2025.

Power management

Mega thread: [Guide] FW13 Ryzen Power Management.

Currently I use system76-power from master branch (just cargo build and then copy the result to replace /usr/bin/system76-power and restart the service for it), which is included by default in Pop OS, but seemingly missing several important parameters for saving power compared to PPD.

It is rumored that auto-cpufreq performs really well, but I don't have time to try.

BTW I found this reply and it seems to be effective:

# get its current value
$ cat /sys/module/pcie_aspm/parameters/policy
[default] performance powersave powersupersave

# set its value to "powersupersave"
$ echo powersupersave | sudo tee /sys/module/pcie_aspm/parameters/policy
powersupersave

Also reducing the screen refresh rate from 60Hz to 48Hz seems to help a lot.

Misc issues

I did encounter some graphical glitches but very occasionly. Like mouse cursor move is very skippy.

Touchpad is too sensitive

Say you want to change scrolling speed under X11 (10~50, default 15, larger is slower). Create a file at /usr/share/X11/xorg.conf.d/30-touchpad.conf:

Section "InputClass"                                                                            
Identifier "Touchpad"
Driver "libinput"
  MatchIsTouchpad "on"
  Option "ScrollPixelDistance" "25"
EndSection

Takes effect on the next login.

For Firefox under X11

Set MOZ_USE_XINPUT2=1 with some tweaks in about:config:

Key Value
apz.fling_friction 0.005
apz.gtk.pangesture.delta_mode 2
apz.gtk.touchpad_pinch.enabled false

A good place to enforce the env is to put in /etc/security/pam_env.conf:

​​MOZ_USE_XINPUT2 DEFAULT=1

HW decoding in Firefox

It is disabled by default on AMD GPUs and can be enabled with media.ffmpeg.vaapi.enabled set to true. See gfxinfo. The GPU only supports H264, VP9, AV1, which can be confirmed in about:support.

Totem with vaapi will result in incorrect color

Have tried allow_rgb10_configs=false but it did not work. So removing gstreamer-vaapi (or just using VLC

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
) seems to be the only workaround.

Monitoring the power consumption

I wonder if I can monitor these data to benchmark each solution: Measuring effective power received on a USB-C port under Linux.

Framework's EC provides some information about active PD states (negotiated voltage and current) for each port.

EC log has an estimated drain time, but I cannot utilize it without polling. The output of ectool is longer, but I don't know why.

The handy powerdraw script: https://gist.github.com/guss77/c91e1d6583fad5b5c917eafc345cb81b

Auto-adjustment of (screen) backlight is too crude

See https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/575 for inspiration.

For now, I just disabled that option in GNOME and controlled it manually.

Preserve battery when in sleep

There is some random wake up behavior observed: https://community.frame.work/t/resolved-systemd-suspend-then-hibernate-wakes-up-after-5-minutes/39392. Also, it is really annoying that closing the lid will wake up the OS from sleep.

Use s2idle script to detect problems. One common point it suggests is to add rtc_cmos.use_acpi_alarm=1 into the boot parameter. However this is no longer required in newer (6.7+) kernels.

Note that it is not the lid open/close event itself that wakes up the system, but the extra IRQ interrupts whose effect is similar to a keystroke. So it happens even when the setting in the DM is disabled.

Disable lid wake up behavior through udev: https://community.frame.work/t/tracking-framework-amd-ryzen-7040-series-lid-wakeup-behavior-feedback/39128/45

ACTION=="add", SUBSYSTEM=="acpi", DRIVERS=="button", ATTRS{hid}=="PNP0C0D", ATTR{power/wakeup}="disabled"
ACTION=="add", SUBSYSTEM=="serio", DRIVERS=="atkbd", ATTR{power/wakeup}="disabled

TODO: SSD is fast nowadays, should really do hibernation when battery level matters (e.g., during travels).