PCSC icon indicating copy to clipboard operation
PCSC copied to clipboard

LIBUSB_ERROR_TIMEOUT on first connect

Open andrewbaxter opened this issue 1 year ago • 2 comments
trafficstars

Versions

  • smart card reader driver name and version

I'm not sure, AFAICT only the ccid plugin is installed. pn533_usb loaded itself but (as detailed later) I had to rmmod that.

  • pcsc-lite version
  • the output of the command /usr/sbin/pcscd --version
pcsc-lite version 2.2.3
Copyright (C) 1999-2002 by David Corcoran <[email protected]>.
Copyright (C) 2001-2024 by Ludovic Rousseau <[email protected]>.
Copyright (C) 2003-2004 by Damien Sauveron <[email protected]>.
Report bugs to <[email protected]>.
Enabled features: USB serial libudev polkit systemd Linux x86_64 ipcdir=/run/pcscd usbdropdir=/var/lib/pcsc/drivers serialconfdir=/etc/reader.conf.d
MAX_READERNAME: 128, PCSCLITE_MAX_READERS_CONTEXTS: 16

Platform

  • Operating system or GNU/Linux distribution name and version

NixOS unstable from the last couple days.

  • Smart card middleware name and version
  • Smart card reader manufacturer name and reader model name

ACR122U-A9, same as detected by pcscd, although the amazon listing was somewhat light on details (brand is "cyrank")

https://www.amazon.co.jp/gp/product/B0CNQNHBSY/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

  • Smart card name

N/A

Issue

The smartcard reader works fine, but when I boot with it attached I get either LIBUSB_ERROR_BUSY or LIBUSB_ERROR_TIMEOUT and it's unusable until I make additional manual changes.

There's two scenarios:

  1. I start the host with the reader attached, pcscd starts at boot (well, it's socket activated and a command that reads an nfc card runs at boot). The pn533_usb kernel module gets loaded automatically. pcscd starts with LIBUSB_ERROR_BUSY (during_pn533_usb.txt). Doing rmmod and restarting pcscd allows it to start and interact with the card fine (after_pn533_usb.txt).
  2. I start the host with the reader attached, pcscd setup as above, and the pn533_usb kernel module blacklisted. pcscd starts with LIBUSB_ERROR_TIMEOUT until I disconnect and reconnect the reader (physically), while pcscd is still running (reconnect.txt sorry, I did truncate this one but after it recognized the device). Stopping pcscd seems before reconnecting the reader doesn't do anything positive (the TIMEOUT error stays).

My current workaround is to let pn533_usb load then immediately rmmod it, which allows pcscd to start with no errors, but this is timing sensitive.

Log

I attached the logs above.

Thanks for all your work on this project, it's super cool and I've had almost no issues!

andrewbaxter avatar Aug 22 '24 14:08 andrewbaxter