khampf / g13

libusb driver for the g13
23 stars 14 forks source link

Suspend/Resume issue #9

Open acmay opened 4 years ago

acmay commented 4 years ago

I did a suspend/resume with g13d running manually and it lost track of the gamepad. I was able to kill and restart it fine and things worked again but I am not yet sure how to configure this to be done automatically. I don't see anything in the systemd service file that would trigger the restart but I am not sure.

This is on Debian 10/Buster.

Linux mud 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64 GNU/Linux
Package: libusb-0.1-4

Logs

1598941533 INFO  : Known keys on G13:
1598941533 INFO  : BD DOWN G1 G10 G11 G12 G13 G14 G15 G16 G17 G18 G19 G2 G20 G21 G22 G3 G4 G5 G6 G7 G8 G9 L1 L2 L3 L4 LEFT LIGHT LIGHT2 LIGHT_STATE M1 M2 M3 MISC_TOGGLE MR TOP UNDEF1 UNDEF3
1598941533 INFO  : Known keys to map to:
1598941533 INFO  : 0 1 2 3 4 5 6 7 8 9 A APOSTROPHE B BACKSLASH BACKSPACE C CAPSLOCK COMMA D DELETE DOT DOWN E END ENTER EQUAL ESC F F1 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F2 F20 F21 F22 F23 F24 F3 F4 F5 F6 F7 F8 F9 G GRAVE H HOME I INSERT J K KP0 KP1 KP2 KP3 KP4 KP5 KP6 KP7 KP8 KP9 KPASTERISK KPDOT KPMINUS KPPLUS KPSLASH L LEFT LEFTALT LEFTBRACE LEFTCTRL LEFTSHIFT M MEXTRA MINUS MLEFT MMIDDLE MRIGHT MSIDE N NEXTSONG NUMLOCK O P PAGEDOWN PAGEUP PLAYPAUSE PREVIOUSSONG Q R RIGHT RIGHTALT RIGHTBRACE RIGHTCTRL RIGHTSHIFT S SCROLLLOCK SEMICOLON SLASH SPACE T TAB U UP V W X Y Z
1598941533 INFO  : USB device found during enumeration
1598941533 INFO  : USB device connected
1598941533 INFO  : Setting up device 
1598941533 INFO  : Active Stick zones 
               STICK_UP   { 0 x 0.1 / 1 x 0.3 }   SEND KEYS: UP
             STICK_DOWN   { 0 x 0.7 / 1 x 0.9 }   SEND KEYS: DOWN
             STICK_LEFT   { 0 x 0 / 0.2 x 1 }   SEND KEYS: LEFT
            STICK_RIGHT   { 0.8 x 0 / 1 x 1 }   SEND KEYS: RIGHT
           STICK_PAGEUP   { 0 x 0 / 1 x 0.1 }   SEND KEYS: PAGEUP
         STICK_PAGEDOWN   { 0 x 0.9 / 1 x 1 }   SEND KEYS: PAGEDOWN
[[Alibusb: warning [handle_timeout] async cancel failed -5 errno=22
[[1;5A^[[1;5Alibusb: warning [handle_timeout] async cancel failed -5 errno=22
1598969267 ERROR  : Error while reading keys: No such device (it may have been disconnected)
libusb: warning [handle_timeout] async cancel failed -5 errno=22
1599011759 ERROR  : Error while reading keys: No such device (it may have been disconnected)
libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=16
1599011759 ERROR  : Error while reading keys: Input/Output Error
libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=16
khampf commented 4 years ago

The errors looks exactly as the device got disconnected and g13d should wait around for a device to be inserted but the daemon might have gotten terminated by the system and not started on insertion. When this happens, can you see the device in the list when running lsusb?

acmay commented 4 years ago

For the first case the logs spit out a lot more in a loop before I killed it myself. I didn't capture all of it. I did it again, and it didn't send out as many log messages.

Here is the lsusb output after I killed it.

lsusb 
Bus 004 Device 002: ID 0781:558c SanDisk Corp. 
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 05e3:0612 Genesys Logic, Inc. Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
Bus 001 Device 014: ID 1b1c:1b36 Corsair 
Bus 001 Device 008: ID 046d:c07c Logitech, Inc. M-R0017 [G700s Rechargeable Gaming Mouse]
Bus 001 Device 006: ID 046d:c531 Logitech, Inc. C-U0007 [Unifying Receiver]
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 002: ID 046d:c21c Logitech, Inc. G13 Advanced Gameboard
Bus 001 Device 009: ID 1781:0e58 Multiple Vendors 
Bus 001 Device 007: ID 248a:00da Maxxter 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Here is the output where I did a suspend first, then hibernate.

1599200242 INFO  : g13d v1.0.4-2-g3f699e8 Aug 30 2020 21:48:30
1599200242 INFO  : Known keys on G13:
1599200242 INFO  : BD DOWN G1 G10 G11 G12 G13 G14 G15 G16 G17 G18 G19 G2 G20 G21 G22 G3 G4 G5 G6 G7 G8 G9 L1 L2 L3 L4 LEFT LIGHT LIGHT2 LIGHT_STATE M1 M2 M3 MISC_TOGGLE MR TOP UNDEF1 UNDEF3
1599200242 INFO  : Known keys to map to:
1599200242 INFO  : 0 1 2 3 4 5 6 7 8 9 A APOSTROPHE B BACKSLASH BACKSPACE C CAPSLOCK COMMA D DELETE DOT DOWN E END ENTER EQUAL ESC F F1 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F2 F20 F21 F22 F23 F24 F3 F4 F5 F6 F7 F8 F9 G GRAVE H HOME I INSERT J K KP0 KP1 KP2 KP3 KP4 KP5 KP6 KP7 KP8 KP9 KPASTERISK KPDOT KPMINUS KPPLUS KPSLASH L LEFT LEFTALT LEFTBRACE LEFTCTRL LEFTSHIFT M MEXTRA MINUS MLEFT MMIDDLE MRIGHT MSIDE N NEXTSONG NUMLOCK O P PAGEDOWN PAGEUP PLAYPAUSE PREVIOUSSONG Q R RIGHT RIGHTALT RIGHTBRACE RIGHTCTRL RIGHTSHIFT S SCROLLLOCK SEMICOLON SLASH SPACE T TAB U UP V W X Y Z
1599200242 INFO  : USB device found during enumeration
1599200242 INFO  : USB device connected
1599200242 INFO  : Setting up device 
1599200242 INFO  : Active Stick zones 
               STICK_UP   { 0 x 0.1 / 1 x 0.3 }   SEND KEYS: UP
             STICK_DOWN   { 0 x 0.7 / 1 x 0.9 }   SEND KEYS: DOWN
             STICK_LEFT   { 0 x 0 / 0.2 x 1 }   SEND KEYS: LEFT
            STICK_RIGHT   { 0.8 x 0 / 1 x 1 }   SEND KEYS: RIGHT
           STICK_PAGEUP   { 0 x 0 / 1 x 0.1 }   SEND KEYS: PAGEUP
         STICK_PAGEDOWN   { 0 x 0.9 / 1 x 1 }   SEND KEYS: PAGEDOWN
^[[D^[[C^[[B

libusb: warning [handle_timeout] async cancel failed -5 errno=22
1599200278 ERROR  : Error while reading keys: No such device (it may have been disconnected)

libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=16
1599200396 ERROR  : Error while reading keys: Input/Output Error
libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=16
1599200399 ERROR  : Error while reading keys: Input/Output Error
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=16
1599200400 ERROR  : Error while reading keys: Input/Output Error
libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=16
1599200403 ERROR  : Error while reading keys: Input/Output Error
libusb: error [udev_hotplug_event] ignoring udev action bind

^C1599200444 INFO  : Caught signal 2 (Interrupt)
1599200444 INFO  : Cleaning up
libusb: error [submit_control_transfer] submiturb failed error -1 errno=16
1599200444 ERROR  : Problem changing color: Input/Output Error
libusb: error [release_interface] release interface failed, error -1 errno 22
1599200444 INFO  : Exit