timothycrosley / streamdeck-ui

A Linux compatible UI for the Elgato Stream Deck.
https://timothycrosley.github.io/streamdeck-ui/
MIT License
1.13k stars 241 forks source link

Started crashing on startup after system update #271

Closed BrianAllred closed 1 year ago

BrianAllred commented 1 year ago

Describe the bug streamdeck-ui crashes on startup. I don't think this is due to a change in streamdeck-ui itself, but possibly pynput, Gnome, or Wayland. But I figured I'd start here and work my way down the chain. It used to work, but stopped in the last few days.

I checked my pacman log, the only relevant python/gnome/wayland/streamdeck packages updated within the past few days were gnome-shell (1:43.1-1 -> 1:43.1-2) and python-elgato-streamdeck (0.9.1-1 to 0.9.3-1).

To Reproduce Steps to reproduce the behavior:

  1. Run streamdeck from terminal
  2. Review console output
  3. See error

Expected behavior Application runs

Screenshots Error log:

$ streamdeck                                  Mon 14 Nov 2022 11:12:24 AM CST
Traceback (most recent call last):
  File "/usr/sbin/streamdeck", line 5, in <module>
    from streamdeck_ui.gui import start
  File "/usr/lib/python3.10/site-packages/streamdeck_ui/gui.py", line 11, in <module>
    from pynput import keyboard
  File "/usr/lib/python3.10/site-packages/pynput/__init__.py", line 40, in <module>
    from . import keyboard
  File "/usr/lib/python3.10/site-packages/pynput/keyboard/__init__.py", line 31, in <module>
    backend = backend(__name__)
  File "/usr/lib/python3.10/site-packages/pynput/_util/__init__.py", line 76, in backend
    raise ImportError('this platform is not supported: {}'.format(
ImportError: this platform is not supported: ('failed to acquire X connection: Can\'t connect to display ":0": b\'Authorization required, but no authorization protocol specified\\n\'', DisplayConnectionError(':0', b'Authorization required, but no authorization protocol specified\n'))

Try one of the following resolutions:

 * Please make sure that you have an X server running, and that the DISPLAY environment variable is set correctly

Operating system (please complete the following information)

Stream Deck Version

snide commented 1 year ago

Just a small note that I ran into this as well after updating Gnome to 43. My guess is this is something related to wayland / X11 compatibility.

jvzr commented 1 year ago

I've had this too, on Gnome 43 as well. It appears that KDE users are getting this as well (issue #243)

snide commented 1 year ago

Small note for those that might need an alternative that works currently in Gnome 43. Boatswain looks like it works. Unfortunately I haven't learned to have it exec scripts, but it has pretty good OBS / application support.

https://gitlab.gnome.org/World/boatswain

dhtseany commented 1 year ago

Hi, I'm the package maintainer of streamdeck-ui on Arch and I can confirm that a 100% fresh build with Gnome 43 produces this bug. I'm happy to provide testing resources as well as providing any detailed troubleshooting that might be required.

dhtseany commented 1 year ago

Hi there, circling back on this as we haven't had any recognition from the dev staff yet for this xorg bug.

A workaround for those landing here from Google:

  1. Run: $ xhost +
  2. Run: $ streamdeck

This will allow the app to launch however I think this is somewhat of a workaround and not a proper fix. Any assistance from the dev team would be appreciated. Thanks!

Jost-Philip commented 1 year ago

Is there any new development on this? As I understand it this is not so much a defect as a (deliberate) policy change in the way Wayland handles desktop session security.

dodgyrabbit commented 1 year ago

Wayland has a more secure model. The pynput library emulates keypresses to allow you to "type" or "press keys". I guess there are some security concerns and Wayland has a more restrictive model.

Unless pynput adds support (if it's even possible) or an alternative approach is found - we could remove the dependency on pynput. This would mean reduced functionality (you can't use the text or keypress functions), but IMHO you can still do quite a bit by executing commands. May be good enough for many. Would like to get people's feedback on this.

dodgyrabbit commented 1 year ago

Please update to 2.0.13, it should avoid this crash (and not require the xhost + workaround).

tnais commented 1 year ago

Hi there, circling back on this as we haven't had any recognition from the dev staff yet for this xorg bug.

A workaround for those landing here from Google:

1. Run:
   `$ xhost +`

2. Run:
   `$ streamdeck`

This will allow the app to launch however I think this is somewhat of a workaround and not a proper fix. Any assistance from the dev team would be appreciated. Thanks!

It might be a workaround (does non work on Linux sequoia 6.2.0-20-generic #20-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 6 07:48:48 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux - ubuntu lunar) but it is also an heck of security issue if you put your x-server in listening on port 6000.

I am using X11.