mustek-probs: color, preview

Andreas Gaumann (gg261@appl2.hrz.uni-siegen.de)
Fri, 30 May 1997 10:27:35 +0100 (MET DST)

Hello all,

last week I've written that I have some probs with the preview-window and
color-scanning on my Mustek MSF-6000SP (Rev. 3.12).
^^^

At first, thanks to all who helped me so far.

Now there are no more horizontal stripes in color-images but therefore they are
horizontal scaled by the factor 2 if the resolution is <=300 dpi (equal if
color- or gray-mode) and the are all right if the resolution is >300 dpi.
The preview-window runs only if I set the y_range.max to 180. But then all
pictures are also scaled.

Now here is more detailed what I have tested and find out:

---------
1. scanning-speed (->SIG_BIG_BUFF):
---------

In /usr/include/scsi/sg.h I've set SIG_BIG_BUFF to 1024*128-512.
(Before I've forgot the -512). I have not exactly compared the scanning-times
but (subjective) I would say that scanning is a little bit faster.

---------
2. horizontal stripes in color-pictures and no preview:
---------

---------
(a) trying "./configure --disable-ld-fix"
---------

Recompiling sane with

make distclean; ./configure --disable-ld-fix; make; make install

takes no effects to previous tests. The stripes are also in color-pictures
while gray-pictures are all right. Trying to get a preview the scanner stops
at the end (bottom) while it is still blinking but making NO noise. In
/var/log/messages the entries of the preview test are

ncr53c8xx : at PCI bus 0, device 10, function 0
ncr_attach: unit=0 chip=810 base=fb000000, io_port=e000, irq=12
ncr53c810-0: using memory mapped IO at virtual address 0x283d000
ncr53c810-0: initial value of SCNTL3 = 13, final = 13
ncr53c810-0: requesting shared irq 12 (dev_id=0x1b5c068)
ncr53c810-0: restart (scsi reset).
scsi5 : ncr53c8xx (rel 1.12d)
scsi : 1 host.
Vendor: IOMEGA Model: ZIP 100 Rev: D.09
Type: Direct-Access ANSI SCSI revision: 02
Vendor: MUSTEK^?^? Model: MSF-06000SP^?^?^?^?^? Rev: 3.12
Type: Scanner ANSI SCSI revision: 01
Detected scsi generic sgb at scsi5, channel 0, id 6, lun 0
ncr53c810-0-<target 6, lun 0>: extraneous data discarded.
ncr53c810-0-<target 6, lun 0>: COMMAND FAILED (9 0) @00469810.
ncr53c810-0: restart (ncr dead ?).
ncr53c810-0: releasing host resources
ncr53c810-0: resetting chip
ncr53c810-0: host resources successfully released
scsi : 0 hosts.

( ^ switching off the scanner and turn it on again)

---------
(b) adding MUSTEK_FLAG_LD_MFS
---------

I've added the line

dev->flags |= MUSTEK_FLAG_LD_MFS;

in backend/mustek.c in the "attach"-function nearly line 324. This line is
copied from the MFS-1200SP if-tree. After recompiling sane with

make distclean; ./configure; make; make install

it has two effects:
1. There are no more horizontal stripes in color-images.
2. All images (color, gray, lineart, ...) are horizontal stretched by the
factor 2 if the resolution is in 0..300 dpi. But if the resolution is
>=301 dpi the images are all right!!!
Color-Images have two (very) small lines at the top (a dark blue line
and a cyan line under the blue one), but they are very small and can be
deleted very easily.

Now I've added the factor 2 at some different places where the resulution is
set (these places are chosen a little bit randomized because I don't really
know what I have done there) but all tries take no effect equal which
scan-mode I've tried. (I want to say that I've added the factor 2 at one
place, recompiled sane, tested it and see no effect, than adding the factor
at the next place (most times without deleting the previous one) and so on.)

These placse are:
1. in the function "line_distance" nearly line 779:
s->ld.peak_res = res / 2;
2. in the same function nearly line 785/786:
res*=2;
peak_res*=2;
3. in the function "sane_get_parameters" nearly line 1867:
s->params.lines = height * dots_per_mm * 2;

(By this, what's the difference between "res" and
"peak_res" ?)

---------
(c) setting y_range.max to 180 (instead of 360) in the function attach
---------

The entry in the function "attach" nearly line 325

dev->y_range.max = SANE_FIX (180); /* measured */

makes the scanner to scan the preview-window but with this parameter all
images (equal if preview or normal) are scaled in horizontal direction.
While getting the preview-image the scanner stops after the half length,
then the first half of the image is shown in the window and finally the
second half of the image is scanned. So it seemes that with the normal
value (360) the scanner tries to scan the first part, but when the
scanner-head reaches the bottom, it stops (perhaps a little bit before the
half of the suspected data is read) and so the first half isn't shown and
the rest of the image will not be scanned.

------------------------------------------

All in all I think that the main problem is the MUSTEK_FLAG_LD_MFS-flag
because it is made for 1200-scanners. These have a resolution of 1200x600
(I think so, but I do not really know). So there is the factor 2 between
horizontal and vertical resolution. On the other hand my scanner has a
resolution of 600dpi in both directions and so there is no factor 2. But
I havn't found the place where to set the right resolution.

So far,

Andreas.

-------------------------------
gaumann@studm.hrz.uni-siegen.de
gg261@appl2.hrz.uni-siegen.de
===============================

--
Source code, list archive, and docs: http://www.azstarnet.com/~axplinux/sane/
To unsubscribe: mail -s unsubscribe sane-devel-request@listserv.azstarnet.com