Alan Stern | 1 Aug 15:55 2011
Picon

Re: Help decoding errno: error -1 errno 71

On Sat, 30 Jul 2011, pavan.inferno wrote:

> Hello,
> 
> I am trying to debug a driver for custom hardware. Kindly let me know what
> the particular error no. s mean. error -1  is (IO) but I dont know what
> error no 2 and 71 mean.  I encounter these two errors during the execution
> of my program. 
> 
> For a clearer picture, my output:
> 
> *Init libusb
> Success
> Opening device handle
> Setting configuration
> libusb:error [op_set_configuration] failed, error -1 errno 71

Error 71 is a low-level hardware error.  In this case it probably means 
the device did not respond to the Set-Configuration request.

> Claiming interface
> Success
> libusb:error [submit_bulk_transfer] submiturb failed error -1 errno=2

Error 2 during submission means the endpoint doesn't exist.  Which 
isn't surprising, since the device never got into the configuration you 
wanted.

Alan Stern

(Continue reading)

pavan.inferno | 1 Aug 20:31 2011
Picon

Re: Help decoding errno: error -1 errno 71

Thank you folks for responding promptly.

I would like to know the source of your information about these errors, and
like to read more about it. Kindly point me towards appropriate resources. 

The device works fine on Windows with a precompiled exe, so I know for sure
the hardware isnt flawed. 
Thank you once again for your keen insights.  

--
View this message in context: http://libusb.6.n5.nabble.com/Help-decoding-errno-error-1-errno-71-tp4651358p4655967.html
Sent from the LibUSB Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
Tim Roberts | 1 Aug 20:46 2011

Re: Help decoding errno: error -1 errno 71

pavan.inferno wrote:
> I would like to know the source of your information about these errors, and
> like to read more about it. Kindly point me towards appropriate resources.

Alan is a Linux kernel developer who knows the USB stack extremely
well.  You can look up the error codes in the kernel source.  That's the
beauty of Linux.

> The device works fine on Windows with a precompiled exe, so I know for sure
> the hardware isnt flawed. 

Sorry, your conclusion does not follow from your premise.  Both Windows
and Linux accept many devices that do not technically meet the USB
specifications, and which cause failures on other operating systems with
other assumptions.  That's why we do testing on multiple platforms. 
Have you run your device against the USB Command Verifier tests (USBCV)?

Does your device handle a SetConfiguration request without
disconnecting?  Some devices built for Windows do not.  Is your device
based on an off-the-shelf USB processor (e.g., FX2) or is this a custom
FPGA?

--

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

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
(Continue reading)

Richard Hughes | 4 Aug 10:08 2011
Picon

Re: Portable event mechanisms in glib, Qt and friends

On 29 July 2011 21:34, Peter Stuge <peter <at> stuge.se> wrote:
> It's the Windows problem with the libusb-1.0 API. It might even be
> worse in the glib setting because of what glib likes. Are fds the
> prefered event mechanism in glib? What else is there?

This is what I'm using in colord:
https://gitorious.org/colord/master/blobs/master/src/cd-usb.c

Richard.

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
Xiaofan Chen | 4 Aug 10:45 2011
Picon

Re: Portable event mechanisms in glib, Qt and friends

On Thu, Aug 4, 2011 at 4:08 PM, Richard Hughes <hughsient <at> gmail.com> wrote:
> On 29 July 2011 21:34, Peter Stuge <peter <at> stuge.se> wrote:
>> It's the Windows problem with the libusb-1.0 API. It might even be
>> worse in the glib setting because of what glib likes. Are fds the
>> prefered event mechanism in glib? What else is there?
>
> This is what I'm using in colord:
> https://gitorious.org/colord/master/blobs/master/src/cd-usb.c
>

I assume this is not for Windows, right?

++++++++++
http://www.libusb.org/wiki/windows_backend
Known Restrictions
    .....
    Because there is no native poll on Windows, the ability to return
    externally pollable file descriptors on Windows (libusb_pollfd) has
    been disabled.
++++++++++

--

-- 
Xiaofan

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
(Continue reading)

Michael Dam | 4 Aug 22:40 2011
Picon
Picon

got a problem using async bulk transfers

Hi there,
thanks for all the help i found on your mailing list so far. 
unfortunately i need some more!

synchronous transfers work perfectely. but async doesn't.

my code:

libusb_context *usbContext;
libusb_device_handle *usbDev;
struct libusb_transfer *usb_trans;
const long USB_BUFFER_SIZE=512*4*8;  //16384

main()
{
     status=libusb_init(&usbContext);
     usbDev=libusb_open_device_with_vid_pid((usbContext), VID, PID);
     status=libusb_set_configuration(usbDev, USB_CONFIG);
     status=libusb_claim_interface(usbDev, USB_INTERFACE);
     status=libusb_set_interface_alt_setting(usbDev, USB_INTERFACE, 
USB_ALTSETTING);

#ifndef USB_SYNC

     usb_trans=libusb_alloc_transfer(0);
     libusb_fill_bulk_transfer(usb_trans, usbDev, OUT_EP, buf, 
USB_BUFFERSIZE, BulkOutCallback, NULL, USB_TIMEOUT);
     timeval tv;
     tv.tv_sec=1;

(Continue reading)

Mauro Carvalho Chehab | 5 Aug 00:21 2011

Re: USB mini-summit at LinuxCon Vancouver

Hi Sarah/Greg,

Em 09-06-2011 21:21, Sarah Sharp escreveu:
> I'm pleased to announce a USB mini-summit at LinuxCon Vancouver.
> 
> What:	USB mini-summit
> When:	Tuesday, August 16th, all day
> Where:	At the conference venue, room TBD pending confirmation from
> 	Angela Brown.
> 
> Proposed topics include USB virtualization, and improved bandwidth APIs
> between the USB core and drivers (especially webcam drivers).  See the
> detailed topic list below.  Anyone is also welcome to propose or show up
> with a USB related topic.  MUSB?  USB 3.0 gadget drivers?  USB-IP?
> 
> The USB mini-summit does overlap with the virtualization mini-summit by
> a day, but I'm hoping we can schedule talks so some of the
> virtualization folks can make it to the USB mini-summit.  The other
> option was on Friday during the conference which was not ideal.
> 
> Proposed topics:
> 
> Topic 1
> -------
> 
> The KVM folks suggested that it would be good to get USB and
> virtualization developers together to talk about how to virtualize the
> xHCI host controller.  The xHCI spec architect worked closely with
> VMWare to get some extra goodies in the spec to help virtualization, and
> I'd like to see the other virtualization developers take advantage of
(Continue reading)

Greg KH | 5 Aug 00:56 2011

Re: USB mini-summit at LinuxCon Vancouver

On Thu, Aug 04, 2011 at 07:21:47PM -0300, Mauro Carvalho Chehab wrote:
> I know that this problem were somewhat solved for 3G modems, with the usage
> of the userspace problem usb_modeswitch, and with some quirks for the USB
> storage driver, but I'm not sure if such tricks will scale forever, as more
> functions are seen on some USB devices.

Well, no matter how it "scales" it needs to be done in userspace, like
usb_modeswitch does.  We made that decision a while ago, and it is
working out very well.  I see no reason why you can't do it in userspace
as well as that is the easiest place to control this type of thing.

I thought we had a long discussion about this topic a while ago and came
to this very conclusion.  Or am I mistaken?

thanks,

greg k-h
Mauro Carvalho Chehab | 5 Aug 02:33 2011

Re: USB mini-summit at LinuxCon Vancouver

Em 04-08-2011 20:22, Matthew Dharm escreveu:
> On Thu, Aug 4, 2011 at 3:56 PM, Greg KH <greg@...
<mailto:greg@...>> wrote:
> 
>     On Thu, Aug 04, 2011 at 07:21:47PM -0300, Mauro Carvalho Chehab wrote:
>     > I know that this problem were somewhat solved for 3G modems, with the usage
>     > of the userspace problem usb_modeswitch, and with some quirks for the USB
>     > storage driver, but I'm not sure if such tricks will scale forever, as more
>     > functions are seen on some USB devices.
> 
>     Well, no matter how it "scales" it needs to be done in userspace, like
>     usb_modeswitch does.  We made that decision a while ago, and it is
>     working out very well.  I see no reason why you can't do it in userspace
>     as well as that is the easiest place to control this type of thing.
> 
>     I thought we had a long discussion about this topic a while ago and came
>     to this very conclusion.  Or am I mistaken?
> 
>  
> We keep having the discussion over and over again.  But, you are correct: the conclusion was that this all
needs to live in userspace.

In the case of 3G modem x USB storage only, it is possible to handle it on userspace.

However, when there are more functions added, an they're not (completely) mutually exclusive,
then I don't see an easy way (if is there a way) for doing it at userspace.

Several devices offer more than one function at the same time, but some
resources are mutually exclusive. A TV stick with just one tuner, and
both analog and digital demods offer both analog and digital TV at the
(Continue reading)

Xiaofan Chen | 5 Aug 04:12 2011
Picon

Re: got a problem using async bulk transfers

On Fri, Aug 5, 2011 at 4:40 AM, Michael Dam <michael.dam <at> gmx.at> wrote:
> i am using libusb-1.0.8 on an ubuntu 11.04 64bit machine. i am
> programming in eclipse.
>
> any idea, what to try, what to change, or even how to fix??

Without looking into the details of the codes and logs, just
one suggestion, there are many bugs in libusb-1.0.8
under Linux (and Mac OS X) which is fixed in libusb-stuge.
Probably you want to try it first.
http://git.libusb.org/?p=libusb-stuge.git;a=summary;js=1

--

-- 
Xiaofan

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1

Gmane