pwr-Solaar / Solaar

Linux device manager for Logitech devices
https://pwr-solaar.github.io/Solaar
GNU General Public License v2.0
5.33k stars 400 forks source link

Crash on updating UI #2551

Closed TheAyes closed 3 weeks ago

TheAyes commented 1 month ago

Information

rules cannot access modifier keys in Wayland, accessing process only works on GNOME with Solaar Gnome extension installed
solaar version 1.1.13

solaar: error: Traceback (most recent call last):
  File "/nix/store/z7lma5402204akzfcywhshyglm20r2wj-solaar-1.1.13/lib/python3.12/site-packages/solaar/cli/__init__.py", line 221, in run
    m.run(c, args, _find_receiver, _find_device)
  File "/nix/store/z7lma5402204akzfcywhshyglm20r2wj-solaar-1.1.13/lib/python3.12/site-packages/solaar/cli/show.py", line 327, in run
    _print_device(d)
  File "/nix/store/z7lma5402204akzfcywhshyglm20r2wj-solaar-1.1.13/lib/python3.12/site-packages/solaar/cli/show.py", line 101, in _print_device
    print(f"{dev.name}")
             ^^^^^^^^
  File "/nix/store/z7lma5402204akzfcywhshyglm20r2wj-solaar-1.1.13/lib/python3.12/site-packages/logitech_receiver/device.py", line 204, in name
    return self._name or self._codename or ("Unknown device %s" % (self.wpid or hex(self.product_id)[2:].upper()))
                                                                                ^^^^^^^^^^^^^^^^^^^^
TypeError: 'str' object cannot be interpreted as an integer

Contents of `~/.config/solaar/config.yaml`: ``` - 1.1.13 - _NAME: G502 X PLUS _absent: [hi-res-scroll, lowres-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert, thumb-scroll-mode, report_rate_extended, pointer_speed, dpi_extended, speed-change, backlight, backlight_level, backlight_duration_hands_out, backlight_duration_hands_in, backlight_duration_powered, backlight-timed, led_control, led_zone_, brightness_control, fn-swap, reprogrammable-keys, persistent-remappable-keys, divert-keys, disable-keyboard-keys, crown-smooth, divert-crown, divert-gkeys, m-key-leds, mr-key-led, multiplatform, change-host, gesture2-gestures, gesture2-divert, gesture2-params, sidetone, equalizer, adc_power_management] _battery: 4100 _modelId: 4099C0950000 _sensitive: {hires-scroll-mode: ignore, hires-smooth-invert: true, hires-smooth-resolution: true, onboard_profiles: true, report_rate: false, rgb_control: true, rgb_zone_1: ignore} _serial: BFB481BC _unitId: BFB481BC _wpid: '4099' dpi: 7000 hires-scroll-mode: false hires-smooth-invert: false hires-smooth-resolution: false onboard_profiles: 0 per-key-lighting: {1: -1, 2: -1, 3: -1, 4: -1, 5: -1, 6: -1, 7: -1, 8: -1} report_rate: 1 rgb_control: 0 rgb_zone_1: !LEDEffectSetting {ID: 0, color: 9662683, intensity: 0, period: 5000, ramp: 0, speed: 0} - _NAME: G733 Gaming Headset _absent: [hi-res-scroll, lowres-scroll-mode, hires-smooth-invert, hires-smooth-resolution, hires-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert, thumb-scroll-mode, onboard_profiles, report_rate, report_rate_extended, pointer_speed, dpi, dpi_extended, speed-change, backlight, backlight_level, backlight_duration_hands_out, backlight_duration_hands_in, backlight_duration_powered, backlight-timed, rgb_control, rgb_zone_, brightness_control, per-key-lighting, fn-swap, reprogrammable-keys, persistent-remappable-keys, divert-keys, disable-keyboard-keys, crown-smooth, divert-crown, m-key-leds, mr-key-led, multiplatform, change-host, gesture2-gestures, gesture2-divert, gesture2-params] _battery: 7968 _modelId: 0AFE00000000 _sensitive: {adc_power_management: true, hires-scroll-mode: ignore, hires-smooth-invert: ignore, hires-smooth-resolution: ignore} _unitId: FFFFFFFF adc_power_management: 5 divert-gkeys: false equalizer: {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0} led_control: 0 led_zone_1: !LEDEffectSetting {ID: 1, color: 196608, ramp: 0} led_zone_2: !LEDEffectSetting {ID: 0} sidetone: 0 - _NAME: G915 TKL LIGHTSPEED Wireless RGB Mechanical Gaming Keyboard _absent: [hi-res-scroll, lowres-scroll-mode, hires-smooth-invert, hires-smooth-resolution, hires-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert, thumb-scroll-mode, report_rate_extended, pointer_speed, dpi, dpi_extended, speed-change, backlight, backlight_level, backlight_duration_hands_out, backlight_duration_hands_in, backlight_duration_powered, backlight-timed, led_control, led_zone_, fn-swap, reprogrammable-keys, persistent-remappable-keys, disable-keyboard-keys, crown-smooth, divert-crown, multiplatform, gesture2-gestures, gesture2-divert, gesture2-params, sidetone, equalizer, adc_power_management] _battery: 4097 _modelId: B35F408EC343 _sensitive: {brightness_control: true, change-host: ignore, divert-gkeys: ignore, divert-keys: ignore, hires-scroll-mode: ignore, hires-smooth-invert: ignore, hires-smooth-resolution: ignore, m-key-leds: ignore, mr-key-led: ignore, onboard_profiles: true, per-key-lighting: ignore, rgb_control: true, rgb_zone_1: true, rgb_zone_2: true} _serial: BBCB83ED _unitId: BBCB83ED _wpid: 408E brightness_control: 100 change-host: null divert-gkeys: false divert-keys: {209: 0, 210: 0} m-key-leds: {1: false, 2: false, 4: false} mr-key-led: false onboard_profiles: 0 per-key-lighting: {1: -1, 2: -1, 3: -1, 4: -1, 5: -1, 6: -1, 7: -1, 8: -1, 9: -1, 10: -1, 11: -1, 12: -1, 13: -1, 14: -1, 15: -1, 16: -1, 17: -1, 18: -1, 19: -1, 20: -1, 21: -1, 22: -1, 23: -1, 24: -1, 25: -1, 26: -1, 27: -1, 28: -1, 29: -1, 30: -1, 31: -1, 32: -1, 33: -1, 34: -1, 35: -1, 36: -1, 37: -1, 38: -1, 39: -1, 40: -1, 41: -1, 42: -1, 43: -1, 44: -1, 45: -1, 46: -1, 47: -1, 48: -1, 49: -1, 50: -1, 51: -1, 52: -1, 53: -1, 54: -1, 55: -1, 56: -1, 57: -1, 58: -1, 59: -1, 60: -1, 61: -1, 62: -1, 63: -1, 64: -1, 65: -1, 66: -1, 67: -1, 68: -1, 69: -1, 70: -1, 71: -1, 72: -1, 73: -1, 74: -1, 75: -1, 76: -1, 77: -1, 78: -1, 79: -1, 97: -1, 98: -1, 99: -1, 100: -1, 101: -1, 102: -1, 103: -1, 104: -1, 105: -1, 106: -1, 107: -1, 108: -1, 109: -1, 110: -1, 111: -1, 153: -1, 155: -1, 156: -1, 157: -1, 158: -1, 210: -1} report_rate: 1 rgb_control: 1 rgb_zone_1: !LEDEffectSetting {ID: 1, color: 9699539, intensity: 100, period: 5000, ramp: 1, speed: 0} rgb_zone_2: !LEDEffectSetting {ID: 1, color: 9699539, intensity: 74, period: 2507, ramp: 1, speed: 0} ```

Describe the bug Solaar fails to interpret a variable and crashes.

To Reproduce Steps to reproduce the behavior:

  1. Start Solaar
  2. Resize the window or click on a different device
  3. Solaar crashes with the error message seen in the solaar show section.

Additional context Full solaar -ddd stdout of a normal use (start the application, and try to change a setting)

https://pastebin.com/e1yGJce6

pfps commented 1 month ago

That bug is likely fixed in the version of Solaar in this repository. Please use git to download Solaar from this repository. Then from the download directory run Solaar as bin/solaar. If the error still occurs post the output of solaar -ddd.

TheAyes commented 1 month ago

Sadly it's not as easy to do this on nixos, since it doesn't create the binaries in /bin. I'd need to package it myself then, which is a bit too much for me since I'm rather new to this. However I might be able to fetch the git version of solaar using the flake you've linked in your readme. I'll try that and see if that changes anything!

Edit: I've come to the realization, that the flake still just fetches the 1.1.13 tarball. so I'm currently unable to install it without writing my own script for it.

pfps commented 1 month ago

Not /bin. When you clone from this repository you will have a new directory with the Solaar sources. cd to that directory and run bin/solaar. That should start Solaar using the code that you just downloads.

To download Solaar run https://github.com/pwr-Solaar/Solaar.git. That will create a Solaar directory. Then cd Solaar and then bin/solaar to run the downloaded Solaar.

TheAyes commented 1 month ago

I am unable to build the desired environment because I have 0 experience with python and anything related to it. The reason for that is the following: Package requirement 'PyGObject' is not satisfied yet installing it returns an error

Collecting PyGObject
  Using cached pygobject-3.48.2.tar.gz (715 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'

  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [51 lines of output]
      Collecting meson-python>=0.12.1
        Obtaining dependency information for meson-python>=0.12.1 from https://files.pythonhosted.org/packages/91/c0/104cb6244c83fe6bc3886f144cc433db0c0c78efac5dc00e409a5a08c87d/meson_python-0.16.0-py3-none-any.whl.metadata
        Using cached meson_python-0.16.0-py3-none-any.whl.metadata (4.1 kB)
      Collecting pycairo>=1.16
        Using cached pycairo-1.26.1.tar.gz (346 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting meson>=1.2.3 (from meson-python>=0.12.1)
        Using cached meson-1.5.0-py3-none-any.whl
      Collecting packaging>=19.0 (from meson-python>=0.12.1)
        Obtaining dependency information for packaging>=19.0 from https://files.pythonhosted.org/packages/08/aa/cc0199a5f0ad350994d660967a8efb233fe0416e4639146c089643407ce6/packaging-24.1-py3-none-any.whl.metadata
        Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
      Collecting pyproject-metadata>=0.7.1 (from meson-python>=0.12.1)
        Obtaining dependency information for pyproject-metadata>=0.7.1 from https://files.pythonhosted.org/packages/aa/5f/bb5970d3d04173b46c9037109f7f05fc8904ff5be073ee49bb6ff00301bc/pyproject_metadata-0.8.0-py3-none-any.whl.metadata
        Using cached pyproject_metadata-0.8.0-py3-none-any.whl.metadata (3.0 kB)
      Using cached meson_python-0.16.0-py3-none-any.whl (26 kB)
      Using cached packaging-24.1-py3-none-any.whl (53 kB)
      Using cached pyproject_metadata-0.8.0-py3-none-any.whl (7.5 kB)
      Building wheels for collected packages: pycairo
        Building wheel for pycairo (pyproject.toml): started
        Building wheel for pycairo (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error

        × Building wheel for pycairo (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [12 lines of output]
            running bdist_wheel
            running build
            running build_py
            creating build
            creating build/lib.linux-x86_64-cpython-312
            creating build/lib.linux-x86_64-cpython-312/cairo
            copying cairo/__init__.py -> build/lib.linux-x86_64-cpython-312/cairo
            copying cairo/__init__.pyi -> build/lib.linux-x86_64-cpython-312/cairo
            copying cairo/py.typed -> build/lib.linux-x86_64-cpython-312/cairo
            running build_ext
            'pkg-config' not found.
            Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for pycairo
      Failed to build pycairo
      ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects

      [notice] A new release of pip is available: 23.2.1 -> 24.1.2
      [notice] To update, run: pip install --upgrade pip
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 23.2.1 -> 24.1.2
[notice] To update, run: pip install --upgrade pip

Since I have no idea what I should do about it, it might just be best for me to wait for the next tagged release.

pfps commented 1 month ago

OK. The next release should be in a month or so.