External mouse and keyboard sleep when they stay untouched for a few seconds

Hello! I asked this question on matrix but the answers did not work, so I decided to start a conversation here.

I have an external mouse I used across many operating systems but I feel like I see this behavior only with NixOS. At the beginning I only had one laptop an Asus Zenbook with a USB-C dock station and so on. I thought something along the way was not right, but I get this behavior with a new System76 Thelio without any dock station.

In practice when I don’t move the mouse for a few seconds it β€œgoes to sleep” (not sure if that’s what it does), but in practice I have to wait a few seconds when touching it again in order to get it awake and working. The same happens with the keyboard, the light goes off, after ~3seconds and the first time I press a key it does not work.

Nothing shows up in dmesg.

I am using i3 and I have libinput installed, my configuration is available on GitHub https://github.com/gianarb/dotfiles/tree/master/nixos/machines

Thanks a lot!

I just realized that the problem happens only when I boot the laptop with keyboard and mouse attached to it. If I connect them when the laptop has booted everything works

I just realized that the problem happens only when I boot the laptop with keyboard and mouse attached to it. If I connect them when the laptop has booted everything works

This problem persist even when I am using a workstation (thelio system76), if it boots with the keyboard attached vs if I remove and connect it again when the boot is over

Could it be something different about the kernel modules that get loaded? I would try to save the output of the lsmod command on each situation and then confront them with diff to see if there is any difference

Thaanks a lot @azazel75 ! I am a bit short on ideas about how to debug this issue. I tried what you suggested but as you can see the diff does not show anything that important, at least for what I can tell

$ diff -d <(sort ~/Documents/notes/test-lsmod/first-boot.txt) <(sort ~/Documents/notes/test-lsmod/when-everything-works-after-reconnect.txt)
16c16
< bluetooth             614400  47 btrtl,btintel,btbcm,bnep,btusb,rfcomm
---
> bluetooth             614400  45 btrtl,btintel,btbcm,bnep,btusb,rfcomm
48c48
< drm                   512000  7 drm_kms_helper,nvidia,nvidia_drm
---
> drm                   512000  10 drm_kms_helper,nvidia,nvidia_drm
124,126c124,126
< nvidia              35176448  178 nvidia_uvm,nvidia_modeset
< nvidia_drm             57344  3
< nvidia_modeset       1179648  5 nvidia_drm
---
> nvidia              35176448  420 nvidia_uvm,nvidia_modeset
> nvidia_drm             57344  6
> nvidia_modeset       1179648  9 nvidia_drm

You’re right @gianarb there’s no difference, but clearly the same devices get configured differently, so depending on your energy, I would look for the following things:

  • look into dmesg when the devices get first recognized;
  • see if lsusb tells something different;
  • is having the X or Wayland session a key fatctor? E.g. Without starting a graphical session but using something like gpm on console and connecting the devices after boot, do they still behave correctly?
  • With the help of lsusb look into /sys/bus/usb/devices/x and see if something seems different.
1 Like

I have a strong motivation to attempt a fix for this because it is a problem I have with both my machines :smiley: And I would really like to switch on the workstation and enjoy it without having to walk around to play with the usb ports! So let’s try!

dmesg for the mouse does not bring anythig to my attention

[    6.656069] usb 5-3: new full-speed usb device number 2 using xhci_hcd
[    6.799765] usb 5-3: new usb device found, idvendor=3938, idproduct=1031, bcddevice= 1.36
[    6.799767] usb 5-3: new usb device strings: mfr=1, product=2, serialnumber=0
[    6.799768] usb 5-3: product: 2.4g wireless mouse
[    6.799769] usb 5-3: manufacturer: mosart semi.
[    6.811771] input: mosart semi. 2.4g wireless mouse as /devices/pci0000:00/0000:00:08.1/0000:0c:00.3/usb5/5-3/5-3:1.0/0003:3938:1031.0004/input/input6
[    6.811784] input: MOSART Semi. 2.4G Wireless Mouse as /devices/pci0000:00/0000:00:08.1/0000:0c:00.3/usb5/5-3/5-3:1.0/0003:3938:1031.0004/input/input7
[    6.812245] hid-generic 0003:3938:1031.0004: input,hiddev98,hidraw3: USB HID v1.10 Mouse [MOSART Semi. 2.4G Wireless Mouse] on usb-0000:0c:00.3-3/input0

I think the keyboard is this one:

$ lsusb
...
Bus 001 Device 002: ID 04b4:6001 Cypress Semiconductor Corp.  

Maybe this is a bit weird but I can’t really tell: [ 1.378989] usb 3-4: config 1 has an invalid interface number: 2 but max is 1

[    1.293154] ata2: SATA link down (SStatus 0 SControl 300)
[    1.378989] usb 3-4: config 1 has an invalid interface number: 2 but max is 1
[    1.378990] usb 3-4: config 1 has no interface number 1
[    1.379037] usb 1-3: New USB device found, idVendor=04b4, idProduct=6001, bcdDevice= 1.03
[    1.379038] usb 1-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.390989] usb 3-4: New USB device found, idVendor=0b05, idProduct=18f3, bcdDevice= 1.00
[    1.390990] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3


...
...
[    1.436690] input: HID 04b4:6001 as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.0/0003:04B4:6001.0001/input/input0
[    1.489690] hid-generic 0003:04B4:6001.0001: input,hidraw0: USB HID v1.11 Keyboard [HID 04b4:6001] on usb-0000:07:00.1-3/input0
[    1.489938] input: HID 04b4:6001 Mouse as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1/0003:04B4:6001.0002/input/input1
[    1.489951] input: HID 04b4:6001 System Control as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1/0003:04B4:6001.0002/input/input2
[    1.542236] usb 1-4: new high-speed USB device number 3 using xhci_hcd
[    1.542290] input: HID 04b4:6001 Consumer Control as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1/0003:04B4:6001.0002/input/input3
[    1.542305] input: HID 04b4:6001 as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1/0003:04B4:6001.0002/input/input4
[    1.542318] input: HID 04b4:6001 Keyboard as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1/0003:04B4:6001.0002/input/input5
[    1.542409] hid-generic 0003:04B4:6001.0002: input,hiddev96,hidraw1: USB HID v1.11 Mouse [HID 04b4:6001] on usb-0000:07:00.1-3/input1
[    1.542500] hid-generic 0003:0B05:18F3.0003: hiddev97,hidraw2: USB HID v1.11 Device [AsusTek Computer Inc. AURA LED Controller] on usb-0000:07:00.3-4/input2
[    1.670782] usb 1-4: New USB device found, idVendor=0451, idProduct=8142, bcdDevice= 1.00
[    1.670784] usb 1-4: New USB device strings: Mfr=0, Product=0, SerialNumber=1
[    1.670785] usb 1-4: SerialNumber: 1D0018611882
lsusb -d 3938:1031 -v                                                                               huge: Wed Sep 15 10:10:54 2021β”‚ + D/D/n/t/dmesg-first-boot.txt
                                                                                                                                              β”‚    34 [    0.988986] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
can't get debug descriptor: Resource temporarily unavailable                                                                                  β”‚    33 [    0.988987] usb usb4: Product: xHCI Host Controller
                                                                                                                                              β”‚    32 [    0.988987] usb usb4: Manufacturer: Linux 5.10.62 xhci-hcd
Bus 005 Device 002: ID 3938:1031 MOSART Semi. 2.4G Wireless Mouse                                                                             β”‚    31 [    0.988987] usb usb4: SerialNumber: 0000:07:00.3
Device Descriptor:                                                                                                                            β”‚    30 [    0.989019] hub 4-0:1.0: USB hub found
  bLength                18                                                                                                                   β”‚    29 [    0.989026] hub 4-0:1.0: 4 ports detected
  bDescriptorType         1                                                                                                                   β”‚    28 [    0.989126] usb: port power management may be unreliable
  bcdUSB               1.10                                                                                                                   β”‚    27 [    0.989193] xhci_hcd 0000:0c:00.3: xHCI Host Controller
  bDeviceClass            0                                                                                                                   β”‚    26 [    0.989195] xhci_hcd 0000:0c:00.3: new USB bus registered, assigned bus number 5
  bDeviceSubClass         0                                                                                                                   β”‚    25 [    0.989287] xhci_hcd 0000:0c:00.3: hcc params 0x0278ffe5 hci version 0x110 quirks 0x0000000000000410
  bDeviceProtocol         0                                                                                                                   β”‚    24 [    0.989491] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
  bMaxPacketSize0         8                                                                                                                   β”‚    23 [    0.989491] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
  idVendor           0x3938                                                                                                                   β”‚    22 [    0.989491] usb usb5: Product: xHCI Host Controller
  idProduct          0x1031                                                                                                                   β”‚    21 [    0.989492] usb usb5: Manufacturer: Linux 5.10.62 xhci-hcd
  bcdDevice            1.36                                                                                                                   β”‚    20 [    0.989492] usb usb5: SerialNumber: 0000:0c:00.3
  iManufacturer           1 MOSART Semi.                                                                                                      β”‚    19 [    0.989525] hub 5-0:1.0: USB hub found
  iProduct                2 2.4G Wireless Mouse                                                                                               β”‚    18 [    0.989529] hub 5-0:1.0: 4 ports detected
  iSerial                 0                                                                                                                   β”‚    17 [    0.989641] xhci_hcd 0000:0c:00.3: xHCI Host Controller
  bNumConfigurations      1                                                                                                                   β”‚    16 [    0.989642] xhci_hcd 0000:0c:00.3: new USB bus registered, assigned bus number 6
  Configuration Descriptor:                                                                                                                   β”‚    15 [    0.989642] xhci_hcd 0000:0c:00.3: Host supports USB 3.1 Enhanced SuperSpeed
    bLength                 9                                                                                                                 β”‚    14 [    0.989648] usb usb6: We don't know the algorithms for LPM for this host, disabling LPM.
    bDescriptorType         2                                                                                                                 β”‚    13 [    0.989655] usb usb6: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
    wTotalLength       0x0022                                                                                                                 β”‚    12 [    0.989655] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    bNumInterfaces          1                                                                                                                 β”‚    11 [    0.989655] usb usb6: Product: xHCI Host Controller
    bConfigurationValue     1                                                                                                                 β”‚    10 [    0.989656] usb usb6: Manufacturer: Linux 5.10.62 xhci-hcd
    iConfiguration          0                                                                                                                 β”‚     9 [    0.989656] usb usb6: SerialNumber: 0000:0c:00.3
    bmAttributes         0xa0                                                                                                                 β”‚     8 [    0.989688] hub 6-0:1.0: USB hub found
      (Bus Powered)                                                                                                                           β”‚     7 [    0.989691] hub 6-0:1.0: 4 ports detected
      Remote Wakeup                                                                                                                           β”‚     6 [    0.989889] nvme nvme0: Shutdown timeout set to 10 seconds
    MaxPower              100mA                                                                                                               β”‚     5 [    0.996302] nvme nvme0: 32/0/0 default/read/poll queues
    Interface Descriptor:                                                                                                                     β”‚     4 [    0.998574]  nvme0n1: p1 p2
      bLength                 9                                                                                                               β”‚     3 [    1.227355] usb 1-3: new full-speed USB device number 2 using xhci_hcd
      bDescriptorType         4                                                                                                               β”‚     2 [    1.235354] usb 3-4: new full-speed USB device number 2 using xhci_hcd
      bInterfaceNumber        0                                                                                                               β”‚     1 [    1.292784] ata1: SATA link down (SStatus 0 SControl 300)
      bAlternateSetting       0                                                                                                               β”‚  893  [    1.293154] ata2: SATA link down (SStatus 0 SControl 300)
      bNumEndpoints           1                                                                                                               β”‚     1 [    1.378989] usb 3-4: config 1 has an invalid interface number: 2 but max is 1
      bInterfaceClass         3 Human Interface Device                                                                                        β”‚     2 [    1.378990] usb 3-4: config 1 has no interface number 1
      bInterfaceSubClass      1 Boot Interface Subclass                                                                                       β”‚     3 [    1.379037] usb 1-3: New USB device found, idVendor=04b4, idProduct=6001, bcdDevice= 1.03
      bInterfaceProtocol      2 Mouse                                                                                                         β”‚     4 [    1.379038] usb 1-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
      iInterface              0                                                                                                               β”‚     5 [    1.390989] usb 3-4: New USB device found, idVendor=0b05, idProduct=18f3, bcdDevice= 1.00
        HID Device Descriptor:                                                                                                                β”‚     6 [    1.390990] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
          bLength                 9                                                                                                           β”‚     7 [    1.390990] usb 3-4: Product: AURA LED Controller
          bDescriptorType        33                                                                                                           β”‚     8 [    1.390991] usb 3-4: Manufacturer: AsusTek Computer Inc.
          bcdHID               1.10                                                                                                           β”‚     9 [    1.390991] usb 3-4: SerialNumber: 9876543210
          bCountryCode            0 Not supported                                                                                             β”‚    10 [    1.400939] hid: raw HID events driver (C) Jiri Kosina
          bNumDescriptors         1                                                                                                           β”‚    11 [    1.436015] usbcore: registered new interface driver usbhid
          bDescriptorType        34 Report                                                                                                    β”‚    12 [    1.436016] usbhid: USB HID core driver
          wDescriptorLength     118                                                                                                           β”‚    13 [    1.436690] input: HID 04b4:6001 as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.0/0003:>
         Report Descriptors:                                                                                                                  β”‚    14 [    1.489690] hid-generic 0003:04B4:6001.0001: input,hidraw0: USB HID v1.11 Keyboard [HID 04b4:6001] on usb-0000:07:00.1-3/input0
           ** UNAVAILABLE **                                                                                                                  β”‚    15 [    1.489938] input: HID 04b4:6001 Mouse as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1>
      Endpoint Descriptor:                                                                                                                    β”‚    16 [    1.489951] input: HID 04b4:6001 System Control as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1->
        bLength                 7                                                                                                             β”‚    17 [    1.542236] usb 1-4: new high-speed USB device number 3 using xhci_hcd
        bDescriptorType         5                                                                                                             β”‚    18 [    1.542290] input: HID 04b4:6001 Consumer Control as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/>
        bEndpointAddress     0x81  EP 1 IN                                                                                                    β”‚    19 [    1.542305] input: HID 04b4:6001 as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1/0003:>
        bmAttributes            3                                                                                                             β”‚    20 [    1.542318] input: HID 04b4:6001 Keyboard as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:>
          Transfer Type            Interrupt                                                                                                  β”‚    21 [    1.542409] hid-generic 0003:04B4:6001.0002: input,hiddev96,hidraw1: USB HID v1.11 Mouse [HID 04b4:6001] on usb-0000:07:00.1-3/inp>
          Synch Type               None                                                                                                       β”‚    22 [    1.542500] hid-generic 0003:0B05:18F3.0003: hiddev97,hidraw2: USB HID v1.11 Device [AsusTek Computer Inc. AURA LED Controller] on>
          Usage Type               Data                                                                                                       β”‚    23 [    1.670782] usb 1-4: New USB device found, idVendor=0451, idProduct=8142, bcdDevice= 1.00
        wMaxPacketSize     0x0007  1x 7 bytes                                                                                                 β”‚    24 [    1.670784] usb 1-4: New USB device strings: Mfr=0, Product=0, SerialNumber=1
        bInterval               4                                                                                                             β”‚    25 [    1.670785] usb 1-4: SerialNumber: 1D0018611882
Device Status:     0x0000                                                                                                                     β”‚    26 [    1.678059] tsc: Refined TSC clocksource calibration: 3393.626 MHz
  (Bus Powered) 

Same for the keyboard:

gianarb@huge ~  $ lsusb -d 04b4:6001 -v

Bus 001 Device 002: ID 04b4:6001 Cypress Semiconductor Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x04b4 Cypress Semiconductor Corp.
  idProduct          0x6001
  bcdDevice            1.03
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0042
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          2 Game_Keyboard
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              2 Game_Keyboard
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      63
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              4 Function_Device
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     176
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

I will proceed with the other tests (gpm) in a bit

This is what happens when I disconnect and reconnect the mouse:

[   74.243725] usb 5-3: USB disconnect, device number 2




[   84.162232] usb 5-3: new full-speed USB device number 3 using xhci_hcd
[   84.306736] usb 5-3: New USB device found, idVendor=3938, idProduct=1031, bcdDevice= 1.36
[   84.306739] usb 5-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   84.306740] usb 5-3: Product: 2.4G Wireless Mouse
[   84.306741] usb 5-3: Manufacturer: MOSART Semi.
[   84.320883] input: MOSART Semi. 2.4G Wireless Mouse as /devices/pci0000:00/0000:00:08.1/0000:0c:00.3/usb5/5-3/5-3:1.0/0003:3938:1031.0005/input/input26
[   84.320989] input: MOSART Semi. 2.4G Wireless Mouse as /devices/pci0000:00/0000:00:08.1/0000:0c:00.3/usb5/5-3/5-3:1.0/0003:3938:1031.0005/input/input27
[   84.321066] hid-generic 0003:3938:1031.0005: input,hiddev96,hidraw0: USB HID v1.10 Mouse [MOSART Semi. 2.4G Wireless Mouse] on usb-0000:0c:00.3-3/input0

And the keyboard:

[  125.285227] usb 1-3: USB disconnect, device number 2
[  129.542917] usb 1-3: new full-speed USB device number 10 using xhci_hcd
[  129.685986] usb 1-3: New USB device found, idVendor=04b4, idProduct=6001, bcdDevice= 1.03
[  129.685989] usb 1-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[  129.709122] input: HID 04b4:6001 as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.0/0003:04B4:6001.0006/input/input28
[  129.760820] hid-generic 0003:04B4:6001.0006: input,hidraw2: USB HID v1.11 Keyboard [HID 04b4:6001] on usb-0000:07:00.1-3/input0
[  129.775496] input: HID 04b4:6001 Mouse as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1/0003:04B4:6001.0007/input/input29
[  129.775847] input: HID 04b4:6001 System Control as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1/0003:04B4:6001.0007/input/input30
[  129.827832] input: HID 04b4:6001 Consumer Control as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1/0003:04B4:6001.0007/input/input31
[  129.827998] input: HID 04b4:6001 as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1/0003:04B4:6001.0007/input/input32
[  129.828073] input: HID 04b4:6001 Keyboard as /devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:07:00.1/usb1/1-3/1-3:1.1/0003:04B4:6001.0007/input/input33
[  129.828158] hid-generic 0003:04B4:6001.0007: input,hiddev98,hidraw3: USB HID v1.11 Mouse [HID 04b4:6001] on usb-0000:07:00.1-3/input1

Just a shot in the dark, but in the past, when I had similar issues, it turned out that the Linux kernel’s USB autosuspend feature was involved and the devices apparently could not properly handle the autosuspend.

You can search directories under /sys/bus/usb/devices for your affected USB devices. Subsequently, you could check the contents of a file named power/control stored in the respective directory. The file may contain the string auto, which instructs the kernel to use USB autosuspend when the devices are not in use. You can then manually disable auto-suspend by writing on to these files instead, as in: echo on | sudo tee /sys/bus/usb/devices/…/power/control.

When your problem no longer occurs after disabling USB autosuspend, you could configure things so that in the future, USB autosuspend will be automatically disabled for these devices. E.g., see Power management - ArchWiki or compare the NixOS documentation on setting up udev rules.

Hello!

The suggestion @eigengrau gave me was right I think! I spend a couple of hours fighting against udev. I didn’t figure out how to write the rule I was hoping to write (the one who re-writes power/control for a specific device because as soon as I add filters per idProduct and idVendor it stops working). But I managed to deplay autosuspend to 120 minutes.

I hope it will be enough for now.
Thanks a lot to both of you for your help here!