pcscd does not recognize virtualized device, was Re: [Muscle] multiuser pcscd?

Harald Milz hm at seneca.muc.de
Mon Sep 29 06:17:06 PDT 2008


Hi,

On Tue, Jul 29, 2008 at 03:20:49PM +0200, Harald Milz wrote:
> On Tue, Jul 29, 2008 at 11:23:22AM +0200, Ludovic Rousseau wrote:
> > Using the NoMachine technology is different since PC/SC connection are
> > not redirected (only X11 is). The best solution (I think) would be to
> > add PC/SC support in the NX protocol.
> 
> We considered that but it's too much of a hassle. It's more like we'll be
> using usbip tunneled over the NX ssh connection because sooner or later
> somebody will require scanners or Blackberries over NX ;-) 

Since my last mail, we set up a working demo (still, single-user) using
PCSC over usbip over a separate tunnel in NX. Basically, this works fine.
But at times, pcscd does not want to recognize what's on the USB bus, and
just sits there and does nothing. 

Background: I've tried a Chipdrive micro pro USB reader together with
various cards (FSF OpenPGP, German Geldkarte, cellphone SIM card) on a
"native" OS (i.e. on bare metal) just fine (openSUSE 11.0 w/ pscsd 1.4.100
and Ubuntu 8.04 w/ pcscd 1.4.99. Works reliably. As soon as some
virtualization layer enters the game (namely, Virtualbox 2.0.2 and NX
tunnel), in many cases pcscd does not scan the bus on (re)start
or hotplug. 

Normally, starting pcscd looks like: 

Sep 29 12:52:00 lt-hm pcscd: pcscdaemon.c:513:main() pcsc-lite 1.4.99 daemon ready.
Sep 29 12:52:01 lt-hm pcscd: hotplug_libusb.c:478:HPAddHotPluggable() Adding USB device: 002:002
Sep 29 12:52:01 lt-hm pcscd: readerfactory.c:1116:RFInitializeReader() Attempting startup of SCM SCR 335 (21120813307031) 00 00 using /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so.1.3.1
Sep 29 12:52:01 lt-hm pcscd: readerfactory.c:983:RFBindFunctions() Loading IFD Handler 3.0
Sep 29 12:52:01 lt-hm pcscd: ifdhandler.c:1239:init_driver() LogLevel: 0x0003
Sep 29 12:52:01 lt-hm pcscd: ifdhandler.c:1249:init_driver() DriverOptions: 0x0000
Sep 29 12:52:01 lt-hm pcscd: ifdhandler.c:77:IFDHCreateChannelByName() lun: 0, device: usb:04e6/5115:libusb:002:002
Sep 29 12:52:01 lt-hm pcscd: ccid_usb.c:233:OpenUSBByName() Manufacturer: Ludovic Rousseau (ludovic.rousseau at free.fr)
Sep 29 12:52:01 lt-hm pcscd: ccid_usb.c:243:OpenUSBByName() ProductString: Generic CCID driver v1.3.1
Sep 29 12:52:01 lt-hm pcscd: ccid_usb.c:249: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.
Sep 29 12:52:01 lt-hm pcscd: ccid_usb.c:397:OpenUSBByName() Found Vendor/Product: 04E6/5115 (SCM SCR 335)
Sep 29 12:52:01 lt-hm pcscd: ccid_usb.c:399:OpenUSBByName() Using USB bus/device: 002/002
Sep 29 12:52:01 lt-hm pcscd: ccid_usb.c:752:get_data_rates() IFD does not support GET_DATA_RATES request: Broken pipe
Sep 29 12:52:03 lt-hm pcscd: ccid_usb.c:512:ReadUSB() usb_bulk_read(002/002): Resource temporarily unavailable
Sep 29 12:52:05 lt-hm pcscd: ccid_usb.c:512:ReadUSB() usb_bulk_read(002/002): Resource temporarily unavailable
Sep 29 12:52:05 lt-hm pcscd: ifdhandler.c:841:IFDHPowerICC() lun: 0, action: PowerUp
Sep 29 12:52:05 lt-hm pcscd: Card ATR: 3B FA 13 00 FF 81 31 80 45 00 31 C1 73 C0 01 00 00 90 00 B1 
Sep 29 12:52:05 lt-hm pcscd: ifdhandler.c:271:IFDHGetCapabilities() lun: 0, tag: 0xFAE
Sep 29 12:52:05 lt-hm pcscd: ifdhandler.c:313:IFDHGetCapabilities() Reader supports 1 slot(s)

(this is on Ubuntu Hardy)

In the other case, pcscd just spits out the first line and that's it.
Running it in the foreground reveals: 


nxserver:~ # lsusb
Bus 001 Device 002: ID 04e6:5115 SCM Microsystems, Inc. SCR335 SmartCard Reader
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
nxserver:~ # pcscd -afd
00000000 pcscdaemon.c:275:main() pcscd set to foreground with debug send to stderr
00001227 debuglog.c:239:DebugLogSetLevel() debug level=debug
00008086 pcscdaemon.c:493:main() pcsc-lite 1.4.100 daemon ready.
00161856 hotplug_libhal.c:304:get_driver() Looking a driver for VID: 0x1D6B, PID: 0x0002

(This is in the NX environment, importing the USB reader with usbip). 

Huh? Why would it be looking for a driver for the virtual USB hub? 

There is no openct running, and udev does not spawn anything like openct so
this should not be in the way. 

BTW openct reacts similarly in such a situation so I suspect the problem is
how the USB layer presents the devices. Please correct me if I'm wrong. 

I'm really in the dark here - please help! TIA! 


-- 
A.A.A.A.A.:
	An organization for drunks who drive


More information about the Muscle mailing list