Export to GitHub

boblight - issue #79

Lightpack (USB) with Windows/Darwin will crash


Posted on Feb 24, 2014 by Swift Ox

What steps will reproduce the problem? 1. Run boblightd with usb lightpack on Windows/Darwin 2. 3.

What is the expected output? What do you see instead? It crashes

What version of the product are you using? On what operating system? trunk, on windows

Please provide any additional information below. The issue is that libusb_detach_kernel_driver is not available on Windows/Darwin, so this block of code needs to be guarded:

    if ((error=libusb_detach_kernel_driver(devhandle, LIGHTPACK_INTERFACE)) != LIBUSB_SUCCESS) {
      LogError("%s: error detaching interface %i, error:%i %s", m_name.c_str(), LIGHTPACK_INTERFACE, error, UsbErrorName(error));
      return false;
    }

(lines 100 to 103 of devicelightpack.cpp)

See: http://libusb.sourceforge.net/api-1.0/group__dev.html#ga21bd343325f558987ca57e4e281a6d47

If that block is removed, then boblightd works as expected AS LONG AS THE USB DRIVER FOR THE DEVICE IS REPLACED VIA ZADIG TO WINUSB - it does not work with the default HIDUSB driver that gets installed when you just plug it in.

Hope that helps someone - fixing it properly is beyond my c++ skills I am afraid!

Comment #1

Posted on Jan 14, 2015 by Quick Cat

Does it work for you on osx when you comment that block out? I can just #ifdef it out for osx in that case.

Comment #2

Posted on Jan 15, 2015 by Happy Monkey

I'm sorry but I don't have access to OSX anymore, got rid of my old mac mini, so I can't be sure. I am not currently using my lights either, as I moved my TV.

Status: New

Labels:
Type-Defect Priority-Medium