2018-08-06

Ubuntu 18.04 on Asus Transformer Mini (T102H)

Installation


Create a USB drive with a single FAT32 partition then extract the installation ISO into it using 7z:

7z x /path/to/ISO -o/path/to/usb

Note that there is no space between -o and the following path.

Plug in the USB drive then turn on the T102H while pressing the ESC key. This will allow you to enter the settings menu and allow you to boot from USB. Select installation and follow the instructions until asked to reboot.

Xorg Setup


An immediate problem is that the display is portrait by default. Additionally the modesetting driver is used which has worse performance than the intel driver. Fix both of these issue by placing the following file in /usr/share/X11/xorg.conf.d/99-transformer.conf:

Section "Device"
 Identifier "i915"
 Driver "intel"
 Option "TearFree" "true"
 Option "DRI" "2"
 Option "Backlight" "intel_backlight"
EndSection

Section "Screen"
 Identifier "Screen0"
 Monitor "BuiltInLCD"
EndSection

Section "Monitor"
 Identifier "BuiltInLCD"
 Option "Rotate" "right"
EndSection

Section "InputClass"
 Identifier "BuiltInTouchscreen"
 MatchProduct "ELAN22A6:00 04F3:22A6"
 Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
EndSection

This sets the display driver to intel, rotates the monitor, and also transforms touchscreen inputs to match the landscape orientation.

i915

To further improve performance place the following into /etc/modprobe.d/i915.conf
options i915 enable_fbc=1 enable_guc=3 enable_psr=1 disable_power_well=0 semaphores=1

Backlight


Out of the box backlight doesn't work because of a module loading order issue [96571]. The easiest fix, found in the bug report thread, is to use dracut to remove the i915 module from initramfs so it loads after the PWM modules.

sudo apt install dracut
sudo dracut -f --omit-drivers="i915"
sudo update-grub

This issue may be fixed in a later release as the issue has been reported to Ubuntu.

After rebooting /sys/class/backlight/intel_backlight/ should exist, indicating that backlight control is available.

Keyboard Backlight Control


Unfortunately while we can now control the backlight using programs like xbacklight, the screen brightness keys (fn+F5 and fn+F6) don't work. We can get around this by binding control-F5 and control-F6 to trigger xbacklight -dec 20 and xbacklight -inc 20 respectively to decrement/increment screen brightness by 20% per keyboard press.

Airplane Mode


Similar to the backlight control buttons the airplane mode button also doesn't work. The following script uses rfkill to toggle bluetooth and wifi on/off, effectively implementing airplane mode in software. I haven't found a way to disable bluetooth and wifi in hardware.

#!/bin/bash

BLUETOOTH_OFF_BY_DEFAULT=1

n_devices="$(rfkill -n | wc -l)"
n_blocked="$(rfkill -n | grep -w blocked | wc -l)"

echo "$n_devices devices, $n_blocked blocked"

if [ "$n_blocked" == "$n_devices" ]; then
  rfkill unblock bluetooth wlan

  if [ "$BLUETOOTH_OFF_BY_DEFAULT" == "1" ]; then
    rfkill block bluetooth
  fi
else
  rfkill block bluetooth wlan
fi

Power Saving


It is a good idea to install tlp to improve the running time

TODOs:

  • Script and keybindings to rotate the screen and touchscreen
  • Pressure level with the pen