OSX Wine program not recognizing USB device - macos

I'm trying to use CSR BlueFlash to dump the firmware/upload new firmware to a JBL Flip 3 speaker. I've put the speaker into DFU mode and it shows up in the OSX ioregistry (see below):
but when I try to run BlueFlash, no USB devices are found. Looking in ~/.wine/dosdevices, there are no COM<number> symlinks. In fact, I don't believe there are any /dev/tty devices corresponding to the USB device. I've tried many different USB port numbers (like idProduct and bcdDevice) but BlueFlash finds no USB devices with that number.
I have seen a project where someone got BlueFlash to recognize the device with a JBL Flip 4 so I am fairly certain that what I am trying to do is possible.
Does anyone know how to get Wine on OSX to recognize a USB device?

Related

macOS MIDI Driver CFPlugin fails on kIOReturnExclusiveAccess and 2 devices shown in MIDI Studio

I'm trying to write a custom USB MIDI driver for macOS. I found a few projects online that are based on some old Apple Sample code, one example linked below.
https://github.com/ysalathe/GenericUSBMIDI
The project seems sensible and works to an extent, but I'm having a problem with it. I hoped someone with experience of the macOS CFPlugin based MIDI driver system might be able to help me...
Steps to recreate issue:
Copy the project's product (GenericUSBDriver.plugin) to ~/Library/Audio/MIDI Drivers
Connect my MIDI device via USB
Open Audio MIDI setup and select show MIDI studio
MIDI studio now shows an icon with the name from my MIDI device's USB descriptor. However, my log shows that my driver failed in USBDevice::OpenAndConfigure when USBDeviceOpen() returns kIOReturnExclusiveAccess (USBDevice.cpp line: 189).
require_noerr((*mPluginIntf)->USBDeviceOpen(mPluginIntf), errexit);
Then after clicking 'Rescan MIDI' my driver loads successfully and a 2nd icon appears in MIDI studio with the driver specified name, but the original icon from step 4 persists. So, I now have 2 icons representing the attached device in MIDI Studio.
Googling things like: 'USBDeviceOpen() kIOReturnExclusiveAccess MIDI' gets various 'Apple Mailing Lists' hits around a decade old, but with no solutions.
It seems to me the standard Apple USB MIDI driver is grabbing my device and causing my driver to fail with kIOReturnExclusiveAccess on USBDeviceOpen(). Then after clicking 'Rescan MIDI' the Apple driver has let go, which allows my driver to load.
My device has an asynchronous USB audio interface, and a MIDI interface with 2 bidirectional ports.
My main question is...
How can I get the Apple MIDI system to select my driver after matching on USB VID/PID instead of the standard Apple driver?
but also...
Does anyone know of any docs or books that can help me? Is there a newer/ better way perhaps?
My driver renames the MIDI ports to something more intuitive for our users, macOS seems to ignore the names in the jack descriptors unlike Windows. Is there another way to do this?
I've been reading the book "OS X and iOS Kernel Programming", but while being very interesting hasn't shed any light on this problem. I can get their USB driver example to match on my USB device's MIDI interface and load, but there seems no obvious way for that to then influence the CFPlugin choice.

Can anyone help me with an Unrecognized device: Device descriptor request failed error on Windows 8.1?

I have a Metrologic MS1690 Barcode scanner that I'm trying to use with Windows 8.1, I get a Unrecognized Device: Device descriptor request failed error in devices and printers. The scanner gets no power from the computer when it is plugged in because of this. It usually shows up as a usb keyboard in windows 8 and 7, but with 8.1 it does not and I can't find an answer anywhere. Please help! Or even if someone could tell me how to get a generic usb keyboard driver for this thing that may help as well. Thanks.
The scanner gets no power from the computer when it is plugged in
Bit of a guess, but there was a change in Win8.1 that can affect HID devices like this. Such devices are now suspended when no application or service is accessing it. This can cause the device to misbehave if it depends on receiving timely power to operate correctly.
The workaround is to disable Enhanced Power Management for the device. The instructions are pretty elaborately spelled-out in this blog post. At break-neck speed: use Regedit.exe, locate the device in the HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Enum\ USB key and set the EnhancedPowerManagementEnabled value to 0.
The "solution" for me has been to add a PCI-E USB card, and use that for the scanner. I went with this one from Rosewill because it uses an NEC chipset which I have heard good things about.
After installing the provided drivers for the PCI-E card, the scanner seems to enumerate consistently (I have only been able to test it for a couple days so far).
According to the person I bought my scanner from, it's an issue with the USB chipset on the motherboard. Some are compatible and some aren't. If I had to do it over again, I would go with an RS232 cable and a power adapter instead of USB. I haven't tested that setup, but if your app needs serial data like mine does, it should be more reliable given that it's not dependent on the vagaries of integrated USB chipsets.

Using Motorola Symbol barcode scanner in Simple COM Port Emulation on Mac OS X

I have a Motorola Symbol DS6708 barcode scanner. I need to scan QR codes that are in binary. So, the default HID Keyboard Emulation mode will not work for me. I want to put the device into a serial device mode. I can put it into Simple COM Port Emulation mode, and the device appears on the USB bus. However, it doesn't appear as a serial device, and there's nothing in /dev that relates to the device.
The documentation refers to a driver for COM mode for Windows, but I don't see any drivers for Mac. Any tips to get this working?
Check around and see if you can figure it who manufactures the USB->serial chip in the device. If it is Prolific, there are open source Prolific drivers available for the Mac. If the bridge is TI, then see if you can suss out the model of the chip, since there is example source for drivers (compilable) available thought the TI developer program/portal.

Unique device identifiers for USB, firewire, and serial ports

I am working on a project that involves the auto-detection of USB and firewire devices being plugged and unplugged from an OS X system. For a given device, the system needs to recognise a device when it is plugged in (no matter which port) and load a device-specific bundle to deal with it.
The key to making this work is obviously the unique identification of each device. I know that USB devices are identified by a combination of the vendor ID and product ID fields, but this does not provide a unique ID, only the "kind" of device. If I have two devices the same and I plug both of them in to the computer, I would like some way to distinguish them. Is there a general and reliable way to do this, perhaps using other fields in the USB descriptor?
A related question, how does this work for USB serial ports? Suppose I plug in two USB serial ports of the same make/model. OS X should give them unique inodes in the /dev tree. However, suppose it calls them /dev/usbserial1 and /dev/usbserial2. If I then unplug the ports and plug in only one one of them, will that port be given the same name as it previously had, or will it just get /dev/usbserial1 (since it is the only) port plugged in?
Same question for firewire devices, although I think firewire devices are supposed to have a 64-bit GUID. In this case I am looking for someone to verify that using the GUID for firewire device identification would be reliable. In other words, if I plugged in two separate cameras of the same make and model, would I expect them to have different GUIDs?
I know I could test some of these with the appropriate hardware, but I don't have multiple bits of hardware at this time, so I am hoping someone may know at least some of the answers to the above questions.
With luck, your USB devices should have unique serial numbers, in addition to the VID/PID combination. If you're enumerating IOUSBDevice objects, look at the USB Serial Number property.
On Windows, Microsoft remembers device-specific settings by:
the device's serial number (the iSerialNumber field in the USB device descriptor), if available
or otherwise, by the "path" to the device: its bus (i.e. what hub it's plugged into etc.) + USB VID and PID
Without serial numbers, USB devices are virtually indistinguishable. You could tell apart different USB disk drives, but for devices which have no non-volatile memory of any kind (and many USB devices fall into this category), they are just indistinguishable, so you just have to make the best effort to do what the user expects.

How do I communicate with a GPIO USB device in OS X?

I have a USB web camera from ViMicro that contains a GPIO chip. We have a microswitch wired to one of the IO pins and can read the status of the switch on Windows using an ActiveX control that was provided by ViMicro, named exvmuvc.ax. I need to duplicate this functionality using IOKit on OS X.
USBTrace from SysNucleus displays the conversation happening between the Windows system and the USB device, but I cannot duplicate this on the Mac.
Does anyone know of a software USB sniffer, like USBTrace, that works on OS X so that I can compare the packets? Also, is anyone familiar with this particular camera chip and its GPIO subsystem, even on Linux?
You could use usbtracer from Xcode, or you can try using using USB Prober with a debug release of IOUSBFamily, this will most likely output more information than you actually want. You may want to look at qa1370 for more information.
In general though, I'd recommend you get a hardware USB analyzer, they make this sort of thing much easier.

Resources