python-elgato-streamdeck icon indicating copy to clipboard operation
python-elgato-streamdeck copied to clipboard

get_firmware_version() call leads to streamdeck XL ignoring top 3 row presses

Open humbled opened this issue 5 years ago • 7 comments

Strange behaviour encountered today where the top 3 rows of an XL get ignored until reset() or similar

Here's a tiny working illustration. Pressing key(0) makes the call and the top 3 rows stop working then. Pressing key(31) runs reset() then all kets work again.

import threading
from StreamDeck.DeviceManager import DeviceManager

def _cbKeyPressed(deck, key, state):
    print("Got a press on {}".format(key))
    if state:
        return
    if key == 0:
        print("Running get_firmware_version()!")
        deck.get_firmware_version()
    elif key == 31:
        print("restoring")
        deck.reset()
        
def setup(deck):
    deck.open()
    deck.reset()
    deck.set_key_callback(_cbKeyPressed)

deck = DeviceManager().enumerate()[0]
setup(deck)

for t in threading.enumerate():
    if t is threading.currentThread():
        continue
    
    if t.is_alive():
            t.join()

streamdeck 0.6.3 hidapi 0.9.0.post2 Mac OS 10.15.2 (Catalina)

Seen same on Linux with hid (referenced in #29)

humbled avatar Feb 28 '20 04:02 humbled

Could you please try the latest 0.7.3 release? It has a new HID backend I wrote that directly binds to the system installed hidapi, which might resolve the issue.

If you don't want to upgrade for some reason, there's also a newer release of the HIDAPI python library that your 0.6.3 version uses, which could also help.

abcminiuser avatar Apr 19 '20 10:04 abcminiuser

Give the latest 0.8.1 a go please and report back - the back end is substantially different to the version mentioned in this report, and the underlying issue might now be solved.

abcminiuser avatar Jun 15 '20 12:06 abcminiuser

Closing due to an extended period of inactivity - please re-open if you can reproduce this on the latest version of the library.

abcminiuser avatar Oct 04 '20 05:10 abcminiuser

@abcminiuser just got the same problem with a XL and version 0.8.4 of your (awesome, thanks for it, btw) lib: only the last row is working. Adding a deck.reset() after reading the firmware version solved it (I was going crazy until I found this issue)

twidi avatar May 02 '21 09:05 twidi

Well, that's frustrating. I don't have an XL model around to test with, but I've checked over the original application multiple times, and it definitely reads out a 32-byte feature report (report ID 5) from the XL device. If that's causing issues it'll either be device firmware related, or something not quite right in the libhidapi-libusb backend.

If anyone else has a StreamDeck XL, can you please try this on Mac or Windows and report if the same issue is observed there?

abcminiuser avatar Jun 19 '21 04:06 abcminiuser

Old thread I know, but I can confirm this on Ubuntu 20.04 and Stream Deck XL. If I do any of the deck.get_* function calls, the top three rows quit working. If I remove any and all of those calls from my code and just do deck.open(), deck.reset(), and deck.set_key_callback() and never make any of the get_* calls, it works fine. With the calls in there, it works fine on a Stream Deck Mini.

edit: Also my libhidapi-libusb0 version is 0.9.0+dfsg-1 if that helps. I also am actively working on this so can easily test fixes.

impala454 avatar May 20 '22 16:05 impala454

@abcminiuser I'm available to test/troubleshoot on Windows or Rasberry Pi OS (and Ubuntu VM if that works to test). I have a XL and know python

aaronr8684 avatar May 20 '22 16:05 aaronr8684