[sane-devel] Fwd: LIDE 60. configure scanner

Ben Green greenb1 at mac.com
Fri Apr 1 22:24:47 UTC 2011


		

Begin forwarded message:

> From: Ben Green <greenb1 at mac.com>
> Date: 1 April 2011 22:01:58 BST
> To: stef <stef.dev at free.fr>
> Subject: Re: [sane-devel] LIDE 60. configure scanner
>
>
> On 28 Mar 2011, at 20:32, stef wrote:
>
>> Le Monday 21 March 2011 22:18:26, vous avez écrit :
>>> Begin forwarded message:
>>>> From: Ben Green <greenb1 at mac.com>
>>>> Date: 21 March 2011 21:04:38 GMT
>>>> To: stef <stef.dev at free.fr>
>>>> Subject: Re: [sane-devel] LIDE 60. configure scanner
>>>>
>>>> On 20 Mar 2011, at 20:59, stef wrote:
>>>>> Le Sunday 20 March 2011 20:59:41, vous avez écrit :
>>>>>> Hello Stef,
>>>>>>
>>>>>>
>>>>>> I'm hoping you might be able to shed some light on this
>>>>>> situation.. I
>>>>>> have a large debug file attached which i've cut the data off the
>>>>>> end,
>>>>>> i'm unsure which of the rest is pertinent.
>>>>>>
>>>>>> I'm not sure if you remember but -
>>>>>>
>>>>>> I am trying to disable the calibration steps that the scanner  
>>>>>> goes
>>>>>> through before scanning as the lamp is disabled and the scanner
>>>>>> covered (except for a square aperture the centre of the scanning
>>>>>> glass
>>>>>> - far from the calibration area).
>>>>>>
>>>>>> I went (painfully slowly - with allan's patient help) through the
>>>>>> steps of adding a flag _GENESYS_FLAG_NO_CALIBRATION into the
>>>>>> backend.
>>>>>> Then rebuilding the backend and replacing the file.  
>>>>>> Unfortunately, I
>>>>>> cant seem to see if this has actually been successful. There is
>>>>>> still
>>>>>> calibration going on - so possibly not.
>>>>>>
>>>>>> Are you able to see from the debug files if anything has changed
>>>>>> from
>>>>>> the norm?
>>>>>>
>>>>>> Here's what allan got me to do...
>>>>>>
>>>>>>> 7. edit backend/genesys_devices.c file. I like vim, you can use
>>>>>>> whatever editor you want, including some icky gui thing, as long
>>>>>>> as it
>>>>>>> does not try to reformat the text.
>>>>>>>
>>>>>>> 8. around line 1573 you will see a section of data for the  
>>>>>>> lide 60.
>>>>>>> Near the end of that section, there are a bunch of flags,
>>>>>>> separated by
>>>>>>> the '|' symbol. Remove the lines with 'CALIBRATION' in them, and
>>>>>>> add
>>>>>>> one in their place that says:
>>>>>>> '| GENESYS_FLAG_NO_CALIBRATION'
>>>>>>>
>>>>>>> 9. save the file.
>>>>>>>
>>>>>>> 10. Run the following command (all on one line)
>>>>>>> BACKENDS=genesys ./configure --prefix=/usr --sysconfdir=/etc --
>>>>>>> disable-locking
>>>>>>>
>>>>>>> 11. Run the following command (takes awhile)
>>>>>>> make
>>>>>>>
>>>>>>> 12. copy the file backend/.libs/libsane-genesys.so.1.0.23 over
>>>>>>> top of
>>>>>>> the copy provided by your distro, not sure where it is on a Mac.
>>>>>>> Probably in /usr/local/lib?
>>>>>>> Note that the file name will change- your current file might  
>>>>>>> end in
>>>>>>> .21 or .22, that's fine. We want the new one to have the same
>>>>>>> name. We
>>>>>>> are replacing the old file. You can save the old one before you
>>>>>>> overwrite it if you want.
>>>>>>
>>>>>> I think after this there was some different file names generated,
>>>>>> but
>>>>>> we ended up using
>>>>>>
>>>>>>> greenb1:.libs greenb1$ file libsane-genesys.so
>>>>>>
>>>>>> to replace the genesys section.
>>>>>>
>>>>>> As I mentioned, when the lamp is disabled and the scanner is  
>>>>>> covered
>>>>>> the driver is flagging up -no light - document jam-. (see below)
>>>>>>
>>>>>> I have included two de-bug scans - one error scan - when the
>>>>>>
>>>>>> scanner
>>>>>> was covered and one scan where there is enough ambient light to
>>>>>> allow
>>>>>> the scanner to calibrate. Can you tell me where i've gone wrong?
>>>>>>
>>>>>> Any advice you can give is greatly appreciated -- unfortunately  
>>>>>> my
>>>>>> programming knowledge is 1000% better than it was a month ago and
>>>>>> yet
>>>>>> still woefully inadequate to get anywhere with this..
>>>>>>
>>>>>> Many Thanks
>>>>>>
>>>>>>
>>>>>> Ben
>>>>>>
>>>>>> Begin forwarded message:
>>>>>>> From: "m. allan noah" <kitno455 at gmail.com>
>>>>>>> Date: 19 March 2011 13:37:38 GMT
>>>>>>> To: Ben Green <greenb1 at mac.com>
>>>>>>> Subject: Re: [sane-devel] LIDE 60. configure scanner
>>>>>>>
>>>>>>> honestly, you'd have to get input from stef on this, as it's his
>>>>>>> code.
>>>>>>> you might consider sending text attachments, instead of rtf.
>>>>>>>
>>>>>>> allan
>>>>>>>
>>>>>>> On Sat, Mar 19, 2011 at 8:53 AM, Ben Green <greenb1 at mac.com>  
>>>>>>> wrote:
>>>>>>>> Hi Allan,
>>>>>>>> I'm still hammering away at this scanner. I think I'm getting
>>>>>>>> somewhere,
>>>>>>>> however I am afraid I have not killed off that calibration
>>>>>>>> completely yet.
>>>>>>>> Basically, the scanner is still going through some initial  
>>>>>>>> short
>>>>>>>> test sweeps
>>>>>>>> to set the light levels. This might not be such a problem,  
>>>>>>>> however
>>>>>>>> the
>>>>>>>> scanner now has its light disabled and will eventually be  
>>>>>>>> covered
>>>>>>>> and sealed
>>>>>>>> in darkness with the only open area being a 5" square in the
>>>>>>>> middle
>>>>>>>> of the
>>>>>>>> scanning plate.
>>>>>>>> At the moment if I cover the calibration area when scanning,  
>>>>>>>> I get
>>>>>>>> the
>>>>>>>> following message..
>>>>>>>> scanimage > foo.png
>>>>>>>> [genesys_gl841] **********************************************
>>>>>>>> [genesys_gl841] **********************************************
>>>>>>>> [genesys_gl841] ****                                      ****
>>>>>>>> [genesys_gl841] ****  Extremely low Brightness detected.  ****
>>>>>>>> [genesys_gl841] ****  Check the scanning head is          ****
>>>>>>>> [genesys_gl841] ****  unlocked and moving.                ****
>>>>>>>> [genesys_gl841] ****                                      ****
>>>>>>>> [genesys_gl841] **********************************************
>>>>>>>> [genesys_gl841] **********************************************
>>>>>>>> scanimage: sane_start: Document feeder jammed
>>>>>>>> greenb1:~ greenb1$
>>>>>>>> Which stops the scan all together, so that's one bit of
>>>>>>>> calibration
>>>>>>>> I need
>>>>>>>> to override. I can still scan successfully with the cover off
>>>>>>>> (some
>>>>>>>> ambient
>>>>>>>> light hits the scan head initially).
>>>>>>>>
>>>>>>>> But also in the debug info, I can still see quite a bit of
>>>>>>>>
>>>>>>>> calibrating and
>>>>>>>> shading going on. I can now see "[genesys] Calibration: Cannot
>>>>>>>> open
>>>>>>>> /Users/greenb1/.sane/canon-lide-60.cal"  so perhaps that's a  
>>>>>>>> good
>>>>>>>> start?
>>>>>>>>
>>>>>>>> I'm hoping that you might be able to see whether our
>>>>>>>>
>>>>>>>> _GENESYS_FLAG_NO_CALIBRATION edits in the backend were
>>>>>>>> successful?,
>>>>>>>> or did I
>>>>>>>> screw up the compiling part?
>>>>>>>> If the GENESYS_FLAG_NO_CALIBRATION did work, then it looks  
>>>>>>>> like I
>>>>>>>> need to
>>>>>>>> dig further to remove these calibration steps. But perhaps it's
>>>>>>>> just not
>>>>>>>> compiled properly or I am still using the old backend somehow.
>>>>>>>> I have included the debug info from a normal (open top) scan as
>>>>>>>> well as the
>>>>>>>> error (document jam) scan with the cover over the calibration
>>>>>>>> area.
>>>>>>>> Any Ideas?
>>>>>>>> also - just so I can get a handle on what the scanner is  
>>>>>>>> doing, I
>>>>>>>> assume the
>>>>>>>> slope tables are something about setting the motor speed to
>>>>>>>> match the
>>>>>>>> sampling rate. Is this correct? - is it a problem that I can  
>>>>>>>> see
>>>>>>>> "
>>>>>>>> [genesys] sanei_genesys_generate_slope_table: target slope:
>>>>>>>> vstart:
>>>>>>>> 3500,
>>>>>>>> vend: 1300, steps: 60, g: 0.8
>>>>>>>> [genesys] Can not reach target speed(1300) in 1 steps.
>>>>>>>> [genesys] Expect image to be distorted. Ignore this if only
>>>>>>>> feeding."
>>>>>>>>
>>>>>>>>
>>>>>>>> Many Thanks for your advice,
>>>>>>>> best
>>>>>>>> Ben
>>>>> 	
>>>>> 	Hello,
>>>>> 	
>>>>> 	I think the no calibration file hasn't been applied like you'd  
>>>>> need.
>>>>>
>>>>> There should be no coarse calibration in this case. Try to apply
>>>>> the same
>>>>> flags than the one from 'static Genesys_Model hpg4010_model = {'  
>>>>> in
>>>>> genesys_devices.c to the canon_lide60 entry.
>>>>>
>>>>> Regards,
>>>>>
>>>>> 	Stef
>>>>
>>>> Hello Stef,
>>>>
>>>> I have tried a number of different ways to implement the 4010 flags
>>>> into the lide60 entry. I'm unsure of the syntax however. The 4010
>>>> has a FLAG_NO_CALIBRATION entry before the FLAG_LAZY_INIT. Also,  
>>>> the
>>>> "|" lines (which i assume are important!) are all typed after the
>>>> flag entries whereas they are included before in the Lide60 flags -
>>>> is it important where they are? anyway - regardless, for the few
>>>> attempts of different syntaxes that I've compiled - the scanner is
>>>> no longer recognized after i load the libsane-genesys.so into usr/
>>>> local/lib/sane/libsane-genesys.1.0.21.so.
>>>>
>>>> I am now going to try just adding the FLAG_NO_CALIBRATION at the  
>>>> top
>>>> of the flag list and remove the two calibration lines.. I'll let  
>>>> you
>>>> know how that goes.
>>>>
>>>> Do you have any suggestions as to where i'm going wrong?
>>>>
>>>> Many Thanks
>>>>
>>>>
>>>> Ben
>>>>
>>>> The 4010 entry is laid out as follows.
>>>>
>>>>> MOTOR_G4050,
>>>>>
>>>>> GENESYS_FLAG_NO_CALIBRATION |
>>>>> GENESYS_FLAG_LAZY_INIT |      /* Which flags are needed for this
>>>>>
>>>>> scanner? */
>>>>>
>>>>> GENESYS_FLAG_SKIP_WARMUP |
>>>>> GENESYS_FLAG_OFFSET_CALIBRATION |
>>>>> GENESYS_FLAG_CUSTOM_GAMMA,
>>>>> GENESYS_HAS_SCAN_SW | GENESYS_HAS_FILE_SW | GENESYS_HAS_COPY_SW,
>>>>> 280,
>>>>> 400
>>>>>
>>>>> };
>>>>
>>>> The original LIDE60 entry is laid out as follows
>>>>
>>>>> MOTOR_CANONLIDE35,
>>>>>
>>>>> GENESYS_FLAG_LAZY_INIT        /* Which flags are needed for this
>>>>>
>>>>> scanner? */
>>>>>
>>>>>   | GENESYS_FLAG_SKIP_WARMUP
>>>>>   | GENESYS_FLAG_OFFSET_CALIBRATION
>>>>>   | GENESYS_FLAG_DARK_WHITE_CALIBRATION
>>>>>   | GENESYS_FLAG_CUSTOM_GAMMA
>>>>>   | GENESYS_FLAG_HALF_CCD_MODE,
>>>>>
>>>>> GENESYS_HAS_NO_BUTTONS, /* no buttons supported */
>>>>> 300,
>>>>> 400
>>>>>
>>>>> };                              /* this is completely untested --
>>>>> hmg */
>>>>
>>>> I originally changed this to the following - this version does
>>>> compile successfully but still operates as normal including
>>>> calibration
>>>>
>>>>> MOTOR_CANONLIDE35,
>>>>> GENESYS_FLAG_LAZY_INIT        /* Which flags are needed for this
>>>>>
>>>>> scanner? */
>>>>>
>>>>>   | GENESYS_FLAG_SKIP_WARMUP
>>>>>   | GENESYS_FLAG_NO_CALIBRATION
>>>>>   | GENESYS_FLAG_NO_CALIBRATION
>>>>>   | GENESYS_FLAG_CUSTOM_GAMMA
>>>>>   | GENESYS_FLAG_HALF_CCD_MODE,
>>>>>
>>>>> GENESYS_HAS_NO_BUTTONS, /* no buttons supported */
>>>>> 300,
>>>>> 400
>>>>>
>>>>> };
>>>
>>> Hi Stef,
>>>
>>> That was not successful. The scanner is still recognized but the
>>> calibration has not been stopped.
>>>
>>>  GENESYS_FLAG_NO_CALIBRATION |
>>>  GENESYS_FLAG_LAZY_INIT        /* Which flags are needed for this
>>> scanner? */
>>>
>>>    | GENESYS_FLAG_SKIP_WARMUP
>>>    | GENESYS_FLAG_NO_CALIBRATION
>>>    | GENESYS_FLAG_NO_CALIBRATION
>>>    | GENESYS_FLAG_CUSTOM_GAMMA
>>>    | GENESYS_FLAG_HALF_CCD_MODE,
>>>
>>>  GENESYS_HAS_NO_BUTTONS, /* no buttons supported */
>>>  300,
>>>  400
>>> };
>>>
>>> any ideas?
>>>
>>>
>>> Thanks very much,
>>>
>>>
>>> Ben
>> 	Hello,
>>
>> 	that's strange. Maybe adding a debug trace would make you sure you  
>> are
>> running the modified version. You can also replace the whole
>> gl841_coarse_gain_calibration() function with a mere return  
>> SANE_STATUS_GOOD;
>> to bypass gain calibration.
>>
>> Regards,
>> 	Stef
>> 	
>
>
>
> Hi Stef,
>
> Welcome back -
>
> I have included a debug file attached as suggested.
> Are you able to see if it is running my modified backend?
> I have no idea from reading this code?? but i do see attempts at  
> calibration.
>
>
>> You can also replace the whole
>> gl841_coarse_gain_calibration() function with a mere return  
>> SANE_STATUS_GOOD;
>> to bypass gain calibration.
>
> is this command inside the genesys_devices.c file?
>
> thanks for your advice,
>
> ben
>
ADDED:

Hello Stef,

found the genesys_gl841.c file and the course calibration section..
  removed the calibration section and added the return  
SANE_STATUS_GOOD..
rebuilt the backend using the two following two commands..

	- BACKENDS=genesys ./configure --prefix=/usr --sysconfdir=/etc -- 
disable-locking
	
	- make

Unfortunately after this point, I cannot identify which file I need to  
copy across into the /usr.. and which file it should replace? Can you  
help with this?

Previously Allan helped me find the following repacement:
sudo cp ~/downloads/sane-backends-git20110321/backend/.libs/libsane- 
genesys.so /usr/local/lib/sane/libsane-genesys.1.0.21
but i assume this was particular to the genesys_devices.c file --

anyway I hope you can help,

best


ben







>
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20110401/04dee291/attachment-0001.htm>


More information about the sane-devel mailing list