[Pcsclite-muscle] ACR122U LIBUSB_ERROR_TIMEOUT

Fulup Le Foll fulup.arfoll at iot.bzh
Wed Jan 24 02:38:02 PST 2024


Hi,

I confirm that the issue describe yesterday by Valentin is easily 
reproducible. Here after the log on my laptop

Fedora-39
  - pcsc-lite-2.0.0
  - ccid-1.5.4

To reproduce:
  1) plug the reader ACR122U
  2) pcscd -d -f

Because of this bug, the reader is not visible after a boot and have to 
be unplug/plug to work. I tried to increase USB read timeout at 
ccid_usb.c:1023 with not success.

Any idea more than welcome.

Fulup

Log when reader is plug before starting pcscd (boot configuration)

00000002 [140146565136192] readerfactory.c:1089:RFInitializeReader() 
Attempting startup of ACS ACR122U PICC Interface 01 00 using 
/usr/local/lib64/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000002 [140146565136192] readerfactory.c:877:RFLoadReader() Reusing 
already loaded driver for 
/usr/local/lib64/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000007 [140146565136192] readerfactory.c:964:RFBindFunctions() Loading 
IFD Handler 3.0
00000010 [140146565136192] 
ifdhandler.c:111:CreateChannelByNameOrChannel() Lun: 10000, device: 
usb:072f/2200:libudev:0:/dev/bus/usb/001/026
00000007 [140146565136192] ccid_usb.c:327:OpenUSBByName() Using: 
/usr/local/lib64/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
00000509 [140146565136192] ccid_usb.c:345:OpenUSBByName() 
ifdManufacturerString: Ludovic Rousseau (ludovic.rousseau at free.fr)
00000004 [140146565136192] ccid_usb.c:346:OpenUSBByName() 
ifdProductString: Generic CCID driver
00000003 [140146565136192] ccid_usb.c:347:OpenUSBByName() Copyright: 
This driver is protected by terms of the GNU Lesser General Public 
License version 2.1, or (at your option) any later version.
00000261 [140146565136192] ccid_usb.c:699:OpenUSBByName() Found 
Vendor/Product: 072F/2200 (ACS ACR122U PICC Interface)
00000003 [140146565136192] ccid_usb.c:701:OpenUSBByName() Using USB 
bus/device: 1/26
00000002 [140146565136192] ccid_usb.c:774:OpenUSBByName() 
bNumDataRatesSupported is 0
00168577 [140146565136192] ccid_usb.c:1023:ReadUSB() read failed (1/26): 
LIBUSB_ERROR_TIMEOUT
00055355 [140146565136192] ccid_usb.c:1050:ReadUSB() Invalid frame detected
00102643 [140146565136192] ccid_usb.c:1023:ReadUSB() read failed (1/26): 
LIBUSB_ERROR_TIMEOUT
00000046 [140146565136192] 
ifdhandler.c:203:CreateChannelByNameOrChannel() failed
00000335 [140146565136192] readerfactory.c:1130:RFInitializeReader() 
Open Port 0x200001 Failed (usb:072f/2200:libudev:0:/dev/bus/usb/001/026)

Unplug/Plug the reader and it works (hot plug case)

00000009 [140146539697856] ccid_usb.c:346:OpenUSBByName() 
ifdProductString: Generic CCID driver
00000006 [140146539697856] ccid_usb.c:347:OpenUSBByName() Copyright: 
This driver is protected by terms of the GNU Lesser General Public 
License version 2.1, or (at your option) any later version.
00000324 [140146539697856] ccid_usb.c:699:OpenUSBByName() Found 
Vendor/Product: 072F/2200 (ACS ACR122U PICC Interface)
00000006 [140146539697856] ccid_usb.c:701:OpenUSBByName() Using USB 
bus/device: 1/27
00000004 [140146539697856] ccid_usb.c:774:OpenUSBByName() 
bNumDataRatesSupported is 0

03106232 [140146539697856] ccid_usb.c:1023:ReadUSB() read failed (1/27): 
LIBUSB_ERROR_TIMEOUT
00001974 [140146539697856] ccid_usb.c:1050:ReadUSB() Invalid frame detected
00049533 [140146539697856] ifdhandler.c:389:IFDHGetCapabilities() tag: 
0xFB3, usb:072f/2200:libudev:0:/dev/bus/usb/001/027 (lun: 10000)
00000043 [140146539697856] readerfactory.c:394:RFAddReader() Using the 
reader polling thread
00000604 [140146539697856] ifdhandler.c:389:IFDHGetCapabilities() tag: 
0xFAE, usb:072f/2200:libudev:0:/dev/bus/usb/001/027 (lun: 10000)
00000025 [140146539697856] ifdhandler.c:496:IFDHGetCapabilities() Reader 
supports 1 slot(s)

With recompiled version of CCID and timeout*5

000261 [140146565136192] ccid_usb.c:699:OpenUSBByName() Found 
Vendor/Product: 072F/2200 (ACS ACR122U PICC Interface)
00000003 [140146565136192] ccid_usb.c:701:OpenUSBByName() Using USB 
bus/device: 1/26
00000002 [140146565136192] ccid_usb.c:774:OpenUSBByName() 
bNumDataRatesSupported is 0
00168577 [140146565136192] ccid_usb.c:1023:ReadUSB() read failed (1/26): 
LIBUSB_ERROR_TIMEOUT
00055355 [140146565136192] ccid_usb.c:1050:ReadUSB() Invalid frame detected
00102643 [140146565136192] ccid_usb.c:1023:ReadUSB() read failed (1/26): 
LIBUSB_ERROR_TIMEOUT
00000046 [140146565136192] 
ifdhandler.c:203:CreateChannelByNameOrChannel() failed
00000335 [140146565136192] readerfactory.c:1130:RFInitializeReader() 
Open Port 0x200001 Failed (usb:072f/2200:libudev:0:/dev/bus/usb/001/026)
00000033 [140146565136192] readerfactory.c:374:RFAddReader() ACS ACR122U 
PICC Interface init failed.
00000028 [140146565136192] readerfactory.c:624:RFRemoveReader() 
UnrefReader() count was: 1
00000019 [140146565136192] readerfactory.c:1143:RFUnInitializeReader() 
Attempting shutdown of ACS ACR122U PICC Interface 01 00.
00000035 [140146565136192] hotplug_libudev.c:516:HPAddDevice() Failed 
adding USB device: ACS ACR122U PICC Interface



On 19/01/2024 14:49, Valentin Geffroy wrote:
 > Hello,
 >
 > We've noticed an issue on the ACR122U NFC Card Reader. When its is 
connected to a Linux based embedded board (using your reader with libusb 
& pscsd 2.0.1 / ccid 1.5.5), the reader is not detected by the pcscd daemon.
 >
 > It works when we unplugged/plugged the reader again.
 >
 > After a boot:
 >
 >

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/pcsclite-muscle/attachments/20240124/ee9190e9/attachment.sig>


More information about the pcsclite-muscle mailing list