2

I am using xboxdrv in version 0.8.7 and a XBox 360 Wireless controller on raspberrypi 3 (4.9.13-v7+).

It works sometimes a day, sometimes some minutes. But I get always:

[ERROR] USBController::on_read_data(): USB read failure: 32: LIBUSB_TRANSFER_ERROR

The common suggestions in the forum didn't help me and I think there are still some people struggling with that.

I tried to contact the author but didn't get answer so far. The software runs under GPL-3.0, so I had a look in the source code.

Project on GitHub: https://github.com/xboxdrv/xboxdrv

I identified where it crashs (src/usb_controller.cpp, line 277 and below). That's the last else-section in the code below. Starting with log_error("USB read failure:

    void
USBController::on_read_data(libusb_transfer* transfer)
{
  assert(transfer);

  if (transfer->status == LIBUSB_TRANSFER_COMPLETED)
  {
    // process data
    XboxGenericMsg msg;
    if (parse(transfer->buffer, transfer->actual_length, &msg))
    {
      submit_msg(msg);
    }

    int ret;
    ret = libusb_submit_transfer(transfer);
    if (ret != LIBUSB_SUCCESS) // could also check for LIBUSB_ERROR_NO_DEVICE
    {
      log_error("failed to resubmit USB transfer: " << usb_strerror(ret));
      m_transfers.erase(transfer);
      libusb_free_transfer(transfer);
      send_disconnect();
    }
  }
  else if (transfer->status == LIBUSB_TRANSFER_CANCELLED)
  {
    m_transfers.erase(transfer);
    libusb_free_transfer(transfer);
  }
  else if (transfer->status == LIBUSB_TRANSFER_NO_DEVICE)
  {
    m_transfers.erase(transfer);
    libusb_free_transfer(transfer);
    send_disconnect();
  }
  else
  {
    log_error("USB read failure: " << transfer->length << ": " << usb_transfer_strerror(transfer->status));
    m_transfers.erase(transfer);
    libusb_free_transfer(transfer);
  }
}

My C++ knowledge is bad, further I haven't experience with libusb. Could you make a suggestion how I could fix that for me.

The problem is, as soon as the mentioned error occurs, xboxdrv is stopping and it will handle no more input from the XBOX 360 Wireless Controller.

It should just kind of ignore that wrong package and wait for a new one. But just don't stop working.

Thank you

hallo02
  • 307
  • 3
  • 11

0 Answers0