Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Samsung R429 Linux setup

I run Arch Linux on a Samsung R429. These are the fixes and tweaks I use to keep it working.

Hardware

Component Specification
Model Samsung R429 / NP-R429
CPU Intel Core i3 M 330 (2.13 GHz)
GPU NVIDIA GeForce 310M (GT218M)
RAM 4 GB DDR3
Storage 320 GB Mechanical HDD
OS Arch Linux

Lid suspend fix

The lid switch on this board does not send correct SW_LID events:

kernel: ACPI: button: The lid device is not compliant to SW_LID.

systemd-logind needs SW_LID, so closing the lid does not suspend.

Fix

1. Set kernel parameter button.lid_init_state=open

Add button.lid_init_state=open to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub, then update GRUB:

sudo grub-mkconfig -o /boot/grub/grub.cfg

2. Catch lid events with acpid

sudo pacman -S acpid

Create /etc/acpi/events/lid:

event=button/lid.*
action=/etc/acpi/handlers/lid.sh

Create /etc/acpi/handlers/lid.sh:

#!/bin/bash
grep -q closed /proc/acpi/button/lid/LID0/state && /usr/bin/systemctl suspend

Make it executable and start acpid:

sudo chmod +x /etc/acpi/handlers/lid.sh
sudo systemctl enable --now acpid

Keyboard fix after resume

The built-in keyboard can stop responding after suspend. The PS/2 controller loses register state on resume.

Add i8042.reset=1 i8042.nomux=1 to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub, then update GRUB:

sudo grub-mkconfig -o /boot/grub/grub.cfg

Performance and disk tweaks

1. GPU reclocking with Nouveau

The GeForce 310M defaults to power state 07 (405 MHz core). State 0f runs 625 MHz core / 1530 MHz shader / 790 MHz memory.

Create /etc/systemd/system/nouveau-pstate.service:

[Unit]
Description=Set Nouveau GPU to max pstate
After=sysinit.target

[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo 0f > /sys/kernel/debug/dri/0/pstate'
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Enable the service:

sudo systemctl enable --now nouveau-pstate.service

2. Disable CPU mitigations

This reclaims 10-20% CPU performance on this dual-core.

Add mitigations=off to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub, then update GRUB.

3. I/O scheduler and queue tuning for HDD

BFQ with smaller read-ahead prevents stutter during heavy reads on mechanical drives.

Create /etc/udev/rules.d/60-hdd-queue.rules:

ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq", ATTR{queue/read_ahead_kb}="512", ATTR{queue/nr_requests}="256"

4. Memory and dirty page settings

I use ZRAM with 4 GB RAM. Early swappiness and low writeback thresholds keep the UI responsive.

/etc/sysctl.d/99-zram.conf:

vm.swappiness = 150

/etc/sysctl.d/99-hdd-dirty-ratio.conf:

vm.dirty_background_ratio = 3
vm.dirty_ratio = 6

/etc/sysctl.d/99-writeback.conf:

vm.dirty_writeback_centisecs = 6000

5. Ext4 mount options

Edit /etc/fstab and add noatime and commit=60 to the root partition:

UUID=... / ext4 rw,noatime,commit=60 0 1

commit=60 applies to ext4 only. Do not add it to the VFAT /boot entry.

6. Browser cache in RAM with profile-sync-daemon

This symlinks browser profiles to tmpfs and syncs periodically. This cuts disk writes:

sudo pacman -S profile-sync-daemon
systemctl --user enable --now psd.service

7. Threaded interrupts and Mesa threading

Add threadirqs nouveau.config=NvBoost=2,NvPmEnableGating=1 to the GRUB command line.

Enable Mesa threading in /etc/environment:

mesa_glthread=true

Set DRI3 in /etc/X11/xorg.conf.d/20-nouveau.conf:

Section "Device"
    Identifier "Nouveau GPU"
    Driver "nouveau"
    Option "DRI" "3"
    Option "TearFree" "true"
EndSection

8. Nouveau video decode firmware

This extracts the video engine firmware from the NVIDIA 340.108 driver. This enables H.264 hardware decode under Nouveau:

mkdir -p /tmp/nouveau-fw-build && cd /tmp/nouveau-fw-build
wget https://raw.githubusercontent.com/envytools/firmware/master/extract_firmware.py
wget https://us.download.nvidia.com/XFree86/Linux-x86_64/340.108/NVIDIA-Linux-x86_64-340.108.run
sh NVIDIA-Linux-x86_64-340.108.run --extract-only
python3 extract_firmware.py
sudo mkdir -p /usr/lib/firmware/nouveau
sudo cp -a nv* vuc-* /usr/lib/firmware/nouveau/
sudo mkinitcpio -P
rm -rf /tmp/nouveau-fw-build

Revert by removing /usr/lib/firmware/nouveau and running sudo mkinitcpio -P.


Faster boot

  • Disable NetworkManager-wait-online.service and bluetooth.service: sudo systemctl disable NetworkManager-wait-online.service bluetooth.service
  • Skip initramfs fsck: remove fsck from HOOKS in /etc/mkinitcpio.conf, then run sudo mkinitcpio -P.
  • Use a volatile journal: set Storage=volatile in /etc/systemd/journald.conf.d/00-journal-limit.conf.

LightDM theme

Copy the GTK theme system-wide, then set /etc/lightdm/lightdm-gtk-greeter.conf:

[greeter]
theme-name = TokyoNight
icon-theme-name = Papirus-Dark
background = #16161e
user-background = false
font-name = Sans 10
position = 50%,center 50%,center
indicators = ~clock;~spacer;~session;~power
clock-format = %a, %b %d  %H:%M

About

Linux performance tweaks, GPU reclocking, lid suspend, and hardware fixes for the Samsung R429 (Arch Linux / GT218M).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages