Tuesday 3 September 2013

Running Linux on ASUS N550JV - Fedora 19

The ASUS N550JV is the latest version of the performance/entertainment notebook N series from ASUS. It features a Haswell quad-core CPU with RAM expandable to 16GB and a replaceable HDD. The star of the show is the Full HD IPS screen, which is top-notch. Also, the entire case is made from aluminium and build quality is close to a MBP.

Linux runs rather well on the unit, but it took me some trial and error in order to get most of the features and components working properly on Fedora 19.

Update: The newest F19 kernel - 3.11.1-200 isn't supported by the bumblebee package and you will get poor battery life unless you manually echo "OFF" to /proc/acpi/bbswitch.

To install the previous version of the kernel from fedora-updates, download the RPMs from koji -
http://koji.fedoraproject.org/koji/buildinfo?buildID=463094

Model: ASUS N550JV CM067H
CPU: Intel i7-4700HQ Haswell Quad-Core (47w)
Discrete Graphics: Nvidia 750M 2GB DDR3
RAM: 1 x 8GB DDR3 1600mhz SODIMM (2 slots total, 1 slot free)
HDD: 1TB 5400rpm HDD (Replaceable)
Display: 15.6" IPS LCD Panel (LP156WF4-SPB1)


ACPI -

The main thing is to run a recent kernel and put acpi_osi="" in the kernel command line in grub. This will fix the backlight brightness and function keys. You may also have to manually load the asus-nb-wmi module in /etc/modules-load.d to ensure that the module load on boot.

Also, remember to take out any other ACPI kernel command line options you may have put in before, such as acpi_backlight as the keys will not work properly if you have those.

Also consider updating the BIOS to 206 as it has proven to be a stable configuration for me and the ACPI keys work consistently.


Optimus/Bumblebee -

To get Optimus/Bumblebee working, you will need to revert a ACPI commit in the kernel 3.8, see these links for more info -

https://bugzilla.kernel.org/show_bug.cgi?id=60561
https://github.com/Bumblebee-Project/bbswitch/issues/65
https://github.com/Bumblebee-Project/bbswitch/issues/446

The patch fixing this issue has been accepted in Linus' tree and appears to be on track for the 3.11 kernel release.

After installing the modified kernel RPM that reverts the change (not necessary when the 3.11 kernel comes out), and then installing the bumblebee RPMS from http://techies.ncsu.edu/wiki/bumblebee, everything works as expected.

Update: The ACPI handle works without patches as of kernel-3.10.10-200.fc19

Update 20131103: There is a problem with the Fedora Xorg which makes bbswitch unable shut off the Nvidia card after using optirun. This is detailed in the following issue ticket -

https://github.com/Bumblebee-Project/Bumblebee/issues/433

To fix this, I had to create  /etc/udev/rules.d/99-drm-bumblebee-fix-issue-433.rules (the file could be any name you want), with the following inside -

SUBSYSTEM=="drm", KERNEL=="card1", RUN+="/bin/rm /dev/dri/card1"


Subwoofer -

There is some information on how to get previous ASUS notebooks with an external subwoofer working under ALSA. However, I've not been able to get the subwoofer to work on the N550JV. If I do have some free time, might have a go at it. It's not a big issue for me, as it is a hassle to carry the subwoofer around, and on the desk I can connect the system to proper audio equipment that sounds much better than with the external subwoofer unit.


Full Disk Encryption -

The really interesting thing about this system is that it allows the user to set the ATA security passwords. When the system is equipped with a Full Disk Encryption supporting SSD or HDD, the FDE support can be completely seemless. You can set both master and user passwords in the UEFI BIOS. I've replaced the original HDD with a 960GB Crucial M500 SSD with ATA security enabled. No problems with this setup so far.


Power Management -

Put the following in /etc/pm/power.d/power (create the file with executable permissions if not present) -

#!/bin/sh

# Shell script to reduce energy consumption when running battery. Place
# it in /etc/pm/power.d/ and give execution rights.

#if on_ac_power; then
# Put specific AC power config here
#else
# Put specific Battery power config here
#fi

# Common Settings

# Enable Laptop-Mode disk writing
echo 5 > /proc/sys/vm/laptop_mode

# NMI watchdog should be turned off
for foo in /proc/sys/kernel/nmi_watchdog;
do echo 0 > $foo;
done

# Set SATA channel to power saving
for foo in /sys/class/scsi_host/host*/link_power_management_policy;
#do echo "min_power" > $foo;
#do echo "medium_power" > $foo;
#do echo "max_performance" > $foo;
done

# Activate USB autosuspend
# Autosuspend for USB device Bluetooth USB Host Controller [Atheros Communications]
echo 'auto' > '/sys/bus/usb/devices/3-5/power/control';
# Autosuspend for USB device Touchscreen [ELAN]
echo 'auto' > '/sys/bus/usb/devices/3-10/power/control';
# Autosuspend for USB device USB2.0-CRW [Generic]
echo 'auto' > '/sys/bus/usb/devices/3-8/power/control';

# Activate PCI autosuspend
for foo in /sys/bus/pci/devices/*/power/control;
do echo auto > $foo;
done

# Activate audio card power saving
echo '1' > '/sys/module/snd_hda_intel/parameters/power_save';

# VM Writeback timeout
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';

# Turn off WOL
ethtool -s p3p1 wol d;

The script above will turn on most of the power management setting. However, regarding SATA link power management, some SSDs (and maybe some HDDs as well) do not work well with min_power, and I have corrupted disks with this setting on. Currently, I'm using medium_power and this setting is fine for my M500 SSD so far. However, please do your own tests before turning on the SATA link power management - I left this commented out in the script above for this reason!


SD Card Reader -

Update: It looks that that the kmod-staging driver for the rts5139 loads and detects the a block device, but does not actually detect media. So as of yet, the module isn't actually functional.

The card reader on the N550JV uses the RTS5139 chipset. As the driver for this is in staging, the module is not included in the default Fedora kernel. To fix this install kmod-staging from rpmfusion.org which should install the correct kmod-staging rpm for your current kernel. Be aware that this package sometimes lag behind the Fedora kernel.


Bluetooth -

My N550JV came with an Atheros AR9485 Card that includes also the bluetooth adapter (Atheros AR3012). Older versions of the kernel didn't include the USB ID of the device. See the following link for details -

https://bugzilla.kernel.org/show_bug.cgi?id=60726

I can confirm that this now work on Fedora since kernel 3.10.11.

You may also need to enable bt_coex. To do this, create a new file /etc/modprobe.d/ath9k.conf and put in the file the following -

options ath9k btcoex_enable=1

With the new kernel, bluetooth is now working fine on the system. However, as the Atheros card only support single-band wifi, it may be a good option to upgrade to an Intel card that supports dual-band.

18 comments:

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Are you able to get everything running under Fedora? With the new 3.10.11 kernel, everything but the card reader and subwoofer is working for me.

      Delete
  2. Hi, I have probably the same laptop (N550JV-DB72T maybe this is the US model number!) and have similar specs. I am having a problem with the battery which I noticed after installing Fedora 19. The battery LED is always blinking orange and will not charge so i returned the laptop got a new one and after a while the same issue happened.

    Did you face such problem?
    What BIOS version do you have installed?
    Are you using the normal EFI or did you switch to Legacy mode (Emulated BIOS)?

    ReplyDelete
    Replies
    1. Maybe I should update the article as I had the same problem after replacing the HDD with an SSD and installing Fedora. To fix this, I resat the battery and then the issue was gone. After doing that, the battery at the beginning didn't show a lot of stats, but it started to return all of the normal numbers after a few charge cycles.

      At first I thought that this may be because when I replaced the HDD with SDD, I didn't resit the battery correctly, but now having seen that other people experiencing this as well, I suppose this may be because the battery needs time to acclimatise, or that installing Fedora from the Live USB reset something in the battery (maybe due to ACPI on an older kernel, or something similar).

      In any case, I recommended upgrading to the latest kernel version and resitting the battery. That worked for me.

      Delete
    2. I installed Fedora from a DVD so Live USB is not the problem. Ih ave few questions that I like your answers for:

      1-What do you mean by resitting the battery? like unplugging it then putting it back? (which means I have to open up the laptop)

      2- What are the stats that you see now which didn't show before?

      3- Is the problem gone for good now? or does it come and go?

      also for me i seem to start having the problem after booting into 3.10.11. With 3.9.5 it was working fine. Thank you

      Delete
    3. Live USB or DVD both use the same 3.9.5 kernel on first install. So maybe it is the change in kernel behavior after upgrade.

      1 - Yes. I opened up the bottom cover again and I took out the battery, waited for a bit, and then plugged the battery back in. Three screws hold the battery to the unit and the battery is pretty modular -

      http://www.notebookcheck.net/Review-Asus-N550JV-CN201H-Notebook.98311.0.html

      http://www.notebookcheck.net/typo3temp/_processed_/csm_N550_UnterseiteOffen_b9df1aca99.jpg


      2 - Current capacity when full, etc. I can't remember exactly.

      3 - Yes, the problem is now gone for good after updating Fedora and resitting the battery just once.

      Delete
  3. This is good news. I will try to get bumblbee working with 3.10.11 and see if the battery can be solve by just resitting it.

    Also did you manage to get the F-keys for LCD brightness working? I got them all working except the screen brightness and Wireless.

    ReplyDelete
    Replies
    1. For the Fn-keys, don't put any other acpi options in the kernel command line apart from acpi_osi="" . The quickest way is to edit /etc/grub2.conf or /etc/grub2-efi.conf depending if you installed with EFI support or not.

      If you have any acpi_backlight options in there already, remove them. That will cause the backlight keys not to work.

      Delete
    2. Awesome, now both LCD brightness and wireless hot keys work.
      I would suggest putting the acpi_osi="" in the /etc/default/grub [GRUB_CMDLINE_LINUX], so I will be applied to the new installed kernels as well.

      Did you have any luck with the SD card reader? the staging driver for rts5139 (kmod-staging from rpmfusion) is not working for me.

      Delete
    3. Theoretically you are right, the updated kernel command line should be in /etc/default/grub, however....

      If you do testing on the system, you'll find that Grubby just copies the command line from previous kernels when an update is performed. /etc/default/grub is untouched, and also if you try to create a new grub conf from that file, it changes significantly the grub menu structure compared to what the installer produced.

      WRT the SD Card reader, you are right as well. The module loads and detects a new block device, but the reader doesn't detect media for some reason. I didn't check this last part initially as the kmod-staging package was missing for the latest kernel, so I only checked if the module loaded properly. I'm using an external card reader anyway so it is not an issue for me, but I'll take a look whether this bug has been reported.

      BTW, is your battery working now?

      Delete
    4. Yes it is working, but I didn't open it up, instead I updated the BIOS and that was enough to reset the missed up battery setting. Also I never booted back into the old 3.9.5 kernel which I now sure was the cause of the problem.

      Delete
  4. Hi,
    I've got the same laptop and wanted to change the slow 5400rpm disk with a SSD (actually a 250Go Samsung 840pro). I carefully remove the 5400 and put the SSD, but after remount/rebooting, the BIOS did't show me the drive. Any ideas?

    ReplyDelete
  5. Subwoofer issue has been fixed in kernel 3.13-rc2.
    https://bugzilla.kernel.org/show_bug.cgi?id=65091

    ReplyDelete
  6. Hi,
    I have the same laptop (but with ubuntu 13.10). I was wondering how long battery lasts after all power management tweaks?
    Initially, I got 2 hrs. After bumblebee installation battery lasts for 3 hrs. I was wondering if it gets -significantly- better after other power management tweaks.
    Hmm, also you have SSD now, so you should have much better battery life.

    One more question, I am using synclient to configure clickpad. It's working okay but I heard there's ginn to configure to full potential, but I wasn't able to make ginn work. Can you do pinch-rotate with your clickpad?
    Thanks.

    ReplyDelete
    Replies
    1. Mine last between 3-4 hours.. that's with bumblebee and the backlight on 1 with moderate use.

      I think the battery itself is the limiting factor. I'm sure with light use you will get more than that.

      For the clickpad, I haven't tried ginn. I've got a Anywhere MX and use that instead of the clickpad as much as possible. Sorry!

      Delete
  7. I have the same laptop but with Fedora 20 and I'm having problems with the graphic driver. I'm also a linux newbie so...please be patient. I can only have one resolution: 1920x1080 (16:9). All hte other lower resolutions can be set but never with a 16:9 ratio. It only gives me 5:4 and 4:3 ratios. Is this a graphic driver problema? Can I change this somehow?

    ReplyDelete
    Replies
    1. You need to add custom resolutions to Xorg. Here is an example (for Linux Mint) -

      http://community.linuxmint.com/tutorial/view/877

      Delete
  8. I've been scouring the internet for a way to get my keyboard backlight working in F20 but I've yet to find an answer. I'm on a N550JV with bumblebee installed, in case that matters. I've tried adding acpi_osi= to the grub command line with no success. I've also tried adding asus_nb_wmi.conf file to etc/modules-load.d/ without any success as well. I've asked elsewhere (https://ask.fedoraproject.org/en/question/53830/asus-n550jv-brightness-keys-and-sd-card-reader-not-working/?comment=53980#comment-53980) but it seems like my last resort is to post here: Hey man, would you be the nicest and swellest person I know and help me out here? I'm dying without the ability to control this backlight—even xbacklight doesn't work!

    Thanks!

    ReplyDelete

Missing GPUGraphicsClockOffset and GPUMemoryTransferRateOffset in nvidia-settings for overclocking from the terminal (Linux)

For those that are using Linux and encountering the following error messages when trying to adjust the overclock offset in the terminal - ER...