What to fix with the fresh factory Ubuntu 16.04 on a Dell XPS 13 9360 (Q&A) [closed]

The Dell factory installed Ubuntu on 16.04 has a few shortcomings that needed to be fixed before it is fully useful. Below are the things I had to fix. Please feel free to add yours as well.

[NB] As suggested by the admins I have set up a thread on Ubuntu Forums https://ubuntuforums.org/showthread.php?t=2357424


Here is my list, based on recommendations from the Arch Linux Wiki on the Dell XPS 13 (9360).

Update linux-firmware in order to get the i915 guc and huc blobs

Manually install latest linux-firmware (at least released after 20170217).

  1. Go to the Ubuntu linux-firmware package site for zesty.
  2. Click on "linux-firmware 1.xyz in amd64 (Release)", where xyz is the latest version you see on the page. (Assuming you need 64-bit packages)
  3. Under Downloadable files click to download the .deb file.
  4. Double-click the downloaded file to install it.

Update to the latest kernel to get NVMe power savings

Manually install kernel 4.11rc1 or later to get an NVMe power savings patch (download the linux-image-generic, linux-headers and linux-headers-generic for the version you choose). This alone should net you an idle power savings of 30%.

  1. Go to the Ubuntu mainline kernel site.
  2. Scroll to the bottom of the page and click the bottom link.
  3. Click to download the amd64 .deb files:
    • linux-headers-*.deb
    • linux-headers-*-generic.deb
    • linux-image-*-generic.deb
  4. Double-click the downloaded files to install them.
  5. Run sudo update-grub.

Improve graphics performance and power savings

Requires above two updates first!

Edit /etc/default/grub and include the following options after GRUB_CMDLINE_LINUX_DEFAULT="quiet splash to improve video driver power savings and performance:

i915.modeset=1 i915.enable_rc6=1 i915.enable_fbc=1 i915.enable_guc_loading=1 i915.enable_guc_submission=1 i915.enable_huc=1 i915.enable_psr=1 i915.disable_power_well=0 i915.semaphores=1

Run sudo update-grub.

Note that you should be able to add these into a .conf file for the i915 module, but Ubuntu doesn't seem to look at the file when I create it, which is why I recommend this method instead. Also, not all options are supported at this time (such as enable_huc and sempahores, but may be in the future in later kernels or linux-firmware releases).

I've tested Borderlands 2 with this and see an improvement of about 5 FPS (on an original 26 FPS). I also see a slight decrease in power usage.

Ensure you get the best wireless speeds

Edit /etc/default/crda and set your country code at the end of the REGDOMAIN line.

eg. REGDOMAIN=US

Fix palm detection on the touchpad

Install xserver-xorg-input-libinput.

Create /usr/share/X11/xorg.conf.d/90-libinput.conf containing:

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "Tapping" "True"
        Option "PalmDetection" "True"
        Option "TappingDragLock" "True"
EndSection

Fix some screen tearing issues

Create /usr/share/X11/xorg.conf.d/20-intel.conf containing:

Section "Device"
        Identifier  "Intel Graphics"
        Driver      "intel"
        Option      "AccelMethod" "sna"
        Option      "TearFree"    "true"
EndSection

Cooling Fan spins up because of a faulty samba process

The culprit is gvfsd-smb-browse process.

Add the statement below to [global] section of your /etc/samba/smb.conf

name resolve order = wins lmhosts bcast

https://itsfoss.com/fix-gvfsd-smb-high-cpu-ubuntu/

Remove conflicting duplicate touchpad driver

To get things working properly, I needed to disable the second touchpad device "SynPS/2 Synaptics TouchPad". I think it was mostly being ignored, and syndaemon was attaching to it instead of "DLL0704:01 06CB:76AE Touchpad", which was actually managing the touchpad.

I disabled it in the Xorg config file. I opened:

/usr/share/X11/xorg.conf.d/51-synaptics-quirks.conf

and added this entry:

Code:

# Disable generic Synaptics device, as we're using
# "DLL0704:01 06CB:76AE Touchpad"
# Having multiple touchpad devices running confuses syndaemon
Section "InputClass"
        Identifier "SynPS/2 Synaptics TouchPad"
        MatchProduct "SynPS/2 Synaptics TouchPad"
        MatchIsTouchpad "on"
        MatchOS "Linux"
        MatchDevicePath "/dev/input/event*"
        Option "Ignore" "on"
EndSection

https://ubuntuforums.org/showthread.php?t=2316240

Activate Touchpad Palm Detection

Add to /usr/share/X11/xorg.conf.d/50-synaptics.conf after line 13 an Option "PalmDetect" "1" so the overall this section looks like this:

Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
    Option "PalmDetect" "1"
# This option is recommend on all Linux systems using evdev, but cannot be
# enabled by default. See the following link for details:
# http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html
      MatchDevicePath "/dev/input/event*"
EndSection

https://erik.torgesta.com/2016/11/things-to-improve-ubuntu-16-04-on-dell-xps-13-9630/

sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install touchpad-indicator
/opt/extras.ubuntu.com/touchpad-indicator/bin/touchpad-indicator&

The touchipad icon should appear in the notification area. Go to preferences, Set General Options->Autostart and Actions->Disable Touchpad on typing. Youst may want to adjust the delay in milliseconds too.

Changing the scrolling direction of the two-finger scrolling on the touch-pad:

EDIT: the below file doesn't seem to have any effect on the scrolling but breaks the mouse functionality. I have deleted it again but do not have the problem with the scrolling anymore.

Alternate method from https://askubuntu.com/a/519859/452753 worked for me:

In the file /usr/share/X11/xorg.conf.d/20-natural-scrolling.conf you have opened in your preferred text editor, paste the following:

Section "InputClass"
        Identifier "natural scrolling for mouse wheel"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "mouse"
        Option "Device" "/dev/input/mice"
        Option "Protocol" "Auto"
        Option "ZAxisMapping" "5 4"
EndSection

Save the file and reboot. As above, individual users can switch it off on a per-user basis by using Ubuntu-Tweak to "turn on" natural scrolling (it will be the reverse of the system-wide setting on a per-user basis but will not affect the actual system setting for other users who will want to use natural scrolling).

Get the F1-F12 row to function as such instead of media keys by default

How to invert fn keys on Dell Laptop? Press F2 during POST (Power On Self Test) to enter the System Setup (BIOS) utility.

In the Function Key Behavior, select Multimedia Key First or Function Key First.

Function Key First — This is the default option. Press any function key to perform the associated function. For multimedia action, press Fn + the required multimedia key.

Lacking dedicated page up/down, home/end buttons.

The XPS 13 keyboard has these buttons combined with the arrow buttons and so one needs two hands to access them (pressing Fn required). Here I re-purpose Print button to act as a Home button and Insert as PgDn:

xmodmap -e "keycode 107 = Home" # using "Print" button
xmodmap -e "keycode 118 = Next" # using "Insert" button

Remove the Print shortcut to Screenshot in the System Settings->Keyboard ->Shortcuts->Screenshots

Right Ctrl (with the list symbol) + up_arrow/down_arrow function as home/end as well.

Encrypted home directory blocks ssh key based authentication and vpn client

This is not strictly an XPS or 16.04 related issue, but it is helpful to know that you need to move your authorized_keys file outside of your encrypted home directory in order to be able to use ssh key based authentication. https://help.ubuntu.com/community/SSH/OpenSSH/Keys#Troubleshooting

Here is a help entry from one of the VPN providers on the fix for their software in case you are using encrypted home directory. https://helpdesk.privateinternetaccess.com/hc/en-us/articles/227831828-Installing-the-PIA-app-on-Linux-with-encrypted-home-directories

Change Default Power Button Behaviour From Interactive to Suspend

gsettings set org.gnome.settings-daemon.plugins.power button-power suspend

Monitor Stays Blank After Suspend When External Monitor Was In Use

This issue seems to pertain to poor Thunderbolt protocol support in older kernels. Problems crashing/hanging after plugging/unplugging monitors seem to go away after updating the kernel - see below.

Update to latest HWE Kernel

The 4.4.0 kernel that ships with the XPS 13 seems to have some problems with WiFi breaking, resuming from sleep, and external monitors that goes away with a kernel update.

There are many options for updating the kernel, however as far as I can tell the best approach is to install a signed (because the original image was signed and UEFI may complain without it) HWE (Hardware Enablement) kernel along with the image-extra drivers. HWE is especially important because the 4.10 and 4.13 kernel updates bring significant improvements in Thunderbolt 3 support--super important if you are using a docking station. The following command does that:

sudo apt install linux-signed-generic-hwe-16.04 linux-image-extra-virtual-hwe-16.04

If you don't install linux-image-extra-virtual-hwe your WiFi and touchpad will probably not work.

This kernel update may also fix the above issue with the screen not working after resume / connection to external monitor.