-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scc-daemon drops existing USB devices when system suspends #57
Comments
Try https://github.com/C0rn3j/sc-controller/releases/tag/v0.4.9.8 although am not sure if it'll fix your issue. |
Still not solved. E USB Failed to submit the transfer!
Traceback (most recent call last):
File "/tmp/.mount_sc-conueE4qz/usr/lib/python3.11/site-packages/scc/drivers/usb.py", line 58, in callback_wrapper
transfer.submit()
File "/tmp/.mount_sc-conueE4qz/usr/lib/python3/dist-packages/usb1/__init__.py", line 748, in submit
raiseUSBError(result)
File "/tmp/.mount_sc-conueE4qz/usr/lib/python3/dist-packages/usb1/__init__.py", line 120, in raiseUSBError
raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorIO: LIBUSB_ERROR_IO [-1]
D root TODO: Hardcoded 1s sleep! I tried the next change with system installed old sc-controller: try:
transfer.submit()
except Exception as e:
log.error("Failed to submit data")
log.error(e) This change get the python traceback away, but the inputs are not working after resume. My assumption is: Any kind of re-connection / re-initialization is needed to get the controls working again. If I restart the daemon, the sc-controller is working again. (If I do it in /lib64/elogind/system-sleep/my-sleep.sh, the system freezes :-() |
Does it stop logging entirely afterwards, or does it keep working but just not with the previously connected devices? i.e. you can connect a DS4 or whatever and it picks it up and works, but the USB devices it killed (or rather the Deck input itself?) remain dead until daemon restart? Because the daemon should restart if it crashes to my understanding, this sounds like it just gets into a weird state. Does it work if you add this to force restart the device in the exception I added? except Exception:
log.exception("Failed to submit the transfer!")
self.force_restart() |
The daemon is running. I see log entries and OSD messages, if I switch to other window with autoswicher configured. Now I connected my Switch Pro controller trough USB and tried again. (sc-controller is able to handle multiple inputs ?!). If I add the Note: I still test with 0.4.8.17 because I do not know how I can launch sc-controller from source tree without installing |
Git clone it (.zip is currently broken) and The readme needs a bit of a touch up. EDIT: Touched up.
Sigh, we really need a feature showcase.
Huh, any of these 4 methods work instead? 1. self.flush()
2. self.unclaim()
3. self.close():
4. self.resetDevice()
4. self..close() |
All proposed commands does not help. I think the |
I think there's another bug interfering here - where the daemon is just unable to handle a restart - this can be reproduced by running one version of the daemon, and then launching a DIFFERENT version of sc-controller. That will attempt to restart the daemon, but it only kills it, it won't start its own no more. |
Updated the repository for last changes, cleared up and rebuild. Tried again using './run.sh daemon --alone' My current adjustments: $ git --no-pager diff
diff --git a/run.sh b/run.sh
index 6455dfc..098c387 100755
--- a/run.sh
+++ b/run.sh
@@ -75,7 +75,8 @@ pip install --prefix ".env" dist/*.whl --force-reinstall
if [[ ${1-} == 'daemon' ]]; then
# Kill any existing daemons before spawning our own
pkill -f scc-daemon || true
- scc-daemon debug
+ shift
+ scc-daemon debug $@
else
sc-controller $@
fi
diff --git a/scc/drivers/steamdeck.py b/scc/drivers/steamdeck.py
index 04a80b0..8a4a70d 100644
--- a/scc/drivers/steamdeck.py
+++ b/scc/drivers/steamdeck.py
@@ -231,7 +231,7 @@ class Deck(USBDevice, SCController):
if self._ready:
self.daemon.remove_controller(self)
self._ready = False
- USBDevice.close(self)
+ super().close()
def turnoff(self):
log.warning("Ignoring request to turn off steamdeck.")
diff --git a/scc/drivers/usb.py b/scc/drivers/usb.py
index 71cf1bc..3d422dd 100644
--- a/scc/drivers/usb.py
+++ b/scc/drivers/usb.py
@@ -57,7 +57,8 @@ class USBDevice(object):
try: # https://github.com/C0rn3j/sc-controller/issues/57
transfer.submit()
except Exception:
- log.exception("Failed to submit the transfer!")
+ log.error("Failed to submit the transfer!")
+ self.force_restart()
transfer = self.handle.getTransfer()
transfer.setInterrupt( EDIT: By the way, in the meantime the hid-steam kernel driver exists, that take the controller and gyro available in /dev/input/event*. How difficult is to change the steamdeck base from hidraw to hid or evdev? Maybe that is the direction to solve this issue ... |
No idea, never had to write a driver for this thing yet, but there are a bunch of existing ones you can take examples from, PlayStation controllers already do something similar I suppose. Unfortunately no clue how to proceed here without spending a large amount of time learning libUSB and going through the codebase. |
Same issue like #55 but tested with current sc-controller-0.4.9.7-bookworm-x86_64.AppImage
If I suspend and resume system, the sc-controller does not work anymore
Reopen issues seems to be disabled. I do not get the "Repopen" button :-( Therefore I created new issue
The text was updated successfully, but these errors were encountered: