Skip to content

Doesn't detect Stream Deck +, permission/ownership issue of /dev/bus/usb/003/014 w/ flatpak #288

Description

@wez

When the app is opened, my Stream Deck + is not detected.

I'm using the flatpak version, running on Ubuntu 24.04.

$ flatpak list
Name                                        Application ID                            Version            Branch          Installation
StreamController                            com.core447.StreamController              1.5.0-beta.6       stable          system

When I run it from the terminal, this is what I see:

$ flatpak run com.core447.StreamController
2024-11-24 10:10:21.584 | WARNING  | __main__:main:249 - Should you get an Error 71 (Protocol error) please add GSK_RENDERER=ngl to your "/etc/environment" file
2024-11-24 10:10:21.584 | INFO     | __main__:quit_running:192 - Checking if another instance is running
2024-11-24 10:10:21.586 | INFO     | __main__:quit_running:200 - No other instance running, continuing
2024-11-24 10:10:21.586 | ERROR    | __main__:quit_running:201 - org.freedesktop.DBus.Error.ServiceUnknown: The name com.core447.StreamController was not provided by any .service files
2024-11-24 10:10:21.601 | ERROR    | __main__:reset_all_decks:189 - Failed to reset deck, maybe it's already connected to another instance? Skipping...
2024-11-24 10:10:21.604 | ERROR    | src.backend.GnomeExtensions:connect_dbus:31 - Failed to connect to D-Bus: org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Shell was not provided by any .service files
2024-11-24 10:10:21.604 | INFO     | src.backend.PageManagement.PageManagerBackend:update_auto_change_info:333 - Updated auto-change info in 0.00011038780212402344 seconds
2024-11-24 10:10:21.605 | INFO     | src.backend.PageManagement.PageManagerBackend:remove_old_backups:448 - Removed old page backups: 2024-11-24T08:28:49.444159
2024-11-24 10:10:21.682 | INFO     | src.backend.WindowGrabber.WindowGrabber:init_integration:63 - Initializing window grabber for environment: kde under server: x11
2024-11-24 10:10:21.729 | INFO     | __main__:load:92 - Loading app
2024-11-24 10:10:21.730 | INFO     | __main__:update_assets:152 - Updating store assets
2024-11-24 10:10:21.749 | INFO     | src.backend.DeckManagement.DeckManager:__init__:66 - Running under Flatpak. Using separate thread to detect device disconnection.
2024-11-24 10:10:21.749 | INFO     | src.backend.DeckManagement.DeckManager:__init__:70 - Beta resume mode: True
2024-11-24 10:10:21.763 | ERROR    | src.backend.DeckManagement.DeckManager:load_hardware_decks:92 - Failed to open deck. Maybe it's already connected to another instance?

(process:3): Gtk-WARNING **: 10:10:21.764: Theme parser error: style.css:399:19-27: Unknown name of pseudo-class
2024-11-24 10:10:21.784 | INFO     | src.backend.Store.StoreBackend:get_stores:74 - Official store branch: main
2024-11-24 10:10:21.787 | TRACE    | src.app:on_activate:80 - running: on_activate
2024-11-24 10:10:21.787 | TRACE    | src.windows.mainWindow.mainWindow:build:93 - Building main window
2024-11-24 10:10:21.867 | INFO     | src.backend.Store.StoreBackend:get_stores:74 - Official store branch: main
2024-11-24 10:10:21.892 | INFO     | src.backend.Store.StoreBackend:get_stores:74 - Official store branch: main
2024-11-24 10:10:21.914 | INFO     | __main__:update_assets:160 - Updating 0 store assets took 0.18320846557617188 seconds
2024-11-24 10:10:21.940 | SUCCESS  | src.app:on_activate:112 - Finished loading app
2024-11-24 10:10:21.941 | INFO     | autostart:request_background_callback:57 - request_background success=True

If I then unplug and re-plug the deck it prints out this additional information:

2024-11-24 10:13:05.251 | INFO     | src.backend.DeckManagement.DeckManager:on_connect:135 - Device /dev/bus/usb/003/014 with info: {'ID_MODEL_ID': '0084', 'ID_MODEL': 'Stream_Deck_Plus', 'ID_MODEL_FROM_DATABASE': '', 'ID_VENDOR': 'Elgato', 'ID_VENDOR_ID': '0fd9', 'ID_VENDOR_FROM_DATABASE': 'Elgato Systems GmbH', 'ID_USB_INTERFACES': ('030000',), 'ID_USB_CLASS_FROM_DATABASE': '', 'DEVNAME': '/dev/bus/usb/003/014', 'DEVTYPE': 'usb_device'} connected
Exception in thread USB Monitor:
Traceback (most recent call last):
  File "/usr/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
    self.run()
  File "/app/lib/python3.12/site-packages/pyudev/monitor.py", line 544, in run
    self._callback(device)
  File "/app/lib/python3.12/site-packages/usbmonitor/__platform_specific_detectors/_linux_usb_detector.py", line 73, in __handle_device_event
    on_connect(device_id, device_info)
  File "/app/bin/StreamController/src/backend/DeckManagement/DeckManager.py", line 140, in on_connect
    self.connect_new_decks()
  File "/app/bin/StreamController/src/backend/DeckManagement/DeckManager.py", line 152, in connect_new_decks
    self.add_newly_connected_deck(deck)
  File "/app/bin/StreamController/src/backend/DeckManagement/DeckManager.py", line 181, in add_newly_connected_deck
    deck_controller = DeckController(self, deck)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bin/StreamController/src/backend/DeckManagement/DeckController.py", line 336, in __init__
    deck.open()
  File "/app/lib/python3.12/site-packages/StreamDeck/Devices/StreamDeck.py", line 233, in open
    self.device.open()
  File "/app/lib/python3.12/site-packages/StreamDeck/Transport/LibUSBHIDAPI.py", line 373, in open
    self.device_handle = self.hidapi.open_device(self.device_info['path'])
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.12/site-packages/StreamDeck/Transport/LibUSBHIDAPI.py", line 224, in open_device
    raise TransportError("Could not open HID device.")
StreamDeck.Transport.Transport.TransportError: Could not open HID device.

I've tried flatpak kill com.core447.StreamController to ensure that there are no other instances running and it doesn't change the outcome.

I also have a Stream Deck Original; when that is connected, it is detected on startup, so I know that the application can function on at least a basic level.

I just found that if I sudo chown $USER /dev/bus/usb/003/014 and re-launch, then I can see my Stream Deck +.
This feels like it is probably a bad solution for this; is there a better way?

Prior to chown, it showed up as:

$ ls -l /dev/bus/usb/003/014
crw-rw-r-- 1 root root 189, 269 Nov 24 10:13 /dev/bus/usb/003/014

So it seems to me like there are two issues here:

  1. How to surface this sort of permission issue more clearly?
  2. How to resolve this sort of permission issue safely?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions