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

Not responding after suspend when attached via KVM. #251

Closed dariusgm closed 2 years ago

dariusgm commented 2 years ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

/usr/bin/python3 /home/d.murawski/.local/bin/streamdeck -n
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Gtk-Message: 11:59:42.988: Failed to load module "canberra-gtk-module"
Gtk-Message: 11:59:42.989: Failed to load module "canberra-gtk-module"
Traceback (most recent call last):
  File "/home/d.murawski/.local/lib/python3.10/site-packages/streamdeck_ui/gui.py", line 141, in handle_keypress
    if api.reset_dimmer(deck_id):
  File "/home/d.murawski/.local/lib/python3.10/site-packages/streamdeck_ui/api.py", line 94, in reset_dimmer
    return self.dimmers[serial_number].reset()
  File "/home/d.murawski/.local/lib/python3.10/site-packages/streamdeck_ui/dimmer.py", line 55, in reset
    self.brightness_callback(self.brightness)
  File "/home/d.murawski/.local/lib/python3.10/site-packages/streamdeck_ui/api.py", line 194, in <lambda>
    lambda brightness: self.decks[serial_number].set_brightness(brightness),
  File "/home/d.murawski/.local/lib/python3.10/site-packages/StreamDeck/Devices/StreamDeckXL.py", line 132, in set_brightness
    self.device.write_feature(payload)
  File "/home/d.murawski/.local/lib/python3.10/site-packages/StreamDeck/Transport/LibUSBHIDAPI.py", line 412, in write_feature
    return self.hidapi.send_feature_report(self.device_handle, payload)
  File "/home/d.murawski/.local/lib/python3.10/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)

Expected behavior Streamdeck should wake up and show icons again. They stay dark.

Screenshots /

Operating system (please complete the following information)

installed globally via pip install streamdeck-ui

Stream Deck Version

dodgyrabbit commented 2 years ago

Hi @dariusgm - this is a very curious problem, since the same API that is used to dim (darken) the screen is used to wake it up again. Was this a once-off problem, or are you able to consistently reproduce this problem?

Maybe to help narrow down the problem:

  1. Are you able to slide the main Brightness slider (1) up/down (all the way up and down) without issue?
  2. Can you try setting the Dim to % value to various positions, let it dim, and see it can recover on any value?

Dimming can also be reset via the UI via the context menu on the Notification Icon (app indicator/tray icon). Does that also create an error or does it work?

Ultimately this particular problem doesn't make any sense - so I'd need some of your help to narrow down what is going on. Thanks

image

dariusgm commented 2 years ago

The laptop was running and I left the device. Then I assume it got in "sleep mode". I returned to continue working and found the streamdeck hardware was all blacked out. I killed the python process and restarted it via cli.

This got me to a error loop: streamdeck Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. Error during attach: Failed to write feature report (-1) Error during attach: Could not open HID device. Error during attach: Could not open HID device. Error during attach: Could not open HID device. Terminating it with Ctrl+C or Ctrl+D did not work - but that seems like a different issue. The Streamdeck-UI was like reset.

So maybe it was still blocked by the OS somehow. After disconnecting it physical and restarting the application everything returned as before with no errors.

dodgyrabbit commented 2 years ago

I returned to continue working and found the streamdeck hardware was all blacked out.

OK it's not clear from your explanation exactly what state it was in. I'll describe the expected behaviour: After you resume, the device will effectively re-initialize. What this typically looks like is all the buttons briefly light up "white" and then return to the normal state (showing your pictures/text). If you leave it for your configured timeout, they will black out again. Pressing any of the streamdeck buttons, will return to normal state.

Could you repeat your test? I.e. get it in a working state - then suspend your machine - resume it and closely observe behaviour. If it doesn't behave as I describe above, please provide details. Provide any relevant console output. Thanks!

dariusgm commented 2 years ago

I now could find out that the blackout makes the device is still working but the icons are not present anymore. maybe its really with some power supply of the usb kvm problem. I will give hints when I have more precise data on this issue (hope soon)

dodgyrabbit commented 2 years ago

power supply of the usb kvm problem OK maybe move it directly to the computer or to a different USB port. This could play a role for sure.

dariusgm commented 2 years ago

I would suggest in closing this. Maybe the streamdeck have some voltage check or something that could be read out to make sure its running in the required specs and give the user otherwise an appropriate warning.