mylesche | 1 Jun 2011 06:33
Picon

"UpdateDriverForPlugAndPlayDevices" crashed

Hi all,

I created an test_libusb.inf on XP via inf-wizard.exe and modified it as
follows:

[Version]
Signature   = "$Windows NT$"
Class       = "libusb-win32 devices"
ClassGuid   = {EB781AAF-9C70-4523-A5DF-642A87ECA567}
Provider    = "libusb-win32"
CatalogFile = test_libusb.cat
DriverVer   = 10/02/2010, 1.2.2.0

[Manufacturer]
%VendorName% = Devices, NT

[Devices.NT]
%DeviceName% = LIBUSB_WIN32_DEV, USB\%DeviceID%

[ClassInstall32]
Addreg = libusb_class_install_add_reg

[SourceDisksFiles.x86]
libusb0.sys     = 1,x86
libusb_coinstall.dll =1,x86

[DestinationDirs]
libusb_files_sys       = 10,system32\drivers
LibusbCoInstallFiles_NT      = 11

(Continue reading)

Pete Batard | 1 Jun 2011 13:01
Picon
Gravatar

Re: "UpdateDriverForPlugAndPlayDevices" crashed

On 2011.06.01 05:33, mylesche wrote:
> I can't get error via getLastError(),since the
> UpdateDriverForPlugAndPlayDevices crashed.

Since you're on XP, you should be able to get the setupapi debug logs 
(provided the output was flushed after the crash) in 
C:\Windows\setupapi.log. It might give you some clue with regards to the 
error, or at least tell you how far the installation process went.

For a more verbose log, I'd recommend testing on Vista and Windows 7 if 
you can and checking C:\Windows\inf\\setupapi.dev.log, as it gives more 
details into the driver installation process and problems encountered.

Regards,

/Pete

------------------------------------------------------------------------------
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. 
http://p.sf.net/sfu/quest-sfdev2dev
Vitali Lovich | 2 Jun 2011 23:43
Picon

Re: HID and Libusb or Winsub

I haven't had issues with the codeless kext not working on OSX.  I'm currently trying to figure out how to get
my inf for a HID device to install via Device Manager, but it's saying it can't find any matching devices
(I'm hoping the situation will get better once the driver is signed, but I'm really nervous at this point).

-Vitali

On May 24, 2011, at 6:42 PM, Xiaofan Chen wrote:

> On Wed, May 25, 2011 at 5:47 AM, Mark Brooks <mbr <at> icelantern.com> wrote:
>> Hi guys,
>> 
>> Sorry about this question. It might be a little off scope here but lets
>> see....
>> 
>> I have a PIC controller design which is currently not HID and I control it
>> from Qt using libusb. So far so good.
> 
> Keep this.
> 
>> The product i think would be better as HID since then the user would not
>> need to install all the libusb driver etc.
> 
> HID is good and bad. The general recommendation from the libusb
> side is that do not use HID for generic device when using libusb.
> http://www.libusb.org/wiki/FAQ#CanIcreateadriverlessdeviceusingHIDclass
> http://www.libusb.org/ticket/33
> 
> Originally the libusb-1.0 Windows backend has the HID backend and
> I was requesting an HID backend for Mac OS X, but due to the above
> strong opinions from the libusb-1.0 project admins, both ideas were
(Continue reading)

Xiaofan Chen | 3 Jun 2011 04:42
Picon

Re: HID and Libusb or Winsub

On Fri, Jun 3, 2011 at 5:43 AM, Vitali Lovich <vlovich <at> gmail.com> wrote:
> I haven't had issues with the codeless kext not working on OSX.

It is said that Mac OS X 10.6.6 does not work but 10.6.7 fixed the issue.

> I'm currently trying to figure out how to get my inf for a HID device to
> install via Device Manager, but it's saying it can't find any matching
> devices (I'm hoping the situation will get better once the driver is signed,
> but I'm really nervous at this point).

I do not understand what you mean by this. Firstly please use
the latest version.

Are you creating the driver packages using the GUI Inf-Wizard? In
that case it should work. In the end of the GUI Inf-Wizard, you will
have the option to install the driver package and that should work.

The libusb0.sys kernel driver is digital signed since version 1.2.0.0
(the latest release is 1.2.4.0). The whole driver package created
by Inf-Wizard is of course not signed so you will see the warning,
but you should be able to install 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. 
(Continue reading)

Xiaofan Chen | 3 Jun 2011 04:46
Picon

Re: "UpdateDriverForPlugAndPlayDevices" crashed

On Wed, Jun 1, 2011 at 12:33 PM, mylesche <mylesche <at> gmail.com> wrote:

> I installed driver via:
> rundll32 .\libusb0.dll,usb_install_driver_np_rundll .\libusb_test.inf

I tend to believe what you do is not standard and will not be
supported by the above.

> How could I register and use co-installer for libusb-win32?

Create your own installer and forget about using libusb-win32
libusb0.dll's driver installer which is not a general driver
installer.

Maybe you want to look at libwdi.

--

-- 
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 
mylesche | 3 Jun 2011 06:48
Picon

Re: "UpdateDriverForPlugAndPlayDevices" crashed


Pete Batard wrote:
> 
> On 2011.06.01 05:33, mylesche wrote:
>> I can't get error via getLastError(),since the
>> UpdateDriverForPlugAndPlayDevices crashed.
> 
> Since you're on XP, you should be able to get the setupapi debug logs 
> (provided the output was flushed after the crash) in 
> C:\Windows\setupapi.log. It might give you some clue with regards to the 
> error, or at least tell you how far the installation process went.
> 
> For a more verbose log, I'd recommend testing on Vista and Windows 7 if 
> you can and checking C:\Windows\inf\\setupapi.dev.log, as it gives more 
> details into the driver installation process and problems encountered.
> 
> Regards,
> 
> /Pete
> 
> ------------------------------------------------------------------------------
> 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. 
> http://p.sf.net/sfu/quest-sfdev2dev
> _______________________________________________
> Libusb-win32-devel mailing list
(Continue reading)

jonesjuice0 | 4 Jun 2011 19:36

Re: win32 - ISO USB2.0 transfers (helpful hint)

I'm having this exact same problem and I was hoping that you could elaborate
a bit on your solution.

Also, the link included re-directs and I'm not sure if this page contains
the impossible to find solution you mentioned.

I'm trying to send output packets to the following endpoint:

Endpoint 3:
        bLength: 7
        bDescriptorType: 5
        bEndpointAddress: 0x02
        bmAttributes: Isochronous - Synchronous
        wMaxPacketSize: 76
        bInterval: 1
        bRefresh: 0
        bSynchAddress: 0

So the number of packets must be eight: Does this mean that you have to
submit eight requests before reaping any? I get an error as soon as I submit
even one request, and for 8, I get the same error 8 times. Is there a trick
for timing, or setup that prevents these errors? Do you have any examples or
code segments that I could see?

Relevant code follows (I've already opened device, set configuration,
claimed interface and all that good stuff)
<em>
.
.
.
(Continue reading)

jonesjuice0 | 4 Jun 2011 19:37

Re: win32 - ISO USB2.0 transfers (helpful hint)

I'm having this exact same problem and I was hoping that you could elaborate
a bit on your solution.

Also, the link included re-directs and I'm not sure if this page contains
the impossible to find solution you mentioned.

I'm trying to send output packets to the following endpoint:

Endpoint 3:
        bLength: 7
        bDescriptorType: 5
        bEndpointAddress: 0x02
        bmAttributes: Isochronous - Synchronous
        wMaxPacketSize: 76
        bInterval: 1
        bRefresh: 0
        bSynchAddress: 0

So the number of packets must be eight: Does this mean that you have to
submit eight requests before reaping any? I get an error as soon as I submit
even one request, and for 8, I get the same error 8 times. Is there a trick
for timing, or setup that prevents these errors? Do you have any examples or
code segments that I could see?

Relevant code follows (I've already opened device, set configuration,
claimed interface and all that good stuff)

.
.
.
(Continue reading)

Tim Schuerewegen | 4 Jun 2011 20:28
Picon

Re: win32 - ISO USB2.0 transfers (helpful hint)

Try this ...
 
       audio_out_block audio_out[OUT_FRAMES][32]; // output data blocks
       void* audio_out_context[OUT_FRAMES][32]; // context for iso async output
transfers
       // initialize isochronous asynchronous request types
       int i;
       for(i=0;i<OUT_FRAMES;i++){
               ret = usb_isochronous_setup_async(handle,
&audio_out_context[i][0], EP_ISOC_OUT, EP_ISOC_OUT_MPSIZE * 32);
               if(ret != 0){
                       printf("Error: failed to setup isochronous output
transfer %d error code: %d\n",i,ret);
                       res = USB_ISOC_OUT_ERROR;
                       goto done;
               }
       }
       for(i=0;i<OUT_FRAMES;i++){
               ret = usb_submit_async(audio_out_context[i], (char*)
&audio_out[i][0], EP_ISOC_OUT_MPSIZE * 32);
               if(ret != 0){
                       printf("Error: submit isochronous output transfer %d
error code: %d\n",i,ret);
                       res = USB_ISOC_OUT_ERROR;
                       goto done;
               }
       }
 
 
On Sat, Jun 4, 2011 at 7:37 PM, jonesjuice0 <aaron <at> sonistic.com> wrote:
I'm having this exact same problem and I was hoping that you could elaborate
a bit on your solution.

Also, the link included re-directs and I'm not sure if this page contains
the impossible to find solution you mentioned.

I'm trying to send output packets to the following endpoint:

Endpoint 3:
       bLength: 7
       bDescriptorType: 5
       bEndpointAddress: 0x02
       bmAttributes: Isochronous - Synchronous
       wMaxPacketSize: 76
       bInterval: 1
       bRefresh: 0
       bSynchAddress: 0

So the number of packets must be eight: Does this mean that you have to
submit eight requests before reaping any? I get an error as soon as I submit
even one request, and for 8, I get the same error 8 times. Is there a trick
for timing, or setup that prevents these errors? Do you have any examples or
code segments that I could see?

Relevant code follows (I've already opened device, set configuration,
claimed interface and all that good stuff)

.
.
.

#define EP_ISOC_OUT 0x02 // bEndpointAddress: isochronous output
(host->device)
#define EP_ISOC_OUT_MPSIZE 76 // wMaxPacketSize: isochronous output
#define OUT_FRAMES 8                // Number of audio out blocks per
millisecond

typedef struct{
       uint16_t left;
       uint16_t right;
       uint16_t center;
       uint16_t lfe;
       uint16_t surround_left;
       uint16_t surround_right;
} sample_51;

typedef struct{
       uint16_t window;
       uint8_t seq;
       uint8_t wierd;
       sample_51 audio[OUT_SAMPLES];
} audio_out_block;

.
.
.

       audio_out_block audio_out[OUT_FRAMES]; // output data blocks
       void* audio_out_context[OUT_FRAMES]; // context for iso async output
transfers

       // initialize isochronous asynchronous request types
       int i;
       for(i=0;i<OUT_FRAMES;i++){
               ret = usb_isochronous_setup_async(handle,
&audio_out_context[i], EP_ISOC_OUT, EP_ISOC_OUT_MPSIZE);
               if(ret != 0){
                       printf("Error: failed to setup isochronous output
transfer %d error code: %d\n",i,ret);
                       res = USB_ISOC_OUT_ERROR;
                       goto done;
               }
       }

       for(i=0;i<OUT_FRAMES;i++){
               ret = usb_submit_async(audio_out_context[i], (char*)
&audio_out[i], EP_ISOC_OUT_MPSIZE);
               if(ret != 0){
                       printf("Error: submit isochronous output transfer %d
error code: %d\n",i,ret);
                       res = USB_ISOC_OUT_ERROR;
                       goto done;
               }
       }

.
.
.

This code doesn't return and error, but DebugView shows the following error
8 times (once for each submitted package)

libusb0-sys:[transfer] [iso-write #2146] EP02h packet-size=76 length=76
reset-status=00000000h
libusb0-sys:err [transfer_complete] sequence 2146: transfer failed: status:
0xc000000d, urb-status: 0x80000300

Also, if I try to reap any of the requests I get an error:

.
.
.

       for(i=0;i<OUT_FRAMES;i++){
               ret = usb_reap_async(audio_out_context[i],USB_TIMEOUT);
               if(ret != EP_ISOC_OUT_MPSIZE){
                       printf("Error: isochronous output transfer not
received properly: bytes sent %d, bytes transferred
%d\n",ret,EP_ISOC_OUT_MPSIZE);
                       res = USB_ISOC_OUT_ERROR;
                       goto done;
               }
               printf("%d bytes received successfully!\n",ret);
       }

.
.
.

Console shows

Error: isochronous output transfer not received properly: bytes sent -22,
bytes transferred 76

According to DebugView, -22 means a bad parameter error

[4612] libusb0-dll:err [_usb_reap_async] reaping request failed, win error:
The parameter is incorrect.
[4612]


I've been stuck on this for several days, and would be very grateful for any
help.

Thanks,
~Aaron

--
View this message in context: http://libusb.6.n5.nabble.com/win32-ISO-USB2-0-transfers-helpful-hint-tp10979p4454420.html
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.

------------------------------------------------------------------------------
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-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel

------------------------------------------------------------------------------
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-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
jonesjuice0 | 4 Jun 2011 21:51

Re: win32 - ISO USB2.0 transfers (helpful hint)

Tim, Thanks for your reply. I tried the changes you recommended and . . . audio_out_block audio_out[OUT_FRAMES][32]; // output data blocks void* audio_out_context[OUT_FRAMES][32]; // context for iso async output transfers // initialize isochronous asynchronous request types int i; for(i=0;i<OUT_FRAMES;i++){ ret = usb_isochronous_setup_async(handle, &audio_out_context[i][0], EP_ISOC_OUT, EP_ISOC_OUT_MPSIZE * 32); if(ret != 0){ printf("Error: failed to setup isochronous output transfer %d error code: %d\n",i,ret); res = USB_ISOC_OUT_ERROR; goto done; } } for(i=0;i<OUT_FRAMES;i++){ ret = usb_submit_async(audio_out_context[i], (char*) <b>// THIS LINE &audio_out[i][0], EP_ISOC_OUT_MPSIZE * 32); if(ret != 0){ printf("Error: submit isochronous output transfer %d error code: %d\n",i,ret); res = USB_ISOC_OUT_ERROR; goto done; } } . . . Generates an invalid handle error and exits on the first loop iteration. Presumably, this is because audio_out_context[0] is a pointer to an array of type <void*> only audio_out_context[0..7][0] actually contain a pointers to an initialized context. I changed the line to . . . ret = usb_submit_async(audio_out_context[i][0], (char*)&audio_out[i][0], EP_ISOC_OUT_MPSIZE * 32); . . . And now get the same error that I had before libusb0-sys:[transfer] [iso-write #2162] EP02h packet-size=2432 length=2432 reset-status=00000000h libusb0-sys:err [transfer_complete] sequence 2162: transfer failed: status: 0xc000000d, urb-status: 0x80000300 libusb0-sys:[transfer] [iso-write #2163] EP02h packet-size=2432 length=2432 reset-status=00000000h libusb0-sys:err [transfer_complete] sequence 2163: transfer failed: status: 0xc000000d, urb-status: 0x80000300 libusb0-sys:[transfer] [iso-write #2164] EP02h packet-size=2432 length=2432 reset-status=00000000h libusb0-sys:err [transfer_complete] sequence 2164: transfer failed: status: 0xc000000d, urb-status: 0x80000300 libusb0-sys:[transfer] [iso-write #2165] EP02h packet-size=2432 length=2432 reset-status=00000000h libusb0-sys:err [transfer_complete] sequence 2165: transfer failed: status: 0xc000000d, urb-status: 0x80000300 libusb0-sys:[transfer] [iso-write #2166] EP02h packet-size=2432 length=2432 reset-status=00000000h libusb0-sys:err [transfer_complete] sequence 2166: transfer failed: status: 0xc000000d, urb-status: 0x80000300 libusb0-sys:[transfer] [iso-write #2167] EP02h packet-size=2432 length=2432 reset-status=00000000h libusb0-sys:err [transfer_complete] sequence 2167: transfer failed: status: 0xc000000d, urb-status: 0x80000300 libusb0-sys:[transfer] [iso-write #2168] EP02h packet-size=2432 length=2432 reset-status=00000000h libusb0-sys:err [transfer_complete] sequence 2168: transfer failed: status: 0xc000000d, urb-status: 0x80000300 libusb0-sys:[transfer] [iso-write #2169] EP02h packet-size=2432 length=2432 reset-status=00000000h libusb0-sys:err [transfer_complete] sequence 2169: transfer failed: status: 0xc000000d, urb-status: 0x80000300 I'm curious as to why you recommend this particular change. Does it involve increasing the URB size? I noticed some of your previous posts referred to modifications you implemented to the libusb-win32 library to make the async iso transfers work better. From that thread and others, I get the impression that libusb-win32's async support for isochronous transfers is somewhat limited, but from the modest amount of documentation available, have not been able to determine exactly what the limitations are. Unfortunately the license (LGPL) prevents me from making or using mods for my application, so I'm hoping to determine what the limitations of the current release version are without pouring through the source code. My goal is to stream audio data to and from the device using the endpoints list ed below. I can tolerate say 50ms latency on the input and the occasional packet loss. Any info on this or other suggestions you have would be much appreciated. EP_AUDIO_IN bEndpointAddress: 0x82 bmAttributes: 0x0d wMaxPacketSize: 524 bInterval: 5 bRefresh: 0 bSynchAddress: 0 EP_AUDIO_OUT bEndpointAddress: 0x02 bmAttributes: 0x0d wMaxPacketSize: 76 bInterval: 1 bRefresh: 0 bSynchAddress: 0 Thanks again for the response, ~Aaron

View this message in context: Re: win32 - ISO USB2.0 transfers (helpful hint)
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.
------------------------------------------------------------------------------
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-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel

Gmane