Installing the Razer Core on Ubuntu 16.04

Step 0: Install Ubuntu

First, follow my previous tutorial to install Ubuntu on the Razer Blade Stealth. I’m using a fresh Ubuntu 16.04.3 64bit install on a Razer Balde Stealth (late 2016).

Step 1: Update the Intel drivers

Start by updating your Intel drivers:

Step 2: Set the kernel options

I had to fiddle a lot to make things work. One of the major problems I got is that the machine wouldn’t properly suspend/shutdown/reboot/logout when I was using the integrated GPU witht the NVIDIA drivers installed.

At some point, I found this seamingly related issue on Bumblebee’s GitHub so I started playing with the kernel ACPI options. And I did not reproduce my issue with the following modifications… so maybe this step is useful, maybe it’s not.

Anyway, edit the value of  GRUB_CMDLINE_LINUX_DEFAULT  in  /etc/default/grub :

Update grub by calling update-grub  then reboot.

Step 3: Install the NVIDIA drivers

Then follow this tutorial to install the NVIDIA’s proprietary drivers version 384.59 and reboot.

Voilà! You should be able to use the descrete GPU and it should be listed in the NVIDIA X Server Settings (GTX 1080) in my case:

Step 4: Disable suspend when plugged in

For your information, I compiled a little recap of the last 3 versions available:

As you can see, things are getting better and version 384.59 appears to be the most functionnal so far.

But we’re not there yet: suspend “works” but it won’t resume properly. But the good thing with the Razer Core is that it provides both the discrete GPU and power. So using the NVIDIA driver implies the machine is plugged in. A simple solution is then to simply change the power options to never suspend when the machine is plugged in.

XPS 13 “Developer Edition” Microphone Fix

It seems the microphone doesn’t work out of the box on the XPS 13 “Developer Edition”. Worse, you’ll actually need to re-compile your kernel to make it work… at least the patches are easy to find thanks to Dell’s “Project Sputnik” leader Barton George:

I used those on the Linux 4.0.2 (stable) kernel, recompiled, installed… and voilà! The microphone works!

Hopefully those fixes will soon be in the kernel main line…

XPS13 “Developer Edition”: Updating the graphics driver

Update: I previously indicated to use the “xorg-edgers” PPA. But it’s far too brutal since it will update a lot of other things (such as the X server) and it might just break. I now recommend using the Oibaf PPA to update only the drivers.

Following my article about a few “out of the box” fixes for the XPS 13 “Developer Edition”, I wanted to upgrade the Intel graphics driver and Mesa. Indeed, I noticed some issues with 3D apps:

  • most games were incredibly slow, or at least a lot slower than what ohter got with the same hardware on Windows (and OpenGL performance are supposed to be on-par or close – if not better – on Linux now);
  • WebGL was not available neither on Chromium nor Firefox, even through their latest stable version.

The pre-installed version of Mesa (10.1.3) is pretty old (May 2014). You can upgrade it to the latest version along with the latest Intel drivers using the “xorg-edgers” PPA the Oibaf “Updated and Optimized Open Graphics Drivers” PPA.

Updating the i915 drivers and Mesa should give you a very important performance boost on 3D apps. I noticed “Counter Strike: Global Offensive” went from barely playable to completely smooth. I also noticed WebGL is now properly available on both Firefox and Chrome.

XPS13 Developer Edition Fixes

I recently bought a brand new XPS 13 “Developer Edition” that I want to use as my main machine for development. I’m very happy to see Dell building machines fit for Linux. The Dell XPS 13 has many very very good reviews. And it’s even better when it comes with Ubuntu pre-installed with all the good drivers (or close…).

dell xps13

It’s too soon to draw any conclusions yet: I’ve been using the computer for only 1 day. Still, I must say it works overall very good and I’m satisfied so far (except for the one or two quirks listed below). Especially by the gorgeous incredible “infinity display”, which packs a 3200×1800 touchscreen in a 13′” screen that fits in 11″ case. The XPS 13 “Developer Edition” comes with Ubuntu pre-installed, and it also comes with a “factory reset” feature you come to expect from a brand such as Dell. So if you brick your Ubuntu install, you can easily reset it without much hassle.

The only problem I encountered is some trackpad freezes that happen to be very annoying. It gives you the feeling the rig is not responsive when it’s actually pretty fast. To fix this, I applied this kernel patch:

You can safely apply this patch to the 3.13 Linux kernel that comes with the XPS 13/Ubuntu 14.04 mint install. But as I had to re-compile the kernel, I wanted to try the recently released stable Linux 4.0.2 kernel.

If you do so, you’ll also need to patch the Broadcom drivers. And because they’re not compatible with Linux 4.0 kernels, you’ll have to apply a little patch: bcmwl driver fixed for Linux 4.0 kernel.

After upgrading to Linux 4.0, I noticed the overall computer feels a lot faster and responsive. I don’t know why but it just does. It might be related to the fact the old 3.13 kernel was not using the new Intel P-state CPU governor.

Last, I also encountered kernel panic issues at three occasions:

  1. When changing access-points or simply disconnecting the Wi-Fi. This fix seams to do the trick: fix for the bcmwl kernel panic/crash.
  2. When suspending, but I guess it’s related to the Wi-Fi issue.
  3. When running a VirtualBox VM. I had to use VirtualBox 5.0 beta and patch Vagrant to support it.

Update: You can get more out of the XPS13 battery using the following script:

Fixing 2013 MacBook Air Ubuntu sound issue

Regarding my Ubuntu adventures for the latest MacBook Air 2013, I already posted about how to:

If you follow those two blog posts, you should end up with a very functional Ubuntu install and the linux 3.11-rc7 kernel working on your MacBook Air 2013. As we’ve already taken care of the Wi-Fi, the touchpad and the keyboard, two issues remain:

  • Brightness settings do not work as expected after suspend.
  • Sound does not work in the speakers (it works fine in the headset though)

In this post, we will see how to fix the second issue. And in order to make the speakers work we will have to patch the kernel and re-compile (yes, again!). Luckily, I have already explained everything you need to know so you’ll just have to follow the same procedure except you have to apply this patch before you re-compile.

When the new kernel is built, install it as usual and don’t forget to re-install the Wi-Fi driver module. Reboot and sound should now work fine!

Now sound is fixed, the brightness issue seams to be the last problem… please let me know if you find anything!

Upgrading to Linux 3.11 on the new MacBook AIR 2013

In my last post I explained how I installed Ubuntu on the new MacBook AIR 2013. The last issues I have are:

  • Sound doesn’t work.
  • Screen brightness is either 0 (total dark) or 1 (totally lit) after coming back from suspend.

I thought both issues might be kernel related. I also read that actual support for Haswell processors was coming in the 3.11 Linux Kernel so I wanted to give it a try. That’s why I started working on compiling the 3.11-rc7 kernel for Ubuntu.

Building the kernel

Building the kernel is really easy. I fetched the sources from the Ubuntu “saucy” repository with the following command:

Before actually building the Kernel, don’t forget the apply the patch to add support for the new mouse/keyboard! Then I just copied my current kernel configuration:

I updated the configuration with the new kernel options:

and I finally build the kernel:

  • The “-j” option will make sure the build process will use as many CPUs as possible
  • “LOCALVERSION=-custom” is used to name your kernel packages with the “-custom” suffix (instead of “-generic”)
  • “INSTALL_MOD_STRIP=1” is used to remove debug symbols and make the final binaries significantly (10 times!) lighter

When the build is finished, just install the packages (they are created in the parent directory):

Fixing the Wi-Fi

The Wi-Fi uses a proprietary Broadcom driver that will need to be re-compile against this new kernel. Compiling the driver module yourself is a nightmare. Instead, you can simply use the package already available in the “saucy” repository:

https://launchpad.net/ubuntu/saucy/amd64/bcmwl-kernel-source/6.30.223.30+bdcom-0ubuntu3

Reboot and you’re all set!

Conclusion

Upgrading to 3.11 does not fix neither the sound nor the brightness problem… or at least not with the rc7. Yet running dmesg you would find an interesting message:

According to what I found on some commit messages, enabling this option in the kernel build configuration might solve the sound issue. I’ll try tomorrow and give you an update! If you have any hint on the sound or the brightness issue please let me know.

Ubuntu 13.04 On The New MacBook Air (2013)

I rencently bought a new MacBook AIR with a 512GB SSD to have a Mac OS, Linux, Windows triple boot. There are lots of tutorial on how to install Ubuntu on a Mac.

Yet, the latest MacBook AIR brings some new hardware. The new Intel Haswell CPU is one of them: it brings both awesome performances and long lasting battery life. Up to 10 hours on Mac OS X! I was very eager to test Ubuntu to see how it would perform and since all Macs are now Intel based I did not expect too much problems. Yet it took me 2 days to get everything (I need) to work.

I encountered problems with:

  • The install process would simply not run.
  • The keyboard special/functions keys where not recognized and some keys are mixed.
  • The trackpad was detected as a mouse: no multitouch, not two-fingers scroll, no right click.
  • The Wi-Fi chip was not installed out of the box.
  • Sound doesn’t work.
  • After suspend, brightness is buggy and is either 0 (fully dimmed) or 1 (fully bright).

I wanted to share my experience (and also make sure I logged those steps somewhere) so here it is!

Installing Ubuntu

The first thing you must be careful about it the ISO disc image you download. You have to make sure it’s a Mac-compatible ISO. If you download the ISO from the official Ubuntu website from Mac OS, you’ll get a Mac-compatible ISO. Otherwise, make sure you download the right one from the Ubuntu Rairing Ringtail download page:

Ubuntu 13.04 (Raring Ringtail) downloads

Now you have the right ISO, you can setup a USB drive using unetbootin. When the drive is ready and plugged, reboot your MBA and make sure you press the Option (Alt) key as soon as it boots. You should then see multiple options and one of them will be named “EFI Boot” with a USB icon. Select this options and press Enter.

Proceed installing Ubuntu normally. Thanks to selecting the EFI Boot option, Ubuntu will install in EFI mode instead of the old-fashioned BIOS emulation mode.

Fixing Ubuntu’s Boot

When Ubuntu is installed, you’ll notice it takes some time to boot. A lot of udev error messages will also appear stating that it failed at locating the HDD or some partitions. To fix this we will add the libata.force=noncq option to our kernel. To do this, when you’re in Grub, just press ‘e’ to edit the command line and on the line starting with “linux” add the libata.force=noncq option at the end of the line.

Press F10 and Ubuntu should start a lot faster without any error message. To make this change permanent, edit the /etc/default/grub file and replace:

with:

Then run update-grub to update your Grub configuration. The kernel option will now be enabled by default and you’ll be able to start Ubuntu without any issue.

Installing the Wi-Fi drivers

Now Ubuntu is setup and booting properly, we will setup the Wi-Fi. To do this, we need to install some proprietary drivers available in the bcmwl-kernel-source package. You can try adding it with apt:

On my machine it does work and ends in a kernel panic. I searched for some time and finally found fixed debian packages:

Just make sure you install both packages at the same time running a command like:

Reboot and Wi-Fi should now work fine!

Fixing the touchpad and the keyboard

This is a bit trickier since we’ll have to re-compile our kernel. I was a bit scared of this since I never did it. Yet I was pleasantly surprised by how easy it is. Ubuntu’s documentation on Building Your Own Kernel is very well made and will teach you everything you need to know.

You just have to follow the article. The only difference is that we will actually patch our kernel before we compile it (the “Building the kernel” step). The patch is available here:

https://launchpadlibrarian.net/148354532/macbookair-3.11-rc6.patch

It’s meant for the 3.11 kernel but the destination files are exactly the same so it will work with Ubuntu’s 13.04 default kernel (3.8.29). To apply the patch, just go to the directory where the kernel sources have been downloaded and run:

The paths won’t match (since this patch was made for the 3.11 kernel). Patch will just prompt you to manully enter the actual path of the destination file. So “linux-3.11-rc6.orig/drivers/hid/hid-apple.c” should be rewritten into “drivers/hid/hid-apple.c” assuming you’re in the “linux-3.8.0” directory.
Using patch -p 1 will make sure the first dorectory is ignored and the patch applies without any problem.

Finish the kernel build/update process and voilà! Both the keyboard and the touchpad should work fine. You can even configure the touchpad in the “Mouse & Touchpad” menu. I also recommend isntalling “pommed” and “pommed-gtk” to have the function keys working nicely.

The only remaining issue is that the “@/#” and the “>/<" keys are mixed. To fix that, we will use xmod to remap those 2 keys:

Test the corresponding keys to make sure it works as expected and then run the following command to make the change permanent:

If you have problems or suggestions please hit the comments!