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

XL plus 15 key | Both Connected | Reboot nothing, works. #253

Closed Data-007 closed 2 years ago

Data-007 commented 2 years ago

Describe the bug I have on Arch(based) a long standing good XL configuration that works great. I dug out my older 15 key And connected it up. It did not work with the XL connected, on reboot once loaded nothing works, neither the XL or 15. Loading the program from the tray and all interface is blank, trying to select 'streamdeck' and their is nothing to select.

Expected behavior I expected to be able to select my streamdeck XL and configure also true for 15 from within the streamdeck-ui interface.

Operating system (please complete the following information)

Stream Deck Version -Standard, XL (both old ie not MK2)

dodgyrabbit commented 2 years ago

@Data-007 could you please add more info here. Are there any errors in the terminal you launched it from? Could you post a screenshot of what you are seeing?

You could also try:

  1. Exit streamdeck_ui (make sure no process running)
  2. Rename your ~/.streamdeck_ui.json file to something else.
  3. Launch streamdeck_ui again. On startup, a new empty ~/.streamdeck_ui.json file will be created.

If your streamdecks work when doing this - there must be something in the existing configuration file that causes a problem. We can troubleshoot that if need be. If it still doesn't work, we'll I guess then it's some other problem. You could also try the above steps to see if each of the streamdecks work individually - and that we're really dealing with a problem specifically when both are attached at the same time.

Also, please see #230. It sounds quite similar to what you describe.

Data-007 commented 2 years ago

@dodgyrabbit Status investigating. I don't actually run it streamdeck-ui from the terminal anymore, I use a script in Plasma's autostart.

Both decks were blank and nothing was showing in the device selector if memory servers.

Data-007 commented 2 years ago

Hi Pieter Ok, I have two decks, 15/XL, the 15 key was previously on another computer and configured there. That computer no longer exists, so no way to scrub the device, it still shows icons from the previous configuration.

I have the XL configured and running off that script I mentioned, all it does is call streamdeck in the cli/script. StreamdeckXL-Before reboot

What I see is this, XL installed and configured.... and I connect the 15 and reboot. StreamdeckXL-After reboot

I disconnected the 15 and reboot to a working XL. I exit the streamdeck-ui from the tray and connect up the 15&XL I get the following in the cli running streamdeck.

Error during attach: Could not open HID device. Error during attach: Could not open HID device. Error during attach: Could not open HID device. Error during attach: Could not open HID device. Error during attach: Could not open HID device. Error during attach: Could not open HID device.

replug off the 15 I get.

Unable to load icon /home/steve/StreamDeck/icons/Discord.PNG with error [Errno 2] No such file or directory: '/home/steve/StreamDeck/icons/Discord.PNG' Unable to load icon /home/steve/StreamDeck/icons/Nas.png with error [Errno 2] No such file or directory: '/home/steve/StreamDeck/icons/Nas.png' Unable to load icon /home/steve/StreamDeck/Avatars/Coritani.png with error [Errno 2] No such file or directory: '/home/steve/StreamDeck/Avatars/Coritani.png' Exception in thread Thread-5 (_run): Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/home/steve/.local/lib/python3.10/site-packages/streamdeck_ui/display/display_grid.py", line 168, in _run self.streamdeck.set_key_image(button, image) File "/home/steve/.local/lib/python3.10/site-packages/StreamDeck/Devices/StreamDeckOriginalV2.py", line 170, in set_key_image raise IndexError("Invalid key index {}.".format(key)) IndexError: Invalid key index 16. ^CTraceback (most recent call last): File "/home/steve/.local/lib/python3.10/site-packages/streamdeck_ui/gui.py", line 766, in streamdeck_cpu_changed def streamdeck_cpu_changed(ui, serial_number: str, cpu: int): KeyboardInterrupt

The keyboardInturupt is me copying manually from the cli the above output

HIH @dodgyrabbit

-- Data

dodgyrabbit commented 2 years ago

Thank you for the additional information. Based on my investigation so far, it seems like for some reason the smaller streamdeck settings is getting expanded to match the larger one (only for some pages) and that leads to the problem.

It would be very useful to confirm you are seeing the same behaviour as issue #129. Could you share your ~/.streamdeck_ui.json file?

I'm unable to reproduce this problem. So it would be helpful to get your system back to a working state (this should be possible by fixing the configuration file (I can help) or renaming it (as per my instructions above) to get back to a clean slate - and then seeing what triggers the problem.

Data-007 commented 2 years ago

Hi Pieter I can't get the 15 recognized, by themselves, I included the file's various configurations Please see the end of the filename for configuration, possibly no difference as the 15 even by itself is blank!! HIH @dodgyrabbit streamdeck_ui_export.zip

Data-007 commented 2 years ago

I'm unable to reproduce this problem. So it would be helpful to get your system back to a working state (this should be possible >by fixing the configuration file (I can help) or renaming it (as per my instructions above) to get back to a clean slate - and then >seeing what triggers the problem.

What triggers the problem is possibly a dodgy deck! I mean by its self-only connected it shows icons from the previous configuration, however even after reboot(ile check again) it is not picked up by streamdeck-ui

Edit: It is not picked up, I will try it on winblows and see.

dodgyrabbit commented 2 years ago

OK I would like to clear up a few things:

I mean by its self-only connected it shows icons from the previous configuration, however even after reboot(ile check again) it is not picked up by streamdeck-ui

A Stream Deck does not store images in non-volatile memory (like flash memory). It would be very slow and since flash memory has limited writes, the usable life of the Stream Deck would be very short. Besides, if you think about things like animated gifs, you're writing on each key multiple times per second.

In short - it's not possible for a Stream Deck itself to "remember" the images that it had before. The logical explanation is that the software is setting it to the same images when you plug it in. However, the config file has a problem, which then stops processing and therefore creates the appearance of the Stream Deck failing. It is very likely your Stream Deck is fine.

I included the file's various configurations

Thank you. I would like to explain a bit more about the configuration files and how it works. The three files in the ZIP are exactly the same (i.e. they contain identical contents). The configuration for streamdeck_ui is stored in json format. It contains an entry for each Stream Deck in the same file, keyed by the Stream Deck's serial number. In other words, each file contains the configuration for both your Stream Decks.

Put clearly: importing and exporting does not import only for the active deck, but for all decks.

It would be very useful to confirm you are seeing the same behaviour as issue #129.

With the help of your configuration file, I can confirm that it is exactly the same issue as in #129. The first page entry in the configuration file for your StreamDeckV2 (15 key) has extra button entries, which leads to an Invalid key index error, which in turns stops processing. This also explains why, when you plug in just your StreamDeck XL, everything works fine (since it's configuration is fine).

Let's get your system back in a working state:

I've fixed your configuration file and attached it here: streamdeck_ui_fixed.zip

You need to replace the file ~/.streamdeck_ui.json with the one in the ZIP file. Note that the file inside the zip is called streamdeck_ui_fixed.json (note the _fixed at the end).

I think the easiest way to replace it would be to run streamdeck_ui without the 15 key streamdeck attached, then use the File->Import function and select streamdeck_ui_fixed.json. Once imported, you should be able to attach the 15 key Stream Deck and it should function correctly. I.e. you should not get an Invalid key index error in the console output. You may get Unable to load icon, but these are not fatal errors. Just means the icon you originally configured could not be found.

This is just additional explanation, in case someone else has the same problem: How did I "fix" your configuration file?

If you look in the JSON file, review the config for your 15 key Stream Deck:

Notice there are nested levels. The first is for each page, the second is for each button on that page. image

Yours had extra entries on page 0. So I removed the following: image

It's was a fairly simple fix, you just have to be careful with making sure the JSON is still valid (i.e. there isn't an extra comma or bracket etc).

Once you confirm it's working - it would be interesting to figure out what causes the corruption. Maybe you can keep an eye on it and help figure out how the configuration file got to this state in the first place. The only strange thing I can see is that the JSON file pages are not in order. I would typically expect that it would be page 0, page 1, page 2 etc. However, in yours as well as the example in issue #129 had the pages slightly out of order. That technically doesn't matter because internally it's a dictionary keyed on the page number, but I still find it curious why that is there.

Data-007 commented 2 years ago

Hi Thanks, Pieter, install a brand new copy now. On brand spanking new Arch.

Status investigating

Now Fixed we/you can close.

-- Data

dodgyrabbit commented 2 years ago

I would still like to figure out the root cause of the extra button entries. It's possible that this was a bug an older versions and that the current version is OK. Importing an old settings file (with the extra entries) obviously will bring the issue back.

Now that everything is working for you - please keep an eye out. If the issue recurs, please reopen the case with as much detail as possible so we can troubleshoot and permanently fix. I have tried to reproduce but I don't have two physical stream decks, so not ideal.

Closing for now.