Skip to content

StreamDeck.Transport.Transport.TransportError: Failed to write feature report (-1) #154

@danielskowronski

Description

@danielskowronski

Describe the bug
The issue is very unstable: after at least one open-reset-write-reset-close cycle, from time to time, I can no longer control Stream Deck Neo until the device is physically reconnected. The error is Failed to write feature report (-1) during feature report sending.

This is similar to #134, but that report was for a platform-specific scenario when issue occurred automatically after some time and only reboot could solve the issue.

Full output:

Traceback (most recent call last):
  File "/home/daniel/rpideck/rpideck.py", line 193, in <module>
    deck.reset()
  File "/home/daniel/.local/lib/python3.11/site-packages/StreamDeck/Devices/StreamDeckNeo.py", line 120, in reset
    self.device.write_feature(payload)
  File "/home/daniel/.local/lib/python3.11/site-packages/StreamDeck/Transport/LibUSBHIDAPI.py", line 405, in write_feature
    return self.hidapi.send_feature_report(self.device_handle, payload)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/daniel/.local/lib/python3.11/site-packages/StreamDeck/Transport/LibUSBHIDAPI.py", line 265, 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.
python3: ../../libusb/os/threads_posix.h:46: usbi_mutex_lock: Assertion `pthread_mutex_lock(mutex) == 0' failed.
Aborted

To Reproduce
Run example_neo.py, close it and from time to time it'll crash and block device until it's reconnected.

StreamDeck Information
Stream Deck Neo

System Information

  • library version 0.9.6
  • Raspberry Pi 3B+ (aarch64)
  • Raspbian 64-bit -> `Linux rpi 6.6.74+rpt-rpi-v8 maintenance: Strem -> Stream #1 SMP PREEMPT Debian 1:6.6.74-1+rpt1 (2025-01-27) aarch64 GNU/Linux
  • libhidapi-libusb0:arm64=0.13.1-1
  • libusb-1.0-0:arm64=2:1.0.26-1

Investigation status
I'm in the process of verifying the exact triggers for this bug, but wanted to let you know that issue exists.

I can spin up Linux VM on some other architecture, but it may be difficult to get exactly the same library configuration. However, as tested for #134 the same issue was happening on Raspbian and Ubuntu (with newer kernel and libusb 1.0.27) so I suspect it's not related to libusb, but either to DWC2 controller or this library.

I tried to add hid_error support to learn why exactly report can't be sent, but on Linux it always returns hid_error is not implemented yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions