google/gousb

Can't detach kernel driver. Invalid param [code -2] for iOS 16 devices

Karazum opened this issue · 5 comments

Hello,

I'm running an application that mirrors iphone screen via usb cable to my linux desktop.
The application in question is a modified quick time video hack

Essentially, when a iphone is connected to a linux machine, it determines which usb configuration is for audio-video mirroring and when you run the application it will attempt to switch to that usb configuration

invokes usbDevice.Config(device.QTConfigIndex which
invokes d.ctx.libusb.detachKernelDriver(d.handle, uint8(iface.Number)))

but it fails when it attempts to detachKernelDriver with the following error:
{"error_message":"failed connecting to usb","original_error":"Can't detach kernel driver of the device vid=05ac,pid=12a8,bus=5,addr=21 and interface 3: libusb: invalid param [code -2]"}

Additional useful information:

  • autodetach is enabled
  • linux version: ubuntu 22.04
  • usbmuxd version: 1.1.2
  • go version: 1.20.1
  • gousb version:
  • steps to reproduce:

Did you ever make any progress in this? Running into same issue with same qvh library. Also running into libusb: device or resource busy [code -6] when not attempting to auto detach kernal.

Yes. It seems that the issue was in the usbmuxd binary.
Downloading the latest version from git and manually building the binary resolves the issue.

That fixed the issue, Thanks!! Stuck on the "waiting for Ping..." Were you able to start receiving packets?

I had the same issue with waiting for Ping, but I could make it work if you do qvh activate and qvh gstreamer within 1-2 seconds.

Wow was able to get that to work as well. Thanks again!