libratbag / piper

GTK application to configure gaming devices
GNU General Public License v2.0
4.79k stars 177 forks source link

[Help Needed] Piper Compiled but not Launching #848

Closed jaamivstheworld closed 1 year ago

jaamivstheworld commented 1 year ago

Libratbag is compiled (latest release march 3, 2023) and enabled as a DBus-activated service. Piper is also compiled on the latest version as of march 3, 2023.

OS is openSUSE Tumbleweed

Issue: Piper is simply not launching. Trying to open piper via the terminal gives the following output:

Traceback (most recent call last):
  File "/usr/bin/piper", line 36, in <module>
    from piper.application import Application
  File "/usr/lib/python3.10/site-packages/piper/application.py", line 4, in <module>
    from .window import Window
  File "/usr/lib/python3.10/site-packages/piper/window.py", line 7, in <module>
    from .mouseperspective import MousePerspective
  File "/usr/lib/python3.10/site-packages/piper/mouseperspective.py", line 5, in <module>
    from .buttonspage import ButtonsPage
  File "/usr/lib/python3.10/site-packages/piper/buttonspage.py", line 7, in <module>
    from .mousemap import MouseMap
  File "/usr/lib/python3.10/site-packages/piper/mousemap.py", line 12, in <module>
    gi.require_version("Rsvg", "2.0")
  File "/usr/lib64/python3.10/site-packages/gi/__init__.py", line 126, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Rsvg not available
staticssleever668 commented 1 year ago

It's basically saying you don't have librsvg installed. Can you check if you have such package?

staticssleever668 commented 1 year ago

Although I think it's supposed to be a dependency of Gtk. Let's just check if you have all of the dependency listed in Piper's build spec for OpenSUSE: AppStream fdupes meson pkgconfig python-rpm-macros python3-cairo python3-cairo python3-evdev python3-evdev python3-flake8 python3-gobject python3-gobject-Gdk python3-gobject-devel python3-lxml python3-lxml update-desktop-files (source https://build.opensuse.org/package/view_file/openSUSE:Factory/piper/piper.spec).

jaamivstheworld commented 1 year ago

Looks like I was missing librsvg-devel and 2 of the dependencies you listed. That allows piper to launch now which is great, but it's spitting out an error saying that it cannot connect to ratbagd and to make sure it is running and I'm in the right group.

A solution was to add myself to the games group but that didn't work. I noticed this when I checked ratbagd's status with systemctl:

× ratbagd.service - Daemon to introspect and modify configurable mice
     Loaded: loaded (/usr/lib/systemd/system/ratbagd.service; enabled; preset: >
     Active: failed (Result: exit-code) since Sat 2023-03-04 10:39:52 EST; 1min>
    Process: 2079 ExecStart=/usr/local/bin/ratbagd (code=exited, status=1/FAILU>
   Main PID: 2079 (code=exited, status=1/FAILURE)
        CPU: 7ms

Something that may be relevant to this error is that I had to copy the ratbagd service file provided to /usr/lib/systemd/system/ because systemctl wasn't able to read the service file.

staticssleever668 commented 1 year ago

What does systemctl stop ratbagd && sudo ratbagd --verbose=raw say?

jaamivstheworld commented 1 year ago

Sudo says that the command ratbagd wasn't found. Running ratbagd without sudo says permission denied.

staticssleever668 commented 1 year ago

Let's run is as sudo ./builddir/ratbagd --verbose=raw then.

Note to myself: I just tried it on my OpenSUSE install, to be able to launch it with sudo when installed you need to use their patch: https://build.opensuse.org/package/view_file/openSUSE:Factory/libratbag/install-daemon-into-sbindir.patch?expand=1 This is needed because they separate /bin and /sbin so that regular users don't have access to /sbin, but we install ratbagd to /bin. In their patch they say Upstream: to be done, so I should check whether I should just merge it myself. For starting with systemd it doesn't matter, however, because the service file has a full path to ratbagd. EDIT: patch merged, https://github.com/libratbag/libratbag/pull/1443