From: Steinar H. Gunderson Date: Sat, 30 Jul 2016 16:45:42 +0000 (+0200) Subject: Make a better error message on LIBUSB_ERROR_NOT_FOUND. X-Git-Tag: 0.5.1~1 X-Git-Url: https://git.sesse.net/?p=bmusb;a=commitdiff_plain;h=05831781fb79ec7436280ccef6ef0fdabf105f33 Make a better error message on LIBUSB_ERROR_NOT_FOUND. --- diff --git a/bmusb.cpp b/bmusb.cpp index 5fda217..7f62a19 100644 --- a/bmusb.cpp +++ b/bmusb.cpp @@ -1105,6 +1105,11 @@ void BMUSBCapture::configure_card() rc = libusb_set_interface_alt_setting(devh, /*interface=*/0, /*alternate_setting=*/1); if (rc < 0) { fprintf(stderr, "Error setting alternate 1: %s\n", libusb_error_name(rc)); + if (rc == LIBUSB_ERROR_NOT_FOUND) { + fprintf(stderr, "This is usually because the card came up in USB2 mode.\n"); + fprintf(stderr, "In particular, this tends to happen if you boot up with the\n"); + fprintf(stderr, "card plugged in; just unplug and replug it, and it usually works.\n"); + } exit(1); } rc = libusb_set_interface_alt_setting(devh, /*interface=*/0, /*alternate_setting=*/2);