[sane-devel] Fwd: Visioneer 9450 added

m. allan noah kitno455 at gmail.com
Sun Sep 27 12:17:52 UTC 2009


patch from user. Rene?

allan

---------- Forwarded message ----------
From: Andyz Smith <andyzsmith at yahoo.com>
Date: Sun, Sep 27, 2009 at 7:51 AM
Subject: Re: [sane-devel] Visioneer 9450 added
To: "m. allan noah" <kitno455 at gmail.com>


Allan

I was able to narrow down the changes the needed to be made for the
Visioneer 9450.  I have one problem though.

I need to add an enumeration value in avision.h.  When I do the
compiler complains that the static value I am shifting into the enum
is larger than the maximum value for the type.  Can somebody figure
this out.  I don't have the scanner anymore so some of this is
untested, but was generally tested while I had the scanner.  It's
pretty simple actulaly, changes below:

avision.c

ln 908
   { NULL, NULL,
     0x04a7, 0x0421,
     "Visioneer", "9450",
     AV_MULTI_CALIB_CMD | AV_ADF_BGR_ORDER_INVERT | AV_NO_BUTTON |
AV_NO_TUNE_SCAN_LENGTH /* ajs */
},
     /* comment="sheetfed scanner" */
     /* status="complete" */


ln 4077
 dev->inquiry_tune_scan_length = BIT(result[94],2);
/* ajs */
 if (Avision_Device_List [model_num].feature_type & AV_NO_TUNE_SCAN_LENGTH)
   dev->inquiry_tune_scan_length = 0;
/* ajs */




----- Original Message ----
From: m. allan noah <kitno455 at gmail.com>
To: Andyz Smith <andyzsmith at yahoo.com>
Cc: sane-devel at lists.alioth.debian.org
Sent: Thursday, September 10, 2009 9:11:24 AM
Subject: Re: [sane-devel] Visioneer 9450 added

1. Avision is notorious for having drastically different firmware and
chipset versions inside the same wrapper
2. Can you pound this patch into slightly better shape (don't short
circuit these functions for all machines)

Hopefully Rene will be able to comment further.

allan

On Wed, Sep 9, 2009 at 10:45 PM, Andyz Smith <andyzsmith at yahoo.com> wrote:
> Hi All
>
> Working from libsane Ubuntu (Karmic(1.0.20)) I have fixed several problems related to the Visioneer 9450 scanner.
>
> Please see my notes below about "avision.c"
>
> Other Notes:
>
> Best Modes:
> 150, 300 dpi
> Grey, Color
>
> Document Feeder works.
>
> Some resolutions are buggy.  Like in the 180 - 299 range.  Hangs the scanner, only sometimes.
> High resolutions time - out and hang sometimes.  I went up to 600 dpi color and it work sometimes.
>
>
> BEGIN "avision.c"
>
> ln 914
> The Visioneer 9450 is in here but either somebody didn't test it or there are different version of the chipset or firmware in different hardware production runs.
>    { NULL, NULL,
>      0x04a7, 0x0421,
>      "Visioneer", "9450",
>      AV_ADF_BGR_ORDER_INVERT /* AJS */
>
> },
>
>
> ln 2019
> FUNCTION: Avision_Cmd
> Not sure this is helping anything, but it is working anyway.
>    /* may I vote for the possibility to use C99 ... */
> #define min_usb_size 10
> #define max_usb_size 512 * 1024 /* or 0x10000, used by AV Windows driver during background raster read, ... ? */ //ajs up max_usb_size to 512
>
> line 3173
> FUNCTION Get_Button_Status
> Uh yeah.....bad bug for this scanner/firmware/chipset something
> static SANE_Status
> get_button_status (Avision_Scanner* s)
> {
> //ajs !!!!!!!!!!!!!!!!!!!!!!!!
> return SANE_STATUS_GOOD;
>
> ln 4220
> FUNCTION: Send_Tune_Scan_Length
> uh..bad bug for scanner firmware/chipset you get the idea
> static SANE_Status
> send_tune_scan_length (Avision_Scanner* s)
> {
>    return SANE_STATUS_GOOD;
> //ajs !!!!!!!!!!!!!!!!!!!!!!
>
> ln 4549
> FUNCTION:Set_Calib_Data
> Yeah, somebody didn't test this or there are a lot of different chipset/firmwares running around labeled as Visioneer 9450.  I keep looking at the vertically striped output from color scans and it looked MOSTLY like a massive calibration error, not any other gamma/shading whatever whatever.
> TO FIX: Visioneer 9450 cannot handle the 3 channel color calibration data in one burst. Only if we are doing 1 channel calibration for gray or lineart or whatever do we send all the data in one burst.  Otherwise we stream the calibration data separately for each color channel.
>
>  memset (&scmd, 0x00, sizeof (scmd));
>  scmd.opc = AVISION_SCSI_SEND;
>  scmd.datatypecode = send_type;
> .......................................................
>  out_size = format->pixel_per_line * 2;
>
>  /* send data in one command? */
>  /* FR: HP5370 reports one-pass, but needs multi (or other format in single) */
>  if (format->channels == 1) //ajs ||
> //ajs       ( ( (dev->hw->feature_type & AV_ONE_CALIB_CMD) ||
> //ajs      ! BIT(format->ability1, 0) ) &&
> //ajs     ! (dev->hw->feature_type & AV_MULTI_CALIB_CMD) ) )
>    /* one command (most scanners) */
> ...........................................................
>  return SANE_STATUS_GOOD;
> }
>
> END "avision.c"
>
>
>
>
>
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>             to sane-devel-request at lists.alioth.debian.org
>



--
"The truth is an offense, but not a sin"







-- 
"The truth is an offense, but not a sin"



More information about the sane-devel mailing list