Difference between revisions of "Samsung N140"

From ArchWiki
Jump to: navigation, search
(SATA exception, freeze, reset)
m (Binding Fn keys with xbindkeys: fixed template)
(40 intermediate revisions by 12 users not shown)
Line 1: Line 1:
[[Category:Samsung (English)]][[Category:Getting and installing Arch (English)]]
+
[[Category:Samsung]]
[[Category:HOWTOs (English)]]
+
{{out of date}}
 
This article provides information about installing and setting up Arch Linux on the Samsung N140. It is also relevant for the Samsung N130 which is identical except for the omission of Bluetooth and stereo speakers (and possibly a different battery capacity). There are versions of the N130 which include a 3G cellular modem, available from Vodafone and China Mobile. The [[Samsung NC10]] is similar but not identical to the N140, so you may or may not find useful information on that page.
 
This article provides information about installing and setting up Arch Linux on the Samsung N140. It is also relevant for the Samsung N130 which is identical except for the omission of Bluetooth and stereo speakers (and possibly a different battery capacity). There are versions of the N130 which include a 3G cellular modem, available from Vodafone and China Mobile. The [[Samsung NC10]] is similar but not identical to the N140, so you may or may not find useful information on that page.
  
=Issues=
+
=== BIOS issues ===
  
==BIOS Issues==
+
==== No backlight setting via ACPI ====
===SATA exception, freeze, reset===
+
  
{{Note|Patches addressing this problem have been included in the kernel since version <b>2.6.34rc1</b>. Please test and report.}}
+
A workaround is to use {{ic|setpci}} as shown below.
 
+
A BIOS problem causes a SATA hardreset shortly after boot. This is unresolved up to Samsung N140 BIOS 05CU, and Samsung N130 BIOS 06CM.
+
See
+
http://bugzilla.kernel.org/show_bug.cgi?id=14314, http://bugzilla.kernel.org/show_bug.cgi?id=13416,
+
http://lkml.indiana.edu/hypermail/linux/kernel/0908.2/02809.html
+
and
+
http://lkml.indiana.edu/hypermail/linux/kernel/0911.3/01604.html .
+
 
+
A summary of the status as currently understood:
+
 
+
About 5 minutes after boot or resume, the BIOS switches on some power saving features which were not enabled at boot. It enables additional (sleepier) processor C-states, and sends power management instructions to the HDD. It does these behind the operating system's back -- not using ACPI, which would be handled correctly by Linux. Instead the sudden change results in a SATA exception at the first disk access following the switch.
+
At that point the SATA driver resets the disk to resolve the problem. The result: the user sees a complete system freeze for about 30 seconds, after which operation of the machine continues normally. This can occur during the periodic fsck at boot if it is running at switch time. Either Samsung needs to be convinced to fix the BIOS, or the Linux kernel needs to be modified to behave more gracefully (Windows doesn't freeze noticeably if at all).
+
 
+
It has been reported that some OpenSUSE kernels [http://download.opensuse.org/repositories/Moblin:/Base/openSUSE_11.1/src/kernel-source-2.6.31.7-37.1.src.rpm] do not freeze and testing is progress in the [http://bbs.archlinux.org/viewtopic.php?id=86454 Arch Forums]. The patch [http://marc.info/?l=linux-ide&m=122724081603679&w=2 libata-ata_piix-clear-spurious-IRQ] has been reported to resolve the freezing problem (Hint: to look at the rpm use [http://www.archlinux.org/packages/extra/i686/rpmextract/ rpmextract], and then untar config.tar.bz2 and patches.*.tar.bz2). Until a final kernel patch is created this patch offers an interim solution to the problem and details are given below on how to include it in a custom kernel.
+
 
+
The N140 and N130 BIOSes have Phoenix FailSafe (you have been warned). It's not clear if the SATA problem has any relation to this.
+
 
+
Version 01CM of the N130 BIOS has been reported to not cause freezes, unlike all later ones which do.
+
 
+
Reports about the N130 02II and 02HI BIOSes (for the cellular modem versions) are not yet available.
+
 
+
This problem is hazardous for your filesystem so take precautions. For example use ext3 (not ext4) with option data=journal and install backup software.
+
 
+
===No backlight setting via ACPI===
+
 
+
A workaround is to use "setpci" as shown below.
+
  
 
Alternatively there is a kernel patch (unrelated to the SATA freeze problem) available which changes the backlight brightness using SMI instead of poking PCI config space. It provides a kernel module called "samsung-laptop". Interestingly we see from a version of this patch which is included in OpenSUSE 11.1 that a special (as yet unreleased?) BIOS for the N130 can be informed that the OS is Linux. The effect of this hasn't been published. Suggestion: run the samsung-laptop module with its debug parameter set to 1 to check whether it does anything at all.
 
Alternatively there is a kernel patch (unrelated to the SATA freeze problem) available which changes the backlight brightness using SMI instead of poking PCI config space. It provides a kernel module called "samsung-laptop". Interestingly we see from a version of this patch which is included in OpenSUSE 11.1 that a special (as yet unreleased?) BIOS for the N130 can be informed that the OS is Linux. The effect of this hasn't been published. Suggestion: run the samsung-laptop module with its debug parameter set to 1 to check whether it does anything at all.
  
===No key releases for some Fn keys===
+
==== No key releases for some Fn keys ====
  
 
Some of the Fn keys give key press events but no key releases. This problem was also seen on the NC10 and NC20. A workaround is given below. For kernels 2.6.32 and later this can be done from userspace.
 
Some of the Fn keys give key press events but no key releases. This problem was also seen on the NC10 and NC20. A workaround is given below. For kernels 2.6.32 and later this can be done from userspace.
  
==Software issues==
+
== Installation ==
 
+
===Frequent wireless disconnects===
+
With kernel 2.6.31 ath9k wifi exhibits frequent disconnects and reconnects. See http://bugzilla.kernel.org/show_bug.cgi?id=14267. Earlier and later kernels are better.
+
 
+
===Screen flickering and blackouts===
+
Some problems have been reported with [[KMS]] enabled for some 2.6.32 kernels. This problem is not specific to the Samsung N130/N140 -- it also affects others using Intel graphics drivers. Until the software is fixed a workaround is to[[Samsung_N140#Kernel_Mode_Setting|  disable powersave mode]]. It expected that this issue will be resolved in kernel 2.6.33.
+
 
+
=Installation=
+
  
 
Do the standard Arch installation procedure from the ARCH CD ISO using an external USB CDROM drive. Alternatively boot the Arch installer from a USB flash drive.
 
Do the standard Arch installation procedure from the ARCH CD ISO using an external USB CDROM drive. Alternatively boot the Arch installer from a USB flash drive.
 +
The standard Arch kernel is recommended.
  
For initial installation and testing you should use the standard Arch kernel.
+
A number of users have used a custom kernel for the following reasons:
 +
* to boot with a minimal kernel containing just the required modules and without an initial ramdisk
  
However a number of users are currently using a custom kernel for the following reasons:
+
=== Custom kernel without initrd ===
* to investigate/resolve the SATA problem described above
+
* to boot with a minimal kernel containing just the required modules and without an initial ramdisk.
+
  
Method A below compiles a minimal kernel without initrd. Method B stays as close as possible to the standard kernel.
+
An AUR package {{AUR|linux-n130}} is available. In this kernel most drivers are compiled in and there is no initial ramdisk. The drivers for cpu frequency scaling (acpi-cpufreq), wifi (ath9k, rtl8192e) and webcam (uvcvideo) are compiled as modules (i.e. '''not''' compiled in) so they can be inserted or removed from the kernel to enable or disable those features. Modules files in {{ic|/etc/modules.d}} can be used to enable or disable loading at boot.
 
+
==Custom kernel installation (A) ==
+
 
+
An AUR package [http://aur.archlinux.org/packages.php?ID=32042 kernel26-n130] has been created for this.
+
 
+
In this kernel most drivers are compiled in and there is no initial ramdisk. The drivers for cpu frequency scaling (acpi-cpufreq), wifi (ath9k, rtl8192e) and webcam (uvcvideo) are compiled as modules (i.e. '''not''' compiled in) so they can be inserted or removed from the kernel to enable or disable those features. MODULES in /etc/rc.conf can be used to enable or disable loading at boot.
+
  
 
Prepare the directory
 
Prepare the directory
 
  $ mkdir ~/builds
 
  $ mkdir ~/builds
  $ mkdir ~/builds/kernel26-n130
+
  $ mkdir ~/builds/linux-n130
  $ cd ~/builds/kernel26-n130
+
  $ cd ~/builds/linux-n130
 
Get the AUR package and untar it
 
Get the AUR package and untar it
  $ wget http://aur.archlinux.org/packages/kernel26-n130/kernel26-n130.tar.gz
+
  $ wget https://aur.archlinux.org/packages/li/linux-n130/linux-n130.tar.gz
  $ tar zxvf kernel26-n130.tar.gz
+
  $ tar zxvf linux-n130.tar.gz
  $ cd kernel26-n130
+
  $ cd linux-n130
  
At this point you can edit the PKGBUILD file if you need to (i) change the name or version number,
+
At this point you can edit the PKGBUILD file if you need to change the name or version number, change options or add additional patches.
(ii) change options or (iii) add additional patches. We will change one option.
+
  
Edit PKGBUILD and make sure _USE_LIBATA_PATCH is set to 1. This patch prevents the SATA problem described above.
+
Check the PKGBUILD. Don't experiment with the CK patchset at this point:
  _USE_LIBATA_PATCH=1
+
  _USE_CK_PATCHSET=0
 
Compile it (this will take some time...):
 
Compile it (this will take some time...):
 
  $ makepkg -s
 
  $ makepkg -s
Install the created .pkg.tar.gz file in the normal pacman way
+
[[pacman|Install]] the kernel from the new .pkg.tar.xz file.
$ sudo pacman -U kernel26-n130-2.6.32.1-3.pkg.tar.gz  (or whatever the created .pkg.tar.gz file is called)
+
 
   
 
   
Then, assuming you are using [[GRUB]], insert a new item in your {{Filename|/boot/grub/menu.lst}} to boot the new kernel "kernel26-N130". Note that no initrd line is necessary for this kernel.
+
Then insert a new item in your boot loader configuration file to boot the new kernel "linux-N130". Note that no initrd line is necessary for this kernel.
<pre>
+
# (0) Arch Linux N130
+
title  Arch Linux Custom N130 Kernel
+
root  (hd0,YOURROOT-1)
+
kernel /boot/vmlinuz26-N130 root=/dev/sdaYOURROOT resume=/dev/sdaYOURSWAP ro quiet
+
</pre>
+
And reboot. If you have problems the standard Arch kernel is still installed and selectable from the GRUB menu.
+
  
For [[GRUB2]] {{Filename|/boot/grub/grub.cfg}} the syntax looks like this (sda1 = your root partition; sda2 = your swap partition)
+
For [[GRUB]] edit {{ic|/boot/grub/grub.cfg}}. The syntax looks like this (sda1 = your root partition; sda2 = your swap partition):
  
<pre>
+
menuentry "Arch Linux N130" {
menuentry "Arch Linux N130" {
+
  set root=(hd0,1)
        set root=(hd0,1)
+
  linux /boot/vmlinuz-N130 root=/dev/sda1 resume=/dev/sda2 ro quiet  
        linux /boot/vmlinuz26-N130 root=/dev/sda1 resume=/dev/sda2 ro quiet  
+
}
}
+
</pre>
+
  
{{Note|The kernel26-n130 has the i915 module compiled in with KMS enabled by default. There is no need to set up KMS as described below unless you wish to disable it.}}
+
For [[GRUB Legacy]] edit {{ic|/boot/grub/menu.lst}}. The syntax looks like this:
  
==Custom kernel installation (B)==
+
# (3) Arch Linux N130
 +
title  Arch Linux Custom N130 Kernel
 +
root  (hd0,YOURROOT-1)
 +
kernel /boot/vmlinuz-N130 root=/dev/sdaYOURROOT resume=/dev/sdaYOURSWAP ro quiet
  
An alternative approach is to compile a custom kernel which is as close as possible to the standard Arch kernel. The only required change is to apply the patch
+
Reboot. If you have problems the standard Arch kernel is still installed and selectable from the GRUB menu.
[http://aur.archlinux.org/packages/kernel26-n130/kernel26-n130/libata-ata_piix-clear-spurious-IRQ libata-ata_piix-clear-spurious-IRQ] to address the SATA problem discussed above.
+
{{Note|The linux-n130 has the i915 module compiled in with KMS enabled by default. There is no need to set up KMS as described below unless you wish to disable it.}}
* get the package files for the standard Arch kernel from [http://repos.archlinux.org/wsvn/packages/kernel26/repos/core-i686/ core-i686] or [[ABS]] or (for the testing kernel) from [http://repos.archlinux.org/wsvn/packages/kernel26/repos/testing-i686/ testing-i686] or [http://aur.archlinux.org/packages.php?ID=17189 AUR/kernel26-source]
+
* in PKGBUILD change "pkgname=kernel26" to "pkgname=kernel26-n140"
+
* add an entry for the patch file to files=() and md5sums=() and a "patch" command just after the -ARCH patches line:
+
<pre>--- PKGBUILD
+
+++ PKGBUILD.new
+
@@ -1,8 +1,8 @@
+
# $Id: PKGBUILD 69948 2010-02-23 18:46:27Z tpowa $
+
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+
# Maintainer: Thomas Baechler <thomas@archlinux.org>
+
-pkgbase="kernel26"
+
-pkgname=('kernel26' 'kernel26-firmware' 'kernel26-headers') # Build stock -ARCH kernel
+
+pkgbase="kernel26-n140"
+
+pkgname=('kernel26-n140' 'kernel26-n140-firmware' 'kernel26-n140-headers') # Build stock -ARCH kernel
+
# pkgname=kernel26-custom      # Build kernel with a different name
+
_kernelname=${pkgname#kernel26}
+
_basekernel=2.6.32
+
@@ -17,12 +17,14 @@ source=(ftp://ftp.kernel.org/pub/linux/k
+
        # the main kernel config files
+
        config config.x86_64
+
        # standard config files for mkinitcpio ramdisk
+
-        kernel26.preset)
+
+        kernel26.preset
+
+        libata-ata_piix-clear-spurious-IRQ)
+
md5sums=('260551284ac224c3a43c4adac7df4879'
+
          'a0a10c99eead1fa8bc05c03f7f18db36'
+
          'c114c5d89622a93165bb948d62d966b5'
+
          '5c91374d56f115ba4324978d5b002711'
+
-        '25584700a0a679542929c4bed31433b6')
+
+        '25584700a0a679542929c4bed31433b6'
+
+        'd679ed71c2d6f367c7b1f65e82d817fa')
+
+
build() {
+
  cd ${srcdir}/linux-$_basekernel
+
@@ -30,6 +32,9 @@ build() {
+
  # See http://projects.archlinux.org/linux-2.6-ARCH.git/
+
  patch -Np1 -i ${srcdir}/${_patchname} || return 1
+
+
+  # Patch for Samsung N130/N140
+
+  patch -Np1 -i ${srcdir}/libata-ata_piix-clear-spurious-IRQ  || return 1
+
+
+
  if [ "$CARCH" = "x86_64" ]; then
+
    cat ../config.x86_64 >./.config
+
  else
+
@@ -57,7 +62,7 @@ build() {
+
  make bzImage modules || return 1
+
}
+
+
-package_kernel26() {
+
+package_kernel26-n140() {
+
  pkgdesc="The Linux Kernel and modules"
+
  groups=('base')
+
  backup=(etc/mkinitcpio.d/${pkgname}.preset)
+
@@ -104,7 +109,7 @@ package_kernel26() {
+
  rm -rf ${pkgdir}/lib/firmware
+
}
+
+
-package_kernel26-headers() {
+
+package_kernel26-n140-headers() {
+
  pkgdesc="Header files and scripts for building modules for kernel26"
+
  mkdir -p ${pkgdir}/lib/modules/${_kernver}
+
  cd ${pkgdir}/lib/modules/${_kernver}
+
@@ -204,7 +209,7 @@ package_kernel26-headers() {
+
  rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
+
}
+
+
-package_kernel26-firmware() {
+
+package_kernel26-n140-firmware() {
+
  pkgdesc="The included firmware files of the Linux Kernel"
+
  groups=('base')
+
  
</pre>
+
== Configure your installation ==
  
* compile, install it and add new section in {{Filename|/boot/grub/menu.lst}}, identical to the standard entry but with kernel26 replaced by kernel26-n140. Reboot.
+
=== Ethernet ===
 
+
=Configure your installation=
+
 
+
==Ethernet==
+
  
 
RTL8101e/8102e fast ethernet. Works out of the box.
 
RTL8101e/8102e fast ethernet. Works out of the box.
  
==Wifi==
+
=== Wifi ===
  
 
The supplied wifi device is either an Atheros AR9285 (PCI ID = 168c:002b) (European markets) or a Realtek RTL8192E (US and UK markets).
 
The supplied wifi device is either an Atheros AR9285 (PCI ID = 168c:002b) (European markets) or a Realtek RTL8192E (US and UK markets).
  
===Atheros AR9285===
+
==== Atheros AR9285 ====
 +
 
 
  02:00.0 Network controller [0280]: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) [168c:002b] (rev 01)
 
  02:00.0 Network controller [0280]: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) [168c:002b] (rev 01)
  
The kernel module for this device is "ath9k" (AR9285 is supported since 2.6.29).
+
The kernel module for this device is "ath9k". Kernels 2.6.32 release candidates and later seem to work fine.
  
Kernels 2.6.30 and 2.6.32-rcN release candidates seem to work fine.
+
==== Realtek RTL8192E ====
However with kernel 2.6.31 the wireless connection exhibits frequent
+
disconnects and reattachments,
+
resulting in periods of bad througput and periods of good throughput.
+
There is no sign of any patches for 2.6.31.y to fix this regression.
+
Complain to linux-wireless@vger.kernel.org. To get it working either
+
downgrade to 2.6.30 or preferably upgrade to 2.6.32.
+
  
The following patch was included in 2.6.32 just before the final release: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=54ab040d24904d1fa2c0a6a27936b7c56a4efb24 . It disables PS (power saving) mode by default, since this mode was found to have problems. See here http://bugzilla.kernel.org/show_bug.cgi?id=14267 . PS mode can also be disabled with the following command, which can be placed in {{Filename|/etc/rc.local}}:
+
===== Open source driver =====
iwconfig wlan0 power off
+
  
===Realtek RTL8192E===
+
The native Linux driver for this wireless device is still in preparation, but it is available as a kernel module "rtl8192e" in "staging" -- i.e. in preparation for inclusion in the kernel and available to try out, but likely to still have some problems. It has been reported as working [https://bbs.archlinux.org/viewtopic.php?id=86454&p=6]. {{Pkg|linux-firmware}} package is required. See  
====Open source driver====
+
http://lkml.org/lkml/2009/12/15/410.
The native Linux driver for this wireless device is still in preparation, but it is available as a kernel module "rtl8192e" in "staging" -- i.e. in preparation for inclusion in the kernel and available to try out, but likely to still have some problems. It has been reported as working [http://bbs.archlinux.org/viewtopic.php?id=86454&p=6]. Firmware is required. See  
+
http://lkml.org/lkml/2009/12/15/410
+
and
+
http://git.kernel.org/?p=linux/kernel/git/gregkh/firmware.git;a=summary .  
+
  
Install the firmware like this:
+
On rebooting, the kernel messages (visible with "dmesg") should now indicate that rtl819xE finds the firmware for loading into the device.
$ sudo pacman -S git
+
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/firmware.git
+
$ sudo cp -a firmware/RTL8192E /lib/firmware
+
$ rm -fr firmware
+
  
Alternatively use a web browser on another computer to save
+
Note: [[wicd]] may cause excessive dropped connections with this driver, while [[NetworkManager]] appears to work better.
[http://git.kernel.org/?p=linux/kernel/git/gregkh/firmware.git;a=snapshot;h=407f318edf3766d63bea50adcf2dd42d55bf0891;sf=tgz firmware-407f318.tar.gz]
+
and transfer the file (e.g. on a USB flash drive) to the Samsung N130/140. Then
+
$ tar zxvf firmware-407f318.tar.gz
+
$ sudo mkdir /lib/firmware/RTL8192E
+
$ sudo cp -a firmware-407f318/*.img /lib/firmware/RTL8192E
+
  
Then
+
===== Ndiswrapper =====
$ md5sum /lib/firmware/RTL8192E/*
+
should return
+
bb9f64de23939ec247d15dfbeb0ed91e  /lib/firmware/RTL8192E/boot.img
+
db83def0338769de1d4658a00b6f738d  /lib/firmware/RTL8192E/data.img
+
0034020e5a32571f486849aa90a389a7  /lib/firmware/RTL8192E/main.img
+
 
+
On rebooting, the kernel messages (visible with "dmesg") should now indicate that rtl819xE finds the firmware for loading into the device.
+
  
====Ndiswrapper====
 
 
It has been reported as working with [[Wireless_Setup#ndiswrapper|ndiswrapper]] which makes use of the closed source Windows driver under Linux.
 
It has been reported as working with [[Wireless_Setup#ndiswrapper|ndiswrapper]] which makes use of the closed source Windows driver under Linux.
  
==Cellular 3G Modem==
+
=== Cellular 3G Modem ===
  
 
''Specifications required''
 
''Specifications required''
  
==Graphics Adapter==
+
=== Graphics Adapter ===
  
 
The video controller is an Intel chipset that works with the xf86-video-intel driver.
 
The video controller is an Intel chipset that works with the xf86-video-intel driver.
Line 254: Line 105:
 
  00:02.1 Display controller [0380]: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller [8086:27a6] (rev 03)
 
  00:02.1 Display controller [0380]: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller [8086:27a6] (rev 03)
  
===Kernel Mode Setting===
+
==== Kernel Mode Setting ====
  
 
See also [[Intel#KMS_.28Kernel_Mode_Setting.29]].
 
See also [[Intel#KMS_.28Kernel_Mode_Setting.29]].
Line 263: Line 114:
 
from suspend-to-RAM or suspend-to-disk.
 
from suspend-to-RAM or suspend-to-disk.
  
{{Note|If you encounter screen flickering or blackouts with KMS enabled, try setting '''i915.powersave&#61;0''' as a kernel boot option.}}
+
{{Note|
 +
* If you encounter screen flickering or blackouts with KMS enabled, try setting '''i915.powersave&#61;0''' as a kernel boot option
 +
* Since version 2.10.0 of {{ic|xf86-video-intel}}, support for UMS has been removed from the intel driver. This means that KMS is a requirement now
 +
}}
  
{{Note|Since version 2.10.0 of xf86-video-intel, support for UMS has been removed from the intel driver. This means that KMS is a requirement now.}}
+
===== Method A =====
  
====Method A====
+
If you are using a kernel with no inital ramdisk and you can simply add the required options to the GRUB kernel line:
  
If you are using a kernel with no inital ramdisk and you can simply add the required options to the GRUB kernel line:h
+
  # (3) Arch Linux N130
 
+
  # (0) Arch Linux N130
+
 
  title  Arch Linux Custom N130 Kernel
 
  title  Arch Linux Custom N130 Kernel
 
  root  (hd0,YOURROOT-1)
 
  root  (hd0,YOURROOT-1)
 
  kernel /boot/vmlinuz26-N130 root=/dev/sdaYOURROOT resume=/dev/sdaYOURSWAP ro quiet '''i915.powersave=0 i915.modeset=1'''
 
  kernel /boot/vmlinuz26-N130 root=/dev/sdaYOURROOT resume=/dev/sdaYOURSWAP ro quiet '''i915.powersave=0 i915.modeset=1'''
  
====Method B====
+
===== Method B =====
  
 
If you are using an initial ramdisk (either the standard kernel or the custom kernel method B above) then do the following:
 
If you are using an initial ramdisk (either the standard kernel or the custom kernel method B above) then do the following:
  
Edit {{Filename|/etc/modprobe.d/modprobe.conf}}:
+
Edit {{ic|/etc/modprobe.d/modprobe.conf}}:
        options i915 powersave=0  
+
options i915 powersave=0  
        options i915 modeset=1
+
options i915 modeset=1
Edit {{Filename|/etc/mkinitcpio.conf}}:
+
Edit {{ic|/etc/mkinitcpio.conf}}:
        MODULES="intel_agp i915"
+
MODULES="intel_agp i915"
        FILES="/etc/modprobe.d/modprobe.conf"
+
FILES="/etc/modprobe.d/modprobe.conf"
Put keymap early in {{Filename|/etc/mkinitcpio.conf}} HOOKS.
+
Put keymap early in {{ic|/etc/mkinitcpio.conf}} HOOKS.
 
Regenerate the init ramdisk for the kernel(s) you are running:
 
Regenerate the init ramdisk for the kernel(s) you are running:
        $ mkinitcpio -p kernel26
+
$ mkinitcpio -p linux
        or  
+
or
        $ mkinitcpio -p kernel26-n140
+
$ mkinitcpio -p linux-n140
Remove any vga= or video= from grub {{Filename|/boot/grub/menu.lst}} kernel line, and reboot.
+
Remove any vga= or video= from grub {{ic|/boot/grub/menu.lst}} kernel line, and reboot.
 
+
====KMS with KDE====
+
  
With earlier versions of KDE, on logout it returned to the F1 real console instead of to [[KDM]].
+
==== Backlight Brightness ====
Uncommenting this entry in {{Filename|/usr/share/config/kdm/kdmrc}} solved the problem:
+
  TerminateServer=true
+
This setting is now the default.
+
  
===Backlight Brightness===
 
 
xbacklight does not work currently.
 
xbacklight does not work currently.
 
However the brightness can be set with the following command
 
However the brightness can be set with the following command
Line 315: Line 161:
 
Obtain sudo permission for user to use those commands with visudo.
 
Obtain sudo permission for user to use those commands with visudo.
  
  #!/bin/bash
+
#!/bin/bash
  # increase/decrease/set/get the backlight brightness (range 0-255) by 16
+
# increase/decrease/set/get the backlight brightness (range 0-255) by 16
  #
+
#
  #get current brightness in hex and convert to decimal
+
#get current brightness in hex and convert to decimal
  var1=`setpci -s 00:02.1 F4.B`
+
var1=$(setpci -s 00:02.1 F4.B)
  var1d=$((0x$var1))
+
var1d=$((0x$var1))
  case "$1" in
+
case "$1" in
        up)
+
      up)
                #calculate new brightness
+
              #calculate new brightness
                var2=`echo "ibase=10; obase=16; a=($var1d+16);if (a<255) print a else print 255" | bc`
+
              var2=$(echo "ibase=10; obase=16; a=($var1d+16);if (a<255) print a else print 255" | bc)
                echo "$0: increasing brightness from 0x$var1 to 0x$var2"
+
              echo "$0: increasing brightness from 0x$var1 to 0x$var2"
                setpci -s 00:02.1 F4.B=$var2
+
              setpci -s 00:02.1 F4.B=$var2
                ;;
+
              ;;
        down)
+
      down)
                #calculate new brightness
+
              #calculate new brightness
                var2=`echo "ibase=10; obase=16; a=($var1d-16);if (a>15) print a else print 15" | bc`
+
              var2=$(echo "ibase=10; obase=16; a=($var1d-16);if (a>15) print a else print 15" | bc)
                echo "$0: decreasing brightness from 0x$var1 to 0x$var2"
+
              echo "$0: decreasing brightness from 0x$var1 to 0x$var2"
                setpci -s 00:02.1 F4.B=$var2
+
              setpci -s 00:02.1 F4.B=$var2
                ;;
+
              ;;
        set)
+
      set)
                #n.b. this does allow "set 0" i.e. backlight off
+
              #n.b. this does allow "set 0" i.e. backlight off
                echo "$0: setting brightness to 0x$2"
+
              echo "$0: setting brightness to 0x$2"
                setpci -s 00:02.1 F4.B=$2
+
              setpci -s 00:02.1 F4.B=$2
                ;;
+
              ;;
        get)
+
      get)
                echo "$0: current brightness is 0x$var1"
+
              echo "$0: current brightness is 0x$var1"
                ;;
+
              ;;
        toggle)
+
      toggle)
                if [ $var1d -eq 0 ] ; then
+
              if [ $var1d -eq 0 ] ; then
                        echo "toggling up"
+
                      echo "toggling up"
                        setpci -s 00:02.1 F4.B=FF
+
                      setpci -s 00:02.1 F4.B=FF
                else
+
              else
                        echo "toggling down"
+
                      echo "toggling down"
                        setpci -s 00:02.1 F4.B=0
+
                      setpci -s 00:02.1 F4.B=0
                fi
+
              fi
                ;;
+
              ;;
        *)
+
      *)
                echo "usage: $0 {up|down|set <val>|get|toggle}"
+
              echo "usage: $0 {up|down|set <val>|get|toggle}"
                ;;
+
              ;;
  esac
+
esac
  exit 0
+
exit 0
  
===External VGA===
+
==== External VGA ====
  
 
External VGA works out of the box with xrandr / krandrtray. Tested at 1920x1080 resolution.
 
External VGA works out of the box with xrandr / krandrtray. Tested at 1920x1080 resolution.
  
==Audio==
+
=== Audio ===
  
 
The audio device is an Intel HD.
 
The audio device is an Intel HD.
 
  00:1b.0 Audio device [0403]: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller [8086:27d8] (rev 02)
 
  00:1b.0 Audio device [0403]: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller [8086:27d8] (rev 02)
  
==Suspend and Hibernate==
+
=== Suspend and hibernate ===
  
Suspend to RAM with pm-suspend works.
+
Suspend to RAM with {{ic|pm-suspend}} works.
  
 
It is most useful to trigger suspends using [[acpid]].
 
It is most useful to trigger suspends using [[acpid]].
  
To catch the "sleep" function key, edit {{Filename|/etc/acpi/handler.sh}} so that the button/sleep) event calls /usr/sbin/pm-suspend (instead of "echo mem > /sys/power/state" which may leave wifi down after resume):
+
To catch the "sleep" function key, edit {{ic|/etc/acpi/handler.sh}} so that the button/sleep) event calls /usr/sbin/pm-suspend (instead of "echo mem > /sys/power/state" which may leave wifi down after resume):
<pre>
+
 
    button/sleep)
+
button/sleep)
        case "$2" in
+
  case "$2" in
            SLPB)   logger "Sleep button pressed, suspending to RAM"
+
  SLPB) logger "Sleep button pressed, suspending to RAM"
                    /usr/sbin/pm-suspend
+
    /usr/sbin/pm-suspend
                    ;;
+
    ;;
            *)     logger "ACPI action undefined: $2"
+
  *)   logger "ACPI action undefined: $2"
                    ;;
+
    ;;
        esac
+
  esac
        ;;
+
;;
</pre>
+
 
 
When catching the lid closure, the button/lid event will be seen twice -- once on suspend
 
When catching the lid closure, the button/lid event will be seen twice -- once on suspend
 
and again on resume. So use the lid state to distinguish between these so that pm-suspend
 
and again on resume. So use the lid state to distinguish between these so that pm-suspend
is not triggered twice:
+
is not triggered twice.
  
Enter the following lines in {{Filename|/etc/acpi/handler.sh}}:
+
Enter the following lines in {{ic|/etc/acpi/handler.sh}}:
    button/lid)
+
button/lid)
        if [ `/bin/awk '{print $2}' /proc/acpi/button/lid/LID0/state` = closed ]; then
+
  if [ $(/bin/awk '{print $2}' /proc/acpi/button/lid/LID0/state) = closed ]; then
            /usr/sbin/pm-suspend
+
    /usr/sbin/pm-suspend
        fi
+
  fi
        ;;
+
;;
  
Hibernate works correctly (see [[pm-utils|pm-utils article]]).
+
Hibernate works correctly. See [[pm-utils]].
  
 
If you are a KDE4 user you can take advantage of powerdevil (included in kdemod-core/kdemod-kdebase-workspace since release 4.2) to manipulate the screen brightness, cpu scaling and hibernate. Suspend
 
If you are a KDE4 user you can take advantage of powerdevil (included in kdemod-core/kdemod-kdebase-workspace since release 4.2) to manipulate the screen brightness, cpu scaling and hibernate. Suspend
 
from KDE works too, but if you are using handler.sh to suspend on the button/lid and button/sleep acpi
 
from KDE works too, but if you are using handler.sh to suspend on the button/lid and button/sleep acpi
 
events, then KDE only needs to lock the screen. Note that cpu scaling requires acpi-cpufreq module
 
events, then KDE only needs to lock the screen. Note that cpu scaling requires acpi-cpufreq module
to be loaded in MODULES in /etc/rc.conf.
+
to be loaded at boot.
  
==Fn Keys==
+
=== Fn keys ===
  
Firstly edit {{Filename|/usr/share/hal/fdi/information/10freedesktop/30-keymap-misc.fdi}}
+
Firstly edit {{ic|/usr/share/hal/fdi/information/10freedesktop/30-keymap-misc.fdi}}
 
and insert N140 into the list where you see NC10 already.
 
and insert N140 into the list where you see NC10 already.
  
Line 414: Line 260:
 
This is a BIOS issue which was also found on the Samsung NC10. A workaround quirk was put in the
 
This is a BIOS issue which was also found on the Samsung NC10. A workaround quirk was put in the
 
kernel in atkbd.c for the NC10. Patching this routine to apply the same
 
kernel in atkbd.c for the NC10. Patching this routine to apply the same
quirk also works for the N140, and is recommended for 2.6.31 and earlier.
+
quirk also works for the N140.
However for 2.6.32 and later (i.e. any current Arch installation) there is a much simpler solution because this quirk can now be applied from user space. Simply edit {{Filename|/etc/rc.local}} and add the following line:
+
There is a much simpler solution because this quirk can now be applied from user space. Simply create a systemd tmpfile with the following line:
  
  echo 130,131,132,134,136,137,179,247,249 > /sys/devices/platform/i8042/serio0/force_release
+
{{hc|/etc/tmpfiles.d/local.conf|
 +
w /sys/devices/platform/i8042/serio0/force_release - - - - 130,131,132,134,136,137,179,247,249
 +
}}
  
After this is run, doing "showkey" in a real console will show key presses and releases.
+
After this is run, doing {{ic|showkey}} in a real console will show key presses and releases.
  
===Binding Fn keys with xbindkeys===
+
==== Binding Fn keys with xbindkeys ====
  
 
The following has been tested with KDE, but should also work for other DEs.
 
The following has been tested with KDE, but should also work for other DEs.
  
To bind the Fn keys to action, read [[Extra_Keyboard_Keys#The_quick_way]] and also [[Extra_Keyboard_Keys_in_Xorg#Using_your_Desktop_Environment_tools|Extra Keyboard Keys in Xorg]].  
+
To bind the Fn keys to action, read [[Extra Keyboard Keys]].
  
The suspend key (Fn+ESC) and disable touchpad (Fn+F10) keys, numlock, scroll lock,
+
The suspend key {{ic|Fn+ESC}} and disable touchpad {{ic|Fn+F10}} keys, numlock, scroll lock,
 
volume controls and mute work out of the box.
 
volume controls and mute work out of the box.
  
Note, that suspend key is handled in {{Filename|/etc/acpi/handler.sh}} (see "button/sleep" case entry) as  
+
Note, that suspend key is handled in {{ic|/etc/acpi/handler.sh}} (see "button/sleep" case entry) as  
 
shown above.
 
shown above.
  
1) install ''xbindkeys''
+
# Install {{Pkg|xbindkeys}}
  pacman -S xbindkeys
+
# Check the key values with {{ic|xbindkeys -mk}}
 +
# Edit .xbindkeysrc {{bc|<nowiki>
 +
"sudo /sbin/backlight up"
 +
    m:0x0 + c:233
 +
"sudo /sbin/backlight down"
 +
    m:0x0 + c:232
 +
"/home/user/bin/systeminfo_battery"
 +
    m:0x0 + c:244
 +
"sudo /sbin/backlight toggle"
 +
    m:0x0 + c:156
 +
"/home/user/bin/systeminfo_disk"
 +
    m:0x0 + c:157
 +
"/home/user/bin/systeminfo_cpu"
 +
    m:0x0 + c:210
 +
"/home/user/bin/systeminfo_wifi"
 +
    m:0x0 + c:246
 +
</nowiki>}}
 +
# Run {{ic|xbindkeys}}, and try it out
  
2) check the key values with
+
For KDE4 put a link to {{ic|/usr/bin/xbindkeys}} in {{ic|~/.kde4/Autostart}}:
  xbindkeys -mk
+
 
+
3) edit .xbindkeysrc
+
 
+
  "sudo /sbin/backlight up"
+
      m:0x0 + c:233
+
  "sudo /sbin/backlight down"
+
      m:0x0 + c:232
+
  "/home/user/bin/systeminfo_battery"
+
      m:0x0 + c:244
+
  "sudo /sbin/backlight toggle"
+
      m:0x0 + c:156
+
  "/home/user/bin/systeminfo_disk"
+
      m:0x0 + c:157
+
  "/home/user/bin/systeminfo_cpu"
+
      m:0x0 + c:210
+
  "/home/user/bin/systeminfo_wifi"
+
      m:0x0 + c:246
+
 
+
4) run xbindkeys, and try it out
+
xbindkeys
+
 
+
For KDE4 put a link to {{Filename|/usr/bin/xbindkeys}} in {{Filename|~/.kde4/Autostart}}
+
 
   ln -s /usr/bin/xbindkeys ~/.kde4/Autostart/xbindkeys.link
 
   ln -s /usr/bin/xbindkeys ~/.kde4/Autostart/xbindkeys.link
  
The Fn+F3 ("Euro") key: here Samsung implemented what has been called
+
The {{ic|Fn+F3}} ("Euro") key: here Samsung implemented what has been called
an entertaingly hilarious hack:
+
an [http://lists.freedesktop.org/archives/hal/2009-August/013536.html entertaingly hilarious hack].
http://lists.freedesktop.org/archives/hal/2009-August/013536.html
+
Fortunately some eurozone models have a real Euro key as well.
ROFL! Does anyone know a practical use for this key?
+
Fortunately some (eurozone) models have a real Euro key as well.
+
  
===Binding Fn keys in Openbox===
+
==== Binding Fn keys in Openbox ====
  
 
In [[Openbox]] one can use the internal keybind setup instead of xbindkeys.
 
In [[Openbox]] one can use the internal keybind setup instead of xbindkeys.
 
Here is an excerpt from rc.xml:
 
Here is an excerpt from rc.xml:
  
<pre>
 
 
     <keybind key="XF86Battery">
 
     <keybind key="XF86Battery">
 
       <action name="Execute">
 
       <action name="Execute">
Line 540: Line 379:
 
       </action>
 
       </action>
 
     </keybind>
 
     </keybind>
</pre>
 
  
==Saving Power==
+
=== Saving Power ===
Read [[Laptop#Power_Management]]
+
  
Read [[Lightweight Applications]]
+
Read [[Laptop#Power_Management]].
  
 
{{Note|Caution is advised here with hdparm settings because the issue with SATA freezing is
 
{{Note|Caution is advised here with hdparm settings because the issue with SATA freezing is
Line 554: Line 391:
 
Obviously the battery life depends on battery capacity as well as power consumption.
 
Obviously the battery life depends on battery capacity as well as power consumption.
 
The supplied battery varies in different markets. This list is a guideline only. Do not rely on this information before purchase -- check with YOUR vendor and update this wiki if it is incorrect:
 
The supplied battery varies in different markets. This list is a guideline only. Do not rely on this information before purchase -- check with YOUR vendor and update this wiki if it is incorrect:
<pre>
 
Voltage 11.1V
 
  
N130            = 4000mAh [44Wh] (most markets), 5200mAh [57Wh] (Sweden)
+
Voltage 11.1V
N130 (Vodafone)  = ? [?] (Spain)
+
 
N130 (CMCC)      = ? [?] (China)
+
N130            = 4000mAh [44Wh] (most markets), 5200mAh [57Wh] (Sweden)
N140            = 5200mAh [57Wh] (US, Germany, France, Sweden), 5900mAh [65Wh] (UK)
+
N130 (Vodafone)  = ? [?] (Spain)
Extended battery = 7800mAh [86Wh]
+
N130 (CMCC)      = ? [?] (China)
</pre>
+
N140            = 5200mAh [57Wh] (US, Germany, France, Sweden), 5900mAh [65Wh] (UK)
Install powertop which is a very useful tool for measuring and tuning power consumption, and htop which is useful for checking the CPU and memory usage of running processes
+
Extended battery = 7800mAh [86Wh]
# pacman -S powertop htop
+
 
 +
Install {{Pkg|powertop}} which is a [[powertop|very useful tool]] for measuring and tuning power consumption.
 +
 
 +
Enable CPU frequency scaling (P-states) by loading the driver module {{ic|acpi-cpufreq}}. This is most conveniently done dropping a namesake file in {{ic|/etc/modules-load.d}}:
 +
{{hc|/etc/modules-load.d/acpi-cpufreq.conf|
 +
acpi-cpufreq
 +
}}
  
Enable CPU frequency scaling (P-states) by loading the driver module "acpi-cpufreq". This is most conveniently done in {{Filename|/etc/rc.conf}}:
+
Select the CPU frequency governor by adding the following lines to a systemd tmpfile:
MODULES=(acpi-cpufreq ... )
+
{{hc|/etc/tmpfiles.d/local.conf|
Select the CPU frequency governor by adding the following lines to {{Filename|/etc/rc.local}}:
+
  w /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - - - - ondemand
  # Set the CPU frequency scaling governor for each core
+
  w /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor - - - - ondemand
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+
}}
  echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
+
  
{{Note|Contrary to the advice in many places "hdparm -B 255 /dev/sda" does NOT necessarily turn off advanced power management. What happens depends on the disk model. With the Samsung HM160HI disk 255 results in very frequent spindowns}}
+
{{Note|Contrary to the advice in many places {{ic|hdparm -B 255 /dev/sda}} does NOT necessarily turn off advanced power management. What happens depends on the disk model. With the Samsung HM160HI disk 255 results in very frequent spindowns}}

Revision as of 15:07, 30 October 2013

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Samsung N140#)

This article provides information about installing and setting up Arch Linux on the Samsung N140. It is also relevant for the Samsung N130 which is identical except for the omission of Bluetooth and stereo speakers (and possibly a different battery capacity). There are versions of the N130 which include a 3G cellular modem, available from Vodafone and China Mobile. The Samsung NC10 is similar but not identical to the N140, so you may or may not find useful information on that page.

BIOS issues

No backlight setting via ACPI

A workaround is to use setpci as shown below.

Alternatively there is a kernel patch (unrelated to the SATA freeze problem) available which changes the backlight brightness using SMI instead of poking PCI config space. It provides a kernel module called "samsung-laptop". Interestingly we see from a version of this patch which is included in OpenSUSE 11.1 that a special (as yet unreleased?) BIOS for the N130 can be informed that the OS is Linux. The effect of this hasn't been published. Suggestion: run the samsung-laptop module with its debug parameter set to 1 to check whether it does anything at all.

No key releases for some Fn keys

Some of the Fn keys give key press events but no key releases. This problem was also seen on the NC10 and NC20. A workaround is given below. For kernels 2.6.32 and later this can be done from userspace.

Installation

Do the standard Arch installation procedure from the ARCH CD ISO using an external USB CDROM drive. Alternatively boot the Arch installer from a USB flash drive. The standard Arch kernel is recommended.

A number of users have used a custom kernel for the following reasons:

  • to boot with a minimal kernel containing just the required modules and without an initial ramdisk

Custom kernel without initrd

An AUR package linux-n130AUR is available. In this kernel most drivers are compiled in and there is no initial ramdisk. The drivers for cpu frequency scaling (acpi-cpufreq), wifi (ath9k, rtl8192e) and webcam (uvcvideo) are compiled as modules (i.e. not compiled in) so they can be inserted or removed from the kernel to enable or disable those features. Modules files in /etc/modules.d can be used to enable or disable loading at boot.

Prepare the directory

$ mkdir ~/builds
$ mkdir ~/builds/linux-n130
$ cd ~/builds/linux-n130

Get the AUR package and untar it

$ wget https://aur.archlinux.org/packages/li/linux-n130/linux-n130.tar.gz
$ tar zxvf linux-n130.tar.gz
$ cd linux-n130

At this point you can edit the PKGBUILD file if you need to change the name or version number, change options or add additional patches.

Check the PKGBUILD. Don't experiment with the CK patchset at this point:

_USE_CK_PATCHSET=0

Compile it (this will take some time...):

$ makepkg -s

Install the kernel from the new .pkg.tar.xz file.

Then insert a new item in your boot loader configuration file to boot the new kernel "linux-N130". Note that no initrd line is necessary for this kernel.

For GRUB edit /boot/grub/grub.cfg. The syntax looks like this (sda1 = your root partition; sda2 = your swap partition):

menuentry "Arch Linux N130" {
 set root=(hd0,1)
 linux /boot/vmlinuz-N130 root=/dev/sda1 resume=/dev/sda2 ro quiet 
}

For GRUB Legacy edit /boot/grub/menu.lst. The syntax looks like this:

# (3) Arch Linux N130
title  Arch Linux Custom N130 Kernel
root   (hd0,YOURROOT-1)
kernel /boot/vmlinuz-N130 root=/dev/sdaYOURROOT resume=/dev/sdaYOURSWAP ro quiet

Reboot. If you have problems the standard Arch kernel is still installed and selectable from the GRUB menu.

Note: The linux-n130 has the i915 module compiled in with KMS enabled by default. There is no need to set up KMS as described below unless you wish to disable it.

Configure your installation

Ethernet

RTL8101e/8102e fast ethernet. Works out of the box.

Wifi

The supplied wifi device is either an Atheros AR9285 (PCI ID = 168c:002b) (European markets) or a Realtek RTL8192E (US and UK markets).

Atheros AR9285

02:00.0 Network controller [0280]: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) [168c:002b] (rev 01)

The kernel module for this device is "ath9k". Kernels 2.6.32 release candidates and later seem to work fine.

Realtek RTL8192E

Open source driver

The native Linux driver for this wireless device is still in preparation, but it is available as a kernel module "rtl8192e" in "staging" -- i.e. in preparation for inclusion in the kernel and available to try out, but likely to still have some problems. It has been reported as working [1]. linux-firmware package is required. See http://lkml.org/lkml/2009/12/15/410.

On rebooting, the kernel messages (visible with "dmesg") should now indicate that rtl819xE finds the firmware for loading into the device.

Note: wicd may cause excessive dropped connections with this driver, while NetworkManager appears to work better.

Ndiswrapper

It has been reported as working with ndiswrapper which makes use of the closed source Windows driver under Linux.

Cellular 3G Modem

Specifications required

Graphics Adapter

The video controller is an Intel chipset that works with the xf86-video-intel driver.

00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 945GME Express Integrated Graphics Controller [8086:27ae] (rev 03)
00:02.1 Display controller [0380]: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller [8086:27a6] (rev 03)

Kernel Mode Setting

See also Intel#KMS_.28Kernel_Mode_Setting.29.

KMS works providing real consoles at the native LCD resolution, 1024x600. There is a known problem with 2.6.32 kernels (later release candidates up to at least release 2.6.32.8), which results in screen flickering and blackouts about 5 minutes after resuming from suspend-to-RAM or suspend-to-disk.

Note:
  • If you encounter screen flickering or blackouts with KMS enabled, try setting i915.powersave=0 as a kernel boot option
  • Since version 2.10.0 of xf86-video-intel, support for UMS has been removed from the intel driver. This means that KMS is a requirement now
Method A

If you are using a kernel with no inital ramdisk and you can simply add the required options to the GRUB kernel line:

# (3) Arch Linux N130
title  Arch Linux Custom N130 Kernel
root   (hd0,YOURROOT-1)
kernel /boot/vmlinuz26-N130 root=/dev/sdaYOURROOT resume=/dev/sdaYOURSWAP ro quiet i915.powersave=0 i915.modeset=1
Method B

If you are using an initial ramdisk (either the standard kernel or the custom kernel method B above) then do the following:

Edit /etc/modprobe.d/modprobe.conf:

options i915 powersave=0 
options i915 modeset=1

Edit /etc/mkinitcpio.conf:

MODULES="intel_agp i915"
FILES="/etc/modprobe.d/modprobe.conf"

Put keymap early in /etc/mkinitcpio.conf HOOKS. Regenerate the init ramdisk for the kernel(s) you are running:

$ mkinitcpio -p linux

or

$ mkinitcpio -p linux-n140

Remove any vga= or video= from grub /boot/grub/menu.lst kernel line, and reboot.

Backlight Brightness

xbacklight does not work currently. However the brightness can be set with the following command

setpci -s 00:02.1 F4.B=hh

where hh is the level of brightness, in the range 00 to FF. Don't set it to zero because your backlight will turn off!

Note this does not require the samsung-laptop patch mentioned above.

Use the following script to increase and decrease the brightness. Put it in /sbin/backlight for example. Use xbindkeys to bind commands to the backlight Fn keys. Obtain sudo permission for user to use those commands with visudo.

#!/bin/bash
# increase/decrease/set/get the backlight brightness (range 0-255) by 16
#
#get current brightness in hex and convert to decimal
var1=$(setpci -s 00:02.1 F4.B)
var1d=$((0x$var1))
case "$1" in
      up)
              #calculate new brightness
              var2=$(echo "ibase=10; obase=16; a=($var1d+16);if (a<255) print a else print 255" | bc)
              echo "$0: increasing brightness from 0x$var1 to 0x$var2"
              setpci -s 00:02.1 F4.B=$var2
              ;;
      down)
              #calculate new brightness
              var2=$(echo "ibase=10; obase=16; a=($var1d-16);if (a>15) print a else print 15" | bc)
              echo "$0: decreasing brightness from 0x$var1 to 0x$var2"
              setpci -s 00:02.1 F4.B=$var2
              ;;
      set)
              #n.b. this does allow "set 0" i.e. backlight off
              echo "$0: setting brightness to 0x$2"
              setpci -s 00:02.1 F4.B=$2
              ;;
      get)
              echo "$0: current brightness is 0x$var1"
              ;;
      toggle)
              if [ $var1d -eq 0 ] ; then
                      echo "toggling up"
                      setpci -s 00:02.1 F4.B=FF
              else
                      echo "toggling down"
                      setpci -s 00:02.1 F4.B=0
              fi
              ;;
      *)
              echo "usage: $0 {up|down|set <val>|get|toggle}"
              ;;
esac
exit 0

External VGA

External VGA works out of the box with xrandr / krandrtray. Tested at 1920x1080 resolution.

Audio

The audio device is an Intel HD.

00:1b.0 Audio device [0403]: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller [8086:27d8] (rev 02)

Suspend and hibernate

Suspend to RAM with pm-suspend works.

It is most useful to trigger suspends using acpid.

To catch the "sleep" function key, edit /etc/acpi/handler.sh so that the button/sleep) event calls /usr/sbin/pm-suspend (instead of "echo mem > /sys/power/state" which may leave wifi down after resume):

button/sleep)
 case "$2" in
  SLPB) logger "Sleep button pressed, suspending to RAM"
   /usr/sbin/pm-suspend
   ;;
  *)    logger "ACPI action undefined: $2"
   ;;
 esac
;;

When catching the lid closure, the button/lid event will be seen twice -- once on suspend and again on resume. So use the lid state to distinguish between these so that pm-suspend is not triggered twice.

Enter the following lines in /etc/acpi/handler.sh:

button/lid)
  if [ $(/bin/awk '{print $2}' /proc/acpi/button/lid/LID0/state) = closed ]; then
    /usr/sbin/pm-suspend
  fi
;;

Hibernate works correctly. See pm-utils.

If you are a KDE4 user you can take advantage of powerdevil (included in kdemod-core/kdemod-kdebase-workspace since release 4.2) to manipulate the screen brightness, cpu scaling and hibernate. Suspend from KDE works too, but if you are using handler.sh to suspend on the button/lid and button/sleep acpi events, then KDE only needs to lock the screen. Note that cpu scaling requires acpi-cpufreq module to be loaded at boot.

Fn keys

Firstly edit /usr/share/hal/fdi/information/10freedesktop/30-keymap-misc.fdi and insert N140 into the list where you see NC10 already.

Now in a real console

 showkey

will show presses for the function keys, but no releases for some of them.

This is a BIOS issue which was also found on the Samsung NC10. A workaround quirk was put in the kernel in atkbd.c for the NC10. Patching this routine to apply the same quirk also works for the N140. There is a much simpler solution because this quirk can now be applied from user space. Simply create a systemd tmpfile with the following line:

/etc/tmpfiles.d/local.conf
 w /sys/devices/platform/i8042/serio0/force_release - - - - 130,131,132,134,136,137,179,247,249

After this is run, doing showkey in a real console will show key presses and releases.

Binding Fn keys with xbindkeys

The following has been tested with KDE, but should also work for other DEs.

To bind the Fn keys to action, read Extra Keyboard Keys.

The suspend key Fn+ESC and disable touchpad Fn+F10 keys, numlock, scroll lock, volume controls and mute work out of the box.

Note, that suspend key is handled in /etc/acpi/handler.sh (see "button/sleep" case entry) as shown above.

  1. Install xbindkeys
  2. Check the key values with xbindkeys -mk
  3. Edit .xbindkeysrc
    "sudo /sbin/backlight up"
        m:0x0 + c:233
    "sudo /sbin/backlight down"
        m:0x0 + c:232
    "/home/user/bin/systeminfo_battery"
        m:0x0 + c:244
    "sudo /sbin/backlight toggle"
        m:0x0 + c:156
    "/home/user/bin/systeminfo_disk"
        m:0x0 + c:157
    "/home/user/bin/systeminfo_cpu"
        m:0x0 + c:210
    "/home/user/bin/systeminfo_wifi"
        m:0x0 + c:246
    
  4. Run xbindkeys, and try it out

For KDE4 put a link to /usr/bin/xbindkeys in ~/.kde4/Autostart:

 ln -s /usr/bin/xbindkeys ~/.kde4/Autostart/xbindkeys.link

The Fn+F3 ("Euro") key: here Samsung implemented what has been called an entertaingly hilarious hack. Fortunately some eurozone models have a real Euro key as well.

Binding Fn keys in Openbox

In Openbox one can use the internal keybind setup instead of xbindkeys. Here is an excerpt from rc.xml:

   <keybind key="XF86Battery">
     <action name="Execute">
       <command>~/.PersonalBin/batteryDisplay</command>
     </action>
   </keybind>
   <keybind key="XF86Display">
     <action name="Execute">
       <command>~/.PersonalBin/monitor</command>
     </action>
   </keybind>
   <keybind key="XF86Launch1">
     <action name="Execute">
       <command>~/.PersonalBin/brightnessToggle</command>
     </action>
   </keybind>
   <keybind key="XF86Launch2">
     <action name="Execute">
       <command>nice python ~/.config/openbox/scripts/checkmail.py --update</command>
     </action>
   </keybind>
   <keybind key="XF86Launch3">
     <action name="Execute">
       <command>~/.PersonalBin/powersaveToggle</command>
     </action>
   </keybind>
   </keybind>
   <keybind key="XF86AudioMute">
     <action name="Execute">
       <command>~/.PersonalBin/volume mute</command>
     </action>
   </keybind>
   <keybind key="XF86WLAN">
     <action name="Execute">
       <command>~/.PersonalBin/wlanToggle</command>
     </action>
   </keybind>
   <keybind key="XF86AudioLowerVolume">
     <action name="Execute">
       <command>~/.PersonalBin/volume -</command>
     </action>
   </keybind>
   <keybind key="XF86AudioRaiseVolume">
     <action name="Execute">
       <command>~/.PersonalBin/volume +</command>
     </action>
   </keybind>
   <keybind key="XF86MonBrightnessDown">
     <action name="PreviousWindow">
       <bar>no</bar>
       <allDesktops>yes</allDesktops>
       <finalactions>
         <action name="Focus"/>
         <action name="Raise"/>
       </finalactions>
     </action>
   </keybind>
   <keybind key="XF86MonBrightnessUp">
     <action name="NextWindow">
       <bar>no</bar>
       <allDesktops>yes</allDesktops>
       <finalactions>
         <action name="Focus"/>
         <action name="Raise"/>
       </finalactions>
     </action>
   </keybind>

Saving Power

Read Laptop#Power_Management.

Note: Caution is advised here with hdparm settings because the issue with SATA freezing is related to power management and spindowns. Before you tune the Samsung N130/N140 to minimize power consumption it is strongly recommended that you resolve the SATA freezing issue as discussed above.

The Samsung N130/N140 contains a 1.6 GHz Intel Atom ULV (ultra low voltage) N270 processor, designed for low power consumption. The power consumption of the netbook (not just the processor) can be as low as 6W on idle with HDD spun down, although a typical figure under normal usage would be considerably higher.

Obviously the battery life depends on battery capacity as well as power consumption. The supplied battery varies in different markets. This list is a guideline only. Do not rely on this information before purchase -- check with YOUR vendor and update this wiki if it is incorrect:

Voltage 11.1V
N130             = 4000mAh [44Wh] (most markets), 5200mAh [57Wh] (Sweden)
N130 (Vodafone)  = ? [?] (Spain)
N130 (CMCC)      = ? [?] (China)
N140             = 5200mAh [57Wh] (US, Germany, France, Sweden), 5900mAh [65Wh] (UK)
Extended battery = 7800mAh [86Wh]

Install powertop which is a very useful tool for measuring and tuning power consumption.

Enable CPU frequency scaling (P-states) by loading the driver module acpi-cpufreq. This is most conveniently done dropping a namesake file in /etc/modules-load.d:

/etc/modules-load.d/acpi-cpufreq.conf
acpi-cpufreq

Select the CPU frequency governor by adding the following lines to a systemd tmpfile:

/etc/tmpfiles.d/local.conf
 w /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - - - - ondemand
 w /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor - - - - ondemand
Note: Contrary to the advice in many places hdparm -B 255 /dev/sda does NOT necessarily turn off advanced power management. What happens depends on the disk model. With the Samsung HM160HI disk 255 results in very frequent spindowns