Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#27 Mono Tools: MonoUsbApi.Init ErrorOther

v2.2.4
closed-works-for-me
5
2010-03-18
2010-03-18
Anonymous
No

Using mono tools remote debug (from VS2008) in the supplied suse vm, the mLastReturnCode returns ErrorOther in the following code:

public MonoUsbSessionHandle() : base(IntPtr.Zero, true)
{
lock (sessionLOCK)
{
IntPtr pNewSession = IntPtr.Zero;
mLastReturnCode = (MonoUsbError)MonoUsbApi.Init(ref pNewSession);

Using a terminal directly in the suse vm produces:

rupert@linux:~/Desktop/LibUsbDotNet_Bin> mono Test_Info.exe
LibUsbDotNet.Main.UsbException: Init:libusb_init Failed:Invalid Session Handle
at MonoLibUsb.MonoUsbEventHandler.Init (UnixNativeTimeval unixNativeTimeval) [0x00000]
at MonoLibUsb.MonoUsbEventHandler.Init () [0x00000]
at MonoLibUsb.MonoUsbApi.InitAndStart () [0x00000]
at LibUsbDotNet.LudnMonoLibUsb.MonoUsbDevice.get_MonoUsbDeviceList () [0x00000]
at LibUsbDotNet.Main.LegacyUsbRegistry.get_DeviceList () [0x00000]
at LibUsbDotNet.UsbDevice.get_AllLibUsbDevices () [0x00000]
at LibUsbDotNet.UsbDevice.get_AllDevices () [0x00000]
at Test_Info.fTestInfo.refreshDeviceList () [0x00000]
at Test_Info.fTestInfo.fTestInfo_Load (System.Object sender, System.EventArgs e) [0x00000]
at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x00000]
at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00000]

Discussion

    • status: open --> pending
     
  • This is the Libusb-1.0 libusb_init() api call failing. Can you run the 'lsusb' example application that comes with the libusb-1.0 source distro?

     

  • Anonymous
    2010-03-18

    win7 ... mono tools suse vmplayer ... libusb-1.0.6 source ... lsusb ... libusb_init also returns -99 (ErrorOther)

    I will try a different linux dist to see if I can isolate the problem to the suse vm

    It might be vmplayer itself not working well with usb

     
  • Not sure if this will help, but if you can build libusb from source there is an ENABLE_DEBUG_LOGGING define that can be set. This should give you more details on exactly why libusb_init() is failing.

    Keep me posted..

    Regards,
    Travis

     

  • Anonymous
    2010-03-18

    Well, the stock suse vm for mono tools doesn't have a usb controller. I added that and that fixes the problem. Thanks for your help. Mark.

     

  • Anonymous
    2010-03-18

    • status: pending --> closed-works-for-me