[sane-devel] Colored vertical stripes with Visioneer Xerox DocuMate 510

Mike Kelly mike at piratehaven.org
Tue Oct 26 13:14:41 UTC 2010

On Mon, Oct 25, 2010 at 11:16:49AM -0400, chris guirl wrote:
> On Mon, Oct 25, 2010 at 3:29 AM, Mike Kelly <mike at piratehaven.org> wrote:
> > My command resulted in the image data being sent to stdout. ?What your
> > command has done is merge the image ouput with the debug log.
> Sorry about that, but when your command ran it never actually scanned
> anything, and left the message "scanimage: output is not a file,
> exiting" in the log. I guess I didn't know what exactly you were
> looking for. Anyway...
> >?Let try again with:
> >
> > ?env SANE_DEBUG_AVISION=7 scanimage 2> avision.log > avision.pnm
> >
> > Please send along a copy of both the avision.log and the avision.pnm file.
> The files are attached.
> Chris

Yeah, sorry for the confusion.

I've looked at the files, and as far as I can tell, the code seems to think
that things are running fine.  Clearly, the image is a bit wonky however,
so my first guess is that we're getting data back in a format we didn't

However, I seem to remember that you mentioned that the scanner worked once
without issues, and you've been unable to reproduce it.  Just to try out a
hunch along these lines, could you try turning the scanner off, connecting it
to Windows, power it on, run a test scan (just to be sure everything is
working), then disconnect the cable, reconnect it to your linux machine
without turning the scanner off, and try to make a scan.  Let me know if
this works or not.

I also recall that you mentioned that you were willing to tweak the source
code.  In this case, could you try enabling the debugging code which creates
the various debug image files?  I'd like a copy of /tmp/sane-avision.raw,
calibration-white.pnm, background-raw.pnm, background.pnm,
background-rear.pnm, background-final.pnm, and background-final-rear.pnm.
Note that not all of these files may be generated, but if they are, I'd like
to look at them.

To enable these files, you'll have to apply this patch:

diff --git a/backend/avision.c b/backend/avision.c
index 15b3f38..ffb0f9a 100644
--- a/backend/avision.c
+++ b/backend/avision.c
@@ -4891,7 +4891,7 @@ normal_calibration (Avision_Scanner* s)
     return status;
-  if (0) /* debug */
+  if (1) /* debug */
       FILE* f = NULL;
       f = fopen ("calibration-white.pnm", "w");
@@ -5679,7 +5679,7 @@ set_window (Avision_Scanner* s)
 static SANE_Status
 get_background_raster (Avision_Scanner* s)
-  const int debug = 0;
+  const int debug = 1;
   Avision_Device* dev = s->hw;
   SANE_Status status;
@@ -6739,7 +6739,7 @@ reader_process (void *data)
   DBG (3, "reader_process: total_size: %lu\n", (u_long) total_size);
   /* write a RAW PNM file for debugging -ReneR */
-  if (0 /* DEBUG */ &&
+  if (1 /* DEBUG */ &&
       (deinterlace == NONE || (deinterlace != NONE && !s->duplex_rear_valid)) )
       raw_fp = fopen ("/tmp/sane-avision.raw", "w");

You can just run the same command as you did this last time, as these tweaks
will cause these files to be dumped in the current directory (except for the
one in /tmp).



--------Mike at PirateHaven.org-----------------------The_glass_is_too_big--------

More information about the sane-devel mailing list