Difference between revisions of "Samsung N140"

From ArchWiki
Jump to: navigation, search
m (Fn Keys)
m
Line 1: Line 1:
[[Category:Laptops (English)]][[Category:Getting and installing Arch (English)]]
+
[[Category:Samsung (English)]][[Category:Getting and installing Arch (English)]]
 
[[Category:HOWTOs (English)]]
 
[[Category:HOWTOs (English)]]
 
=Introduction=
 
=Introduction=

Revision as of 21:52, 27 October 2009

Introduction

This article provides information about installing and setting up Arch Linux on the Samsung N140. The hardware is similar but not identical to the Samsung NC10, so you may or may not find useful information on that page.

Issues

  • With kernel 2.6.31 ath9k wifi exhibits frequent disconnects and reconnects. This seems to be solved in 2.6.32.

Installation

From the ARCH CD iso with an external USB CDROM drive. Alternatively boot from USB flash drive.

Configure your installation

Ethernet

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

Wifi

Supplied wifi is Atheros AR9285 (PCI ID = 168c:002b) (RTL8192E is reported as being supplied in some markets)

Kernel module: ath9k (AR9285 is supported since 2.6.29).

Kernels 2.6.30 and 2.6.32-rcN work fine. 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.

Graphics Adapter

The Video controller is a typical Intel chipset that works with the xf86-video-intel driver.

Kernel Mode Setting

KMS works (at native 1024x600 resolution) after the following: /etc/modprobe.d/modprobe.conf:

       options i915 modeset=1

/etc/mkinitcpio.conf:

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

Put keymap early in mkinitcpio.conf HOOKS. Regenerate the init ramdisk

       mkinitcpio -p kernel26

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

With KDE, on logout KDM returns to the F1 real console not KDM.

Just uncomment this entry in /usr/share/config/kdm/kdmrc:

 TerminateServer=true


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!

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 should work out of the box with xrandr.

Audio

The audio device is an Intel HD.

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, in handler.sh use the button/sleep) event to call /usr/sbin/pm-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 is not triggered twice:

This is an excerpt from /etc/acpid/handler.sh file:

    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 article).

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 in MODULES in /etc/rc.conf.

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.

An issue found on the Samsung NC10 is also present on the N140. It causes most of the function keys to send a key press but not a key release. A workaround quirk was put in the kernel in atkbd.c for the NC10. Patching this routine to apply the same quirk (for 2.6.31 and earlier) also works for the N140.

For 2.6.32 and later this can be done from user space. Simply use the following in /etc/rc.local:

 echo 130,131,132,134,136,137,179,247,249 > /sys/devices/platform/i8042/serio0/force_release

To bind the Fn keys to action, read Extra_Keyboard_Keys#The_quick_way and also Extra Keyboard Keys in Xorg.

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

 pacman -S 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

xbindkeys

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: http://lists.freedesktop.org/archives/hal/2009-August/013536.html ROFL! Does anyone know a practical use for this key? Fortunately some (eurozone) models have a real Euro key as well.

Saving Power

Read Laptop#Suggestions_for_saving_power

But, great caution is advised here with hdparm settings because the issue with SATA freezing is related to power management and spindowns.

Note also that (contrary to the advice in many places) hdparm -B 255 /dev/sda does NOT necessarily turn off advanced power management. What happens actually depends on the disk model. With the Samsung HM160HI disk 255 results in very frequent spindowns.