Lenovo X1 Carbon 7th generation vs. Ubuntu 19.10

i love my old Lenovo X1 Carbon 5th generation, it is light, still large enough to work productively while on the go and it has a long battery life. however, i recently got a new 7th generation x1 and would really love to use it instead due to the much better display (Hi-DPI, which starts to become usable even with Linux) and it supposedly lasts even longer on battery power.

sadly though, the Linux compatibility somehow is not the same anymore as on my old one. My 5th Gen worked out of the box from day 1, on the 7th gen i am struggeling to get some stuff working, even tough it is on the list of certified hardware for ubuntu!

i have currently the latest and up-to-date ubuntu 19.10 installed, but am still facing some issues:

trackpad stops working

… every now and then.. mostly after wakup from suspend but sometimes even right after booting the computer

not fixed so far! supposedly there should be a firmware upgrade for the synaptics touch pad which could fix this. the problem is, the synaptics pad firmware can only be updated under windows and I don't have a windows partitoin anymore!

another suggestion is, that it might have something to do with the NFC module but that did not change anything when i tried it.

internal LTE modem does not work

the 7th gen comes with a L850-GL modem. It is started in PCIe mode but there are no linux drivers for the module in pcie mode and there will never be pcie drivers. The module has however also a USB mode and in USB mode it behaves like a normal USB dongle and can be used in Linux as well!

the best solution i've found so far is to use the xmm7360_usb module which basically is a module to disable the pci device so that the modem initializes as usb device. It seems to work nicely and there is no further action needed except for installing the module. It will automatically be loaded on every boot.

one inconvenience might be, that the module needs to be recompiled upon a kernel update, but this can be automated with dkms.

here is how i've successfully installed the module.

  1. disable secure boot (actually i'm not sure if this is needed but i had mine disabled anyways)
  2. download the latest version of the xmm7360_usb module from the link above
  3. unpack it to /usr/src/xmm7360_usb-master where “master” is the verison
  4. inside this directory, create a dkms.conf file with the following contents
    MAKE="make"
    CLEAN="make clean"
    BUILT_MODULE_NAME="xmm7360_usb"
    BUILT_MODULE_LOCATION=./
    PACKAGE_NAME=xmm7360_usb
    PACKAGE_VERSION=master
    REMAKE_INITRD=yes
    DEST_MODULE_LOCATION=/extra
    </conf> 
      - add moudle to dkms <code>dkms add xmm7360_usb -v master
  5. build the module using dkms:
    dkms build xmm7360_usb -v master
  6. install the module using dkms:
    dkms install xmm7360_usb -v master

after that either load the module using

modprobe xmm7360_usb

or reboot your pc

you should now see the modem with lsusb:

Bus 001 Device 007: ID 2cb7:0007 Fibocom MBIM + 3 CDC-ACM

next the modem needs to be configured to turn on and stay on as usb serial device. this needs to be done only once and it will be permanently kept this way even after a reboot.

on my X1 gen 7 i had to run these commands to disable the FCC lock and enable the modem:

at@nvm:fix_cat_fcclock.fcclock_mode=0
at@store_nvm(fix_cat_fcclock)
AT+GTUSBMODE?
AT+GTUSBMODE=7
AT+CFUN?
AT+CFUN=15

the modem should now show up in your network manager drop-down and you should be able to click through the gui to configure your phone provider and dial in.

other solutions

there is a script available. It's called xmm2usb and can be run to switch the modem into usb mode. The above module was inspired by this script. After switching the modem into usb mode for the first time, the usb mode must be changed from 0 to 7. Once this is done, ubuntu will detect a broadband modem and off you go.

The problem with this solution is, that you need to run this script every time the PCI card is re-initialized which is at least aver every reboot if not after every wakeup (haven't tried this yet). This alone would be no problem, but the script needs a kernel module called acpi_call which is poorly maintained and won't compile on newer kernels (4.5.5 and newer iirc) without modification of the source code. The modification is very simple however, simply make sure that at the begining of the file acpi_call.c the two include statements for acpi.h and uaccess.h contain the path linux/acpi.h and linux/uaccess.h and not acpi/acpi.h etc.. once this is changed the module will compile but make install won't install it and it will not be loadable using insmod because of secure boot. So you need to disable secure boot and then you can load the module via sudo insmod acpi_call.ko. once this is done, the xmm2usb script can be run. however, the script will try to load the module via modprobe which won't work because make install failed.. I simply commented out the modprobe line in the script and it worked.

now all these snags can be fixed somehow and the startup of this cript could be automated using systemd or whatever.. however, a poorely maintained kernel module that needs to be recompiled after every kernel update does sound like trouble. maybe dkms could help with the re-compiling.

so the best solution would be to simply use a card that is linux compatible. so i took the card out of my gen 5 and put that one into my new gen 7.. sadly the notebook will refuse to boot because the bios detects that the card is no longer one of the few whitelisted cards that Lenovo allows you to use in your notebook. there are possibilities to fix this by either modifying your card to emulate another PCI-ID or by modifying the bios, but that's dangerous and will be undone as soon as the next bios update is published, which, given other issues, is something you want to install on the 7th gen notebook.

I've therefore tried to disable the PCIe link on the original card, so that it will start as USB device (that's the documented behaviour, the card will first try to establish a PCI link, if that fails it will start as USB device). I believe i was successful by covering up all odd pins from 41 to 55, but the problem is, that in this case the card is again blocked by the bios because the USB mode is not whitelisted either!

so the best solution to date seems to be the module as described above

the speaker volume can only be 100% or 0%

any volume higher than 0% will result in 100% volume (even though a lower value is displayes it will scream out of its speakers)