[sane-devel] Problem with setting Fujitsu fi-4120c to Grayscale
Peter Chen
peterchenn at hotmail.com
Fri Apr 25 21:04:53 BST 2003
Hi,
I entered SANE_DEBUG_FUJITSU=128 as a shell command (am I doing it right?)
and then I ran scanimage --duplex=both -d fujitsu:/dev/usb/scanner0 > a.pnm
and it showed me the same error messages, nothing special, besides br-x,
br-y, it only showed:
scanimage: sane_start: Invalid argument.
In my previous email, I said my sane_start() hanged, later on I found it's
because I called fopen() before I called sane_start(), now I put fopen()
after sane_start() and it works, I am not sure how to deal with it when I
add the ADF feature.
I did not try scsi. Did usb's duplex mode ever work before? If yes, what
special configuration should be done?
Under RedHat 7.1, there are some 'minor errors' but no errors under RedHat
7.2, just that sane-find-scanner showed the scanner was of unknowed type. So
I guess it does not matter.
Thanks,
Peter
----- Original Message -----
From: "m. allan noah" <anoah at pfeiffer.edu>
To: "Peter Chen" <peterchenn at hotmail.com>
Cc: "SANE Mailing List" <sane-devel at mostang.com>
Sent: Friday, April 25, 2003 2:02 PM
Subject: Re: [sane-devel] Problem with setting Fujitsu fi-4120c to Grayscale
> On Thu, 24 Apr 2003, Peter Chen wrote:
>
> > I tried scanimage with --mode=gray, and it worked fine. But I could not
do
> > it with --duplex=both. It said:
> > scanimage: sane_start: invalid argument. scanadf did not work either.
>
> ok, sounds like a driver problem. the output from setting
> SANE_DEBUG_FUJITSU=128 would be helpful.
>
> >
> > I'm using RedHat 7.2 with fi-4120c, and I feel it works fine with usb,
at
> > least now:).
>
> you tell me in one sentence that it has errors, and in the next it works
> fine? i assume what you are trying to say is that you dont want to switch
> to scsi, just to test.
>
> well, i can tell you, that on my 4120c, duplex gray scanning works just
> fine via scsi. so far, i cant get usb to run stably. it would be helpful
> if you tested on both connections.
>
> allan
>
> When I tried to use sane-find-scanner under RedHat 7.1, it gave
> > me a lot of 'minor errors', so I changed to RedHat 7.2.
> >
> > I figured out that I have to use (void *) to pass to
sane_control_option.
> > Now I can setup grayscale and adf in my application.
> >
> > Thanks a lot,
> > ----- Original Message -----
> > From: "m. allan noah" <anoah at pfeiffer.edu>
> > To: "Peter Chen" <peterchenn at hotmail.com>
> > Cc: "SANE Mailing List" <sane-devel at mostang.com>
> > Sent: Thursday, April 24, 2003 5:33 PM
> > Subject: Re: [sane-devel] Problem with setting Fujitsu fi-4120c to
Grayscale
> >
> >
> > > ok, in your prior mails it would have been helpful to explain the you
were
> > > writing an application, not just trying to use the scanner with the
> > > existing frontends.
> > >
> > > can you set the grayscale and resolution without error using
scanimage?
> > > does it work every time? if not, then it is likely a driver problem,
try
> > > it with the scsi port as well. if there is a difference, then you
might be
> > > onto something.
> > >
> > > i have just plugged my 4120c into a usb port for the first time, and i
> > > get device errors that lock scanadf hard. i should have some time to
play
> > > with it next week (finally). anything you come up with between now and
> > > then, please mail the list, so that others can see.
> > >
> > > allan
> > >
> > > On Thu, 24 Apr 2003, Peter Chen wrote:
> > >
> > > > Hi all,
> > > >
> > > > I tried to set fi-4120c to Grayscale. I used the following code
flow:
> > > >
> > > > status = sane_init(version_code, NULL);
> > > > status = sane_get_devices(&device_list, true);
> > > > ...
> > > > sane_exit();
> > > >
> > > > status = sane_init(version_code, NULL);
> > > > status = sane_open("dev/usb/scanner0", &device );
> > > > sane_control_option (device, 0, SANE_ACTION_GET_VALUE,
> > > > &num_dev_options, 0);
> > > > for (i = 0; i < num_dev_options; ++i)
> > > > {
> > > > opt = sane_get_option_descriptor (device, i);
> > > > // Set the resolutions to 300 dpi
> > > > if ( strcmp(opt->name, SANE_NAME_SCAN_X_RESOLUTION) == 0)
> > > > {
> > > > value = 300;
> > > > sane_control_option (device, i, SANE_ACTION_SET_VALUE,
&value,
> > > > &info);
> > > > }
> > > > if ( strcmp(opt->name, SANE_NAME_SCAN_Y_RESOLUTION) == 0)
> > > > {
> > > > value = 300;
> > > > sane_control_option (device, i, SANE_ACTION_SET_VALUE,
&value,
> > > > &info);
> > > > }
> > > > // Set the scan mode to GrayScale
> > > > if ( strcmp(opt->name, SANE_NAME_SCAN_MODE) == 0)
> > > > {
> > > > value = 3;
> > > > sane_control_option (device, i, SANE_ACTION_SET_VALUE,
&value,
> > > > &info);
> > > > }
> > > > }
> > > >
> > > > The first time I ran it, it successfully set fi-4120c to GrayScale
(when
> > I
> > > > debug, I could see that), but then later when I did that, it always
> > returned
> > > > SANE_STATUS_INVAL, even after I rebooted my linux box and fi-4120c.
I
> > could
> > > > set the resolutions successfully. What did I do wrong?
> > > >
> > > > Thanks,
> > > >
> > > > Peter
> > > > _______________________________________________
> > > > Sane-devel mailing list
> > > > Sane-devel at www.mostang.com
> > > > http://www.mostang.com/mailman/listinfo/sane-devel
> > > >
> > >
> > > --
> > > "so don't tell us it can't be done, putting down what you don't know.
> > > money isn't our god, integrity will free our souls" - Max Cavalera
> > >
> > >
> >
>
> --
> "so don't tell us it can't be done, putting down what you don't know.
> money isn't our god, integrity will free our souls" - Max Cavalera
>
>
More information about the sane-devel
mailing list