dagargo / overwitch

JACK client for Overbridge devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Devices won't work if they are booted before the computer while being connected

lentferj opened this issue · comments

I recently made a fresh install of my system with bullseye (coming from buster). I compiled latest master (after "make distclean"), but now overwitch-cli doesn't work for me (the gui version doesn't find my devices either).

$ overwitch-cli -l
0: Digitone (ID 1935:0014) at bus 003, address 014
1: Digitakt (ID 1935:000c) at bus 003, address 013

$ overwitch-cli -vvv -n 0
DEBUG:overwitch.c:206:(ow_get_devices): Found Digitone (bus 003, address 014, ID 1935:0014)
DEBUG:overwitch.c:206:(ow_get_devices): Found Digitakt (bus 003, address 013, ID 1935:000c)
ERROR:engine.c:708:(ow_engine_init_from_bus_address): Error while opening device: LIBUSB_SUCCESS / LIBUSB_TRANSFER_COMPLETED
ERROR:jclient.c:378:(jclient_init): Overwitch error: can't find a matching device

$ overwitch-cli -vvv -n 1
DEBUG:overwitch.c:206:(ow_get_devices): Found Digitone (bus 003, address 014, ID 1935:0014)
DEBUG:overwitch.c:206:(ow_get_devices): Found Digitakt (bus 003, address 013, ID 1935:000c)
ERROR:engine.c:708:(ow_engine_init_from_bus_address): Error while opening device: LIBUSB_SUCCESS / LIBUSB_TRANSFER_COMPLETED
ERROR:jclient.c:378:(jclient_init): Overwitch error: can't find a matching device

$ overwitch-cli -vvv -d Digitakt
DEBUG:overwitch.c:206:(ow_get_devices): Found Digitone (bus 003, address 014, ID 1935:0014)
DEBUG:overwitch.c:206:(ow_get_devices): Found Digitakt (bus 003, address 013, ID 1935:000c)
ERROR:engine.c:708:(ow_engine_init_from_bus_address): Error while opening device: LIBUSB_SUCCESS / LIBUSB_TRANSFER_COMPLETED
ERROR:jclient.c:378:(jclient_init): Overwitch error: can't find a matching device

$ overwitch-cli -vvv -d Digitone
DEBUG:overwitch.c:206:(ow_get_devices): Found Digitone (bus 003, address 014, ID 1935:0014)
DEBUG:overwitch.c:206:(ow_get_devices): Found Digitakt (bus 003, address 013, ID 1935:000c)
ERROR:engine.c:708:(ow_engine_init_from_bus_address): Error while opening device: LIBUSB_SUCCESS / LIBUSB_TRANSFER_COMPLETED
ERROR:jclient.c:378:(jclient_init): Overwitch error: can't find a matching device

I had issues with running the latest master version from the project folder until I randomly tried to sudo make install.

After that things started working again.

reverting to 71dd4de seems to have fixed it for me

no, I am wrong. It wasn't the revert. If I reboot the system while my Digis are on, it doesn't work. If I restart my Digis after system boot, it works. Maybe a problem with USB, udev or the like?

I do see these messages in dmesg after boot... maybe related?

[   16.173212] usbhid 3-6.2:1.2: couldn't find an input interrupt endpoint
[   16.309777] usbhid 3-6.4:1.2: couldn't find an input interrupt endpoint

When I turn my Digis off and on again I see this... and subsequently overwitch-cli works...

[   99.670750] usb 3-4: USB disconnect, device number 5
[  101.062103] usb 3-2: USB disconnect, device number 3
[  107.320312] usb 3-2: new high-speed USB device number 13 using ehci-pci
[  107.477618] usb 3-2: config 2 has an invalid interface number: 5 but max is 4
[  107.477623] usb 3-2: config 2 has 6 interfaces, different from the descriptor's value: 5
[  107.478177] usb 3-2: New USB device found, idVendor=1935, idProduct=000c, bcdDevice= 0.01
[  107.478182] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  107.478185] usb 3-2: Product: Elektron Digitakt
[  107.478187] usb 3-2: Manufacturer: Elektron Music Machines
[  107.478189] usb 3-2: SerialNumber: 000000000001
[  107.760337] usb 3-4: new high-speed USB device number 14 using ehci-pci
[  107.929171] usb 3-4: config 2 has an invalid interface number: 5 but max is 4
[  107.929177] usb 3-4: config 2 has 6 interfaces, different from the descriptor's value: 5
[  107.929822] usb 3-4: New USB device found, idVendor=1935, idProduct=0014, bcdDevice= 0.01
[  107.929828] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  107.929831] usb 3-4: Product: Elektron Digitone
[  107.929833] usb 3-4: Manufacturer: Elektron Music Machines
[  107.929835] usb 3-4: SerialNumber: 000000000001

This is on a pretty clean Debian Bullseye install.... I didn't tinker with udev or the like...

and this is the dmesg output during original boot (after which overwitch-cli thows the above error)

[    3.335476] usb 3-2: new high-speed USB device number 3 using ehci-pci
[    3.494689] usb 3-2: config 2 has an invalid interface number: 5 but max is 4
[    3.494695] usb 3-2: config 2 has 6 interfaces, different from the descriptor's value: 5
[    3.497316] usb 3-2: New USB device found, idVendor=1935, idProduct=000c, bcdDevice= 0.01
[    3.497322] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.497325] usb 3-2: Product: Elektron Digitakt
[    3.497327] usb 3-2: Manufacturer: Elektron Music Machines
[    3.497329] usb 3-2: SerialNumber: 000000000001

[    3.827484] usb 6-1: new full-speed USB device number 2 using uhci_hcd
[    4.230556] usb 6-1: New USB device found, idVendor=0944, idProduct=0142, bcdDevice= 1.00
[    4.230562] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    4.230565] usb 6-1: Product: minilogue xd
[    4.230567] usb 6-1: Manufacturer: KORG INC.

[    4.523473] usb 3-4: new high-speed USB device number 5 using ehci-pci
[    4.682690] usb 3-4: config 2 has an invalid interface number: 5 but max is 4
[    4.682695] usb 3-4: config 2 has 6 interfaces, different from the descriptor's value: 5
[    4.685334] usb 3-4: New USB device found, idVendor=1935, idProduct=0014, bcdDevice= 0.01
[    4.685340] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    4.685343] usb 3-4: Product: Elektron Digitone
[    4.685345] usb 3-4: Manufacturer: Elektron Music Machines
[    4.685347] usb 3-4: SerialNumber: 000000000001

if I turn the Digis on at a later point during boot it works, too. Very strange.

That is not a Linux problem. That is an Elektron problem.

I noticed it on Windows too with the official Overbridge plugin.

Sometimes turning on the Digitone/Digitakt while the USB cable is connected to a running computer just freezes them.

I can confirm the issue. I never start my Digitakt before the PC, hence I've never seen this before.

$ overwitch -vvv
ERROR:engine.c:708:(ow_engine_init_from_bus_address): Error while opening device: LIBUSB_SUCCESS / LIBUSB_TRANSFER_COMPLETED
ERROR:jclient.c:378:(jclient_init): Overwitch error: can't find a matching device

That is not a Linux problem. That is an Elektron problem.

I agree with @szszoke because I've seen weird USB issues before. For instance, the errors at the end of lsusb that even take some time to appear.

$ lsusb -d 1935:000c -v
[...]
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength       0x0009
        bInCollection           1
        baInterfaceNr(0)        5
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0100
  (Bus Powered)

I saw also what @lentferj has reported but didn't notice the issue.

[  713.182680] usb 1-7: new high-speed USB device number 8 using xhci_hcd
[  713.354989] usb 1-7: config 2 has an invalid interface number: 5 but max is 4
[  713.354994] usb 1-7: config 2 has 6 interfaces, different from the descriptor's value: 5
[  713.366981] usb 1-7: New USB device found, idVendor=1935, idProduct=000c, bcdDevice= 0.01
[  713.366987] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  713.366989] usb 1-7: Product: Elektron Digitakt
[  713.366992] usb 1-7: Manufacturer: Elektron Music Machines
[  713.366994] usb 1-7: SerialNumber: 000000000001

However, I don't see these.

[   16.173212] usbhid 3-6.2:1.2: couldn't find an input interrupt endpoint
[   16.309777] usbhid 3-6.4:1.2: couldn't find an input interrupt endpoint

The workaround is to change the USB configuration in the devices and then change it back. Could you both confirm that this works for you?

I'm leaving this open for now just in case someone wants to comment something on this. Also, I want to do some research.

However, I don't see these.

[   16.173212] usbhid 3-6.2:1.2: couldn't find an input interrupt endpoint
[   16.309777] usbhid 3-6.4:1.2: couldn't find an input interrupt endpoint

yes, they seem unrelated as they do appear even when booting with my Digis turned off.

This issue can be closed as it was not related to Overwitch but to USB hardware issues. Same thing has been reported to happen on Windows and the workaround is basically to turn the devices off and on again.

Be that as it may, the error above was misleading because of a bug and was solved in 9ceb911. See #33 for details about this.

Feel free to reopen this if needed.

Perhaps we can try to reset the device at Overwitch startup to see if it improves anything.

I've been studying libusb lately and reopened this because I thought that we could call libusb_reset_device in this scenario.

But it is not possible since the device can not be opened and it is needed to be to call libusb_reset_device with its device handle.

As stated above, it can be easily fixed by resetting the device USB configuration from the USB config menu.