bitfocus / companion

Bitfocus Companion enables the reasonably priced Elgato Stream Deck and other controllers to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
Other
1.57k stars 499 forks source link

[BUG] Elgato Stream Deck connection drops #2795

Closed orwellsbrother closed 2 months ago

orwellsbrother commented 6 months ago

Is this a bug in companion itself or a module?

Is there an existing issue for this?

Describe the bug

Setup is Windows 10 PC connected to Stream Deck via USB, BlinkStick via USB and MR18 via Ethernet and USB. When controlling the MR18 via Ethernet using the StreamDeck everything works fine. The connection to the Stream Deck drops, when running a Python skript that takes resulting MIDI output from the MR18 via USB / pygame and subsequently controls a BlinkStick LED strip. Companion still functions fine (e.g. test buttons from GUI), but Stream Deck resets to its default Elgato logo screen.

Steps To Reproduce

1) Press button on Stream Deck that triggers state change in MR18 (e.g. toggle mute) via Ethernet -> MR18 sends MIDI message of that state change via USB -> Python skript receives the MIDI message via USB / pygame Python module and sets LED strip via USB / blinkstick Python module -> StreamDeck stops working and goes to default Elgato logo screen

Expected Behavior

StreamDeck continues working like before.

Environment (please complete the following information)

- OS: Windows 10
- Browser: Chome
- Companion Version: 3.2 and 3.3.0+6842-main-ff12a93b both affected

Additional context

[LOG excerpt] 24.03.12 17:03:05 Surface/Handler/streamdeck:AL50I2C03244: Button 1/1/2 pressed 24.03.12 17:03:06 Surface/USB/ElgatoStreamdeck/\?\HID#VID_0FD9&PID_006D#8&35fb5430&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}: fillImage failed after 3 attempts: Error: Cannot write to hid device 24.03.12 17:03:06 Surface/Handler/streamdeck:AL50I2C03244: Elgato Streamdeck disconnected

Julusian commented 2 months ago

I don't know what we can do here. Your log snippet shows fillImage failed after 3 attempts: Error: Cannot write to hid device, meaning that we tried to update the image on a button, then retried 2 times after short delays (100ms?), and the hid driver reported that all the write attempts failed. This usually means that the device is no longer connected, so we give up and mark the device as disconnected.

Maybe we could try more write attempts, but I suspect that it will sometimes also fail, so isn't a good fix and it will likely slow down the disconnection logic for everyone.

This sounds like potentially a power issue, or something causing issues with the usb bus, so I don't see what we can do to mitigate this