Author Topic: Lasershark on Win 10 - 64bit: "Error finding USB device"  (Read 11175 times)

KB

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Lasershark on Win 10 - 64bit: "Error finding USB device"
« on: October 13, 2015, 05:58:19 PM »
Hi Lasarians,

I updated my machine (intel NUC i3) from Win 7-64bit to Windows 10-64bit. I  reinstalled the Zadig drivers  for LS interfaces 0,1,2. Zadig reports drivers installed successfully. Restarting the machine, and attempt to run the (successful under win7 64) "lasershark_stdin_circlemaker.exe | lasershark_stdin.exe" and the command prompt stalls for a moment and then prints: "Error finding usb device"

In Device Manager the Lasershark interfaces are listed. Unplugging the Lasershark causes them to disappear from Device Manager. So it seems the system sees them.

I'd appreciate some guidance here.

Thank you for your attention.
KB
« Last Edit: October 13, 2015, 08:03:20 PM by KB »

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: Lasershark on Win 10 - 64bit: "Error finding USB device"
« Reply #1 on: October 13, 2015, 08:08:32 PM »
Hi KB,

Someone once informed me they encountered this on a Windows 8.1 64-bit box once. Strangely I haven't heard anyone else ask about this problem yet however..

 Here is a snippet of that conversation:


Quote
Jeff,

I believe I have solved the problem.
I played a bit with lasershark_stdin.c and, after making it compatible with Visual Studio (I'm a n00b so I didn't use mingw to compile it) I added the following lines before your call to libusb_open_device_with_vid_pid :

int numDevices = libusb_get_device_list(context, &usbDevices);
if(numDevices < 0)
{
    libusb_free_device_list(usbDevices, 1);
    goto out_post_release;
}

and then, just before your call to libusb_exit, I added:

libusb_free_device_list(usbDevices, 1);

Full code here: http://pastebin.com/HvJZe9Ri

The program does give me a warning after terminating it ("libusb: warning [libusb_exit] some libusb_devices were leaked") but I believe that's nonsense since the memory is freed anyway.

And later...
Quote
Jeff,

just to add to my previous posts (I'll stop spamming your inbox, I promise) it seems the culprit is this function:

libusb_get_device_list

If it's called twice before getting the device it works just fine, which is the reason my "solution" works - libusb_open_device_with_vid_pid calls libusb_get_device_list internally.
I believe this can be tracked down to an OS-specific get_device_list function, and this is probably bugged on Windows 8.1 for some reason. It's not the first time I have issues with USB devices on Windows 8.1 anyway.

Do you have a means to compile code on your box to test to see if this works for you?

KB

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Lasershark on Win 10 - 64bit: "Error finding USB device"
« Reply #2 on: October 13, 2015, 08:32:31 PM »
Thank you for your time, maybe most LS users are not Win 10 64 or are Linux?  No, I don't have a means to compile the suggested change. Which I then dislike, leaves the question of asking you to try it, or I find a Visual Studio user to ask, or roll the system back to Win 7, which isn't awesome but it would be a temp solution if no choice.




Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: Lasershark on Win 10 - 64bit: "Error finding USB device"
« Reply #3 on: October 15, 2015, 11:30:23 PM »
I'll try and compile you something Sunday to test.

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: Lasershark on Win 10 - 64bit: "Error finding USB device"
« Reply #4 on: October 19, 2015, 12:36:26 AM »
After working on this problem today I have found that libusbK must be installed for the "LaserShark (Composite Parent)". This was not necessary in the past. I have updated the instructions to reflect this.

Once libusbk is installed in place of usbccgp everything should work as-is.

While I was debugging this I decided that it would be easy enough to support selection of which LaserShark can be controlled. You can list LaserShark units via the -l option and specify the LaserShark you want to connect to via the -s option (the serial number is used to identify the LaserSharks).

These changes have been checked into git and new binaries for Windows 32bit and 64bit architectures have been uploaded to my website (see the windows usage page)

KB

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Lasershark on Win 10 - 64bit: "Error finding USB device"
« Reply #5 on: October 20, 2015, 05:47:53 PM »
Yeah! This works now on my Win 10-64bit machine. Excellent and thank you.

KB