۱۳۹۱ آذر ۶, دوشنبه

Debian on my new Samsung Series 9 13.3" -- NP900X3C

I got this new laptop and I've installed Debian on that. I had to do some tricks to make it work fine. I've also used help from many other blog posts like here, here, and here.

USB Booting:
I had to disable fast bios boot and press F10 to get the boot menue. Setting the priorities in BIOS didn't work. This thread helped a lot. It is also reported that the right USB 2.0 port works fine in contrast to the left USB 3.0 port.

Kernel:
Debian kernel on Wheezy at this point is too old for this laptop. The brightness buttons does not work due to a known bug in kernel which is fixed nowadays and that's why I migrated to liquorix kernel. The other reason was that the original kernel which was 3.2, used to just hang and go to not responding mode once a while. Right now there is a problem with rtl firmwares and the liquorix new releases and I'm trying to figure out how to workaround/fix it.
Edit: installing firmware-realtek fixed the problem.

Touchpad & Synaptics:
I also had to tweak synaptics settings a lot, and here is the result. I also had to prevent gnome from changing these setting which I got from here, by this (Quoted):

Gnome settings daemon may override existing settings (for example ones set in xorg.conf.d) for which there is no equivalent in any of the graphical configuration utilities. It is possible to stop gnome from touching mouse settings at all:
  1. Run dconf-editor
  2. Edit /org/gnome/settings-daemon/plugins/mouse/
  3. Uncheck the active setting


For my future reference, here is my synaptics config, put in /etc/X11/xorg.conf

Section "InputClass"
        Identifier      "Clickpad"                      # required
        MatchIsTouchpad "yes"                           # required
        Driver          "synaptics"                     # required
        Option          "SHMConfig"             "1"
        Option          "MinSpeed"              "0.8"
        Option          "MaxSpeed"              "1.2"
        Option          "AccelFactor"           "0.15"
        Option          "TapButton1"            "1"
        Option          "TapButton2"            "3"     # multitouch
        Option          "TapButton3"            "2"     # multitouch
        Option          "VertTwoFingerScroll"   "1"     # multitouch
        Option          "HorizTwoFingerScroll"  "1"     # multitouch
        Option          "VertEdgeScroll"        "0"
        Option          "HorizEdgeScroll"       "0"
        Option          "CoastingSpeed"         "8"
        Option          "CornerCoasting"        "1"
        Option          "CircularScrolling"     "1"
        Option          "CircScrollTrigger"     "7"
        Option          "EdgeMotionUseAlways"   "0"
        Option          "ClickPad"              "1"
        Option          "LockedDrags"           "1"
        Option          "LockedDragTimeout"     "5000"
        Option          "FingerHigh"            "14"
        Option          "FingerLow"             "10"
        Option          "FingerPress"           "255"
        Option          "PalmDetect"            "1"
        Option          "PalmMinWidth"          "10"
        Option          "PalmMinZ"              "200"
EndSection

Also to prevent accidental clicks while typing, have this in /etc/X11/Xsession.d/98x11-syndaemon (got it from here):
/usr/bin/syndaemon -d -t -k

Wireless:
This package contains the wireless firmware on this laptop: firmware-iwlwifi

Screen Brightness:
If you don't want to install liquorix kernel but wish to be able to change your screen brightness, this script might help (need to be su):
#!/bin/sh
echo $1 > /sys/class/backlight/acpi_video0/brightness

Keyboard Backlit:
Initially buttons do not work, but this helps (need to be su):
#!/bin/sh
echo $1 > /sys/devices/platform/samsung/leds/samsung\:\:kbd_backlight/brightness
FN Keys:
Alternatively you can make FN keys handle the keyboard backlit, wireless, performance mode, and battery life extender for you. Here is the page I used to have them working; but some changes needed to be applied for my preferences and hardware.
One thing is my keyboard is input/event0, and not input/event4. You can find your keyboard using /lib/udev/findkeyboards. Another thing is my FN+F11 code is 0xB3. I also changed and added some scripts to have notification about current status of what has been changed.
Okay, now to make it short and simple, here is the report of what I've done, and you can read the referenced page for more information.
My /lib/udev/keymaps/samsung-other file is like this:

0x74 prog1 # User key
0x75 www
0x78 mail
0x82 switchvideomode # Fn+F4 CRT/LCD (high keycode: "displaytoggle")
0x83 battery
0x84 prog1
0x86 wlan
0x88 brightnessup
0x89 brightnessdown
0xB1 prog2
0xB3 prog3 
0xB4 wlan 
0xF7 f22 
0xF9 f23 
0x96 kbdillumup
0x97 kbdillumdown
0xCE prog1 
0xD5 wlan 
Some of them are extra, I just didn't remove them. Then here it comes /lib/udev/keymaps/force-release/samsung-other file:
0x82
0x83
0x84
0x86
0x88
0x89
0xB3
0xF7
0xF9
0x96
0x97
0xCE
0xD5
Then here is what I've added to the /etc/sudoers file:
Cmnd_Alias SAMCTL = /home/adrin/bin/samctl.sh batt, \
            /home/adrin/bin/samctl.sh perf, \
            /home/adrin/bin/samctl.sh wlan
Defaults!SAMCTL !requiretty
adrin    ALL=(ALL)   NOPASSWD: SAMCTL
Remember to change "adrin" to your username. Then I have these scripts all in /home/adrin/bin/ path; again remember to change all paths to your correct home folder, or anywhere else you want. Now you might need a reboot to have the keys working, and then add three commands as Custom Shortcuts in gnome3 GUI tool "Keyboard -> Shortcuts -> Custom Shortcuts". I assigned FN+F1 to battery life extender (/home/adrin/bin/samctlbatt.sh), FN+F11 to performance mode changed (/home/adrin/bin/samctlperf.sh), and FN+F12 to WLAN status switcher (/home/adrin/bin/samctlwlan.sh).


Power Consumption:
install laptop-mode-tools
Here is a good tutorial on power management of this laptop and I should remember to use powertop whenever I want more battery, and hit enter on those suggestions to switch their status to Good.

For my own future reference this part is an exact quotation from the same place:


How to get longer battery life

As I said: install powertop. It can even tell you what's drawing how much energy (although this seems not too reliable). Powertop can enable a bunch of power saving options which must be configurable somewhere else too but I haven't figured that out for each. Start it, go to the right-most page and use the 'enter' key to enable them. They seem to stick mostly across reboots but not all of them do so use it whenever you need the battery life. Make sure especially to enable powersaving on the USB channels, one has the webcam which alone can draw 2-3 watts according to powertop.

Second, use the 'silent' performance_level. Set it by echo-ing 'silent' to '/sys/devices/platform/samsung/performance_level'. See more below. In my experience, the laptop is plenty responsive with the CPU speed capped at 800 mhz - as long as you do nothing too fancy.

Third - as you probably won't use it (much), disable the LAN port. Also uses quite some power according to powertop (although I doubt it's accuracy in this, it won't hurt). You can do this in the Bios of the system.

Fourth, enable power saving for the video card by going to Boot Loader in YaST, edit the boot loader options and add this after"Optional Command Line Kernel Parameter" (or editing grub(2) by hand if you're on a less easy distro):
    i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 acpi_backlight=vendor
See phoronix for more info on these. The acpi_backlight=vendor makes sure the laptop uses intel's backlight interface which goes up and esp down far further than the normal one. It does sometimes lead to quirky behavior so if it doesn't work for you, remove it.

I appreciate his work. There is a problem with setting acpi_backlight=vendor. It seems that intel uses a different range as brightness value, it's not between 0 and 100 anymore. It can be literally 0, which means the display is turned off, and the maximum on my system is 4648. Hence, when you decrease the brightness using keyboard, once it gets bellow 100, you can not increase it again. This command then might help (0 <= N <= 4648):
#!/bin/sh
echo $1 > /sys/class/backlight/intel_backlight/brightness

Debian Related (not the hardware):
Mostly for my own future reference.

Fonts:
Independent of this laptop, this package causes problems on my fonts, removed it: ttf-mscorefonts-installer

sources.list:
Right now, my sources.list is like this:
#

# deb cdrom:[Debian GNU/Linux wheezy-DI-b3 _Wheezy_ - Official Snapshot amd64 NETINST Binary-1 20121012-13:45]/ wheezy main

#deb cdrom:[Debian GNU/Linux wheezy-DI-b3 _Wheezy_ - Official Snapshot amd64 NETINST Binary-1 20121012-13:45]/ wheezy main

deb http://mirrors.ece.ubc.ca/debian/ wheezy main non-free contrib
deb-src http://mirrors.ece.ubc.ca/debian/ wheezy main non-free contrib

deb http://security.debian.org/ wheezy/updates main non-free contrib
deb-src http://security.debian.org/ wheezy/updates main non-free contrib

## Liquorix Kernel by damentz http://www.liquorix.net/ .
# Secure Apt: apt-get install '^liquorix-([^-]+-)?keyring.?'
# Latest "stable" kernel
deb http://liquorix.net/debian/ sid main
# RC/Beta kernels
# deb http://liquorix.net/debian/ sid main future

# sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
#deb http://dl.google.com/linux/talkplugin/deb/ stable main

هیچ نظری موجود نیست: