2012-10-14

Samsung NP900X4C and Fedora 17

The Samsung NP900X4C is a ultra slim laptop with quite nice specifications. This post is about running Fedora 17 x86_64 on this laptop.

Specifications

Event though the specifications for this laptop is all over the net, here is a short list with the basics:
  • CPU: Intel Core i7 U3517U (1.9GHz dual core, "Ivy Bridge")
  • Chipset: Intel HM75
  • Graphics: Intel HD4000
  • Memory: 8GB RAM (DDR3 PC3-12800 CL11 204-pin SODIMM)
  • Storage: 128GB mSATA SSD disk (or apperently 256GB on some markets)
  • Wireless: Intel Centrino Advanced-N 6235
  • Wired network: Realtek RTL8111/8168B Gigabit Ethernet controller
  • Screen: 15" matte screen with 1600x900 resolution
  • Bluetooth 4.
  • Synaptics ClickPad
The number of connectors on this laptop is quite small due to its slim design, but at least you get the following:
  • Power connector
  • One USB2 port on the left side
  • Two USB3 ports on the right side
  • One MicroHDMI port
  • One "mini" VGA port that requires a special dongle from Samsung to get a normal VGA connector
  • One"mini" network connector that requires a special dongle from Samsung to get a RJ45. This dongle is included with the laptop
  • One 3.5mm combined headphone/microphone port
  • One built in SD-card reader


Upgradeability

The SSD and memory are "easily" upgradable on this laptop. The back cover is attached with ten small screws and with some plastic snap hooks. The screws are easy to remove with some gentle force (they are loctited) if you have a proper screwdriver. If not, you could easily damage them.

After removing the screws, you have to snap the back cover lose from the plastic hooks and this requires some very gentle force to not damage anything.

Once the cover is removed you can see the memory and SSD disk:



You can replace the 2x4GB SODIMM:s with 2x8GB SODIMM:s to get 16GB of RAM and replace the stock 128GB SSD with a 256GB SSD from Crucial to get more storage space. There is an instruction note on the battery that says that the battery should be disconnected before swapping SODIMM:s Just to be sure, I followed this instruction.

The laptop works just fine after the memory and drive upgrade but it could be that your warranty is void. Samsung says that 8GB RAM is maximum. Upgrade on your own risk.


Installation of Fedora 17

I installed Fedora 17 x86_64 fresh on the new 256GB SSD from a USB DVD-reader. I have no interest in Windows so I didn't bother trying to copy the content of the stock disk to the new one.

The laptop was connected to the net via the ethernet dongle so that I could get all the updates directly during the installation (by choosing to add additional repositories during installation). Wireless is not supported in the kernel that comes with the installation DVD, but is supported when all updates are installed. The installation was problem free.

The list below on what works and not assumes that you have a fully updated Fedora 17. Just installing from the install DVD is not enough!


Works, doesn't work and not tested

Here is a list of what works and not on a fully updated Fedora 17:
    • Graphics: Works including desktop effects. glxgears show 60fps
    • Wired network: Works
    • Wireless network: Works
    • USB2: Works
    • USB3: Works
    • Sound: Works
    • MicroHDMI: Works, including sound out through HDMI
    • "mini" VGA: Not tested
    • Webcam: Works
    • ClickPad: Works. Lot of settings in KDE System Settings, two finger scroll, tapping, clicking, three finger tapping, drag and drop etc.
    • Volume mute, down and up via Fn+F6, F7 and F8: Works
    • Controlling screen brightness via Fn+F2 and F3: Works
    • Controlling keyboard backlit: Works (see below)
    • Controlling keyboard backlit from function keys: Does not work (see below)
    • Toggle the ClickPad on/off with Fn+F5: Works
    • Suspend: Works although not extensively tested
    • Bluetooth: Works to play sound on Bluetooth speakers
    • SD-card reader: Works
    • Turn radio on/off (WLAN and Bluetooth): Works (see below)
    • Turn radio on/off from function keys: Does not work (see below)
    • Change performance levels: Works (see below)
    • Change performance levels via function key: Does not work (see below)
    • Enable/disable battery life extender: Works (see below)
    • Enable/disable USB-charge: Works (see below)


      Keyboard backlit

      The story with keyboard backlit is the following. The kernel support for controlling the keyboard backlit is there and you can control the backlit by doing the following in a terminal window (as root):
       # echo N > /sys/devices/platform/samsung/leds/samsung\:\:kbd_backlight/brightness
      where N should be replaced by a number between 0 (off) and 8 (full brightness).

      What is missing is some program that listens on the Fn+F9 and Fn+F10 keys and decreases or increases the brightness by writing to the above device node. Not sure whether such a program should be in KDE/Gnome or live somewhere under the hood.


      Turn radio on/off

      It is possible to turn the radios for WLAN and Bluetooth on and off from within the OS. This is done by writing to specific device nodes under /sys (like in the case for keyboard backlit).

      To switch the WLAN radio off, do the following (as root or via sudo):
       # echo 0 > /sys/devices/platform/samsung/rfkill/rfkill1/state
      To switch the WLAN on again, just write 1 instead of 0:
       # echo 1 > /sys/devices/platform/samsung/rfkill/rfkill1/state
      And, as you would guess, checking the state of the WLAN radio is done by:
       # cat /sys/devices/platform/samsung/rfkill/rfkill1/state
      The Bluetooth radio is controlled via rfkill2 so you just replace rfkill1 with rfkill2 in the commands above to do the same thing for Bluetooth.

      If you turn off both WLAN and Bluetooth, the blue LED on the F12 key will turn off to indicate that your laptop is in "flight mode".

      As with the keyboard backlit, there is no program that listens on the Fn+F12 key event and writes to the device nodes above. So, when you press Fn+F12 nothing will happen.


      Performance levels

      The NP900X4C has three "performance" levels, "silent", "normal" and "overclock" (or "speed"). As far as I understand they basically control the CPU frequency.

      To check the current performance level, just look at the value in the performance_level device node:
       # cat /sys/devices/platform/samsung/performance_level
      To change the performance level, echo the desired level to the device node:
       # echo LEVEL > /sys/devices/platform/samsung/performance_level
      where LEVEL is replaced by one of silent, normal or overclock.

      As with keyboard backlit and radio on/off, pressing the performance key (Fn+F11) key doesn't do anything.


      Battery life extender

      Battery life extender is a function that can be activated in BIOS or from within the OS. It extends the lifetime of the battery by only charge it to 80% instead of 100%.

      To check if the battery life extender function is activated, look at the value in the battery_life_extender device node:
       # cat /sys/devices/platform/samsung/battery_life_extender
      0 means that the function is deactivated and 1 means activated.

      To activate/deactivate, just write the appropriate value to the device node:
       # echo STATE > /sys/devices/platform/samsung/battery_life_extender
      where STATE is 0 for deactivate or 1 to activate.


      USB charge

      USB charge is a function that can be activated from BIOS or from within the OS. When activated, it allows you to charge your cellphone or other stuff from the USB2-port even when the laptop is switched off.

      To check if the USB charge function is activated, look at the value in the usb_charge device node:
       # cat /sys/devices/platform/samsung/usb_charge
      0 means that the function is deactivated and 1 means activated.

      To activate/deactivate, just write the appropriate value to the device node:
       # echo STATE > /sys/devices/platform/samsung/usb_charge
      where STATE is 0 for deactivate or 1 to activate.

      Some documentation about performance level, battery life extender and USB charge can be fond here.


      Function keys

      Some of the function keys does not have any mappings meaning that even if you press them, Linux will not recognise that. The function keys in question are:
      • Fn+F1 "Settings"
      • Fn+F9 "Keyboard backlit dim"
      • Fn+F10 "Keyboard backlit light up"
      • Fn+F11 "Fan controll"
      • Fn+F12 "Radio kill switch"
      You can verify that nothing is happening by starting xev from the command prompt, move the mouse pointer to be within the black square in the window that pops up and then press different keys. You will see output in the terminal when you press "known" keys, but if you press any of the Fn-keys above nothing will happen.

      To make Linux recognise these buttons you need to create two files and add two lines in two other files.

      To begin with, create the file /lib/udev/keymaps/samsung-900x4c with the following content:
       0x96 kbdillumup         # FN+F10 Keyboard backlight up
       0x97 kbdillumdown       # FN+F9 Keyboard backlight down
       0xB3 silentmode         # FN+F11 Silentmode
       0xCE prog1              # FN+F1 System Settings
       0xD5 wlan               # FN+F12 WiFi

      Second, create the file /lib/udev/keymaps/force-release/samsung-900x4c with the following content:
       0x96 # FN+F10 Keyboard backlight up
       0x97 # FN+F9 Keyboard backlight down
       0xB3 # FN+F11 Silentmode
       0xCE # FN+F1 System Settings
       0xD5 # FN+F12 WiFi

      Third, add the following line to the file /lib/udev/rules.d/95-keymap.rules:
        ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="900X3C*", RUN+="keymap $name samsung-900x4c"
      The line should be added at the bottom of the block of lines that begin with:
       ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*"

      Fourth, add the following line to the file /lib/udev/rules.d/95-keyboard-force-release.rules:
        ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="900X3C*", RUN+="keyboard-force-release.sh $devpath samsung-900x4c"
      The line should be added below the block of lines that begin with:
       ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*"

      The steps above will tell Linux to load the two mapping files if the value of the device node /sys/devices/virtual/dmi/id/product_name matches the regexp "900X3C*". Even though this is a 900X4C, the product_name node contains the string "900X3C/900X4C/900X4D" indicating that all these three laptops are about the same when it comes to Linux support.

      You have to reboot for the new configuration to take effect. Once up and running again, start xev on the command line and observe that things now happen when any of these five function keys are pressed. But, since there still are no program listening on these events and poking on all of the device nodes discussed above, you will not be able to use the function keys until you write some software/scripts that handles that.

      Also, any updates to the udev-system will probably overwrite your changes to /lib/udev/rules.d/95-keymap.rules and /lib/udev/rules.d/95-keyboard-force-release.rules.


      Conclusion

      The Samsung NP900X4C is a really nice laptop to running Linux on. It performs very well for doing "internet stuff", writing and development jobs. The hardware support "out of the box" is very good for such a new laptop.

      The laptop stays very cool during normal use and the fan hardly have to work. This will of course change if you do heavy compilations and stuff but that is expected.

      The finish is also top notch and the laptop looks really sleek and is easy to carry with you. The combination of 15" screen and 1600x900 resolution is also a very good match and looking at the screen feels "natural". Viewing angle is unfortunately a bit narrow but considering everything else, I think it is acceptable. 

      The battery seem to last for at least four-five hours when just surfing/writing with the screen on all the time.

      Do I need to add that I'm quite satisfied with this laptop :-)

      24 comments:

      1. Excellent post! To complete it you could add a section explaining how to disable wireless mode N. I and many others had a problem with this mode. When I turn off this mode, my connection worked perfectly. Thanks for share these informations.

        ReplyDelete
        Replies
        1. Strange, I haven't experienced any problems with the wireless myself. Perhaps it's related to what access point one uses?

          Delete
      2. Thank you very much for this absolutely fabulous post. This was a big help especially with the note about needing to update before the wireless would work.

        Has anyone managed to make a dual boot with linux and windows 8? Is there any permutation of the UEFI settings that will make it work?

        ReplyDelete
      3. Hi, can you confirm that battery state on ACPI is updated correctly? On ubuntu it doesnt!

        ReplyDelete
        Replies
        1. No, the battery state is not updated correctly for me.

          If I boot the computer with the AC adapter unplugged, it does correctly shows that the battery is discharging but doesn't recognize when the AC adapter is plugged in.

          If I boot with the AC adapter plugged in, it shows that charging takes place, but does not recognize that I disconnect the AC adapter.

          This is a kernel issue and is discussed here: https://bugzilla.kernel.org/show_bug.cgi?id=44161

          I will probably write a post about this when I learn more about the issue. BTW, Fedora is at kernel 3.6.10 at this date.

          Delete
        2. Hi, thanks for the response! what about the battery remaining? does it update?

          Delete
        3. Yes, the battery remaining is updated correctly!

          Delete
        4. I'm also on Fedora 17. The battery status and fn+f12 wifi on/off (minus LED state changes) all work if you update to the latest bios. Since that is a Windows only operation you need:
          1. A bootable USB drive /w a Windows 7 on 8 live install on it (Windows PE 3.x or 4.x). You can either make this yourself or grab an ISO online and use wintobootic and make it that way as I did.
          2. A LAN driver since the Windows PE install may not have one built in. You drop this on your boot USB drive and install per normal. Wifi drivers may work too but I didn't test this.
          3. The bios update tool, also drop this on the boot USB drive and run once you have working internet access.

          I also have the keyboard backlight fn keys working on my system as well. I did this back in August so I'll have to go back and figure out what I did and document that here. The only things I *don't* have working on this laptop is the fn+f1 "setup" key, wifi/bluetooth LED state changes, and widi (untested since I have no TV/device that supports this).

          Delete
        5. Ditto, do you mean that Fn+F12 can toggle Bluetooth and WLAN of/off without support from Linux after the BIOS upgrade?

          If that is the case, the blue LED on F12 should go off by it self when you turn off the radios.

          I'm running the stock BIOS, version P02AAC released June 1 2012, but I know that there is an update out there that I haven't tried.

          Delete
        6. The bios update fixes all the battery status issues. I was mistaken about fn+f12. That works 100% too but you have to setup the key and have it use the script below. I have it mapped to "samsung_kb radio"; one press turns bluetooth off, a second wifi (light goes off), a third bluetooth/wifi back on.

          Delete
        7. What is your version Ditto? I believe im on the latest one and still have battery issues. Linux wise, how is the fan noise of your samsung like? Mine seens pretty strange.

          Delete
        8. Luis and Ditto, there seem to be progress in fixing the battery charging status. See the discussion taken place the last month or so here: https://bugzilla.kernel.org/show_bug.cgi?id=44161

          From what I can read, kernel 3.15 will have the fix for this and Fedora 20 as well.

          Time to upgrade to fedora 20 perhaps... :-)

          Delete
      4. Here is the program I use with the function keys to make them work (see function key setup steps above above first):
        https://www.dropbox.com/s/g93c9o9o9yi8gmp/samsung_kb

        You'll need run this with sudo. I use KDE and have custom shortcuts setup for the function keys to call this /w arguments. Gnome or others you'll need to do something similar. You'll also probably want either change the dialog setting in this script or just disable them as well.

        ReplyDelete
      5. Has anyone else tried Fedora 18 out on this laptop yet? My battery status was working fine with 17 after the bios update. After the updating it doesn't even see a battery. Everything else works, including the battery life extender oddly enough.

        ReplyDelete
        Replies
        1. Installing Fedora 18 is on my list as soon as I get some time. Also upgrading the BIOS.

          But for now it is still Fedora 17 with the battery reporting issue :-)

          Delete
        2. If anyone else runs into it I fixed my battery issue with F18. You need to either fully drain the battery (I just left it running the battery calibration in the bios overnight) or open the case up and disconnect the battery for a few minutes. On the next boot the battery is detected and everything works fine once again. Pulling the power cable or connecting it is detected correctly and power management responds how it is supposed to. Bios version P04AAC

          Delete
        3. Ditto, did you update the BIOS using windows PE? Can you explain the whole process?

          Delete
        4. I explained the whole process above in my Dec 21st post. You just need to make a Windows PE USB drive and boot off that. I used an prebuild ISO of Windows PE I found online and a utility to turn ISO's into bootable USB drives. I had to disable the SSD in the bios to be able to boot off USB for some reason but once I did that it was super simple to install the network drivers and run the bios update tools once I booted into Win PE.

          Delete
      6. Hi

        I have the same model Samsung, running Linux Mint. It is a lovely machine to
        use. I added my installation and configuration notes here
        (https://docs.google.com/document/d/1w5qS85WdLQK5r_fxl6qzNW3W4gFx4F5I4gy6ugLrbDQ/edit?usp=sharing).

        There is one niggling issue I've not been able to resolve: I get random
        freezes. It is a really solid system freeze. Nothing responds other than the
        power button. I've never been able to get a definitive error message that could
        point to a root cause. Often I can run the machine for over a week without
        issue. Then suddenly, bam!

        I note in your excellent blog that you do not seem to have encountered this. Do
        you have any advice?

        Cheers

        ReplyDelete
        Replies
        1. Frank,

          I have not experienced any freezes my self that I can remember. Are you using suspend to RAM a lot? Even though I have tested suspend to RAM, I have not used it extensively. My usage pattern it typically; turn on the laptop, work a couple of hours, turn it if. Occasionally the laptop stays on for a couple of days.

          But as I wrote above, no freezes that I can recall.

          Delete
        2. Yes I do use suspend, rather than shutting down. Though the system starts up so fast there is little gain!

          Thanks

          Delete
      7. I am on a NP900X3E running mint 15. All seems to work now (except the lid) but the performance_level doesn't seem to change anything.....

        jacco@jacco-samsung~ $ cat /proc/cpuinfo | grep cpu
        cpu family : 6
        cpu MHz : 1872.000
        cpu cores : 2
        cpuid level : 13
        cpu family : 6
        cpu MHz : 1632.000
        cpu cores : 2
        cpuid level : 13
        cpu family : 6
        cpu MHz : 1704.000
        cpu cores : 2
        cpuid level : 13
        cpu family : 6
        cpu MHz : 1752.000
        cpu cores : 2
        cpuid level : 13
        jacco@jacco-samsung~ $ cat /sys/devices/platform/samsun/performance_level
        silent
        jacco@jacco-samsung~ $ uname -a
        Linux jacco-samsung 3.10.9-031009-generic #201308201935 SMP Tue Aug 20 23:36:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

        ReplyDelete
      8. Hi. About the keyboard backlight, if you press the function keys reserved to control it, you can see messages kernel messages with dmesg that tell suggest you to use setkeycodes to map the scancodes.
        i tried in this way:
        sudo setkeycodes e017 229
        sudo setkeycodes e016 230

        I choose 229 and 230 reading /usr/include/linux/input.h:
        #define KEY_KBDILLUMDOWN 229
        #define KEY_KBDILLUMUP 230

        So now the system catch the event and I see the osd symbol of the keyboard light change but it interprete as a continuos pression, I don't know why.

        I'm on mint 15.

        ReplyDelete
        Replies
        1. Paolo, thanks for the hint. I have tried your setkeycode trick on my Fedora 17 but for me nothing happens.

          I will probably look in to this again when I upgrade my machine to something more modern :-)

          / Johan

          Delete

      PrettyPrint