• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Linux Mint 18.3 for Lenovo Yoga Book YB1-X91F - ISO & Request for Help

Search This thread

jekhor

Member
Feb 28, 2018
26
7
Hi jekhor,
thx for your help. Here's the output:
-- Logs begin at Sat 2020-11-21 22:37:26 CET, end at Sun 2020-11-29 20:17:01 CET. --
Nov 21 22:49:10 x91f systemd[1]: Starting Touch keyboard handler...
Nov 21 22:49:10 x91f systemd[1]: Started Touch keyboard handler.
Nov 21 22:49:10 x91f systemd[609]: touch-keyboard-handler.service: Failed to execute command: Permission denied
Nov 21 22:49:10 x91f systemd[609]: touch-keyboard-handler.service: Failed at step EXEC spawning /usr/sbin/touch_keyboard_handler: Permission denied
Nov 21 22:49:10 x91f systemd[1]: touch-keyboard-handler.service: Main process exited, code=exited, status=203/EXEC
Nov 21 22:49:10 x91f systemd[1]: touch-keyboard-handler.service: Failed with result 'exit-code'.
-- Reboot --
Nov 21 23:11:56 x91f systemd[1]: Starting Touch keyboard handler...
Nov 21 23:11:56 x91f systemd[1]: Started Touch keyboard handler.
Nov 21 23:11:56 x91f systemd[1]: touch-keyboard-handler.service: Main process exited, code=exited, status=203/EXEC
Nov 21 23:11:56 x91f systemd[1]: touch-keyboard-handler.service: Failed with result 'exit-code'.
-- Reboot --
Nov 23 20:42:26 x91f systemd[1]: Starting Touch keyboard handler...
Nov 23 20:42:26 x91f systemd[1]: Started Touch keyboard handler.
Nov 23 20:42:26 x91f systemd[610]: touch-keyboard-handler.service: Failed to execute command: Permission denied
Nov 23 20:42:26 x91f systemd[610]: touch-keyboard-handler.service: Failed at step EXEC spawning /usr/sbin/touch_keyboard_handler: Permission denied
Nov 23 20:42:26 x91f systemd[1]: touch-keyboard-handler.service: Main process exited, code=exited, status=203/EXEC
Nov 23 20:42:26 x91f systemd[1]: touch-keyboard-handler.service: Failed with result 'exit-code'.
-- Reboot --
Nov 29 20:13:07 x91f systemd[1]: Starting Touch keyboard handler...
Nov 29 20:13:07 x91f systemd[1]: Started Touch keyboard handler.
Nov 29 20:13:07 x91f systemd[634]: touch-keyboard-handler.service: Failed to execute command: Permission denied
Nov 29 20:13:07 x91f systemd[634]: touch-keyboard-handler.service: Failed at step EXEC spawning /usr/sbin/touch_keyboard_handler: Permission denied
Nov 29 20:13:07 x91f systemd[1]: touch-keyboard-handler.service: Main process exited, code=exited, status=203/EXEC
Nov 29 20:13:07 x91f systemd[1]: touch-keyboard-handler.service: Failed with result 'exit-code'.

Issue `sudo chmod a+x /usr/sbin/touch_keyboard_handler` command.
 

Jeff

Senior Member
Sep 17, 2003
189
27
Brussels, Belgium
Great to see progress for this device. Using Jekhor's latests tar on an Ubuntu 20.04 install, anyone been able to get the keyboard back after S3 post? Really one of the main things keeping this from being primetime. I tried the script that Thipok17 posted - it lights up but no response.
 

jekhor

Member
Feb 28, 2018
26
7
Great to see progress for this device. Using Jekhor's latests tar on an Ubuntu 20.04 install, anyone been able to get the keyboard back after S3 post? Really one of the main things keeping this from being primetime. I tried the script that Thipok17 posted - it lights up but no response.
Hi! I released a new LiveCD targeted to resolve issues with keyboard and digitizer. Now keyboard works after sleep and 'Pen' button switches mode between of keyboard and digitizer.

It is here: https://github.com/jekhor/yogabook-linux/releases/tag/livecd-5.10.2

If you want to update your installed debian-based system, you need to:
- rebuild kernel from here: https://github.com/jekhor/yogabook-linux-kernel (clone to fast x86_64 system, run 'make yogabook_defconfig && make -j <CPU's cores num> bindeb-pkg') and install it (linux-image package)
- build and install following packages (clone and run dpkg-buildpackage):

I will attach .deb files built for debian testing to release at github but touch-keyboard may need recompilation for your distro.
 
Last edited:

ETTT

Senior Member
Oct 26, 2012
60
30
Hi! I released a new LiveCD targeted to resolve issues with keyboard and digitizer. Now keyboard works after sleep and 'Pen' button switches mode between of keyboard and digitizer.

It is here: https://github.com/jekhor/yogabook-linux/releases/tag/livecd-5.10.2

If you want to update your installed debian-based system, you need to:
- rebuild kernel from here: https://github.com/jekhor/yogabook-linux-kernel (clone to fast x86_64 system, run 'make yogabook_defconfig && make -j <CPU's cores num> bindeb-pkg') and install it (linux-image package)
- build and install following packages (clone and run dpkg-buildpackage):

I will attach .deb files built for debian testing to release at github but touch-keyboard may need recompilation for your distro.

Hello, Great work.
I have build the live cd from your git repo and it works.

Is there a reason to make the live cd against debian testing(bulleye) instead of debian stable(buster)?
 

jekhor

Member
Feb 28, 2018
26
7
Hello, Great work.
I have build the live cd from your git repo and it works.

Is there a reason to make the live cd against debian testing(bulleye) instead of debian stable(buster)?
I cannot remember, maybe something didn't work with buster, maybe I took testing because I don't like to stick at debian stable :)
 

Granat1

Member
Jan 6, 2016
5
0
Hi!
I'm new in this thread and I've just installed Archlinux on my YB1-X91L
I'm now trying to install drivers for various things (mainly the Halo keyboard for now) and I ran into a problem.
In this repository you require the android-libbase-dev as a dependency and I'm unable to find a replacement.
I know that this is mainly a Debian vs Arch issue but does anyone have any idea how I could try to resolve it?
 

jekhor

Member
Feb 28, 2018
26
7
Hi!
I'm new in this thread and I've just installed Archlinux on my YB1-X91L
I'm now trying to install drivers for various things (mainly the Halo keyboard for now) and I ran into a problem.
In this repository you require the android-libbase-dev as a dependency and I'm unable to find a replacement.
I know that this is mainly a Debian vs Arch issue but does anyone have any idea how I could try to resolve it?
Just update, it doesn't require android libs anymore. I forget to remove this from the README.
 
Last edited:

ETTT

Senior Member
Oct 26, 2012
60
30
I cannot remember, maybe something didn't work with buster, maybe I took testing because I don't like to stick at debian stable :)

Well it kind of worked on buster.
I was able to make the buster live-cd.
The thing that was not working was the sound.
Just modifying the base debian to bulseye yields a live-cd that has a working sound.
I already have a working debian buster installed on my yogabook so I installed 5.10 kernel and the sound kind of works. The driver loads, alsamixer lists the sound card and allows me to play with the dials.
However trying to play a wav file with aplay I will get an error "unable to set hw parameters" in dmesg I get:

Code:
[   59.084959] intel_sst_acpi 808622A8:00: FW Version 01.0b.02.02              
[   59.125862]  Audio Port: ASoC: no backend DAIs enabled for Audio Port

you have all dmesg attached.
Is there some firmware that is specific to yogabook sound?
Thanks.
 

Attachments

  • dmesg.zip
    22.5 KB · Views: 19

ETTT

Senior Member
Oct 26, 2012
60
30
Well it kind of worked on buster.
I was able to make the buster live-cd.
The thing that was not working was the sound.
Just modifying the base debian to bulseye yields a live-cd that has a working sound.
I already have a working debian buster installed on my yogabook so I installed 5.10 kernel and the sound kind of works. The driver loads, alsamixer lists the sound card and allows me to play with the dials.
However trying to play a wav file with aplay I will get an error "unable to set hw parameters" in dmesg I get:

Code:
[   59.084959] intel_sst_acpi 808622A8:00: FW Version 01.0b.02.02             
[   59.125862]  Audio Port: ASoC: no backend DAIs enabled for Audio Port

you have all dmesg attached.
Is there some firmware that is specific to yogabook sound?
Thanks.

The problem is that debian buster has the version of alsa 1.1.8
yogabook uses ucm2 that is implemented from 1.2 onward.
So after compiling alsa-lib and alsa-utils version 1.2.4 the sound works on buster also, with 5.10 kernel from live-cd.
 

ETTT

Senior Member
Oct 26, 2012
60
30
Now the keyboard/pen switching is done by bind/unbind the i2c device.

I have added a special application that will do just that.

you can play with it at:
https://github.com/BigET/ying-bend

is the ltSwitch app.

It does have problems that the keyboard sometimes will not light up when entering laptop mode, but it will be active, use the pen switching button to make the light comeup.

have fun.
 
  • Like
Reactions: jekhor

jekhor

Member
Feb 28, 2018
26
7
Now the keyboard/pen switching is done by bind/unbind the i2c device.

I have added a special application that will do just that.

you can play with it at:
https://github.com/BigET/ying-bend

is the ltSwitch app.

It does have problems that the keyboard sometimes will not light up when entering laptop mode, but it will be active, use the pen switching button to make the light comeup.

have fun.
Hi! Good job.
In the latest kernel I have disabled PWM1 chip and move keyboard backlight control to the WMI driver (check /sys/bus/wmi/devices/243FEC1D-1963-41C1-8100-06A9D82A94B4/kbd_brightness). I see that you try to control backlight in your code. I can add manual switching of the Halo keyboard mode to the WMI driver to avoid issues with light it up (there are few pieces of ACPI magic inside the driver to switch modes properly).

I think about adding of bending detection to iio-sensor-proxy daemon to make this function available at other devices (https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/ ). Your code can be good starting point for this.

I have accelerometers device numbers changed randomly across device reboots, so I added few properties to hwdb database to inform iio-sensor-proxy about mount place, maybe you can use this info also (check the ACCEL_LOCATION property, see https://github.com/jekhor/yogabook-support/blob/main/61-sensor-yogabook.hwdb).
 

ETTT

Senior Member
Oct 26, 2012
60
30
Hi! Good job.
In the latest kernel I have disabled PWM1 chip and move keyboard backlight control to the WMI driver (check /sys/bus/wmi/devices/243FEC1D-1963-41C1-8100-06A9D82A94B4/kbd_brightness). I see that you try to control backlight in your code. I can add manual switching of the Halo keyboard mode to the WMI driver to avoid issues with light it up (there are few pieces of ACPI magic inside the driver to switch modes properly).

I think about adding of bending detection to iio-sensor-proxy daemon to make this function available at other devices (https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/ ). Your code can be good starting point for this.

I have accelerometers device numbers changed randomly across device reboots, so I added few properties to hwdb database to inform iio-sensor-proxy about mount place, maybe you can use this info also (check the ACCEL_LOCATION property, see https://github.com/jekhor/yogabook-support/blob/main/61-sensor-yogabook.hwdb).

I try to not be dependent of systemd when develop hardware facing software.
But the bending detection is quite strait forward.

You have 4 accelerometers in the device 2 on the display 2 on the keyboard.
They use 2 each so you can test for the stability of the readings (if on the 2 sensors on the screen you have different values then you can assume that the device is itself rotating right now).

For simplicity we say we have one on the display and one on the keyboard.

The 2 accelerometers will tell you the gravity vector relative to the display and keyboard plane respectivelly.

As long as the hinge is not vertical you can calculate the angle between the planes.

There is a poor design decision in the physical device, the keyboard sensor is rotated 90 degrees along the z axis. That is why I rotate it back so we can easily calculate the angle between vectors.
The 90 degree rotation is easy to do in 2 assignments, x=y; y=0-x;

Then see if the hinge is not vertical (in my code it needs to be at least 10 degrees off vertical to continue).
Then calculate the angle between vectors and normalize the angle between [-180; +180].
If the angle is for instance -90, then you have a laptop with 90 degrees between the keyboard and the screen.
If the angle is 0 then the keyboard and the screen are both flat on the table facing the same way.
If the angle is -180 or 180 the device is fully closed or is in full tablet mode with the keyboard on the back of the screen, respectively.

Now, the accelerometer readings are not without errors so in ltSwitch I take some margins.

if I am between -10 to +10 degrees I am on the border so I will not bounce between laptop and tablet mode. This adds a little of hysteresis.
Also If the angle is less then -150 it means that the laptop is almost with the lid closed so I go into tablet mode because I want to disable the keyboard.

If the keyboard is not disabled and the device has the lid closed you will get ghost typing.

In tablet mode I would actually want to disable both keyboard and pen, also remember what was disabled so when going to laptop mode I will enable the one thing that was disabled.

That's about it.

Hope this helps. That 90 degrees rotation about the z axis of the keyboard sensor was a nasty surprise.
 

guillaumeg

Member
May 13, 2015
10
0
Hi, first Thank you for your hard work on making this device nice again
I would have a couple of questions, I have the android version, if I install any Linux in the free memory of the ext4 partition, what will happen to my android? Because I think the grub could erase some bootloader of android? What happened in you case I have little knowledge about android install? Does it became a dual boot?

Second thing, I tried to boot with your LiveCD on the live USB but it tells me to load the kernel first? (but it does not happen when I took a linuxium version of Ubuntu, I mean I am able to boot the live USB) Did I missed something in Jekhor‘s iso file?

Thanks in advance
Best
 

jekhor

Member
Feb 28, 2018
26
7
Hi, first Thank you for your hard work on making this device nice again
I would have a couple of questions, I have the android version, if I install any Linux in the free memory of the ext4 partition, what will happen to my android? Because I think the grub could erase some bootloader of android? What happened in you case I have little knowledge about android install? Does it became a dual boot?

Second thing, I tried to boot with your LiveCD on the live USB but it tells me to load the kernel first? (but it does not happen when I took a linuxium version of Ubuntu, I mean I am able to boot the live USB) Did I missed something in Jekhor‘s iso file?

Thanks in advance
Best
Unfortunately, pure Linux will not work at Android version of the device because it has wrong ACPI information about hardware. But there is a way to replace original ACPI tables by the tables from the YB1-X91* device. I didn't test this yet.
You can start from this thread to learn how to prepare the ACPI tables: https://forum.xda-developers.com/t/how-to-install-windows-on-android-version-yb1-x90l-f.3791641/ and google for way to replace ACPI tables at Linux boot stage.

I don't know anything about Android bootloader and eMMC layout.
 

jekhor

Member
Feb 28, 2018
26
7
Hi!
Touch keyboard driver with international layout and touchpad buttons added:
Sorry, this release contains mistakes in layouts: touchpad virtual buttons are defined as too wide (causes false button presses at pointer moving).

Here is the hotfix:
 

guillaumeg

Member
May 13, 2015
10
0
Unfortunately, pure Linux will not work at Android version of the device because it has wrong ACPI information about hardware. But there is a way to replace original ACPI tables by the tables from the YB1-X91* device. I didn't test this yet.
You can start from this thread to learn how to prepare the ACPI tables: https://forum.xda-developers.com/t/how-to-install-windows-on-android-version-yb1-x90l-f.3791641/ and google for way to replace ACPI tables at Linux boot stage.

I don't know anything about Android bootloader and eMMC layout.
Thanks a lot for your reply, I will maybe try it then
 

Abe.to75

Member
Apr 20, 2021
6
0
Jekhor, first of all thank you for you amazing job. I'm trying the installation from Ubuntu and I'm facing multiple issues; actually, I'm not able to update the kernel and get the keyboard working. I guess it's just me, as I'm a complete noob 😔. On the other hand, the liveCD is working perfectly; i was wandering if you have a quick way to install the OS after booting from the live, as the "Install Debian" does not seem to work. Any hint?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Hi, I am the author of the repository mentioned above, https://github.com/jekhor/yogabook-linux. My linux porting efforts were focused at kernel, getting battery charger driver and halo keyboard working basically. So, this kernel supports the battery gauge, battery charger (with fast charging mode, yes!). For halo keyboard patch for the goodix touchscreen (touchpad really) kernel was needed, see the https://github.com/jekhor/yogabook-linux-kernel/commit/bd3a5953126fd87e4218550c5a31baafcdc60a38 commit. There is userspace keyboard driver in the Chromium OS which converts touchpad events into keypresses. Forked version suitable for build at GNU\Linux system is here: https://github.com/jekhor/chromiumos_touch_keyboard .

    Some patches were accepted to the mainline Linux already:
    0e116237aa42 extcon-intel-cht-wc: Make charger detection co-existing with OTG host mode (v5.1)
    ff6cdfd71495 ACPI / x86: Make PWM2 device always present at Lenovo Yoga Book (v5.1)
    236c765d6abc mfd: intel_soc_pmic_chtwc: Register LED child device (v5.2)
    a72a1be0de71 extcon: intel-cht-wc: Enable external charger (v5.2)

    Feel free to ask me about this work and to create github issues. This is my spare time project, so I will glad to see other developers connected.
    2
    yep i have a YB1-X91F ;)
    ok nice, than i will wait for the next release

    i found out 2 things that did not work (or not correctly or i'm to stupid xD)
    - sound (but i allready see the post in issues ;) )
    - the gui and if i tried video it looks like there is no graphic driver installed (dont know how to specify this, but if i just move a window it looks like software rendering, ok my english should be better to explain this but i hope you know what i mean ^^)
    if i found something more i will give you feedback
    but for now, its rly nice work
    thank you so much for this project :)

    [/CODE]
    I have uploaded fixed iso (halo keyboard should work): https://github.com/jekhor/yogabook-linux/releases/tag/livecd-test3.1

    Yes, no sound, no force-feedback for keypresses.
    Don't know about video driver and acceleration, need to check.
    1
    Now the keyboard/pen switching is done by bind/unbind the i2c device.

    I have added a special application that will do just that.

    you can play with it at:
    https://github.com/BigET/ying-bend

    is the ltSwitch app.

    It does have problems that the keyboard sometimes will not light up when entering laptop mode, but it will be active, use the pen switching button to make the light comeup.

    have fun.
    1
    Help Needed - Battery Gauge/Charger

    The issue

    The following can be seen by running 'dmesg' after boot using the ISO in my first post, which uses a 4.18 kernel customised for the hardware in the Yoga Book.

    The kernel attempts to load the driver for the TI bq24190 battery charger IC. I'm not yet able to post links so search for 'bq24190_charger.c' in the Linux kernel Github repo. The driver throws an error on boot when it hits this code at line 1640. It's expecting a 6 and it gets a 4, the value of BQ24190_REG_VPRS_PN_24190.

    bq24190_charger.c
    Code:
    	if (v != BQ24190_REG_VPRS_PN_24190 &&
    	    v != BQ24190_REG_VPRS_PN_24192I) {
    		dev_err(bdi->dev, "Error unknown model: 0x%02x\n", v);
    		return -ENODEV;
    	}

    If I remove this check altogether and re-compile the module then the driver proceeds to load but reports zeroes for all status values. It's not clear whether it is, in fact, the right chip and isn't talking to the rest of the hardware or it's simply the wrong driver.

    However, at least removing this check allows the Whiskey Cove ACPI IC driver to get a bit further along. Search for 'intel_cht_int33fe.c' in the kernel source. Comments in this file (line 124) confirm that this IC is expected to be paired with a bq24190.

    By adding in dmesg warnings and re-compiling the int33fe module I could see that when an unmodified bq24190 driver is used, i.e. the check above takes place and is failed, the int33fe driver fails its own check at line 138:

    intel_cht_int33fe.c
    Code:
    regulator = regulator_get_optional(dev, "cht_wc_usb_typec_vbus");
    	if (IS_ERR(regulator)) {
    		ret = PTR_ERR(regulator);
    		return (ret == -ENODEV) ? -EPROBE_DEFER : ret;
    	}
    	regulator_put(regulator);

    When I remove the check, it fails at the next check starting at line 145:

    Code:
    	/* The FUSB302 uses the irq at index 1 and is the only irq user */
    	fusb302_irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 1);
    	if (fusb302_irq < 0) {
    		if (fusb302_irq != -EPROBE_DEFER)
    			dev_err(dev, "Error getting FUSB302 irq\n");
    		return fusb302_irq;
    	}

    I have tried various combinations of including the FUSB driver and dependencies as modules/built in but the result is the same. I also tried moving the FUSB check to after the code which tries to link up with the max17047 battery gauge IC, but this fails also.

    Some owners of the Android version of the Yoga Book have posted files/screenshots on Telegram which indicate that a different charger, the bq25892 is used. As far as I know i2c devices are simply identified by the fact that they occupy a certain address on the bus. You can see in the datasheet for the bq24190 (sorry, no links!) on page 3 that it uses i2c address 6BH. The datasheet for the bq25890/2 shows on page 5 that the bq25892 also uses 6BH.

    I don't know enough about i2c to know whether this is the issue, or how to point Linux to a different driver in the way that you might using a VID:pID for a USB or PCI device? It would be really helpful if anybody could definitively confirm which chip we are dealing with.

    Some final ACPI errors crop up towards the end of the dmesg output (I've cleared all the others) and I suspect that sorting this will clear them, as well as making the Yoga Book with Mint usable in Tablet mode.

    Other things which need fixing:

    - There are sound errors in the dmesg output but it also shows that the drivers and codec are loading properly. I can see all the devices which should be visible in amixer from the command line. Because getting the config wrong can blow speakers I've resisted tackling this until I've done further research but if anyone has a solution please let me know.
    - Halo Keyboard. This needs either a kernel module to be written or a software layer which runs at least under X. I don't expect this to be hugely difficult - Linux can see the Halo as a wacom graphics pad and take input, albeit not deal with it properly yet. There's also a mystery, generic HID device which by process of elimination must be the button/backlight. However, the generic HID driver loads so it shouldn't be too hard to work out how to talk to it.
    - I re-built the ISO using Cubic. When I have tried to make ISOs which use my custom kernel to boot the ISO itself, they don't work. I get garbled graphics and the boot stalls. This is why the touchscreen doesn't work when you live boot (which uses 4.10) but does when you install (because it uses 4.18). This ought not to be insurmountable but I haven't cracked it yet. I've tried doing it manually and using the Debian live-boot commands for both Debian/Ubuntu. Still no luck.
    - Until I can get a custom ISO to boot from a custom kernel it won't be possible to install on the SD Card. Otherwise, there's no reason this shouldn't be possible.
    - It should be possible to install to another USB device now, but I haven't tried yet. Make sure to use the disable MMC script on the desktop if you don't want to install Grub EFI on the eMMC. Ubuntu and derivatives ignore whatever you choose for this and just use the fist EFI partition they find. Amazingly this bug has been there since 2014!
    - It ought to be possible to map the hardware buttons (volume, power) to specific keys in Grub, possibly using a locale. This would allow selections to be made without a keyboard.
    1
    android install

    This might be related as I was just installing windows on Android version and now reverted back (https://forum.xda-developers.com/showpost.php?p=77556606&postcount=44), couple of observations that might help you: On android reinstall back it required to activate halo keyboard to get it working again, there was a phone code entered into the search bar to get it activated which triggered something called easyimage app. In android stock image you can actually find easyimage.zip which I guess is this "fake android update" to install the halo keyboard. Inside the zip are *.so libraries and some files related to halo keyboard and ink pen so you could try to play with those to get it working under classic Linux.

    DNX mode allows to boot EFI via a USB cable &*fastboot (I guess windows version have also this as I activated it somewhere in BIOS?) so this can be also alternative version of booting an OS. IMHO Grub can also chainload iso image directly (I did it in past on normal PC, it was a couple of years ago so I can't find the guide to do it now) so in theory you can just place the Linux ISO image as a normal iso file on disk and tell GRUB to chainload that directly. Since it's possible to revert the Windows installation back to Android it might even be possible to dualboot. Android bootloader is also EFI based (kernelflinger) so you could also play with that. TWRP recovery image have full touch support for screen so that might be also a help when digging for configuration or extracting it from the sources.