timothycrosley / streamdeck-ui

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

StreamDeck UI crash after Gnome Restart #214

Closed WMRamadan closed 2 years ago

WMRamadan commented 2 years ago

Describe the bug StreamDeck UI seems to crash after Gnome is restarted using Alt+F2 - r while streamdeck is in sleep mode. Even after streamdeck is restarted streamdeck_ui will not restart.

To Reproduce Steps to reproduce the behavior:

  1. Start StreamDeck UI
  2. Set a short sleep time for streamdeck and wait until it goes to sleep
  3. Restart Gnome by presseing Alt+F2 and enter r in Run a Command prompt
  4. See ERROR

ERROR

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/.local/lib/python3.9/site-packages/streamdeck_ui/stream_deck_monitor.py", line 86, in _run
    self.attached(streamdeck_id, streamdeck)
  File "/home/user/.local/lib/python3.9/site-packages/streamdeck_ui/api.py", line 178, in attached
    streamdeck.reset()
  File "/home/user/.local/lib/python3.9/site-packages/StreamDeck/Devices/StreamDeckOriginalV2.py", line 111, in reset
    self.device.write_feature(payload)
  File "/home/user/.local/lib/python3.9/site-packages/StreamDeck/Transport/LibUSBHIDAPI.py", line 412, in write_feature
    return self.hidapi.send_feature_report(self.device_handle, payload)
  File "/home/user/.local/lib/python3.9/site-packages/StreamDeck/Transport/LibUSBHIDAPI.py", line 217, in send_feature_report
    raise TransportError("Failed to write feature report (%d)" % result)
StreamDeck.Transport.Transport.TransportError: Failed to write feature report (-1)
python3: ../../libusb/os/threads_posix.h:58: usbi_mutex_destroy: Assertion `pthread_mutex_destroy(mutex) == 0' failed.
Aborted (core dumped)

Expected behavior StreamDeck UI should not crash after Gnome restart or at least should be able to restart streamdeck.

Specs

dodgyrabbit commented 2 years ago

Hi there - are you able to reliably reproduce this? I was unable to and can restart gnome without issue. The call stack also seems a bit odd - it is a failure while resetting the device.

Did you restart Gnome because something was not working (for example the app was hanging)? I.e. I'm trying to figure out if restarting gnome caused the issue, or if there was already an issue and you tried resolving it by restarting gnome.

WMRamadan commented 2 years ago

I should probably mention this happens on Ubuntu 21.10 with Gnome 40.5 specifically when the monitor goes to sleep. After which the computer is woken up, Gnome needs to be restarted as the dock does not function properly. Which in turn causes streamdeck to crash while it is in sleep mode as well.

My argument is that streamdeck should not crash even if Gnome crashed due to some other error, also after which streamdeck can no longer restart.

WMRamadan commented 2 years ago

It seems that in syslog the following error message is displayed:

streamdeck.desktop[12988]: [234101:7:0323/013922.869436:ERROR:command_buffer_proxy_impl.cc(125)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer
dodgyrabbit commented 2 years ago

Please try 2.0.4. There was some suspend/resume logic added that may help here.

dodgyrabbit commented 2 years ago

Please reopen if you can reliably reproduce. Ubuntu 21.10 has reached EOL.