Silenced non-fatal warnings/error messages. Several fixes for avoiding

freezes/timeouts after cancelling a scan. Several fixes for warming up of
lamp. Decreased scan width of Plustek OpticPro 1248U.
merge-requests/1/head
Henning Geinitz 2005-12-09 11:55:11 +00:00
rodzic c8fb998804
commit 7d332297b6
8 zmienionych plików z 104 dodań i 49 usunięć

Wyświetl plik

@ -4,6 +4,13 @@
for (older) external backend for Brother MFC 4600 (USB version). for (older) external backend for Brother MFC 4600 (USB version).
* doc/descriptions/unsupported.desc: Added Lexmark X6170. Removed * doc/descriptions/unsupported.desc: Added Lexmark X6170. Removed
Brother MFC 4600 USB. Brother MFC 4600 USB.
* backend/gt68xx.c backend/gt68xx_devices.c backend/gt68xx_high.c
backend/gt68xx_low.c doc/descriptions/gt68xx.desc
doc/gt68xx/gt68xx.CHANGES doc/gt68xx/gt68xx.TODO: Silenced
non-fatal warnings/error messages. Several fixes for avoiding
freezes/timeouts after cancelling a scan. Several fixes for
warming up of lamp. Decreased scan width of Plustek OpticPro
1248U.
2005-12-08 Gerhard Jaeger <gerhard@gjaeger.de> 2005-12-08 Gerhard Jaeger <gerhard@gjaeger.de>

Wyświetl plik

@ -48,10 +48,12 @@
#include "../include/sane/config.h" #include "../include/sane/config.h"
#define BUILD 78 #define BUILD 79
#define MAX_DEBUG #define MAX_DEBUG
#define WARMUP_TIME 60 #define WARMUP_TIME 60
#define CALIBRATION_HEIGHT 2.5 #define CALIBRATION_HEIGHT 2.5
#define SHORT_TIMEOUT (1 * 1000)
#define LONG_TIMEOUT (30 * 1000)
/* Use a reader process if possible (usually faster) */ /* Use a reader process if possible (usually faster) */
#if defined (HAVE_SYS_SHM_H) && (!defined (USE_PTHREAD)) && (!defined (HAVE_OS2_H)) #if defined (HAVE_SYS_SHM_H) && (!defined (USE_PTHREAD)) && (!defined (HAVE_OS2_H))
@ -1641,6 +1643,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
} }
s->first_scan = SANE_TRUE; s->first_scan = SANE_TRUE;
myinfo |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; myinfo |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS;
gettimeofday (&s->lamp_on_time, 0);
} }
break; break;
case OPT_MODE: case OPT_MODE:
@ -2076,7 +2079,7 @@ sane_cancel (SANE_Handle handle)
{ {
s->scanning = SANE_FALSE; s->scanning = SANE_FALSE;
if (s->total_bytes != (s->params.bytes_per_line * s->params.lines)) if (s->total_bytes != (s->params.bytes_per_line * s->params.lines))
DBG (0, "sane_cancel: warning: scanned %d bytes, expected %d " DBG (1, "sane_cancel: warning: scanned %d bytes, expected %d "
"bytes\n", s->total_bytes, "bytes\n", s->total_bytes,
s->params.bytes_per_line * s->params.lines); s->params.bytes_per_line * s->params.lines);
else else
@ -2097,7 +2100,11 @@ sane_cancel (SANE_Handle handle)
#endif #endif
} }
/* some scanners don't like this command when cancelling a scan */
sanei_usb_set_timeout (SHORT_TIMEOUT);
gt68xx_device_fix_descriptor (s->dev);
gt68xx_scanner_stop_scan (s); gt68xx_scanner_stop_scan (s);
sanei_usb_set_timeout (LONG_TIMEOUT);
if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED) if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED)
{ {
@ -2105,7 +2112,9 @@ sane_cancel (SANE_Handle handle)
} }
else else
{ {
sanei_usb_set_timeout (SHORT_TIMEOUT);
gt68xx_scanner_wait_for_positioning (s); gt68xx_scanner_wait_for_positioning (s);
sanei_usb_set_timeout (LONG_TIMEOUT);
gt68xx_device_carriage_home (s->dev); gt68xx_device_carriage_home (s->dev);
} }
if (s->gamma_table) if (s->gamma_table)

Wyświetl plik

@ -1021,7 +1021,7 @@ static GT68xx_Model plustek_op1248u_model = {
SANE_FIX (3.5), /* Start of scan area in mm (x) */ SANE_FIX (3.5), /* Start of scan area in mm (x) */
SANE_FIX (7.5), /* Start of scan area in mm (y) */ SANE_FIX (7.5), /* Start of scan area in mm (y) */
SANE_FIX (218.0), /* Size of scan area in mm (x) */ SANE_FIX (216.0), /* Size of scan area in mm (x) */
SANE_FIX (299.0), /* Size of scan area in mm (y) */ SANE_FIX (299.0), /* Size of scan area in mm (y) */
SANE_FIX (0.0), /* Start of white strip in mm (y) */ SANE_FIX (0.0), /* Start of white strip in mm (y) */

Wyświetl plik

@ -400,13 +400,27 @@ gt68xx_scanner_wait_for_positioning (GT68xx_Scanner * scanner)
{ {
SANE_Status status; SANE_Status status;
SANE_Bool moving; SANE_Bool moving;
SANE_Int status_count = 0;
usleep (100000); /* needed by the BP 2400 CU Plus? */ usleep (100000); /* needed by the BP 2400 CU Plus? */
while (SANE_TRUE) while (SANE_TRUE)
{ {
RIE (gt68xx_device_is_moving (scanner->dev, &moving)); status = gt68xx_device_is_moving (scanner->dev, &moving);
if (status == SANE_STATUS_GOOD)
{
if (!moving) if (!moving)
break; break;
}
else
{
if (status_count > 9)
{
DBG (1, "gt68xx_scanner_wait_for_positioning: error count too high!\n");
return status;
}
status_count++;
DBG(3, "gt68xx_scanner_wait_for_positioning: ignored error\n");
}
usleep (100000); usleep (100000);
} }
@ -1146,16 +1160,17 @@ gt68xx_wait_lamp_stable (GT68xx_Scanner * scanner,
GT68xx_Afe_Values *values, GT68xx_Afe_Values *values,
SANE_Bool dont_move) SANE_Bool dont_move)
{ {
int i;
SANE_Status status = SANE_STATUS_GOOD; SANE_Status status = SANE_STATUS_GOOD;
SANE_Int last_white = 0; SANE_Int last_white = 0;
SANE_Int first = SANE_TRUE; SANE_Bool first = SANE_TRUE;
SANE_Bool message_printed = SANE_FALSE;
struct timeval now;
int secs;
int increase = -5;
for (i = 0; i < 80; i++) do
{ {
usleep (200000); usleep (200000);
if (i == 10)
DBG (0, "Please wait for lamp warm-up\n");
if (!first && dont_move) if (!first && dont_move)
{ {
@ -1190,18 +1205,24 @@ gt68xx_wait_lamp_stable (GT68xx_Scanner * scanner,
"gt68xx_wait_lamp_stable: this white = %d, last white = %d\n", "gt68xx_wait_lamp_stable: this white = %d, last white = %d\n",
values->total_white, last_white); values->total_white, last_white);
gettimeofday (&now, 0);
secs = now.tv_sec - scanner->lamp_on_time.tv_sec;
if (!message_printed && secs > 5 && secs <= WARMUP_TIME)
{
DBG (0, "Please wait for lamp warm-up\n");
message_printed = SANE_TRUE;
}
if (scanner->val[OPT_AUTO_WARMUP].w == SANE_TRUE) if (scanner->val[OPT_AUTO_WARMUP].w == SANE_TRUE)
{ {
if (scanner->dev->model->flags & GT68XX_FLAG_CIS_LAMP) if (scanner->dev->model->flags & GT68XX_FLAG_CIS_LAMP)
{ {
/* insist on at least 10 seconds */ if (values->total_white <= (last_white - 20))
struct timeval now; increase--;
int secs; if (values->total_white >= last_white)
increase++;
gettimeofday (&now, 0); if (increase > 0 && (values->total_white <= (last_white + 20))
secs = now.tv_sec - scanner->lamp_on_time.tv_sec;
if (secs >= 10 && (values->total_white <= (last_white + 20))
&& values->total_white != 0) && values->total_white != 0)
break; break;
} }
@ -1212,19 +1233,12 @@ gt68xx_wait_lamp_stable (GT68xx_Scanner * scanner,
break; /* lamp is warmed up */ break; /* lamp is warmed up */
} }
} }
else
{ /* insist on 60 seconds */
struct timeval now;
int secs;
gettimeofday (&now, 0);
secs = now.tv_sec - scanner->lamp_on_time.tv_sec;
if (secs >= WARMUP_TIME)
break;
}
last_white = values->total_white; last_white = values->total_white;
} }
DBG (3, "gt68xx_wait_lamp_stable: Lamp is stable\n"); while (secs <= WARMUP_TIME);
DBG (3, "gt68xx_wait_lamp_stable: Lamp is stable after %d seconds\n",
secs);
return status; return status;
} }

Wyświetl plik

@ -1001,7 +1001,7 @@ gt68xx_device_check_result (GT68xx_Packet res, SANE_Byte command)
{ {
if (res[0] != 0) if (res[0] != 0)
{ {
DBG (0, "gt68xx_device_check_result: result was %2X %2X " DBG (1, "gt68xx_device_check_result: result was %2X %2X "
"(expected: %2X %2X)\n", res[0], res[1], 0, command); "(expected: %2X %2X)\n", res[0], res[1], 0, command);
return SANE_STATUS_IO_ERROR; return SANE_STATUS_IO_ERROR;
} }

Wyświetl plik

@ -1,5 +1,5 @@
:backend "gt68xx" :backend "gt68xx"
:version "1.0-78" :version "1.0-79"
:manpage "sane-gt68xx" :manpage "sane-gt68xx"
:url "http://www.meier-geinitz.de/sane/gt68xx-backend/" :url "http://www.meier-geinitz.de/sane/gt68xx-backend/"
:comment "Only the USB scanners mentioned below are supported. For other Mustek BearPaws, look at the Plustek and the MA-1509 backend." :comment "Only the USB scanners mentioned below are supported. For other Mustek BearPaws, look at the Plustek and the MA-1509 backend."

Wyświetl plik

@ -1,5 +1,24 @@
gt68xx.CHANGES -*-text-*- gt68xx.CHANGES -*-text-*-
V 1.0.79 (2005-12-??)
* Silenced warning when scan is cancelled.
* Silenced often non-fatal check_result error messages.
* Reduced timeout for cancelling a scan. Some scanners freeze for 30 seconds
otherwise. Repeat is_moving test even if an error was received.
* Run fix_descriptors before cancelling the scan. Without that, some gt6816
scanners are not detected anymore after closing the device.
* Fixed wait_lamp_stable. Wait for a maximum time of 60 seconds. Print
warming up message after 5 seconds. Print how long warming up took.
* For Mustek ScanExpress A3 USB, use more intelligent warm-up mechanism. The
brightness for this scanner first decreases and then increases again. With the
previous logic the scanner always warmed up for at least 10 seconds even if it
wasn't necessary.
* Warm up lamp also when changing from flatbed to transparency. Without this the
lamp may be too dark directly after changing the source.
* Decreased scan width of Plustek OpticPro 1248U. This fixes some strange color
artifacts and results in less backtracking in some modes.
V 1.0.78 (2005-10-16) V 1.0.78 (2005-10-16)
* Minor modifications to sheet-fed scanner support. * Minor modifications to sheet-fed scanner support.

Wyświetl plik

@ -6,24 +6,19 @@ General:
- some sort of fixed lookup-table may be necessary to compensate for the - some sort of fixed lookup-table may be necessary to compensate for the
non-linear CCD/CIS behaviour. A gamma value is not good enough. Or maybe line non-linear CCD/CIS behaviour. A gamma value is not good enough. Or maybe line
calibration can be used for that? calibration can be used for that?
- Check autobandwidth
- check several get scanner info functions
- check exposure (start + stop)?
- Some Plustek scanners are advertised with e.g. 1200x2400 but the maximum - Some Plustek scanners are advertised with e.g. 1200x2400 but the maximum
vertical resolution seems to be limited to the horizontal one. Check if vertical resolution seems to be limited to the horizontal one. Check if
that's really the case. that's really the case.
- The first scan (or preview) sometimes seem to start at a wrong x-position - Keep a log of all gain/offset combinations already tested and break if
(plustek 1248, calibration disabled). one is repeated to avoid endless loops.
- Print commands that are send to the scanner in clear text.
- Try to implement non-blocking USB bulk reads, check libusb CVS.
- Lamp warmup info message should only be printed when loop takes more then 5
seconds, not 5 seconds after start.
CCD: CCD:
---- ----
- check if CCD calib has stripes now (white limit too high?)
*** coarse + fine calib gray in gray mode
fine calib is ok
coarse calib has an extremely high gain
Mustek BearPaw 2400 TA Plus: Mustek BearPaw 2400 TA Plus:
- some lines at the beginning of each image have wrong colors (linedistance?) - some lines at the beginning of each image have wrong colors (linedistance?)
This seems to happen with other scanners, too. This seems to happen with other scanners, too.
@ -35,28 +30,39 @@ Mustek BearPaw 1200 TA:
- similar color problem as 2400 TA Plus, doesn't always happen? - similar color problem as 2400 TA Plus, doesn't always happen?
Mustek BearPaw 2448 TA Plus: Mustek BearPaw 2448 TA Plus:
- all modes are slow (massive backtracking) - all modes are slow (massive backtracking). If connected to a USB2 port, the
backtracking ich much less despite this scanner can't do USB2. Strange.
- Sometimes there is a USB protocol error when cancelling the scan?
- top borders move with resolution (happened in the early days with 2400 TA!) - top borders move with resolution (happened in the early days with 2400 TA!)
- gray scans have different brightness - gray scans have different brightness
- scan motor is bumpy and freezes sometimes - scan motor is bumpy and freezes sometimes, looks like accelaration is too big
(firmware problem?)
- vertical stripes - vertical stripes
- TA settings are wrong - TA settings are wrong
- no backtrack >= 600 dpi (also gray!) - no backtrack >= 600 dpi (also gray!)
- don't move before and after scan - don't move before and after scan
- check jpeg output - check jpeg output, maybe this can be used for faster scans
Plustek 1248U: Plustek 1248U:
- Linedistance seems to have problems in the first few and the last lines - Linedistance seems to have problems in the first few and the last lines.
- Gain and offset values are quite high. Optimum values are not reached. Problem
with coarse calib? Better algorithm needed.
- Images in color mode sometimes look too redish (result of above problem).
- quite slow when full width is selected. Lots of backtracking.
- Check if pixel mode is possible.
- Check again 600x1200 dpi.
Plustek U16B: Plustek U16B:
- 600 dpi 16 bit is limited to about half the size of the scan area because - 600 dpi 16 bit is limited to about half the size of the scan area because
only pixel mode works and 16k is the maximum buffer size. only pixel mode works and 16k is the maximum buffer size.
- After scanning, a run of sane-find-scanner leads to a protocol error and
scanning does no longer work.
Genius ColorPage Vivid 1200XE Genius ColorPage Vivid 1200XE
- 16 bit per color is advertized but this mode doesn't seem to work - 16 bit per color is advertized but this mode doesn't seem to work
(only 36 bit)? (only 12 bit)?
- 1200x1200 and 1200x2400 dpi doesn't seem to work despite being advertized - 1200x1200 and 1200x2400 dpi doesn't seem to work despite being advertized
- Y-positining varies slightly with resolution (some mm) - Y-positioning varies slightly with resolution (some mm)
CIS: CIS:
---- ----