yashsingh1/xdaforums huggingface dataset:
[Lenovo Yoga Book Questions & Answers] jekhor:
Hi. I returned for some time :)

I trying to get sound working for now but still without success. Driver looks as working but there is no sound in speakers :( I can dump my WiP state of kernel if anybody interested. I am looking for mixer controls dump from the Android kernel (if this is possible). So, if somebody can run 'amixer contents' command (and maybe 'amixer -c1 contents') and save its output, this can help me.
[Lenovo Yoga Book Questions & Answers] thipok17:
Glad you come back, on my github, I have the UCM file for yoga book,. But with your 5.1.16 kernel (from your repo) It still not working. Here's the ucm https://github.com/TiNredmc/YogaBookUCM
[Lenovo Yoga Book Questions & Answers] jekhor:
Thanks, I will check it. I wrote similar configuration by myself but there is no sound played yet.
[Lenovo Yoga Book Questions & Answers] ETTT:
Hi, I want to put here also my efforts to make the yoga-book work on linux (I have a YB1-X91L).

So I have Devuan (debian fork) running on my book.

I had 5.4 compiled with the paches from https://github.com/jekhor/yogabook-linux

But the bluetooth was not working.

I have now 5.7 with the above patches with wifi and bluetooth working (on the bluetooth you have to get the firmware, otherwise it will get a new mac address every time you start so all your pairing will be gone on shutdown).

In 5.7 I have lost the haptic feedback at the keyboard. (in 5.4 was working, need to look into that).

I have made an application that queries the accelerometers (they are working in 5.7 and also the light sensor) and rotates the screen, the touchscreen and the wacom tablet. It also enables or disables the halo keyboard when in laptop mode or tablet mode (the angle between the screen and the keyboard is < 180 degree or not).

You can get it and compile it on https://github.com/BigET/ying-bend

I have made a script that I had binded to the power button that switches between halo keyboard and the wacom tablet. Unfortunately I have not found the input for the pen button above the halo keyboard.

You can get it on https://github.com/BigET/HaloKeyboardSwitcher

What I know it is not working now is: vibrators, sound and web cameras.

What I don't know if are working or not: sdcard and lte.

Maybe it will help someone else.
[Lenovo Yoga Book Questions & Answers] thipok17:
Glad to see you make the >180 degree detection works,

The haptics might require the special udev rules to symlink the eventnumber to /dev/left_vibrator or /dev/right_vibrator . I've made the partially working udev rules. If the special udev rules doesn't work, trying to rollback the driver sourcecode version.

To use the pen Icon, I believe that this feature depend on the goodix touch driver source code. I suspect that it might report the special data packet, Since I replace my keyboard a long time ago. I can't confirm that the Attiny microcontroller on the Flex PCB under the keyboard is involving with the pen Icon (probably the touch sensing of mcu ?) or depend only the goodix touchscreen only. I might desolder it from my old touch keyboard and goes for some reverse engineering the firmware.
[Lenovo Yoga Book Questions & Answers] ETTT:
How to make firefox work properly with touchscreen.

Maybe is a problem specific to Devuan (Debian).

But in case you just get a normal pointer from the touchscreen. Meaning that you cannot scroll the page in firefox if you swipe up/down.

It is actually not a problem with the driver (x11 or evdev).

You have to enable xinput2 client handler in firefox.

More info https://wiki.archlinux.org/index.php/Firefox/Tweaks#Enable_touchscreen_gestures

For me it was sufficient to add the MOZ_USE_XINPUT2 environment variable.

cheers.
[Lenovo Yoga Book Questions & Answers] thipok17:
What about Chrome ? I can't move the tab or chrome windows with touchscreen input, only the mouse cursor works. Any idea ?
[Lenovo Yoga Book Questions & Answers] ETTT:
I will not touch chrome with a 10 foot pole. :)

But there might be 2 issues here.

xinput 2 enable client: take a look here, it might already be done: https://codereview.chromium.org/688253002/

there is a problem in some scenarios when you give some commands with the touchscreen and the window dies before releasing the touch grab, this prevents the clicks in the other windows, I have found a workaround, drag the title bar of a window, this will reset the grab or something.

Besides that I have no idea.
[Lenovo Yoga Book Questions & Answers] ETTT:
Put It in a branch on the repo on github

I will have some time next weekend, can you put the wip somewhere, maybe in a a branch on https://github.com/jekhor/yogabook-linux-kernel and tell me about it, thanks.
[Lenovo Yoga Book Questions & Answers] Juapalso:
Hello, I would like to know what progress you have until today, thank you very much for the work you have done, I am going to acquire a lenovo Yoga Book with windows and I would like to install linux to do computer courses.
[Lenovo Yoga Book Questions & Answers] jekhor:
Hi. I updated repository with kernel with sound working at YB1-X91* and ucm2 configs needed to configure it. Microphones are not tested yet, speakers and headphones works.

See yogabook-linux-kernel submodule and ucm2 folder (files from this folder should be installed over upstream /usr/share/alsa/ucm2 configs).

https://github.com/jekhor/yogabook-linux
[Lenovo Yoga Book Questions & Answers] Juapalso:
I'm going to ask a very beginner's question, but I've never done it. First you would have to install debian with the livecd from your repository and then update the kernel with all the code that you indicate in your comment [MENTION=8976792]jekhor[/MENTION]. I'm sorry if my questions are very new, but even more people are useful. Again great work you have done.
[Lenovo Yoga Book Questions & Answers] thipok17:
You need to install the linux on your YB, you can go get some fast micro SD card and install on that too like I did. First get into bios and disable secure boot (If you're running windows, enable bit locker and keep the recovery key at somewhere else that you can access when bitlocker bug locked your PC)then you need the usb hub, usb mouse + keyboard, flash drive with livecd image (Flash drive is using less power compare to USB hard drive or DVD rom). Enter the setup and after all setup done. you can boot into linux. Note that GRUB2 boot menu won't support touchscreen. The debian will move itself to 1st boot priority. you can modify that once you booted linux and use efibootmgr command (don't forget sudo).

about the sound support. you need to "compile" Linux kernel. There's a guide on internet for how to do that, recommend finding some powerful computer running linux for compiling this, Last time I use my YB to compile the kernel. I let it run overnight and It ate up 12 GB after compilation done so be careful when you running of Micro SD card.

In fact, I've made install tutorial video during pandemic quarantine time. but since after I done it, My school semester start. I might get back and edit all the video and share for all of you soon.

Plus, this might be useful for you. some fixes and secure boot setup guide Here
[Lenovo Yoga Book Questions & Answers] jekhor:
Hi. The LiveCD with sound :)

https://github.com/jekhor/yogabook-linux/releases/tag/livecd-5.10-rc3-1

And the small instruction to get installed Ubuntu 20.10 working (how to install kernel and keyboard/sound support files): https://github.com/jekhor/yogabook-linux/wiki
[Lenovo Yoga Book Questions & Answers] thipok17:
Hi, you have noted the auto-rotation bug. It's belong to Gnome shell bugs, and about the keyboard. I've done some simple systemd script workaround for that too. Plus the haptic motor need to do something with driver to 1. Create separate device with some kind of unique device identifier (e.g. DRV2604-1 DRV2604-2) 2. Fix the device shutdown mode, It's broken and prevent device from sleeping.
[Lenovo Yoga Book Questions & Answers] hal2020:
Feedback & request for help

Hi jekhor,

first of all- THANK YOU very much for putting all the effort in to make linux available for the Yoga Book! This is really appreciated!!!

I followed your instructions as posted above. Here is what happened:

1. First try:

Installed Xubuntu 20.10 (no updates during installation) WITH ZFS. Installed libbase, updated the kernel (with your image as per instruction), copied rootfs. System breaks: ZFS commands not availabe. Hence system not usable.

2. Second try:

Standard partitioning WITH encryption. Rest the same as above. System not usable because keyboard not available when asked for encryption password.

3. Third try:

Standard partitiong. Rest the same as above. Halo keyboard lights up is NOT sensitive for key presses AND the touch screen behaves weird. I then updated Xubuntu as per normal. Now the touch screen works OK, BUT the halo keyboard is still not usable- it lights up but - again - is not sensitive for key presses. So no typing input possible.

Is there anything I can do- like installing another .deb or patching something?

Thank you very much for any idea, input or help!
[Lenovo Yoga Book Questions & Answers] jekhor:
Hi!

Thanks for feedback. The kernel is modified Debian's kernel and it may not work in some cases (I think that using of ZFS is such case).

For keyboard support at early stages of boot you need to add touch-keyboard-handler (binary and configs) and goodix kernel module to initramfs image. I don't have ready instruction for this now.

For third case – could you please check the output of command 'journalctl -u touch-keyboard-handler' (using external keyboard or ssh) and show it here?

---------- Post added at 10:08 PM ---------- Previous post was at 09:51 PM ----------

Good point about haptic driiver. I started to port it but has broke one motor controller during of experiments :( So I temporary paused this effort. But my tablet can sleep without problems anyway.
[Lenovo Yoga Book Questions & Answers] hal2020:
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'.
[Lenovo Yoga Book Questions & Answers] jekhor:
Issue `sudo chmod a+x /usr/sbin/touch_keyboard_handler` command.
[Lenovo Yoga Book Questions & Answers] hal2020:
That did the trick. Xubuntu is now running perfectly!

Thanks!
[Lenovo Yoga Book Questions & Answers] Jeff:
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.
[Lenovo Yoga Book Questions & Answers] jekhor:
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):

GitHub - jekhor/chromiumos_touch_keyboard: touch_keyboard driver from Chromiumos, fork for run it on GNU/Linux

touch_keyboard driver from Chromiumos, fork for run it on GNU/Linux - jekhor/chromiumos_touch_keyboard

github.com

GitHub - jekhor/alsa-ucm-conf-yogabook

Contribute to jekhor/alsa-ucm-conf-yogabook development by creating an account on GitHub.

github.com

GitHub - jekhor/yogabook-support: Lenovo Yoga Book tablet various support files

Lenovo Yoga Book tablet various support files. Contribute to jekhor/yogabook-support development by creating an account on GitHub.

github.com

I will attach .deb files built for debian testing to release at github but touch-keyboard may need recompilation for your distro.
[Lenovo Yoga Book Questions & Answers] ETTT:
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)?
[Lenovo Yoga Book Questions & Answers] jekhor:
I cannot remember, maybe something didn't work with buster, maybe I took testing because I don't like to stick at debian stable :)
[Lenovo Yoga Book Questions & Answers] Cryen:
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?
[Lenovo Yoga Book Questions & Answers] jekhor:
Just update, it doesn't require android libs anymore. I forget to remove this from the README.
[Lenovo Yoga Book Questions & Answers] Cryen:
Thanks!

I cloned the master branch instead of 1.1 release and the installation finished successfully.
[Lenovo Yoga Book Questions & Answers] ETTT:
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:

[ 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.
[Lenovo Yoga Book Questions & Answers] ETTT:
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.
[Lenovo Yoga Book Questions & Answers] ETTT:
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.
[Lenovo Yoga Book Questions & Answers] jekhor:
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).
[Lenovo Yoga Book Questions & Answers] ETTT:
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.
[Lenovo Yoga Book Questions & Answers] guillaumeg:
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
[Lenovo Yoga Book Questions & Answers] jekhor:
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://xdaforums.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.
[Lenovo Yoga Book Questions & Answers] jekhor:
Hi!

Touch keyboard driver with international layout and touchpad buttons added:

Release International keyboard layouts · jekhor/chromiumos_touch_keyboard

Release notes: Mouse keys along of sides of the touchpad area are added. To customize them, see latest lines (with BTN_* entries) in the keyboard layout files. Make virtual touchpad geometry custo...

github.com
[Lenovo Yoga Book Questions & Answers] jekhor:
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:

Release Touchpad buttons hotfix · jekhor/chromiumos_touch_keyboard

Fix the virtual touchpad buttons geometry definitions (were defined with invalid width).

github.com
[Lenovo Yoga Book Questions & Answers] guillaumeg:
Thanks a lot for your reply, I will maybe try it then
[Lenovo Yoga Book Questions & Answers] Abe.to75:
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?
[Lenovo Yoga Book Questions & Answers] jekhor:
Maybe, but describe what kind of issues you met, please.