Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
xubuntu on a Thinkpad Yoga x380

This are a collection of fixes and tweaks I used to get Xubuntu 18.04 LTS working on a lenovo thinkpad X380 yoga laptop.

  • Bios:

  • xubuntu

  • power usage (this gets me ~8 hours):

    • in the BIOS turn of components you wont use like the fingerprint sensor, sdcard reader
    • install powertop, and auto optimize at startup more (don't do this, it makes stylus and other things sleep too often)
      • also check for devices that are drawing lots of power or doing frequent wakeups. The biggest power draw should be the screen/backlight.
    • tlp
      • install
        • sudo apt-get install tp-smapi-dkms acpi-call-dkms tlp tlp-rdw
      • enable
        • sudo systemctl enable tlp
        • sudo systemctl enable tlp-sleep
      • (optional) I also set min and max battery charge for extra life, I use tlpui
      • undervolt using https://github.com/georgewhewell/undervolt this will save power and reduce heat on your lap
        • for me this setting worked under cpu stress `sudo ./undervolt.py --gpu -120 --core -120 --cache -120 --uncore -100 --analogio -100``
        • overall -100mV seems like a good starting point (focus on changing core and cache)
        • install s-tui and use to monitor core temp. Mine went from 55 to 45, and some people got down to 35 degrees (sometimes with reapplying thermal paste). Even 45 makes it more comftorble for lap use.
        • more here
  • keyboard:

  • fix s3 wakeup.

    • without this fix it sometimes has a black screen on wake/login. I could work around this by closing the lid then opening it, but the following is a proper fix
    • set linux commandline option acpi.ec_no_wakeup=1 e.g.
      • one might edit /etc/default/grub and edit GRUB_CMDLINE_LINUX_DEFAULT:
      • e.g. GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi.ec_no_wakeup=1"
      • run sudo update-grub
    • s3 is supported dmesg | grep "ACPI: (supports": ACPI: (supports S0 S3 S4 S5)
  • ssd

  • FIX: To allow youself to scroll with the touchscreen in firefox (with one finger):

    • you need to run xsetwacom --set "Wacom Pen and multitouch sensor Finger touch" Gesture off to have touch register as touch in firefox
      • to make this persist edit /usr/share/X11/xorg.conf.d/70-wacam.conf to have Option "Gesture" "false" lines in the 2 or 3 "Wacom touchscreen class" entry.
    • start firefox with MOZ_USE_XINPUT2=1 firefox
  • Tablet mode scripts. These will do things like auto-rotate the screen

Related info:

hwinfo xinput lspic lsub

lsusb 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 13d3:584b IMC Networks 
Bus 001 Device 005: ID 8087:0a2b Intel Corp. 
Bus 001 Device 004: ID 056a:5155 Wacom Co., Ltd 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ hwinfo --short
cpu:                                                            
                       Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz, 872 MHz
                       Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz, 894 MHz
                       Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz, 892 MHz
                       Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz, 892 MHz
keyboard:
  /dev/input/event4    AT Translated Set 2 keyboard
mouse:
  /dev/input/mice      Wacom Pen and multitouch sensor
  /dev/input/mice      ETPS/2 Elantech TrackPoint
  /dev/input/mice      ETPS/2 Elantech Touchpad
monitor:
                       LG Display LCD Monitor
graphics card:
                       Intel VGA compatible controller
sound:
                       Intel Audio device
storage:
                       Intel Non-Volatile memory controller
network:
  enp0s31f6            Intel Ethernet Connection (4) I219-LM
  wlp4s0               Intel Dual Band Wireless-AC 8265
network interface:
  wlp4s0               Ethernet network interface
  enp0s31f6            Ethernet network interface
  lo                   Loopback network interface
disk:
  /dev/nvme0n1         Intel Disk
partition:
  /dev/nvme0n1p1       Partition
  /dev/nvme0n1p2       Partition
  /dev/nvme0n1p5       Partition
usb controller:
                       Intel Sunrise Point-LP USB 3.0 xHCI Controller
bios:
                       BIOS
bridge:
                       Intel PCI bridge
                       Intel ISA bridge
                       Intel Host bridge
                       Intel Sunrise Point-LP PCI Express Root Port #9
                       Intel Sunrise Point-LP PCI Express Root Port #5
                       Intel PCI bridge
hub:
                       Linux Foundation 2.0 root hub
                       Linux Foundation 3.0 root hub
memory:
                       Main Memory
bluetooth:
                       Intel Bluetooth Device
unknown:
                       FPU
                       DMA controller
                       PIC
                       Keyboard controller
                       Intel Sunrise Point-LP PMC
                       Intel Skylake Gaussian Mixture Model
                       Intel Unclassified device
                       Intel Skylake Processor Thermal Subsystem
                       Intel Sunrise Point-LP CSME HECI #1
                       Intel Serial controller
                       Intel Sunrise Point-LP Thermal subsystem
                       Intel Sunrise Point-LP SMBus
                       Serial controller
                       IMC Networks Integrated Camera
lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)
00:04.0 Signal processing controller: Intel Corporation Skylake Processor Thermal Subsystem (rev 08)
00:08.0 System peripheral: Intel Corporation Skylake Gaussian Mixture Model
00:13.0 Non-VGA unclassified device: Intel Corporation Sunrise Point-LP Integrated Sensor Hub (rev 21)
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
00:16.3 Serial controller: Intel Corporation Device 9d3d (rev 21)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port (rev f1)
00:1c.2 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port (rev f1)
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #5 (rev f1)
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Device 9d4e (rev 21)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (4) I219-LM (rev 21)
04:00.0 Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)
05:00.0 Non-Volatile memory controller: Intel Corporation Device f1a6 (rev 03)
xinput 
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech TrackPoint              	id=14	[slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                	id=15	[slave  pointer  (2)]
⎜   ↳ Wacom Pen and multitouch sensor Finger touch	id=10	[slave  pointer  (2)]
⎜   ↳ Wacom Pen and multitouch sensor Pen stylus	id=11	[slave  pointer  (2)]
⎜   ↳ Wacom Pen and multitouch sensor Pen eraser	id=17	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ Power Button                            	id=8	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=9	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=13	[slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                  	id=16	[slave  keyboard (3)]
    ↳ Integrated Camera: Integrated C         	id=12	[slave  keyboard (3)]
@wassname
Copy link
Author

wassname commented Feb 14, 2020

A 1 year followup review: everything works great except for one gripe. On linux, the stylus goes to sleep if it's >4cm from the screen. It takes about 4 seconds to wakeup. Changing this is not supported in the linux wacom stylus driver.

You can work around this by keeping the pen near the screen when drawing, but if drawing collaboratively it becomes annoying since you need to explain it to people. Stylus sleep isn't a problem on windows.

@rad4day
Copy link

rad4day commented Feb 17, 2020

@wassname are you running powertop with auto tune by any chance?
I had the same problem until just now. Powertop sets the sensors to suspend and it will timeout on resume when the pen comes into proximity.
Just make sure you do not optimize "Autosuspend for USB device Pen and multitouch sensor [Wacom Co.,Ltd.]" with powertop.

@wassname
Copy link
Author

wassname commented Feb 17, 2020

I am! I'll try blacklisting that in the powertop config thanks, I hadn't thought of that :)

EDIT: yes it works, hurrah

@rad4day
Copy link

rad4day commented Feb 24, 2020

Have you got the fingerprint reader working? It's a Validity Sensors 138a:009d in mine

@wassname
Copy link
Author

wassname commented Feb 24, 2020

No I didn't try. Did you?

@rad4day
Copy link

rad4day commented Feb 25, 2020

I tried, but everything looks like it is not that common and there are currently no projects trying to reverse engineer this particular model to create a driver :(

If we're lucky it is not too different from the 009a and the driver which is currently in development could be adapted...

@wassname
Copy link
Author

wassname commented Feb 26, 2020

Damn, fingers crossed

@FabioPratesRocha
Copy link

FabioPratesRocha commented Jul 9, 2020

Hello!
Can you use the biometric reader on it?
I have an X380 with Unbuntu 20.04 but I was unable to activate biometrics. There is also a bug in the video, because when I plug an HDMI monitor it does not initialize, only the initialization screen remains.

@wassname
Copy link
Author

wassname commented Jul 11, 2020

No I never tried to get the biometrics working, but it's useful to know it's difficult.

I had no problem with the HDMI video at all, the only weird things happened when it wasn't waking up from sleep correctly. Besides that I've used HDML on many monitors and projectors, so it's hard to image why yours has a problem sorry.

@rad4day
Copy link

rad4day commented Sep 18, 2021

Our Fingerprint reader
Bus 001 Device 008: ID 138a:009d Validity Sensors, Inc.
works with this library
https://github.com/uunicorn/python-validity

as I just confirmed.

@wassname
Copy link
Author

wassname commented Sep 20, 2021

Good to know, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment