Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touchégg daemon crashes with Goodix Capacitive TouchScreen #415

Closed
nicolalandro opened this issue Dec 21, 2020 · 20 comments
Closed

Touchégg daemon crashes with Goodix Capacitive TouchScreen #415

nicolalandro opened this issue Dec 21, 2020 · 20 comments
Milestone

Comments

@nicolalandro
Copy link

Describe the bug

I use this systemctl sevice '/lib/systemd/system/touchegg.service':

[Unit]
Description=Touchegg

[Service]
Type=simple
Group=input
ExecStart=/usr/bin/touchegg --daemon 100 500
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

I run it with following command:

sudo systemctl daemon-reload && sudo systemctl restart touchegg

It doesn't work, but if I open a shell and run /usr/bin/touchegg --daemon 100 500 it works correctly. Did I do something wrong?

Expected behaviour

Run systemctl service and the shortcut run.

Actual behaviour

Run systemctl service return error:

$ journalctl -u touchegg -b -f
-- Logs begin at Wed 2020-04-01 19:23:42 CEST. --
dic 21 15:30:53 mint-X4 systemd[1]: touchegg.service: Failed with result 'core-dump'.
dic 21 15:30:58 mint-X4 systemd[1]: touchegg.service: Scheduled restart job, restart counter is at 374.
dic 21 15:30:58 mint-X4 systemd[1]: Stopped Touchegg.
dic 21 15:30:58 mint-X4 systemd[1]: Started Touchegg.
dic 21 15:30:58 mint-X4 touchegg[18926]: qt.qpa.xcb: could not connect to display
dic 21 15:30:58 mint-X4 touchegg[18926]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
dic 21 15:30:58 mint-X4 touchegg[18926]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
dic 21 15:30:58 mint-X4 touchegg[18926]: Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
dic 21 15:30:59 mint-X4 systemd[1]: touchegg.service: Main process exited, code=dumped, status=6/ABRT
dic 21 15:30:59 mint-X4 systemd[1]: touchegg.service: Failed with result 'core-dump'.
dic 21 15:31:04 mint-X4 systemd[1]: touchegg.service: Scheduled restart job, restart counter is at 375.
dic 21 15:31:04 mint-X4 systemd[1]: Stopped Touchegg.
....

Your environment

  • Version of Touchégg: 1.1.1-0ubuntu4
  • Operating System: Mint 20
  • Desktop Environment: Cinnamon
@JoseExposito
Copy link
Owner

Hi!

You are using a very old version. The one in the Ubuntu repos is way too old, and it doesn't seem to be interest in updating it.

Please delete the service file you created and install from the Deb package:
https://github.com/JoseExposito/touchegg/releases/tag/2.0.4

No extra configuration is required. The service will be installed and started automatically. Just restart and you'll start to see the gestures working.

@nicolalandro
Copy link
Author

With the new version it does not work, it write that:

$ touchegg --daemon 100 500 
Touchégg v2.0.4.
Usage: touchegg [--daemon [threshold animation_finish_threshold]] [--client]

Multi-touch gesture recognizer.
Touchégg is an app that runs in the background and transform the gestures you make on your touchpad into visible actions in your desktop.
For more information please visit:
https://github.com/JoseExposito/touchegg

Option		Meaning
 --daemon	Run Touchégg in daemon mode. This mode starts a service that gathers gestures but executes no actions
 --client	Connect to an existing Touchégg daemon and execute actions in your desktop
Without arguments Touchégg starts in client mode

Starting Touchégg in daemon mode
Starting daemon server...
Server started
A list of detected compatible devices will be displayed below:
Compatible device detected:
	Name: Goodix Capacitive TouchScreen
	threshold: 100
	animation_finish_threshold: 500
New client connected with ID: 4

But after it does not response to nothing. Neither running it from shell neither from service.

@JoseExposito
Copy link
Owner

JoseExposito commented Dec 22, 2020

You don't need to manually run the daemon. I should be already running after installation.

After rebooting, you should see something like:

$ sudo systemctl status touchegg
● touchegg.service - Touchégg
     Loaded: loaded (/lib/systemd/system/touchegg.service; enabled; vendor preset: enabled)
     Active: active (running) since [...]

And in case you want to see the daemon logs:

$ journalctl -u touchegg -b -f

Everything seems to be working fine on your side. Your daemon should be running in the background and the client is connected:

New client connected with ID: 4

Does it work when you swipe in your touchscreen?
If not, could you kill touchegg (client, no sudo required) and share the logs? It is done by:

$ kilall touchegg
$ touchegg

Swipe on your touchscreen just to see what's going on.

@nicolalandro
Copy link
Author

nicolalandro commented Dec 22, 2020

$ journalctl -u touchegg -b -f                        
-- Logs begin at Wed 2020-04-01 19:23:42 CEST. --
dic 22 10:12:03 mint-X4 touchegg[6383]: Without arguments Touchégg starts in client mode
dic 22 10:12:03 mint-X4 touchegg[6383]: Starting Touchégg in daemon mode
dic 22 10:12:03 mint-X4 touchegg[6383]: Starting daemon server...
dic 22 10:12:03 mint-X4 touchegg[6383]: Server started
dic 22 10:12:03 mint-X4 touchegg[6383]: A list of detected compatible devices will be displayed below:
dic 22 10:12:05 mint-X4 touchegg[6383]: Compatible device detected:
dic 22 10:12:05 mint-X4 touchegg[6383]:         Name: Goodix Capacitive TouchScreen
dic 22 10:12:05 mint-X4 touchegg[6383]:         threshold: 0.0197186
dic 22 10:12:05 mint-X4 touchegg[6383]:         animation_finish_threshold: 0.0985928
dic 22 10:12:08 mint-X4 touchegg[6383]: New client connected with ID: 4
dic 22 10:12:34 mint-X4 systemd[1]: touchegg.service: Main process exited, code=dumped, status=8/FPE
dic 22 10:12:34 mint-X4 systemd[1]: touchegg.service: Failed with result 'core-dump'.
dic 22 10:12:39 mint-X4 systemd[1]: touchegg.service: Scheduled restart job, restart counter is at 3.
dic 22 10:12:39 mint-X4 systemd[1]: Stopped Touchégg.
dic 22 10:12:39 mint-X4 systemd[1]: Started Touchégg.
dic 22 10:12:39 mint-X4 touchegg[6457]: Touchégg v2.0.4.
dic 22 10:12:39 mint-X4 touchegg[6457]: Usage: touchegg [--daemon [threshold animation_finish_threshold]] [--client]
dic 22 10:12:39 mint-X4 touchegg[6457]: Multi-touch gesture recognizer.
dic 22 10:12:39 mint-X4 touchegg[6457]: Touchégg is an app that runs in the background and transform the gestures you make on your touchpad into visible actions in your desktop.
dic 22 10:12:39 mint-X4 touchegg[6457]: For more information please visit:
dic 22 10:12:39 mint-X4 touchegg[6457]: https://github.com/JoseExposito/touchegg
dic 22 10:12:39 mint-X4 touchegg[6457]: Option                Meaning
dic 22 10:12:39 mint-X4 touchegg[6457]:  --daemon        Run Touchégg in daemon mode. This mode starts a service that gathers gestures but executes no actions
dic 22 10:12:39 mint-X4 touchegg[6457]:  --client        Connect to an existing Touchégg daemon and execute actions in your desktop
dic 22 10:12:39 mint-X4 touchegg[6457]: Without arguments Touchégg starts in client mode
dic 22 10:12:39 mint-X4 touchegg[6457]: Starting Touchégg in daemon mode
dic 22 10:12:39 mint-X4 touchegg[6457]: Starting daemon server...
dic 22 10:12:39 mint-X4 touchegg[6457]: Server started
dic 22 10:12:39 mint-X4 touchegg[6457]: A list of detected compatible devices will be displayed below:
dic 22 10:12:40 mint-X4 touchegg[6457]: Compatible device detected:
dic 22 10:12:40 mint-X4 touchegg[6457]:         Name: Goodix Capacitive TouchScreen
dic 22 10:12:40 mint-X4 touchegg[6457]:         threshold: 0.0197186
dic 22 10:12:40 mint-X4 touchegg[6457]:         animation_finish_threshold: 0.0985928
$ sudo kilall touchegg
$ touchegg
Touchégg v2.0.4.
Usage: touchegg [--daemon [threshold animation_finish_threshold]] [--client]

Multi-touch gesture recognizer.
Touchégg is an app that runs in the background and transform the gestures you make on your touchpad into visible actions in your desktop.
For more information please visit:
https://github.com/JoseExposito/touchegg

Option		Meaning
 --daemon	Run Touchégg in daemon mode. This mode starts a service that gathers gestures but executes no actions
 --client	Connect to an existing Touchégg daemon and execute actions in your desktop
Without arguments Touchégg starts in client mode

Starting Touchégg in client mode
Parsing you configuration file...
Using configuration file "/home/mint/.config/touchegg/touchegg.conf"
Configuration parsed successfully
Connecting to Touchégg daemon...
Connection with Touchégg daemon lost. Reconnecting in 5 seconds...
Connection with Touchégg daemon lost. Reconnecting in 5 seconds...

It seams the same error that I was with the older version but replicated also when I try to run it by shell.

@JoseExposito
Copy link
Owner

You killed the daemon, the killall command didn't need sudo, as I mentioned in my previous comment. But don't worry, it is easy to fix.

Restart the daemon:

$ sudo systemctl start touchegg

And check the logs:

$ journalctl -u touchegg -b -f 

As you upgraded from a very old version, maybe your config is incorrect, so lets try this to delete your old config:

$ rm -fr ~/.config/touchegg

Now, kill (no sudo) any running clients, and check the logs:

$ killall touchegg
$ touchegg

Also, make sure that you config in /usr/share/touchegg/touchegg.conf is identical to https://github.com/JoseExposito/touchegg/blob/master/installation/touchegg.conf
Just in case it is using the v1 config.

At this point your touchscreen should work. No touchpad was detected, so if you also have a touchpad that's a different issue.

@nicolalandro
Copy link
Author

The config files are the same, but for most care I remove the lib and the file and reinstall it and I try:

touchegg(2777): Operazione non permessa
touchegg: nessun processo trovato
$ sudo systemctl start touchegg
$ touchegg
Touchégg v2.0.4.
Usage: touchegg [--daemon [threshold animation_finish_threshold]] [--client]

Multi-touch gesture recognizer.
Touchégg is an app that runs in the background and transform the gestures you make on your touchpad into visible actions in your desktop.
For more information please visit:
https://github.com/JoseExposito/touchegg

Option		Meaning
 --daemon	Run Touchégg in daemon mode. This mode starts a service that gathers gestures but executes no actions
 --client	Connect to an existing Touchégg daemon and execute actions in your desktop
Without arguments Touchégg starts in client mode

Starting Touchégg in client mode
Parsing you configuration file...
Using configuration file "/usr/share/touchegg/touchegg.conf"
Configuration parsed successfully
Connecting to Touchégg daemon...
Successfully connected to Touchégg daemon
Connection with Touchégg daemon lost. Reconnecting in 5 seconds...
Connection with Touchégg daemon lost. Reconnecting in 5 seconds...
Successfully connected to Touchégg daemon

It seams work at start, but when i use any gesture it crash with the error that you can see also in the previos messages.

@JoseExposito
Copy link
Owner

Ah ok, so the daemon crashes after you perform a gesture on your touchscreen, I didn't know that.

When it crashes, is the daemon only printing Main process exited, code=dumped, status=8/FPE running journalctl -u touchegg -b -f ?

This is a whole lot different issue. By the way, how big is your touchscreen? I see those calculated thresholds way too small.

@JoseExposito JoseExposito reopened this Dec 22, 2020
@JoseExposito JoseExposito changed the title Touchegg service on Cinnamon does not work Touchégg daemon crashes with Goodix Capacitive TouchScreen Dec 22, 2020
@nicolalandro
Copy link
Author

Yes when I perform something it print that error (also me understand this only few moment later, because I run it clean without perform nothing and monitor it during perform something.).
I use a tablet so it have the same size of the screen (1080x 1920) (I am using a Teclast X4).

@JoseExposito
Copy link
Owner

Could you copy and paste the info of your device, please?

$ sudo libinput list-devices

In Ubuntu, that command is installed with the libinput-tools package.

I find those thresholds really small, so let's see what extra information that command gives us.

@nicolalandro
Copy link
Author

libinput_list.txt
The file contains the result of the instruction.

With the version inside ubuntu base repository Work but only if you run from a shell non as a service. I also noticed that the animation is not visible also if specified, maybe in that version the animation does not exist, maybe can be useful information.

@JoseExposito
Copy link
Owner

OK, we found the issue! Have a look to the size your touch screen reports:

Device:           Goodix Capacitive TouchScreen
Kernel:           /dev/input/event4
Group:            8
Seat:             seat0, default
Size:             0x1mm
Capabilities:     keyboard touch 

It reports a size of 0mm x 1mm. Just guessing, but, does it comes with a pen or similar?

After a quick search on Google, apparently this is a common issue:
https://unix.stackexchange.com/a/565389

And here are some instructions by the driver devs:
https://gitlab.com/AdyaAdya/goodix-touchscreen-linux-driver#resolution-information-missing-for-libinput

I hope that works for you!

@nicolalandro
Copy link
Author

Yes I use the driver (but I do not run it as default because when you update the kernel you must recompile it otherwise it does not work). It work correctly as screen with touch and with pen.
This is the same info with the driver enabled
libinput_list_with_driver.txt

I just tested but it does not work

@JoseExposito
Copy link
Owner

Is it still reporting that size after following the steps described here?
https://gitlab.com/AdyaAdya/goodix-touchscreen-linux-driver#resolution-information-missing-for-libinput

That's a pity, there is not much I can do on my side about it, sorry.
With all of this information, you can create a bug report on their bug tracker. Hopefully, they'll be able to fix it:
https://gitlab.com/AdyaAdya/goodix-touchscreen-linux-driver/-/issues


I'll try to create a workaround for this kind of devices for v2.0.5. I'll ping you when it is ready, so you can compile and test it if you want.

@JoseExposito JoseExposito added this to the 2.0.5 milestone Dec 23, 2020
@nicolalandro
Copy link
Author

If it is a bug of the driver the touch does not work properly in general, but in general work. I try something but I fail, so I return to oldest version for now, and I run it manually by shell. I hope to have some better Idea to fix in the future. Thank you for the support!

@JoseExposito
Copy link
Owner

Fair enough. I created a workaround so at least it doesn't crash and gestures should work, but not optimised to your device size.
Just in case you want to compile the lates master and test it:
https://github.com/JoseExposito/touchegg/blob/master/HACKING.md

I thought I left a comment, but I'm not seeing it 🤔

@nicolalandro
Copy link
Author

So you propose to recompile it to use the workaround that you created? I can specify manually before compiling my device size?

@JoseExposito
Copy link
Owner

JoseExposito commented Dec 26, 2020

Yes, you can clone and compile the latest master and set your threshold as explained here:
https://github.com/JoseExposito/touchegg#daemon-configuration

I'd start with 100 500 and test some other values.

Here are some instructions:

# Remove the previous version
$ sudo apt remove touchegg
# In case you have a config file in /home/your-user/.config/touchegg, remove it (create a backup if you want)

# Install the build dependencies
$ sudo apt-get install git build-essential gdb cmake debhelper dh-systemd \
  libudev-dev libinput-dev libpugixml-dev libcairo2-dev libx11-dev libxtst-dev libxrandr-dev libxi-dev \
  libgtk-3-dev

# Create a folder to build the source code
$ mkdir touchegg
$ cd touchegg

# Download the code
$ git clone https://github.com/JoseExposito/touchegg.git
$ cd touchegg

# Build the deb package
$ dpkg-buildpackage -rfakeroot -us -uc -tc
$ sudo apt install ../touchegg_*.deb # Install the package
$ touchegg # Run Touchégg

At this point you should be able to perform gestures, but the animation is not going to be adjusted for your device size.
To adjust the threshold, edit your service file:

$ sudo nano /lib/systemd/system/touchegg.service
# And add 100 500 after --daemon
# Restart the daemon and test the new values

@nicolalandro
Copy link
Author

By compiling it seams work, but I do not find a new version for the scroll action:

<gesture type="DRAG" fingers="2" direction="ALL">
      <action type="SCROLL">SPEED=7:INVERTED=false</action>
</gesture>

@JoseExposito
Copy link
Owner

Yes, I didn't port that action to v2 because it was problematic depending on your screen DPI and because scroll is nowadays better handled by your desktop environment with 1 finger touches that it was in the past.
If you really need that, you can stick with v1.

@nicolalandro
Copy link
Author

nicolalandro commented Dec 27, 2020

At the end I try with this, but sometimes the 4 finger gestur up and down does not work, for example if Firefox is open, instead of left and right work, it is strange. Also pich to zoom does not work well.

<touchégg>

  <settings>
    <!--
      Delay, in milliseconds, since the gesture starts before the animation is displayed.
      Default: 150ms if this property is not set.
      Example: Use the MAXIMIZE_RESTORE_WINDOW action. You will notice that no animation is
      displayed if you complete the action quick enough. This property configures that time.
    -->
    <property name="animation_delay">150</property>

    <!--
      Percentage of the animation to be completed to apply the action.
      Default: 20% if this property is not set.
      Example: Use the MAXIMIZE_RESTORE_WINDOW action. You will notice that, even if the
      animation is displayed, the action is not executed if you did not moved your fingers far
      enough. This property configures the percentage of the animation that must be reached to
      execute the action.
    -->
    <property name="action_execute_threshold">20</property>

    <!--
      Global animation colors can be configured to match your system colors using HEX notation:

        <color>909090</color>
        <borderColor>FFFFFF</borderColor>

      You can also use auto:

        <property name="color">auto</property>
        <property name="borderColor">auto</property>

      Notice that you can override an specific animation color.
    -->
    <property name="color">auto</property>
    <property name="borderColor">auto</property>
  </settings>

  <!--
    Configuration for every application.
  -->
  <application name="All">
    <gesture type="TAP" fingers="2">
      <action type="MOUSE_CLICK">
        <button>3</button>
        <on>begin</on>
      </action>
    </gesture>

    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>

    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="2" direction="ALL">
      <action type="SCROLL">SPEED=7:INVERTED=false</action>
    </gesture>

    <gesture type="TAP" fingers="3" direction="">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Alt_L+Q</keys>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="4" direction="UP">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Alt_L+Up</keys>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="4" direction="DOWN">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Alt_L+Down</keys>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="4" direction="RIGHT">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Alt_L+Left</keys>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="4" direction="LEFT">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Control_L</modifiers>
        <keys>Alt_L+Right</keys>
      </action>
    </gesture>
  </application>

  <!--
    Configuration for specific applications.
  -->

  <application name="Google-chrome,Chromium-browser,Firefox">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>

    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>
  </application>

</touchégg>

Is not true that scroll is handle from the system, for example into Firefox you can only use the scroll bar that can be small so is not easy to click (especially when you are in a hammock :P).
I end my time for now, but when I can I try to go deeper to resolve all problems. Also because when I have a keyboard I prefer keyboard shortcut, but If I have only a screen use the virtual keyboard is very hard.
Thank you again for all. Merry Christmas!

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

No branches or pull requests

2 participants