Xiaofan Chen | 1 Jun 2011 08:34
Picon

Mac OS X codeless kext for HID device

We have a lot of discussions here about the HID device
under Mac OS X and it is reported that the codeless kext
which used to work up to Mac OS X 10.6.4 no longer
works under 10.6.6.

It seems to me that there should be a way to do this.

I just read the following page from Apple and they seem
to indicate that for matching a USB device, idVendor + idProduct (+ bcdDevice)
will be sufficient. For matching a USB interface, then
idVendor + idProduct + bInterfaceNumber + bConfigurationValue (+ bcdDevice)
will be necessary.
http://developer.apple.com/library/mac/#qa/qa1076/_index.html
http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptAnatomy/kext_anatomy.html

Maybe the existing kext does not cater to the interface matching
case.

I am just curious here as I do not have a Mac. I have only
one Apple device which is the newly got iPad 2 (which is
very nice).

--

-- 
Xiaofan

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
(Continue reading)

Xiaofan Chen | 1 Jun 2011 09:31
Picon

Re: Mac OS X codeless kext for HID device

On Wed, Jun 1, 2011 at 2:34 PM, Xiaofan Chen <xiaofanc <at> gmail.com> wrote:
> We have a lot of discussions here about the HID device
> under Mac OS X and it is reported that the codeless kext
> which used to work up to Mac OS X 10.6.4 no longer
> works under 10.6.6.
>
> It seems to me that there should be a way to do this.
>
> I just read the following page from Apple and they seem
> to indicate that for matching a USB device, idVendor + idProduct (+ bcdDevice)
> will be sufficient. For matching a USB interface, then
> idVendor + idProduct + bInterfaceNumber + bConfigurationValue (+ bcdDevice)
> will be necessary.
> http://developer.apple.com/library/mac/#qa/qa1076/_index.html
> http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptAnatomy/kext_anatomy.html
>
> Maybe the existing kext does not cater to the interface matching
> case.
>
> I am just curious here as I do not have a Mac. I have only
> one Apple device which is the newly got iPad 2 (which is
> very nice).
>

According to the following posts, Mac OS X 10.6.7 seems to fix the
issue.
http://osx-launchpad.blogspot.com/2010/11/launchpads-toolchain-version-20101112.html
http://osx-launchpad.blogspot.com/2010/11/breathing-led-effect-with-launchpad.html?showComment=1302269771023#c5723817088232840420

Example codeless kext for USB Composite Device with an
(Continue reading)

Michael Lewis | 2 Jun 2011 23:40
Picon

OpenUSB 1.1.5 Released

OpenUSB 1.1.5 has been released. It includes only 1 new fix, to
prevent crashes when another usb device is removed and you're
currently have a different USB device open.

It can be downloaded from:
https://sourceforge.net/projects/openusb/files/libopenusb/libopenusb-1.1.5/

--Mike Lewis
"Be who you are and say what you feel, because those who mind don't
matter and those who matter don't mind."   --Dr. Seuss

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
oliver cauchi | 3 Jun 2011 12:15
Picon

libusb isochronous transfer synchronous synchronization

Hello All,

I am new to libusb and hope that the experts in this group can help me. I want to develop a Linux isochronous USB driver with synchronous synchronization that reads from an IN endpoint. I managed to set the configuration, claim the interface and set the alternate settings but am not manging to read from the endpoint. Can someone give me advice on how to proceed ?

I already developed this driver for windows using libusbdotnet but now i want to do the same for Linux. Does OpenEndpointReader exists in libusb-1.0 ?

Thank a lot,
Oliver 

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Libusb-devel mailing list
Libusb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Lionel Debroux | 3 Jun 2011 12:29
Picon
Favicon

usb_reset on Windows makes some devices unhappy, no problem on Linux

Hello,

I'd like to raise again a matter brought forward on this ML in November
2007: http://sourceforge.net/mailarchive/message.php?msg_id=6268021 .

What happens is that the USB controller / stack of the Nspire, the
latest graphing calculator by Texas Instruments, doesn't like the reset
commands sent through libusb, under Windows, by the libticables library
used by the third-party linking software I'm maintaining nowadays, TILP.

* TI's official linking software under Windows (and probably MacOS X as
well, I haven't _checked_), and libusb under Linux, send only
IOCTL_INTERNAL_USB_RESET_PORT. The Nspire is happy with that;

* libusb under Windows unconditionally sends
IOCTL_INTERNAL_USB_RESET_PORT + IOCTL_INTERNAL_USB_CYCLE_PORT, which
makes the Nspire lose connection with the host.

(and resetting the communication frequently is necessary for reliable
communication, at least under Linux)

Unless we patch libusb (libusb0.sys) the following way, as described by
Romain (and we did so for a while):

--- src/driver/reset_device.c.orig      2007-03-20 05:33:29.000000000 -0500
+++ src/driver/reset_device.c   2009-05-07 10:41:28.331560796 -0500
 <at>  <at>  -32,14 +32,14  <at>  <at> 
     {
       DEBUG_ERROR("reset_device(): IOCTL_INTERNAL_USB_RESET_PORT failed: "
                   "status: 0x%x", status);
-    }

-  status = call_usbd(dev, NULL, IOCTL_INTERNAL_USB_CYCLE_PORT, timeout);
+      status = call_usbd(dev, NULL, IOCTL_INTERNAL_USB_CYCLE_PORT,
timeout);

-  if(!NT_SUCCESS(status))
-    {
-      DEBUG_ERROR("reset_device(): IOCTL_INTERNAL_USB_CYCLE_PORT failed: "
-                  "status: 0x%x", status);
+      if(!NT_SUCCESS(status))
+        {
+          DEBUG_ERROR("reset_device(): IOCTL_INTERNAL_USB_CYCLE_PORT
failed: "
+                      "status: 0x%x", status);
+        }
     }

   return status;

TILP's Nspire support under Windows is, well, unusable.
With a pristine libusb, the normal flow for simple operations such as
listing the calculator's contents, or receiving a dump of the screen, is
to trigger them, watch them fail, close the error messages, and repeat
until the operation eventually succeeds (with a sprinkling of unplugging
and replugging the device)...
None of that happens under Linux.

I don't know whether devices which support USB_RESET_PORT but not a
subsequent USB_CYCLE_PORT are to be considered buggy, I'm not very
qualified at USB matters.
But the question is, how do we handle such devices (preferably without
having to patch libusb0.sys...), since these devices do exist in the wild ?
Besides Nspire calculators, the patch reproduced above was reported to
fix interaction with at least another device (by preventing BSODs):
http://lists.fedoraproject.org/pipermail/mingw/2009-May/001338.html .
(in the URLs contained in that message, one needs to remplace "viewcvs"
by "viewvc", e.g.
http://svn.tilp.info/cgi-bin/viewvc.cgi/*checkout*/libticables/trunk/src/win32/usb/libusb-win32.html?pathrev=4162
)

I'm in the process of upgrading the libusb-win32 version shipped with
TILP, so that interested people can, through the filter driver, use TI's
official software and TILP II side by side, without having to uninstall
and reinstall the other program, and change the driver if that hasn't
worked, each time they switch.

If required, I can perform some testing and gather some information on
virtualized (VirtualBox) Windows versions, less often on a native Seven
x64 computer to which I have intermittent physical access.

Thanks in advance,
Lionel.

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
Xiaofan Chen | 3 Jun 2011 13:21
Picon

Re: libusb isochronous transfer synchronous synchronization

On Fri, Jun 3, 2011 at 6:15 PM, oliver cauchi <oliver.cauchi <at> gmail.com> wrote:
> I already developed this driver for windows using libusbdotnet but now i
> want to do the same for Linux. Does OpenEndpointReader exists in libusb-1.0
> ?

libusbdotnet works under Linux, why not try it?

--

-- 
Xiaofan

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
Xiaofan Chen | 3 Jun 2011 13:47
Picon

Re: libusb isochronous transfer synchronous synchronization

On Fri, Jun 3, 2011 at 7:39 PM, oliver cauchi <oliver.cauchi <at> gmail.com> wrote:
>>
>> libusbdotnet works under Linux, why not try it?
>
> Thanks for the reply. I am working on embedded systems and the system is
> minimal (stripped down version of Linux distos). To use libusbdotnet on my
> system I need to install other packages like Mono.net, libusb, etc. This can
> cause me a lot of problems. Is it possible to do isochronous
> transfers/synchronous synchronization with libusb-1.0 ?

I am not so sure about what you mean here. Anyway, isochronous
transfer always use asynchronous API.

--

-- 
Xiaofan

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
Tim Roberts | 3 Jun 2011 19:32

Re: libusb isochronous transfer synchronous synchronization

oliver cauchi wrote:
>
> I am new to libusb and hope that the experts in this group can help
> me. I want to develop a Linux isochronous USB driver with synchronous
> synchronization that reads from an IN endpoint. I managed to set the
> configuration, claim the interface and set the alternate settings but
> am not manging to read from the endpoint. Can someone give me advice
> on how to proceed ?

Setting up an isochronous read is a little tricky, although libusb
manages some of that.  Can you show us your code?

--

-- 
Tim Roberts, timr <at> probo.com
Providenza & Boekelheide, Inc.

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
Gillespie Donald | 4 Jun 2011 02:31
Favicon

libusb_control_transfer timing out sometimes

I am a USB newbie, so excuse me if I sound ignorant; in this case, I am J

 

I’m writing host code using libusb on linux which interfaces via USB with client code running on an Atmel processor.

 

I’m sending commands from the host to the Atmel using libusb_control_transfer. The Atmel code receives the command, executes it, and sends a response to the host using the interrupt endpoint. The host reads the interrupt endpoint periodically, and as long as the host reads the response before it tries to send another command, everything is fine.

 

But I need to have the host send multiple commands in rapid succession and receive the responses later when it reads from the interrupt endpoint. When I do this, libusb_control_transfer returns -7 (timeout) on all calls after the first. The response to the initial command is read subsequently by the host, but by then things are pretty screwed up and usually I just read 2 responses and nothing else.

 

To verify the responses are the problem, I stopped sending the responses, and that fixed the problem. The host can send as many commands in rapid succession as it wants and all are received and executed fine.

 

I’m not sure why it was done this way; I inherited this code and must make it work. Can anyone tell me why I cannot do two successive calls to libusb_control_transfer if there is data waiting to be read on the interrupt endpoint? Also, if you can suggest a fix or perhaps a better solution, I am open and would be grateful.

 

Thank you.

 

Don

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Libusb-devel mailing list
Libusb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Tim Roberts | 4 Jun 2011 03:03

Re: libusb_control_transfer timing out sometimes

Gillespie Donald wrote:
>
>
> I’m writing host code using libusb on linux which interfaces via USB
> with client code running on an Atmel processor.
>
>  
>
> I’m sending commands from the host to the Atmel using
> libusb_control_transfer. The Atmel code receives the command, executes
> it, and sends a response to the host using the interrupt endpoint. The
> host reads the interrupt endpoint periodically, and as long as the
> host reads the response before it tries to send another command,
> everything is fine.
>
> ...
>
> I’m not sure why it was done this way; I inherited this code and must
> make it work. Can anyone tell me why I cannot do two successive calls
> to libusb_control_transfer if there is data waiting to be read on the
> interrupt endpoint? Also, if you can suggest a fix or perhaps a better
> solution, I am open and would be grateful.

This could be an issue in your firmware.  Can your firmware handle the
case where you need to send an additional response but the endpoint
buffer already has data in it?

--

-- 
Tim Roberts, timr <at> probo.com
Providenza & Boekelheide, Inc.

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 

Gmane