[sane-devel] bug with Canon N1240U in Lineart mode at 75 dpi?

Eric Ding ericding@alum.mit.edu
Sat, 27 Nov 2004 14:24:16 -0500


I'm using sane-backends 1.0.15 with libusb on Gentoo Linux with a Canon
N1240U scanner.

When I try to scan in Lineart mode at 75dpi, I get a few back-and-forth
pauses, then a significant buzzing sound as the scanner's (green) light
is on, but the light bar doesn't move at all.  Scanning in other modes
(i.e., Gray, Color) or in Lineart mode with higher resolutions (i.e.,
96, 300, etc.) works fine.

Scanning with these settings using Canon's Windows driver works, so I
conclude that this is likely an issue with the SANE plustek backend.
Below find the stderr output of running

     scanimage --mode Lineart --resolution=75

with SANE_DEBUG_PLUSTEK set to 13. Have I found a bug? Can anyone
confirm or deny this behavior?

Thanks,
Eric

[sanei_debug] Setting debug level of plustek to 13.
[plustek] Plustek backend V0.48-10, part of sane-backends 1.0.15
[plustek] ># Plustek-SANE Backend configuration file<
[plustek] ># For use with LM9831/2/3 based USB scanners<
[plustek] >#<
[plustek] ><
[plustek] ># each device needs at least two lines:<
[plustek] ># - [usb] vendor-ID and product-ID<
[plustek] ># - device devicename<
[plustek] ># i.e. for Plustek (0x07B3) UT12/16/24 (0x0017)<
[plustek] ># [usb] 0x07B3 0x0017<
[plustek] ># device /dev/usbscanner<
[plustek] ># or<
[plustek] ># device libusb:bbb:ddd<
[plustek] ># where bbb is the busnumber and ddd the device number<
[plustek] ># make sure that your user has access to /proc/bus/usb/bbb/ddd<
[plustek] >#<
[plustek] ># additionally you can specify some options<
[plustek] ># warmup, lOffOnEnd, lampOff<
[plustek] >#<
[plustek] ># For autodetection use<
[plustek] ># [usb]<
[plustek] ># device /dev/usbscanner<
[plustek] >#<
[plustek] ># or simply<
[plustek] ># [usb]<
[plustek] >#<
[plustek] ># or if you want a specific device but you have no idea about the<
[plustek] ># device node or you use libusb, simply set vendor- and product-ID<
[plustek] ># [usb] 0x07B3 0x0017<
[plustek] ># device auto<
[plustek] >#<
[plustek] ># NOTE: autodetection is safe, as it uses the info it got<
[plustek] >#       from the USB subsystem. If you're not using the<
[plustek] >#       autodetection, you MUST have attached that device<
[plustek] >#       at your USB-port, that you have specified...<
[plustek] >#<
[plustek] ><
[plustek] >[usb]<
[plustek] next device uses autodetection
[plustek] ... next device
[plustek] ><
[plustek] >#<
[plustek] ># options for the previous USB entry<
[plustek] >#<
[plustek] ># switch lamp off after xxx secs, 0 disables the feature<
[plustek] ># (can also be set via frontend)<
[plustek] >option lampOff 300<
[plustek] Decoding option >lampOff<
[plustek] ><
[plustek] ># warmup period in seconds, 0 means no warmup, -1 means auto-warmup<
[plustek] ># (can also be set via frontend)<
[plustek] >option warmup -1<
[plustek] Decoding option >warmup<
[plustek] ><
[plustek] ># 0 means leave lamp-status untouched, not 0 means switch off<
[plustek] ># on sane_close<
[plustek] ># (can also be set via frontend)<
[plustek] >option lOffOnEnd 1<
[plustek] Decoding option >lOffOnEnd<
[plustek] ><
[plustek] >#<
[plustek] ># options to tweak the image start-position<
[plustek] ># (WARNING: there's no internal range check!!!)<
[plustek] >#<
[plustek] ># for the normal scan area<
[plustek] >#<
[plustek] >option posOffX 0<
[plustek] Decoding option >posOffX<
[plustek] >option posOffY 0<
[plustek] Decoding option >posOffY<
[plustek] ><
[plustek] ># for transparencies<
[plustek] >option tpaOffX 0<
[plustek] Decoding option >tpaOffX<
[plustek] >option tpaOffY 0<
[plustek] Decoding option >tpaOffY<
[plustek] ><
[plustek] ># for negatives<
[plustek] >option negOffX 0<
[plustek] Decoding option >negOffX<
[plustek] >option negOffY 0<
[plustek] Decoding option >negOffY<
[plustek] ><
[plustek] >#<
[plustek] ># for setting the calibration strip position<
[plustek] ># (WARNING: there's no internal range check!!!)<
[plustek] ># -1 means use built in<
[plustek] ># (can also be set via frontend)<
[plustek] >option posShadingY -1<
[plustek] Decoding option >posShadingY<
[plustek] >option tpaShadingY -1<
[plustek] Decoding option >tpaShadingY<
[plustek] >option negShadingY -1<
[plustek] Decoding option >negShadingY<
[plustek] ><
[plustek] >#<
[plustek] ># to invert the negatives, 0 disables the feature<
[plustek] >#<
[plustek] >option invertNegatives 0<
[plustek] Decoding option >invertNegatives<
[plustek] ><
[plustek] >#<
[plustek] ># to disable the internal sensor speedup function,<
[plustek] ># 1 disables the feature<
[plustek] >#<
[plustek] >option disableSpeedup 0<
[plustek] Decoding option >disableSpeedup<
[plustek] ><
[plustek] >#<
[plustek] ># to save/restore coarse calibration data<
[plustek] ># (can also be set via frontend)<
[plustek] >option cacheCalData 0<
[plustek] Decoding option >cacheCalData<
[plustek] ><
[plustek] >#<
[plustek] ># use alternate calibration routines<
[plustek] >#<
[plustek] >option altCalibration 0<
[plustek] Decoding option >altCalibration<
[plustek] ><
[plustek] >#<
[plustek] ># for skipping whole calibration step<
[plustek] >#<
[plustek] >option skipCalibration 0<
[plustek] Decoding option >skipCalibration<
[plustek] ><
[plustek] >#<
[plustek] ># for skipping entire fine calibration step<
[plustek] ># coarse calibration is done<
[plustek] >#<
[plustek] >option skipFine 0<
[plustek] Decoding option >skipFine<
[plustek] ><
[plustek] >#<
[plustek] ># discard the result of the fine white calibration<
[plustek] >#<
[plustek] >option skipFineWhite 0<
[plustek] Decoding option >skipFineWhite<
[plustek] ><
[plustek] ># for replacing the gain values found during coarse<
[plustek] ># calibration<
[plustek] ># (can also be set via frontend)<
[plustek] >option red_gain   -1<
[plustek] Decoding option >red_gain<
[plustek] >option green_gain -1<
[plustek] Decoding option >green_gain<
[plustek] >option blue_gain  -1<
[plustek] Decoding option >blue_gain<
[plustek] ><
[plustek] ># for replacing the offset values found during coarse<
[plustek] ># calibration<
[plustek] ># (can also be set via frontend)<
[plustek] >option red_offset   -1<
[plustek] Decoding option >red_offset<
[plustek] >option green_offset -1<
[plustek] Decoding option >green_offset<
[plustek] >option blue_offset  -1<
[plustek] Decoding option >blue_offset<
[plustek] ><
[plustek] >#<
[plustek] ># for replacing the default lampoff settings, this<
[plustek] ># works only for CIS devices like CanoScan LiDE20<
[plustek] ># (can also be set via frontend)<
[plustek] >option red_lampoff   -1<
[plustek] Decoding option >red_lampoff<
[plustek] >option green_lampoff -1<
[plustek] Decoding option >green_lampoff<
[plustek] >option blue_lampoff  -1<
[plustek] Decoding option >blue_lampoff<
[plustek] ><
[plustek] >#<
[plustek] ># for adjusting the default gamma values<
[plustek] ># (can also be set via frontend)<
[plustek] >option redGamma         1.0<
[plustek] Decoding option >redGamma<
[plustek] >option greenGamma       1.0<
[plustek] Decoding option >greenGamma<
[plustek] >option blueGamma        1.0<
[plustek] Decoding option >blueGamma<
[plustek] >option grayGamma        1.0<
[plustek] Decoding option >grayGamma<
[plustek] ><
[plustek] >#<
[plustek] ># to enable TPA (EPSON or UMAX, if autodetection fails)<
[plustek] ># 0 means default behaviour as specified in the internal tables<
[plustek] ># 1 means enable (needed for UMAX 3450)<
[plustek] >option enableTPA 0<
[plustek] Decoding option >enableTPA<
[plustek] ><
[plustek] >#<
[plustek] ># model override functionality, currently only available for<
[plustek] ># Mustek devices, using NSCs' vendor ID: 0x0400 and<
[plustek] ># also their product ID: 0x1000 (LM9831) 0x1001 (LM9832)<
[plustek] >#<
[plustek] ># mov/PID    |    0x1000   |   0x1001<
[plustek] ># ---------------------------------------<
[plustek] ># 0 (default)| BearPaw1200 | BearPaw 2400<
[plustek] ># 1          |   ignored   | BearPaw 1200<
[plustek] >#<
[plustek] >option mov 0<
[plustek] Decoding option >mov<
[plustek] ><
[plustek] >#<
[plustek] ># and of course the device-name<
[plustek] >#<
[plustek] ># device /dev/usbscanner<
[plustek] >device auto<
[plustek] Decoding device name >auto<
[plustek] ><
[plustek] >#<
[plustek] ># to define a new device, start with a new section:<
[plustek] ># [usb]<
[plustek] >#<
[plustek] attach (auto, 0xbfffc460, (nil))
[plustek] Device configuration:
[plustek] device name  : >auto<
[plustek] USB-ID       : ><
[plustek] model ovr.   : 0
[plustek] warmup       : -1s
[plustek] lampOff      : 300
[plustek] lampOffOnEnd : yes
[plustek] cacheCalData : no
[plustek] altCalibrate : no
[plustek] skipCalibr.  : no
[plustek] skipFine     : no
[plustek] skipFineWhite: no
[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,)
[plustek] Autodetection...
[plustek] Found device at >libusb:001:021<
[plustek] Vendor ID=0x04A9, Product ID=0x220E
[plustek] usbio_DetectLM983x
[plustek] usbio_DetectLM983x: found LM9832/3
[plustek] Detected vendor & product ID: 0x04A9-0x220E
[plustek] Device description for >0x04A9-0x220E< found.
[plustek] usb_initDev(42,0x04a9,-1)
[plustek] Device WAF: 0x00000006
[plustek] Device Flags: 0x00000000
[plustek] Vendor adjusted to: >Canon<
[plustek] LAMP-STATUS: 0x00000000
[plustek] RESETTING REGISTERS(-1)
[plustek] MISC I/O after RESET: 0x66, 0x16, 0x91
[plustek] Calibration file-name set to:
[plustek] >/home/ericding/.sane/Canon-N1240U_LiDE30.cal<
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 6
[plustek] * PhyLines   = 4
[plustek] * TotalBytes = 24
[plustek] usb_SetScanParameters() done.
[plustek] usbDev_getCaps()
[plustek] Scanner information:
[plustek] Vendor : Canon
[plustek] Model  : N1240U/LiDE30
[plustek] Flags  : 0x00000000
[plustek] drvclose()
[plustek] usbDev_stopScan()
[plustek] usbDev_ScanEnd(), start=0, park=0
[plustek] usbDev_close()
[plustek] attach: model = >N1240U/LiDE30<
[plustek] sane_get_devices (0xbfffe588, 0)
[plustek] sane_open - libusb:001:021
[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] sane_start
[plustek] usbDev_open(libusb:001:021,)
[plustek] Vendor ID=0x04A9, Product ID=0x220E
[plustek] usbio_DetectLM983x
[plustek] usbio_DetectLM983x: found LM9832/3
[plustek] Detected vendor & product ID: 0x04A9-0x220E
[plustek] Device description for >0x04A9-0x220E< found.
[plustek] usb_initDev(42,0x04a9,42)
[plustek] Device WAF: 0x00000006
[plustek] Device Flags: 0x00000006
[plustek] Vendor adjusted to: >Canon<
[plustek] LAMP-STATUS: 0x00000000
[plustek] RESETTING REGISTERS(42)
[plustek] MISC I/O after RESET: 0x66, 0x16, 0x91
[plustek] usbDev_getCaps()
[plustek] scanmode = 0
[plustek] usbDev_getCropInfo()
[plustek] usb_GetImageInfo()
[plustek] PPL = 376
[plustek] LPA = 225
[plustek] BPL = 47
[plustek] brightness 0, contrast 0
[plustek] usbDev_setScanEnv()
[plustek] usb_SaveImageInfo()
[plustek] * dwFlag = 0x00000400
[plustek] usb_GetImageInfo()
[plustek] * Preview Mode NOT set!
[plustek] Setting map[3] at 0x08079aac
[plustek] usbDev_startScan()
[plustek] LAMP-STATUS: 0x00000000
[plustek] Switching Lamp on
[plustek] Warmup-Timer started
[plustek] LAMP-STATUS: 0x00000001
[plustek] Lamp-Timer stopped
[plustek] dwflag = 0x40000400 dwBytesLine = 47 
[plustek] Lines          = 225
[plustek] Bytes per Line = 47
[plustek] Bitdepth       = 1
[plustek] TIME START
[plustek] reader_process started (forked)
[plustek] reader_process:starting to READ data (10575 bytes)
[plustek] buf = 0x0808a448
[plustek] usbDev_PrepareScan()
[plustek] sane_start done
[plustek] cano_DoCalibration()
[plustek] SETMCLK[8/1], using entry 8: 12.000000, 1200
[plustek] SETMCLK[8/0], using entry 2: 6.000000, 150
[plustek] cano_AdjustLightsource()
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 20402
[plustek] * PhyLines   = 1
[plustek] * TotalBytes = 20402
[plustek] usb_SetScanParameters() done.
[plustek] usb_ScanBegin()
[plustek] usb_DownloadShadingData(1)
[plustek] usb_IsDataAvailableInDRAM()
[plustek] Data is available
[plustek] usbDev_ScanEnd(), start=1, park=0
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 20402
[plustek] * PhyLines   = 1
[plustek] * TotalBytes = 20402
[plustek] usb_SetScanParameters() done.
[plustek] usb_ScanBegin()
[plustek] usb_DownloadShadingData(1)
[plustek] usb_IsDataAvailableInDRAM()
[plustek] Data is available
[plustek] usbDev_ScanEnd(), start=1, park=0
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 20402
[plustek] * PhyLines   = 1
[plustek] * TotalBytes = 20402
[plustek] usb_SetScanParameters() done.
[plustek] usb_ScanBegin()
[plustek] usb_DownloadShadingData(1)
[plustek] usb_IsDataAvailableInDRAM()
[plustek] Data is available
[plustek] usbDev_ScanEnd(), start=1, park=0
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 20402
[plustek] * PhyLines   = 1
[plustek] * TotalBytes = 20402
[plustek] usb_SetScanParameters() done.
[plustek] usb_ScanBegin()
[plustek] usb_DownloadShadingData(1)
[plustek] usb_IsDataAvailableInDRAM()
[plustek] Data is available
[plustek] usbDev_ScanEnd(), start=1, park=0
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 20402
[plustek] * PhyLines   = 1
[plustek] * TotalBytes = 20402
[plustek] usb_SetScanParameters() done.
[plustek] usb_ScanBegin()
[plustek] usb_DownloadShadingData(1)
[plustek] usb_IsDataAvailableInDRAM()
[plustek] Data is available
[plustek] usbDev_ScanEnd(), start=1, park=0
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 20402
[plustek] * PhyLines   = 1
[plustek] * TotalBytes = 20402
[plustek] usb_SetScanParameters() done.
[plustek] usb_ScanBegin()
[plustek] usb_DownloadShadingData(1)
[plustek] usb_IsDataAvailableInDRAM()
[plustek] Data is available
[plustek] usbDev_ScanEnd(), start=1, park=0
[plustek] * red_lamp_on    = 0
[plustek] * red_lamp_off   = 0
[plustek] * green_lamp_on  = 23
[plustek] * green_lamp_off = 3626
[plustek] * blue_lamp_on   = 0
[plustek] * blue_lamp_off  = 0
[plustek] cano_AdjustLightsource() done.
[plustek] MOTOR: PWM=0x08, PWM_DUTY=0x33 0x45=0x13 0x48=0x02, 0x49=0x42
[plustek] MCLK_FFW = 3 --> 0x04
[plustek] cano_AdjustOffset()
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 20402
[plustek] * PhyLines   = 1
[plustek] * TotalBytes = 20402
[plustek] usb_SetScanParameters() done.
[plustek] usb_ScanBegin()
[plustek] usb_DownloadShadingData(4)
[plustek] usb_IsDataAvailableInDRAM()
[plustek] Data is available
[plustek] usbDev_ScanEnd(), start=1, park=0
[plustek] cano_AdjustOffset() done.
[plustek] cano_AdjustGain()
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 20402
[plustek] * PhyLines   = 1
[plustek] * TotalBytes = 20402
[plustek] usb_SetScanParameters() done.
[plustek] usb_ScanBegin()
[plustek] usb_DownloadShadingData(1)
[plustek] usb_IsDataAvailableInDRAM()
[plustek] Data is available
[plustek] usbDev_ScanEnd(), start=1, park=0
[plustek] cano_AdjustGain() done.
[plustek] MOTOR: PWM=0x08, PWM_DUTY=0x33 0x45=0x13 0x48=0x02, 0x49=0x42
[plustek] MCLK_FFW = 3 --> 0x04
[plustek] cano_AdjustDarkShading()
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 1506
[plustek] * PhyLines   = 32
[plustek] * TotalBytes = 48192
[plustek] usb_SetScanParameters() done.
[plustek] usb_ScanBegin()
[plustek] usb_DownloadShadingData(2)
[plustek] usb_IsDataAvailableInDRAM()
[plustek] Data is available
[plustek] usbDev_ScanEnd(), start=1, park=0
[plustek] cano_AdjustDarkShading() done
[plustek] MOTOR: PWM=0x08, PWM_DUTY=0x33 0x45=0x13 0x48=0x02, 0x49=0x42
[plustek] MCLK_FFW = 3 --> 0x04
[plustek] cano_AdjustWhiteShading()
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 1506
[plustek] * PhyLines   = 32
[plustek] * TotalBytes = 48192
[plustek] usb_SetScanParameters() done.
[plustek] usb_ScanBegin()
[plustek] usb_DownloadShadingData(3)
[plustek] usb_IsDataAvailableInDRAM()
[plustek] Data is available
[plustek] usbDev_ScanEnd(), start=1, park=0
[plustek] cano_AdjustWhiteShading() done
[plustek] MOTOR: PWM=0x08, PWM_DUTY=0x33 0x45=0x13 0x48=0x02, 0x49=0x42
[plustek] MCLK_FFW = 3 --> 0x04
[plustek] cano_DoCalibration() done
[plustek] -------------------------
[plustek] Static Gain:
[plustek] REG[0x3b] = 1
[plustek] REG[0x3c] = 1
[plustek] REG[0x3d] = 1
[plustek] Static Offset:
[plustek] REG[0x38] = 0
[plustek] REG[0x39] = 0
[plustek] REG[0x3a] = 0
[plustek] -------------------------
[plustek] calibration done.
[plustek] usb_SetScanParameters()
[plustek] usb_GetMCLKDivider()
[plustek] * PhyBytes   = 96
[plustek] * PhyLines   = 225
[plustek] * TotalBytes = 21600
[plustek] usb_SetScanParameters() done.
[plustek] ImageProc is: BWScale
[plustek] * scanning->dwFlag=0x40000400
[plustek] usb_ScanBegin()
[plustek] usb_MapDownload()
[plustek] * Threshold is at 2048 siThresh=0
[plustek] * Inverting Map
[plustek] * Threshold is at 2048 siThresh=0
[plustek] * Inverting Map
[plustek] * Threshold is at 2048 siThresh=0
[plustek] * Inverting Map
[plustek] usb_MapDownload() done.
[plustek] usb_DownloadShadingData(0)
[plustek] Downloading 752 pixels
[plustek] Reading the data now!
[plustek] PhyDpi.x         = 150
[plustek] PhyDpi.y         = 75
[plustek] UserDpi.x        = 75
[plustek] UserDpi.y        = 75
[plustek] NumberOfScanBufs = 43690
[plustek] LinesPerScanBufs = 87380
[plustek] dwPhyBytes       = 96
[plustek] dwPhyPixels      = 752
[plustek] dwTotalBytes     = 21600
[plustek] dwPixels         = 376
[plustek] dwBytes          = 47
[plustek] dwValidPixels    = 752
[plustek] dwBytesScanBuf   = 192
[plustek] dwLinesDiscard   = 0
[plustek] dwLinesToSkip    = 1
[plustek] dwLinesUser      = 225
[plustek] dwBytesLine      = 47
[plustek] usb_IsDataAvailableInDRAM()
[plustek] Data is available
[plustek] reader_process: finished reading data
[plustek] (SIG) Child is down (signal=17)
[plustek] drvclose()
[plustek] TIME END 1: 20s
[plustek] usbDev_stopScan()
[plustek] usbDev_ScanEnd(), start=1, park=1
[plustek] MOTOR: PWM=0x08, PWM_DUTY=0x33 0x45=0x13 0x48=0x02, 0x49=0x42
[plustek] MCLK_FFW = 3 --> 0x04
[plustek] Lamp-Timer started (using ITIMER)
[plustek] usbDev_close()
[plustek] close_pipe (r_pipe)
[plustek] sane_cancel
[plustek] do_cancel
[plustek] TIME END 2: 21s
[plustek] sane_close
[plustek] sane_exit
[plustek] Shutdown called (dev->fd=-1, libusb:001:021)
[plustek] Waiting for scanner-ready...
[plustek] Switching lamp off...
[plustek] LAMP-STATUS: 0x00000001
[plustek] Switching Lamp off
[plustek] LAMP-STATUS: 0x00000000
[plustek] Lamp-Timer stopped