[sane-devel] sane-backend on windows

Fred Doo doofredoom at yahoo.fr
Wed Mar 13 15:17:39 UTC 2013


Hi, 

I am trying to build sane-backend  (tarball 1.0.23) on windows.
It's my first approach to cygwin, but the build passed seemlessly, with every backend.
And after installing the last libusb-win32 (is it the way it should work?), sane-find-scanner.exe found my scanner.
scanimage also list it:
C:\sane\bin>scanimage -L
device `plustek:libusb:bus-0:\\.\libusb0-0001--0x04a9-0x2206' is a Canon CanoScan N650U/N656U flatbed scanner


Detection work, but then:

scanimage > image.pnm
scanimage: sane_read: Operation was cancelled

The scanner lights up its lamp but then do nothing else. it seems.
The changes i made on plustek.conf, to add and configure the device never seems to be read.
I suspect one (or maybe multiples) problem(s) with the filesystem, path to config files?

The auto-detection call my device: 'plustek:libusb:bus-0:\\.\libusb0-0001--0x04a9-0x2206' .
What should i write on plustek.conf?
I tried:
[usb] 0x04a9 0x2206
device plustek:libusb:bus-0:\\.\libusb0-0001--0x04a9-0x2206

I also tried:
[usb] 0x04a9 0x2206
device 'plustek:libusb:bus-0:\\.\libusb0-0001--0x04a9-0x2206'

Maybe i never figured to write the good config, (wich is very likely, heh..) butthe program, at another time, cannot read to another filesystem path, when it tries towrite to i.e. "/home/Station/.sane/Canon_CanoScan_N650U_N656U-coarse.cal" where it is supposed to read or write its calibrations data?
I can't tell more as i couldn't make the settings in plustek.conf to apply, (wanted to bypass that problem using "option skipcalibration=1").

I need help as you could guess:

I don't know how to debug libusb-win32 "driver" ( i tried several versions from 0.1 to 1.2.6)

I tried to set USB_DEBUG and SANE_DEBUG without success. 

I would like to have some advises to continue with those tests...
Thanks you very much if you could guide me in this process.

In my case no updated drivers exists for my device on windows 7... So thanks everyone for having made those piece of code working with win32!
Even if it is not actually working, it probably just lacks testing and some tweaks, i could tryout if one can guide me a little more.

Some could also find sane on windows usefull for network scanning, the big missing functionnality on pretty much every windows driver...
(My case: i use virtualbox+debian+apache+phpsane to scan on windows for now but would find native sane version much more clean, haha:)


I had only success with SANE_DEBUG_PLUSTEK:

C:\sane\bin\set SANE_DEBUG_PLUSTEK=3 
C:\sane\bin>scanimage >image.pnm
[sanei_debug] Setting debug level of plustek to 3.
[plustek] UIO error
[plustek] #########################
[plustek] usb_SpeedTest(38,1000000)
[plustek] Scanner not ready!!!
[plustek] UIO error
[plustek] UIO error
[plustek] cano_PrepareToReadWhiteCal() failed
[plustek] calibration failed!!!
[plustek] reader_process: read failed, status = -9004, errno 2
scanimage: sane_read: Operation was cancelled



Here are the results with SANE_DEBUG_PLUSTEK=255 if necessary:

C:\sane\bin>set SANE_DEBUG_PLUSTEK=255

C:\sane\bin>scanimage >image.pnm
[sanei_debug] Setting debug level of plustek to 255.
[plustek] Plustek backend V0.52-10, part of sane-backends 1.0.23
[plustek] Retrieving all supported and conntected devices
[plustek] Checking for 0x07b3-0x0010
[plustek] Checking for 0x07b3-0x0011
[plustek] Checking for 0x07b3-0x0013
[plustek] Checking for 0x07b3-0x0017
[plustek] Checking for 0x07b3-0x0015
[plustek] Checking for 0x07b3-0x0015
[plustek] Checking for 0x07b3-0x0017
[plustek] Checking for 0x07b3-0x0013
[plustek] Checking for 0x07b3-0x0011
[plustek] Checking for 0x07b3-0x0010
[plustek] Checking for 0x07b3-0x0014
[plustek] Checking for 0x07b3-0x0014
[plustek] Checking for 0x07b3-0x0016
[plustek] Checking for 0x07b3-0x0017
[plustek] Checking for 0x07b3-0x0017
[plustek] Checking for 0x07b3-0x0007
[plustek] Checking for 0x07b3-0x000f
[plustek] Checking for 0x07b3-0x000f
[plustek] Checking for 0x07b3-0x0005
[plustek] Checking for 0x07b3-0x0014
[plustek] Checking for 0x07b3-0x0012
[plustek] Checking for 0x0400-0x1000
[plustek] Checking for 0x0400-0x1001
[plustek] Checking for 0x0400-0x1001
[plustek] Checking for 0x0458-0x2007
[plustek] Checking for 0x0458-0x2008
[plustek] Checking for 0x0458-0x2009
[plustek] Checking for 0x0458-0x2013
[plustek] Checking for 0x0458-0x2015
[plustek] Checking for 0x0458-0x2016
[plustek] Checking for 0x03f0-0x0505
[plustek] Checking for 0x03f0-0x0605
[plustek] Checking for 0x04b8-0x010f
[plustek] Checking for 0x04b8-0x011d
[plustek] Checking for 0x1606-0x0050
[plustek] Checking for 0x1606-0x0060
[plustek] Checking for 0x1606-0x0160
[plustek] Checking for 0x049f-0x001a
[plustek] Checking for 0x04a9-0x2206
[plustek] Checking for 0x04a9-0x2207
[plustek] Checking for 0x04a9-0x2208
[plustek] Checking for 0x04a9-0x220d
[plustek] Checking for 0x04a9-0x220e
[plustek] Checking for 0x04a9-0x2220
[plustek] Checking for 0x0a82-0x4600
[plustek] Checking for 0x0a82-0x6620
[plustek] Checking for 0x04a7-0x0427
[plustek] Checking for 0x0a53-0x1000
[plustek] Available and supported devices:
[plustek] Device: >libusb:bus-0:\\.\libusb0-0001--0x04a9-0x2206< - 0x04a9x0x2206

[plustek] attach (auto, 0x286980, 0x0)
[plustek] Device configuration:
[plustek] device name  : ><
[plustek] USB-ID       : ><
[plustek] model ovr.   : 0
[plustek] warmup       : -1s
[plustek] lampOff      : -1
[plustek] lampOffOnEnd : yes
[plustek] cacheCalData : no
[plustek] altCalibrate : no
[plustek] skipCalibr.  : no
[plustek] skipFine     : no
[plustek] skipFineWhite: no
[plustek] skipDarkStrip: no
[plustek] incDarkTarget: yes
[plustek] invertNegs.  : no
[plustek] dis.Speedup  : no
[plustek] pos_x        : 0
[plustek] pos_y        : 0
[plustek] pos_shading_y: -1
[plustek] neg_x        : 0
[plustek] neg_y        : 0
[plustek] neg_shading_y: -1
[plustek] tpa_x        : 0
[plustek] tpa_y        : 0
[plustek] tpa_shading_y: -1
[plustek] red gain     : -1
[plustek] green gain   : -1
[plustek] blue gain    : -1
[plustek] red offset   : -1
[plustek] green offset : -1
[plustek] blue offset  : -1
[plustek] red lampoff  : -1
[plustek] green lampoff: -1
[plustek] blue lampoff : -1
[plustek] red Gamma    : 1.00
[plustek] green Gamma  : 1.00
[plustek] blue Gamma   : 1.00
[plustek] gray Gamma   : 1.00
[plustek] ---------------------
[plustek] usbDev_open(auto,) - 0x20043048
[plustek] Vendor ID=0x04A9, Product ID=0x2206
[plustek] usbio_DetectLM983x
[plustek] usbio_DetectLM983x: found LM9832/3
[plustek] Detected vendor & product ID: 0x04A9-0x2206
[plustek] Device description for >0x04A9-0x2206< found.
[plustek] usb_initDev(38,0x04a9,-1)
[plustek] Device WAF  : 0x00004002
[plustek] Transferrate: 1000000 Bytes/s
[plustek] Device Flags: 0x00000000
[plustek] Vendor adjusted to: >Canon<
[plustek] LAMP-STATUS: 0x00000001 (on)
[plustek] RESETTING REGISTERS(-1) - 0x80
[plustek] SETTING THE MISC I/Os
[plustek] MISC I/O after RESET: 0x66, 0x16, 0x91
[plustek] Calibration file-names set to:
[plustek] >/home/Station/.sane/Canon_CanoScan_N650U_N656U-coarse.cal<
[plustek] >/home/Station/.sane/Canon_CanoScan_N650U_N656U-fine.cal<
[plustek] usb_SetScanParameters()
[plustek] * HDPI: 4.000
[plustek] * XDPI=150, HDPI=4.000
[plustek] * YDPI=150, MinDPIY=75
[plustek] * DataPixelStart=89, LineEnd=89
[plustek] * DataPixelStart=90, LineEnd=90 (ADJ)
[plustek] >> End-Start=0, HDPI=4.00
[plustek] * Full Steps to Skip at Start = 0x0000
[plustek] * StepSize(Preset) = 121 (0x0079)
[plustek] * Scan calculations...
[plustek] * LineLength=6080, LineRateColor=3
[plustek] * Stepsize = 571, 0x46=0x02 0x47=0x3b
[plustek] * DPD =16404 (0x4014)
[plustek] * DPD =1836 (0x072c), step size=571, steps2rev=63
[plustek] * llen=6080, lineRateColor=3, qtcnt=8, hfcnt=8
[plustek] usb_GetMCLKDivider()
[plustek] usb_GetMCLKDiv()
[plustek] - lower mclkdiv limit=4.000000
[plustek] - upper mclkdiv limit=32.500000
[plustek] - hdpi          = 4.000
[plustek] - pixelbits     = 8
[plustek] - pixelsperline = 0
[plustek] - linelen       = 6080
[plustek] - transferrate  = 1000000
[plustek] - MCLK Divider  = 0
[plustek] - Current MCLK Divider = 4
[plustek] * Integration Time Adjust = 0 (HDPI=4.000,MCLKD=4.000)
[plustek] * Setting GreenPWMDutyCycleHigh
[plustek] * Current MCLK Divider = 4.000000
[plustek] * MOTOR-Settings: PWM=0x08, PWM_DUTY=0x1f
[plustek] * FFStepSize = 428, [0x48] = 0x01, [0x49] = 0xac
[plustek] * PhyBytes   = 6
[plustek] * PhyLines   = 4
[plustek] * TotalBytes = 24
[plustek] * PL=295, coeffsize=216, scaler=3
[plustek] * PauseLimit = 2, [0x4e] = 0x01, [0x4f] = 0x01
[plustek] * Scansteps=72 (9*1200/150)
[plustek] usb_SetScanParameters() done.
[plustek] usbDev_getCaps()
[plustek] Scanner information:
[plustek] Vendor : Canon
[plustek] Model  : CanoScan N650U/N656U
[plustek] Flags  : 0x00000000
[plustek] drvclose()
[plustek] usbDev_stopScan()
[plustek] usbDev_ScanEnd(), start=0, park=0
[plustek] usbDev_close()
[plustek] attach: model = >CanoScan N650U/N656U<
[plustek] sane_get_devices (0x288ab8, 0)
[plustek] sane_open - libusb:bus-0:\\.\libusb0-0001--0x04a9-0x2206
[plustek] Presetting Gamma tables (len=4096)
[plustek] * Channel[0], gamma 2.000
[plustek] * Channel[1], gamma 2.000
[plustek] * Channel[2], gamma 2.000
[plustek] * Channel[3], gamma 2.000
[plustek] ----------------------------------
[plustek] Checking MISC IO[0]=0x66
[plustek] * port 1 configured as input, status: RELEASED (40)
[plustek] * port 2 configured as input, status: RELEASED (41)
[plustek] Checking MISC IO[1]=0x16
[plustek] * port 3 configured as input, status: RELEASED (42)
[plustek] Checking MISC IO[2]=0x91
[plustek] sane_start
[plustek] usbDev_open(libusb:bus-0:\\.\libusb0-0001--0x04a9-0x2206,) - 0x0
[plustek] Vendor ID=0x04A9, Product ID=0x2206
[plustek] usbio_DetectLM983x
[plustek] usbio_DetectLM983x: found LM9832/3
[plustek] Detected vendor & product ID: 0x04A9-0x2206
[plustek] Device description for >0x04A9-0x2206< found.
[plustek] usb_initDev(38,0x04a9,38)
[plustek] Device WAF  : 0x00004002
[plustek] Transferrate: 1000000 Bytes/s
[plustek] Device Flags: 0x00000006
[plustek] Vendor adjusted to: >Canon<
[plustek] LAMP-STATUS: 0x00000000 (off)
[plustek] RESETTING REGISTERS(38) - 0x80
[plustek] USING MISC I/O settings
[plustek] MISC I/O after RESET: 0x66, 0x16, 0x91
[plustek] usbDev_getCaps()
[plustek] scanmode = 3
[plustek] usbDev_getCropInfo()
[plustek] usb_GetImageInfo()
[plustek] Area: cx=1216, cy=900
[plustek] PPL = 202
[plustek] LPA = 150
[plustek] BPL = 606
[plustek] brightness 0, contrast 0
[plustek] usbDev_setScanEnv()
[plustek] usb_SaveImageInfo()
[plustek] * dwFlag = 0x00000400
[plustek] usb_GetImageInfo()
[plustek] Area: cx=1216, cy=900
[plustek] * Preview Mode NOT set!
[plustek] AdjustCISLamps(1)
[plustek]  * setting color mode
[plustek] usb_AdjustLamps(1)
[plustek] Setting map[0] at 0x20047d18
[plustek] Setting map[1] at 0x2004bd18
[plustek] Setting map[2] at 0x2004fd18
[plustek] usbDev_startScan()
[plustek] * HDPI: 12.000
[plustek] * XDPI=50, HDPI=12.000
[plustek] * YDPI=75, MinDPIY=75
[plustek] LAMP-STATUS: 0x00000000 (off)
[plustek] Switching Lamp on
[plustek] usb_AdjustLamps(1)
[plustek] Warmup-Timer started
[plustek] LAMP-STATUS: 0x00000001 (on)
[plustek] Lamp-Timer stopped
[plustek] dwflag = 0x40000400 dwBytesLine = 606
[plustek] Lines          = 150
[plustek] Bytes per Line = 606
[plustek] Bitdepth       = 8
[plustek] TIME START
[plustek] local_sane_start done
[[plustekplustek] ] sane_start donereader_process started (forked)
] reader_process:starting to READ data (90900 bytes)
[plustek] buf = 0x2005c978
[plustek] usbDev_PrepareScan()
[plustek] UIO error
[plustek] cano_DoCalibration()
[plustek] #########################
[plustek] usb_SpeedTest(38,1000000)
[plustek] GETMCLK[7/2], using entry 6: 6.000, 600
[plustek] SETMCLK[7/2]: 6.000
[plustek] usb_SetScanParameters()
[plustek] Scanner not ready!!!
[plustek] #########################
[plustek] usb_AutoWarmup()
[plustek] - function skipped, CIS device!
[plustek] GETMCLK[7/2], using entry 6: 6.000, 600
[plustek] SETMCLK[7/2]: 6.000
[plustek] GETMCLK[7/2], using entry 0: 7.000, 50
[plustek] SETMCLK[7/2]: 7.000
[plustek] ###### ADJUST LAMP (COARSE)#######
[plustek] UIO error
[plustek] UIO error
[plustek] cano_PrepareToReadWhiteCal() failed
[plustek] calibration failed!!!
[[plustekplustek] ] reader_process: read failed, status = IPC: Transferrate = -2
0000009004 Bytes/s, errno 2
[plustek
] sane_read - read 0 bytes
[plustek] drvclose()
[plustek] (SIG) Child is down (signal=20)
[plustek] TIME END 1: 68s
[plustek] usbDev_stopScan()
[plustek] usbDev_ScanEnd(), start=1, park=1
[plustek] usbDev_close()
[plustek] close_pipe (r_pipe)
scanimage: sane_read: Operation was cancelled
[plustek] sane_cancel
[plustek] do_cancel
[plustek] >>>>>>>> killing reader_process <<<<<<<<
[plustek] reader_process killed
[plustek] TIME END 2: 68s
[plustek] sane_close
[plustek] sane_exit
[plustek] Shutdown called (dev->fd=-1, libusb:bus-0:\\.\libusb0-0001--0x04a9-0x2
206)
[plustek] Waiting for scanner-ready...
[plustek] Lamp-Timer stopped


Thanks you and best regards, 

Fred.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130313/dc6cb1ea/attachment-0001.html>


More information about the sane-devel mailing list