[argyllcms] Random EPIPE with a Huey Pro

  • From: Lingzhu Xiang <xianglingzhu@xxxxxxxxx>
  • To: argyllcms@xxxxxxxxxxxxx
  • Date: Wed, 1 Feb 2012 04:39:39 +0800

I tried to use a Huey Pro with Argyll but failed, like this:

    $ spotread -D1
    usb_get_paths about to look through devices:
    usb_check_and_add() called with VID 0x1d6b, PID 0x2
    usb_check_and_add() called with VID 0x1d6b, PID 0x2
    usb_check_and_add() called with VID 0x8087, PID 0x24
    usb_check_and_add() called with VID 0x8087, PID 0x24
    usb_check_and_add() called with VID 0x971, PID 0x2005
    usb_check_and_add() found known instrument
    usb_check_and_add() called with VID 0x174f, PID 0x142a
    failed to open serial "/dev/ttyS3"
    failed to open serial "/dev/ttyS2"
    failed to open serial "/dev/ttyS1"
    failed to open serial "/dev/ttyS0"
    huey: About to init coms
    huey: About to init USB
    icoms: About to set usb port characteristics
    icoms: About to open the USB port, tries 0
    icoms: USB port needs opening
    icoms: About to open USB port 'usb:/bus2/dev3/ (GretagMacbeth Huey)'
    open() of USB port 'usb:/bus2/dev3/ (GretagMacbeth Huey)' suceeded
    icoms: USB port is now open
    icoms: Clearing any USB errors
    icoms: usb port characteristics set ok
    huey: Sending cmd 'GetStatus' args 'a0 05 ec c3 ff 7f 00' ICOM err 0x0
    huey: Reading response  '43 69 72 30 30 31' ICOM err 0x0
    huey: init coms has suceeded
    huey: About to init instrument
    huey: about to check response and unlock instrument if needed
    huey: Sending cmd 'GetStatus' args '00 00 00 00 00 00 00'
    huey: Command send failed with ICOM err 0x200
    Instrument initialisation failed with 'Communications failure' 
(Communications failure)!
    icoms: delete called
    icoms: closing port
    usb_close_port() called
    usb port has been released and closed

The ICOM err 0x200 is actually masked LIBUSB_ERROR_PIPE returned by
libusb_control_transfer() as I debugged. However, this error seems random, it
could happen after several more steps or just after the first step. One another
example:

    $ spotread -D1
    [...]
    icoms: usb port characteristics set ok
    huey: Sending cmd 'GetStatus' args '90 8b 4b f2 ff 7f 00' ICOM err 0x0
    huey: Reading response  '43 69 72 30 30 31' ICOM err 0x0
    huey: init coms has suceeded
    huey: About to init instrument
    huey: about to check response and unlock instrument if needed
    huey: Sending cmd 'GetStatus' args '00 00 00 00 00 00 00' ICOM err 0x0
    huey: Reading response  '43 69 72 30 30 31' ICOM err 0x0
    huey: instrument is responding, unlocked, and right type
    huey: Sending cmd 'SetLEDs' args '00 0f 4a f2 ff 7f 00' ICOM err 0x0
    huey: Reading response  '0f 00 00 00 00 00' ICOM err 0x0
    huey: about to read all the registers
    huey: Sending cmd 'RdReg' args '00 00 00 00 00 00 00' ICOM err 0x0
    huey: Reading response  '00 00 00 00 00 00' ICOM err 0x0
    huey: Sending cmd 'RdReg' args '01 00 00 00 00 00 00' ICOM err 0x0
    huey: Reading response  '01 0c 00 00 00 00' ICOM err 0x0
    huey: Sending cmd 'RdReg' args '02 00 00 00 00 00 00' ICOM err 0x0
    huey: Reading response  '02 95 00 00 00 00' ICOM err 0x0
    huey: Sending cmd 'RdReg' args '03 00 00 00 00 00 00'
    huey: Command send failed with ICOM err 0x200
    Instrument initialisation failed with 'Communications failure' 
(Communications failure)!
    [...]

Libusb explains LIBUSB_ERROR_PIPE with "control not supported". But I don't
understand how it could be randomly working and not working, if something is
really not supported from the beginning. The device is good. I tested it under
Windows with Argyll spotread. I also tried it with different USB ports or with
reboots or with kernel 3.1, no success. 

What else can I do to diagnose this? I'm even not sure if this is a bug in
Argyll or libusb or the kernel.

My environment:

Debian GNU/Linux unstable (sid)

Linux laptop 3.2.0-1-amd64 #1 SMP Tue Jan 24 05:01:45 UTC 2012 x86_64 GNU/Linux

Packages:
ii  argyll             1.3.5-5
ii  argyll-dbg         1.3.5-5
ii  libusb-1.0-0       2:1.0.9~rc3-3
ii  libusb-1.0-0-dev   2:1.0.9~rc3-3
ii  libicc-dev         2.12+argyll1.3.5-5
ii  libicc2            2.12+argyll1.3.5-5

/sys/kernel/debug/usb/devices:
T:  Bus=02 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  3 Spd=1.5  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0971 ProdID=2005 Rev= 0.01
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

USB autosuspend is disabled.

Other related posts: