[sane-devel] Backend for plustek Opticbook 3600

2010-12-17 Thread Chris Berry
Hey stef,

I see things seem to be progressing well with the lide 110, good times! 
I have recently had a problem with the account I set up the mailing list 
with so I have added this account instead. I doubt there will have been 
any progress on the plustek drivers, but as I've missed some of the 
emails I wanted to check in with you. Any updates?

Chris



[sane-devel] Backend for plustek Opticbook 3600

2010-12-06 Thread Chris Berry

 Chris, please go ahead. I think you could remove some of my Chris 
 why comments where you know. Should the scanner be added also to the 
 genesys.conf 
Definitely here
 and libsane.rules files?
I have never entered in this file, what was the reason behind adding to 
it? Or at least what does it do?

Thanks for the support you have given here, I think we can realistically 
look at getting this committed within a fortnight, not sure when the 
next official release is, hopefully it is scheduled for entry into 
Fedora 15, im sure their feature freeze is a while off.

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-12-06 Thread Chris Berry
Thanks Stef, a week is no problem for me, i'm pretty busy at work at the 
minute so a weeks time might work out best for all of us.

Chris

On 06/12/10 19:53, stef wrote:
 Le Monday 06 December 2010 15:54:44 Chris Berry, vous avez ?crit :

 Chris, please go ahead. I think you could remove some of my Chris
 why comments where you know. Should the scanner be added also to the
 genesys.conf

 Definitely here

  
 and libsane.rules files?

 I have never entered in this file, what was the reason behind adding to
 it? Or at least what does it do?

 Thanks for the support you have given here, I think we can realistically
 look at getting this committed within a fortnight, not sure when the
 next official release is, hopefully it is scheduled for entry into
 Fedora 15, im sure their feature freeze is a while off.

 Chris
  
   Hello,

   the mail was sitting in my inbox. I am quite busy currently finishing
 LiDE 110 support, and I planned to review it thoroughly in about a week. Is it
 OK ?

 Regards,
   Stef



-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20101206/e7ce502d/attachment.htm
-- next part --
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20101206/e7ce502d/attachment.asc


[sane-devel] Backend for plustek Opticbook 3600

2010-12-06 Thread Chris Berry
Cheers Allan, Stef said hes gonna give the code a thorough look through 
in a week or so, should be plenty of time for the next release if it is 
around your proposed time.

Thanks

Chris

On 06/12/10 15:08, m. allan noah wrote:
 On Mon, Dec 6, 2010 at 9:54 AM, Chris Berrys0457957 at sms.ed.ac.uk  wrote:

 Chris, please go ahead. I think you could remove some of my Chris why
 comments where you know. Should the scanner be added also to the
 genesys.conf

 Definitely here
  
 and libsane.rules files?

 I have never entered in this file, what was the reason behind adding to it?
 Or at least what does it do?
  

 It controls udev permissions. These files (and their hal/policyKit/et
 al equivalents) are generated from the backends .desc file.


 Thanks for the support you have given here, I think we can realistically
 look at getting this committed within a fortnight, not sure when the next
 official release is, hopefully it is scheduled for entry into Fedora 15, im
 sure their feature freeze is a while off.
  

 We'll leave it to the authors of the existing backend to OK the code
 changes. I'm leaning toward doing the next release at the end of
 January, I'll post a proposed timeline shortly.

 allan


-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20101206/ba1c3abf/attachment-0001.htm
-- next part --
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20101206/ba1c3abf/attachment-0001.asc


[sane-devel] Backend for plustek Opticbook 3600

2010-03-30 Thread Chris Berry
Hi Stef, I take it that you have now received my preliminary copy of my 
report. I will send you a completed copy when I am done.

I have a question about the image scans at 1200+ dpi. When attempting 
scans at these resolutions I only get half an image. A little 
investigation has led me to find that the max dpi register is set to 
1200 (from windows driver) BUT i still get half an image when half_ccd 
is set to true *and* false when i do a scan.

As I am very close to handing in my report any information you can give 
me would be helpful if I can include it :)

Thanks again for all the help you have given me with this, i definitely 
owe you a beer or two :)

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Next release update

2010-03-22 Thread Chris Berry
I know this was discussed about 6 weeks ago but is there any update on 
when the next SANE release will be? Would be nice to know a rough date 
or at least if progress is being made

Thanks

Chris



[sane-devel] Backend for plustek Opticbook 3600

2010-03-22 Thread Chris Berry
stef wrote:
 Le lundi 22 mars 2010 07:26:23 Chris Berry, vous avez ?crit :
   
 Hi guys, I have included a patch for the plustek 3600. It isnt quite
 there yet but at least you can apply it to the current development
 version and should be able to test (for those of you with the scanner)
 to see how it goes at this stage.

 I have also included Pierre and Stef on this if they would like to have
 a look at the revisions i have made in order to add support for this
 scanner.

 Thanks for your help with this project

 Chris

 
   Hello,

   it'll take me some days to review correctly. I'll let you know by the 
 end of 
 this week.

 Regards,
   Stef

   
Cheers Stef, I tried scanning at 600dpi (which is highest available on 
plustek application) so I thought that was full sensor resolution and it 
resulted in no difference of the strange colours. I entered a custom 
size into the windows version of the driver (tried 1200dpi and 2400dpi) 
and both work but im not sure if that is hardware or software 
interpolated so I dunno what the max resolution is for this. I tried 
1200 dpi with the sane driver and got a half image (like it needs half 
ccd but it is enabled).  Either way I have made no head way with 
correcting the shading.

Any ideas what im doing wrong?

Thanks

Chris



[sane-devel] Plustek OpticPro S28

2010-03-21 Thread Chris Berry

 Le jeudi 18 mars 2010 07:21:10 Yevgeny Gromov, vous avez ?crit :
   
 Hi everyone!
 In archive I've read that some years ago someone have developed backend for
 Plustek OpticPro S28 based on GL841.
 Is there any alpha support for this scanner or should I write modification
  of sane-genesys based on different GL841 models?



 --
 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

 
   Hello,

   I think the latter is the best option for you. All the mails about the 
 OpticBook 3600 development will give you many interesting information on how 
 to do it.

 Regards,
   Stef
Hi Yevgeny,

I have been developing support for the opticbook 3600 with the help of 
stef so if  you would like any information I will do my best to help 
you, hopefully some of the difficulties I faced will be of benefit to you.

If you are looking for advice on how to start the first thing you need 
to do is get USB snooping software and some scripts to decode it (I have 
a copy of some scripts from stef but if you ask him nicely he may have 
newer versions :) ). USB snoops will show the traffic between the 
scanner and the computer, after the captured snoop has been parsed by 
the script files a lof of vital information will be available.

Good luck and if you would like more information on the 3600 for 
comparison the project site is here: http://sites.google.com/site/bez625/

Chris



[sane-devel] Backend for plustek Opticbook 3600

2010-03-21 Thread Chris Berry
stef wrote:
   Hello,

   for the image quality, I think you could concentrate on on full sensor 
 resolution and 'half ccd' resolution. 
I'm not sure what you mean but I guess full resolution is the maximum 
hardware resolution of the scanner? If so then what is 'half ccd' 
resolution?

 In these modes AVEENB is of no influence 
 since no averaging or deletion occurs. Then you can adjust the offset to be 
 used for shading data. To find the correct offset some trial and error is 
 needed. You'll have to change it's value until bright vertical lines match 
 the 
 closest dark vertical line in scans (you could scan only the white cover of 
 the scanner, lines are more visible). You may try first the offset values 
 from 
 other GL841 scanners. 
   
So I just do scans at full resolution of the white background and alter 
the shading offset until it evens out? Should be no problem
   Once done, you may choose to keep averaging, but in this case you'll 
 have to 
 tune compute_coefficients to do the same averaging than the planar method 
 used 
 for the CCD_CANONLIDE35.

   
Is this method you are talking about the large function added under 
canonlide35 in the send_shading_coefficients? If so I will try if i get 
time but as my hand in date is coming up I may not get time...

 Regards,
   Stef

   
I should have the patch sent out to you by the end of the day, i'll 
include pierre, you and the people who also have the scanner for a bit 
of testing.

Also does this mean I can add my name to the developer list at the top 
of the genesys files :)  ?

Thanks

Chris



[sane-devel] Backend for plustek Opticbook 3600

2010-03-18 Thread Chris Berry

   Hello,

   in order to properly review the result of your hard work, we need the 
 changes
 you done as patches. Either against the version you started to modify, or as a
 git patchset against latest version, which is the best solution. On your site,
 I only found the full sources, may you have a look into it ?

 Regards,
   Stef

   


Ok Stef I will hopefully have a patch to you by the end of the weekend. 
Looking through the git changes and such I really feel the best thing 
for me to do is get the latest version, start over adding things back in 
from my current version and then I can have one commit of just my 
changes and not any other rubbish (white space etc).

As for the quality of the scans is there anything you can advise on 
maybe what I need to do to improve it? I have been a ill this week and 
had other things to work on but after tomorrow i'm back on this project 
full time (there is about a week left until I hand in my written report 
so hopefully I can get some testing done next week to include in the 
report).

Thanks

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-03-16 Thread Chris Berry
On 03/09/2010 05:15 AM, stef wrote:
 Le lundi 8 mars 2010 17:20:23 Chris Berry, vous avez ?crit :

 Ok Stef I have a bit more time to concentrate on this at the minute. I
 have updated the white_shading.pnm and included it at
 http://sites.google.com/site/bez625/updates-1/update080310 there is also
 a copy of the latest scan there too. I only have 20 shading lines in the
 shading area because there is a lot of blue in that area. Should I widen
 it (more shading lines) or should those blue areas be included?

 Also how do I disable the averaging? Is it a software thing or is it on
 one of the registers? I'm also not too sure what you mean about the
 offset, is it the DAC offset?

 Thanks

 Chris

  
   Hello,

   the white shading picture must be all white. The picture you posted is 
 mostly
 OK, but there is still some blue on the right. This is not a blocker, but it
 will certainly have to be fixed to reach best image quality.
   By averaging, I was thinking of the AVEENB bit of register 3 which 
 tells the
 ASIC to delete extra data points or average them to produce data from higher
 dpi.

 Regards,
   Stef
   


Hey guys,

I have experimented with disabling average and altering the offset as 
Stef suggested. Disabling averaging seems to make things worse (dark and 
light lines where solid colour appears with AVEENB) and changing the 
offset seems to make no real difference so i'm not sure what is 
happening. Also I am unsure about what target code I should use for the 
shading compute_coefficients (assumed 0xdc00 as it seems popular).

At the project site (update ) there are a few images in a bzip file to 
show what I mean about toggling the AVEENB. It certainly seems better to 
have it on but this might just be misleading images.

The main issue now seems to be the different coloured vertical lines 
down the document. In addition I performed higer dpi scans (300, 600) 
and the whole image seems darker and the vertical lines are more 
prominent, i cant say im entirely sure whats causing them but im 
guessing its the shading function.

I have also attached my source on the project update if this will make 
it easier to advise on what im doing wrong. I will get around to tidying 
up my code soon so i can commit to git without it looking messy. Has 
there been anymore information about a next release date? I have been 
skimming the mailing list and not seen anything mentioned.

Thanks

Chris
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20100316/a35b0887/attachment.htm
-- next part --
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20100316/a35b0887/attachment.asc


[sane-devel] Backend for plustek Opticbook 3600

2010-03-04 Thread Chris Berry
On 03/03/2010 06:03 AM, stef wrote:
 Le mardi 2 mars 2010 16:40:21 Chris Berry, vous avez ?crit :

 Hey guys, I resolved the issue I was having with the dark_shading
 calibration. The lamp was turning off fine but the | REG03_LAMPPWR in
 gl842_begin_scan was turning the light back on for the scan :/ . Having
 resolved this there is still a black line down the center of the page.
 The black_shading.pnm file is now completely black and the
 white_shading.pnm file is mostly white with some dark edges.

 Any thoughts on how I sort this out now? Is it related to the number of
 sensor pixels or the shading area or something?

 Chris

  
   Hello,

   the black patterns are often used to detect the exact geometry of the
 scanner. What is reliable is these black/white areas, while the casing may
 vary. For instance the HP2400/HP2300 and HP3670 have a black corner which is
 aligned on the exact vertical margin of the visible scan area.So the 
 dark
 edges may be harmless if they are outside the effective scan area used for
 final scan.
   For the big black vertical line (which is a third of the width of the
 picture), it seems that shading coefficients sent aren't send in the correct
 format. It's hard to tell without the code, but the results looks like
 'planar' format (for CIS) was used when 'chunky' format (for CCD) was needed.
 Surely an issue in the genesys_send_shading_coefficient() where
 compute_coefficient() is for chunky, compute_planar_coefficient() is for
 planar and the CCD_CANONLIDE35 case looks for the planar case to me. Pierre
 may confirm this last point.

 Regards,
   Stef
   


Ok thanks guys, this seems to have done the trick! There is now a black 
line down one side of the page (not sure if that is supposed to be there 
or not) and the colours seem to be a bit grainy. I have attached photos 
to the site page 
(http://sites.google.com/site/bez625/updates-1/update040310), these show 
the shading calibration and the latest current scan.

If possible could you take a look and advise on how to sort out the 
grainy parts of colour, im completely unsure myself :)

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-03-02 Thread Chris Berry
Hey guys, I resolved the issue I was having with the dark_shading 
calibration. The lamp was turning off fine but the | REG03_LAMPPWR in 
gl842_begin_scan was turning the light back on for the scan :/ . Having 
resolved this there is still a black line down the center of the page. 
The black_shading.pnm file is now completely black and the 
white_shading.pnm file is mostly white with some dark edges.

Any thoughts on how I sort this out now? Is it related to the number of 
sensor pixels or the shading area or something?

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-02-24 Thread Chris Berry
Hey Stef,

I think I have sorted out the white shading data but the black is still 
a mystery. I have uploaded some files to the project site (here 
http://sites.google.com/site/bez625/updates-1/update240210 ) these are 
at shading lines set to 400 but for the scan to work even a little bit I 
needed to change the lines to 20 (this removes the light blue lines at 
the bottom of the white_shading.pnm).

As you will be able to see the black_shading400.pnm is all white, I have 
no idea how to alter this. You can see from the white_shading400.pnm the 
full calibration area so I am at a loss really. Have you encountered 
this problem before?

Thanks

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-02-24 Thread Chris Berry
On 02/24/2010 10:33 AM, Pierre Willenbrock wrote:
 stef schrieb:

 Le mercredi 24 f?vrier 2010 03:00:16 Chris Berry, vous avez ?crit :
  
 Hey Stef,

 I think I have sorted out the white shading data but the black is still
 a mystery. I have uploaded some files to the project site (here
 http://sites.google.com/site/bez625/updates-1/update240210 ) these are
 at shading lines set to 400 but for the scan to work even a little bit I
 needed to change the lines to 20 (this removes the light blue lines at
 the bottom of the white_shading.pnm).

 As you will be able to see the black_shading400.pnm is all white, I have
 no idea how to alter this. You can see from the white_shading400.pnm the
 full calibration area so I am at a loss really. Have you encountered
 this problem before?

 Thanks

 Chris


  Hello,

  judging from the 2 pictures, there is no black area to scan. You should 
 then
 rather use the GENESYS_FLAG_DARK_WHITE_CALIBRATION (like the lide 35) flag
 instead of GENESYS_FLAG_DARK_CALIBRATION. The shading data will be taken from
 an all white area and black data will be inferred from the small black areas
 still in the picture.
  
  
 GENESYS_FLAG_DARK_WHITE_CALIBRATION is just a way to scan the black and
 white strip in one go. Chris, you should try to figure out if the
 backend goes through genesys_dark_shading_calibration with
 GENESYS_FLAG_DARK_CALIBRATION, and if so, why the lamp does not switch off.

 Regards,
Pierre


Hi Pierre / Stef,

I was wondering the same thing but the lamp does indeed go off. I'm not 
sure why the scan is so light, I had no idea which area it was scanning 
from I have been playing with the dark_white calibration and i seem 
to be getting somewhere, here ( 
http://sites.google.com/site/bez625/updates-1/update240210lateron ) are 
some scans.

Should I abandon the work with DARK_WHITE and see if I can fix the issue 
with DARK_CALIBRATION?

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-02-23 Thread Chris Berry
stef wrote:
 Le lundi 22 f?vrier 2010 15:09:11, vous avez ?crit :
   
 On 02/22/2010 06:43 AM, stef wrote:
 
 Le lundi 22 f?vrier 2010 02:09:14 Chris Berry, vous avez ?crit :
   
 ...
   
 Hey Stef,

 Thanks for the awk script, helped a lot. I put the values into a
 spreadsheet and got gamma values all around 1.0 so I didnt really need
 to alter them at all, but it gives me something to talk about in my
 report :). I have tweaked the gain and offset (offset is largely ignored
 for AD type frontend it seems so I added a similar AD_OFFSET_CALIB
 function to gl841) and now the picture seems right with the original
 shading issues.

 So now I need to alter the shading as the shading files are still
 showing really odd things. How do I adjust these? I imagine I need to
 find the calibration area in some way but im not sure how I do this?

 After the shading is corrected I think I should be ready to test, is
 there any formal testing procedure with SANE? There are a couple of
 people who are awaiting this scanner backend and have agreed to help
 testing so I will get it to them in some way. Im also going to sort my
 patch out and get rid of any whitespace or other rubbish ;)

 Cheers

 Chris

 
   Hello,

   The shading calibration area is 'under the roof', it is located inside 
 the 
 scanner. You can have a picture of it by doing a scan after setting physical 
 y 
 offset to 0. ie you scan from parking position.
   
Sorry I wasnt very clear with this, I know where the shading area is I 
just dont know how to alter where the backend reads the shading data 
from. At first I thought it was in the genesys_device struct in the 
white strip/ black mark section but that seem to make no affect.

Hopefully I can fix this by tomorrow and start testing

Chris



[sane-devel] Backend for plustek Opticbook 3600

2010-02-22 Thread Chris Berry
Hey Stef,

I think I have isolated the gamma tables from the logs but there is a 
significant difference; the gamma tables all seem to be sent at once to 
the scanner. Regs 0x5b and 0x5c are both set to 0x00 and 1536 bytes are 
sent to the scanner. I have attached the log file appearances of the 
gamma tables to this email, there are five occurrences in my log file so 
all sets are here. I have split them up myself into three blocks but in 
the original snoop they all appear together.

Will I need to modify the code base to account for all the gamma tables 
being sent at once?

Thanks

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

-- next part --
An embedded and charset-unspecified text was scrubbed...
Name: gammatables.log
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20100222/32d80fc2/attachment-0001.asc


[sane-devel] Backend for plustek Opticbook 3600

2010-02-22 Thread Chris Berry
On 02/22/2010 06:43 AM, stef wrote:
 Le lundi 22 f?vrier 2010 02:09:14 Chris Berry, vous avez ?crit :

 Hey Stef,

 I think I have isolated the gamma tables from the logs but there is a
 significant difference; the gamma tables all seem to be sent at once to
 the scanner. Regs 0x5b and 0x5c are both set to 0x00 and 1536 bytes are
 sent to the scanner. I have attached the log file appearances of the
 gamma tables to this email, there are five occurrences in my log file so
 all sets are here. I have split them up myself into three blocks but in
 the original snoop they all appear together.

 Will I need to modify the code base to account for all the gamma tables
 being sent at once?

 Thanks

 Chris

  
   Hello,

   no need to modify the backend. Both way of writing data give the same 
 result.
 Since all 3 curves are the same, you can pick one (from the '1' write, others
 are simple ramps) and turn it into a list of 256 16 bits words. You can then
 import it in a spreadsheet.
   You may use this kind of awk script on a 1 line file with all the hex 
 values:
 {
   for(i=1;iNF;i+=2)
   {
   print strtonum($i)+256*strtonum($(i+1))
   }
 }

 Regards,
   Stef


Hey Stef,

Thanks for the awk script, helped a lot. I put the values into a 
spreadsheet and got gamma values all around 1.0 so I didnt really need 
to alter them at all, but it gives me something to talk about in my 
report :). I have tweaked the gain and offset (offset is largely ignored 
for AD type frontend it seems so I added a similar AD_OFFSET_CALIB 
function to gl841) and now the picture seems right with the original 
shading issues.

So now I need to alter the shading as the shading files are still 
showing really odd things. How do I adjust these? I imagine I need to 
find the calibration area in some way but im not sure how I do this?

After the shading is corrected I think I should be ready to test, is 
there any formal testing procedure with SANE? There are a couple of 
people who are awaiting this scanner backend and have agreed to help 
testing so I will get it to them in some way. Im also going to sort my 
patch out and get rid of any whitespace or other rubbish ;)

Cheers

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-02-20 Thread Chris Berry
On 02/12/2010 08:47 AM, stef wrote:
 Le jeudi 11 f?vrier 2010 19:50:25, vous avez ?crit :

 Hello,

 I am facing the same issues than you while adding support for the
 HP3670. I eventually found that one of my decoding script was buggy and
 hide most of AFE accesses. I have appended the fixed version. By decoding
 usbsnoop again, you may find more AFE writes to be coded in backend. That
 may fix the red tint issue you have. I wouldn't be surprised if only
 write to red gain was showing in decoded log, leaving other channels
 untouched.

 Ok I have decoded another log file using this revision, you are correct
 there are many more writes to the fe showing up but they do not really
 mean anything more to me :(. I have attached the fe_writes.log file,
 which is just a straight grep of the fe writes with the new decoded log
 file. If you could look at it and tell me what you think is happening,
 the only reasonable things I can gather is that there are:

 * init style writes (0x00 -  0x70, 0x01 -  0x80, everything else -  0x00)
 * possible offset settings (0x05-0x07 seem to be set to 0x80 and 0xff
 repeatedly)
 * offset (0x05-0x07) and gain (0x02-0x04) seem to be set arbitrarily at
 various times.

 I'm not sure if any of this is relevant but whenever I set the
 offset/gain values in genesys_devices they seem to make little (if any)
 difference to the scans.

  
 You'll also have to look at the base gamma coefficient in the
 Genesys_Sensor entry for your model.

 I've had a look at this and I take it you mean this section:
 float red_gamma;
 float green_gamma;
 float blue_gamma;
 uint16_t *red_gamma_table;
 uint16_t *green_gamma_table;
 uint16_t *blue_gamma_table;

 I've tried changing the floats but there doesn't seem to be much
 difference, maybe I should wait until I fix the shading issue then tweak
 this?

 I assume the gamma_table entries are just initialisers for the tables.

  
 When doing a calibrated scan, the REG01_DVDSET bit is set to activate
 shading calibration. Clearing it may side step issues with shading
 calibration, but defeat the purpose of calibration.

 I was slightly worried that's what I had done here, i've restored it to
 the original values :P

  
 When tuning shading calibration, you must
 look at the black/white_shading.pnm and black/white_average pnm files
 that are written when full debug is enabled. With proper offset and gain
 values, you must have a full black picture (with some values slightly
 above 0) and a full white one. If not, the computed shading calibration
 coefficient will be bogus and you'll get black scans.

 Regards,
 Ste

 Ok i've also attached the black/white_shading/average files. If I
 understood you correctly the black_shading.pnm should be all white and
 not the pretty purple colour it is now and conversely the white should
 not look as it does. I have tried altering the offset and gain in
 gen_devices but this doesnt seem to do anything :(. Any other
 suggestions about how I move forward with the shading? I think as soon
 as the shading is sorted I might be there with this project and ready to
 commit to the dev version.

 Also I currently have OFFSET_CALIBRATION and DARK_CALIBRATION flags set
 for the scanner, how do I know if I should be using these (as opposed to
 COARSE_CALIB and DARK_WHITE_CALIB)?

 Sorry I have given you quite an essay to read there but at the minute I
 have a few assignments to deal with so i'm just trying to juggle
 everything but again thanks for all the help and time you have given me.
 One other thing I wanted to ask is about a new release? I've seen a lot
 of chat on the mailing list about this but I just wondered if you knew
 any more specifics?

 I only ask because I am taking this project on as part of my University
 course and the ideal end result for me is to have the drivers present in
 a SANE stable release,so if I could do this by the next release that
 would be perfect :)

 Thanks

 Chris

  
   Hello,

   regarding the AFE writes, judging by the AD9826 data sheet the writes to
 addresses 0x02-0x04 are R, G and B gains. The interesting thing is that red
 gain value 0x32 is higher than the 2 others (0x1e). So a red tint seems
 sensible. Personally, I would try to set them all to 0x32 (preferably) or 0x1e
 and map the gain array to these addresses. The other writes at 0x05, 0x06 and
 0x07 are for offsets. For instance the sequence of AFE writes matches it, wee
 see gains set to 0 and various offsets tried. Then gains are set half range
 (0x80) and new offsets are tried. Looks like offset calibration for me. The 2
 remaining addresses are for AFE configuration.

   For shading calibration, GENESYS_FLAG_DARK_WHITE_CALIBRATION would 
 allow do
 calibrate in one pass and generate 'black' data using dark areas. To my
 opinion, GL842 scanners need really good black data to do proper shading
 calibration, so I'd recommend 

[sane-devel] Backend for plustek Opticbook 3600

2010-02-20 Thread Chris Berry

   Hello,

   regarding the gamma values you can extract the gamma tables sent to your
 scanner by the windows driver from USB logs. Put them in a spreadsheet, then
 you can insert the formula used by the genesys backend and compare the
 reference and generated curves.


I am not sure at all how to get the gamma values from the snoop. After 
looking at some parsed logs there are no references to gamma values, but 
looking in the awk files (specifically the bulk_write_register) there 
should be some parsed output for them. Maybe I am using the wrong 
version of your awk files for this?

   For gain and offset, until calibration work I have nothing else to 
 advise you
 than trial and error. But by choosing a black/white target, you may refine
 your tests. Scanned black areas should give values slightly above zero. If no
 raise the offset. Once tweaked, you can adjust gain until white areas give
 values of about 240 (0xF0).

Ok ill try this once I have the correct gamma settings.
   For the release date I can't tell. Next release should be close. When 
 your
 work should be terminated for your University course ?

 Regards,
   Stef
   


I have about 3 weeks to finish the implementation really, after that the 
sooner the better for the release :).

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-02-11 Thread Chris Berry

   Hello,

   I am facing the same issues than you while adding support for the 
 HP3670. I
 eventually found that one of my decoding script was buggy and hide most of AFE
 accesses. I have appended the fixed version. By decoding usbsnoop again, you
 may find more AFE writes to be coded in backend. That may fix the red tint
 issue you have. I wouldn't be surprised if only write to red gain was showing
 in decoded log, leaving other channels untouched.

Ok I have decoded another log file using this revision, you are correct 
there are many more writes to the fe showing up but they do not really 
mean anything more to me :(. I have attached the fe_writes.log file, 
which is just a straight grep of the fe writes with the new decoded log 
file. If you could look at it and tell me what you think is happening, 
the only reasonable things I can gather is that there are:

* init style writes (0x00 - 0x70, 0x01 - 0x80, everything else - 0x00)
* possible offset settings (0x05-0x07 seem to be set to 0x80 and 0xff 
repeatedly)
* offset (0x05-0x07) and gain (0x02-0x04) seem to be set arbitrarily at 
various times.

I'm not sure if any of this is relevant but whenever I set the 
offset/gain values in genesys_devices they seem to make little (if any) 
difference to the scans.

   You'll also have to look at the base gamma coefficient in the 
 Genesys_Sensor
 entry for your model.

I've had a look at this and I take it you mean this section:
float red_gamma;
float green_gamma;
float blue_gamma;
uint16_t *red_gamma_table;
uint16_t *green_gamma_table;
uint16_t *blue_gamma_table;

I've tried changing the floats but there doesn't seem to be much 
difference, maybe I should wait until I fix the shading issue then tweak 
this?

I assume the gamma_table entries are just initialisers for the tables.

   When doing a calibrated scan, the REG01_DVDSET bit is set to activate 
 shading
 calibration. Clearing it may side step issues with shading calibration, but
 defeat the purpose of calibration.
I was slightly worried that's what I had done here, i've restored it to 
the original values :P

 When tuning shading calibration, you must
 look at the black/white_shading.pnm and black/white_average pnm files that are
 written when full debug is enabled. With proper offset and gain values, you
 must have a full black picture (with some values slightly above 0) and a full
 white one. If not, the computed shading calibration coefficient will be bogus
 and you'll get black scans.

 Regards,
   Ste


Ok i've also attached the black/white_shading/average files. If I 
understood you correctly the black_shading.pnm should be all white and 
not the pretty purple colour it is now and conversely the white should 
not look as it does. I have tried altering the offset and gain in 
gen_devices but this doesnt seem to do anything :(. Any other 
suggestions about how I move forward with the shading? I think as soon 
as the shading is sorted I might be there with this project and ready to 
commit to the dev version.

Also I currently have OFFSET_CALIBRATION and DARK_CALIBRATION flags set 
for the scanner, how do I know if I should be using these (as opposed to 
COARSE_CALIB and DARK_WHITE_CALIB)?

Sorry I have given you quite an essay to read there but at the minute I 
have a few assignments to deal with so i'm just trying to juggle 
everything but again thanks for all the help and time you have given me. 
One other thing I wanted to ask is about a new release? I've seen a lot 
of chat on the mailing list about this but I just wondered if you knew 
any more specifics?

I only ask because I am taking this project on as part of my University 
course and the ideal end result for me is to have the drivers present in 
a SANE stable release,so if I could do this by the next release that 
would be perfect :)

Thanks

Chris


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-02-09 Thread Chris Berry
Ok so ive managed to fix the problem with the FLAG being set, the 
REG01_DVDSET part was screwing me up, so im not sure what that was 
about... More details are here 
http://sites.google.com/site/bez625/updates-1/update090210 with a new 
attachment of the scanning image.

The scans now have a red tint which is a bit weird. Im still not sure 
how i am supposed to turn the brightness up, do you think there might be 
something specialist because of the AD AFE and its not wolfson?

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-02-09 Thread Chris Berry
Yea thanks guys for all the support so far, if you are interested there 
are scans available on the project website. As soon as the 
brightness/red colour is sorted i should (hopefully) be in a position to 
release to the development. From reading the lists I think we are 
probably going to be looking at a release soon so who knows, it could be 
in the stable release before long.

Jan and Dominik, when I have a working version available would you guys 
mind helping me test it? Ill send you both out a copy as soon as its 
ready if you want.

Thanks

Chris

On 02/09/2010 05:24 PM, Jan-Benedict Glaw wrote:
 On Tue, 2010-02-09 17:05:15 +, Chris Berrys0457957 at sms.ed.ac.uk  
 wrote:

 Ok so ive managed to fix the problem with the FLAG being set, the
 REG01_DVDSET part was screwing me up, so im not sure what that was
 about... More details are here
 http://sites.google.com/site/bez625/updates-1/update090210 with a new
 attachment of the scanning image.
  
 Oh, great! Nice to see, that you managed to take the first and
 probably largest hurdle, getting an image (without looking at the
 quality.)


 The scans now have a red tint which is a bit weird. Im still not sure
 how i am supposed to turn the brightness up, do you think there might be
 something specialist because of the AD AFE and its not wolfson?
  
 I guess that'll be solved over time, at least I hope so!

 MfG, JBG




-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-02-07 Thread Chris Berry
Hey Stef, did you manage to have a look at the patch I sent you? I 
havent had much time to look at the project over the last few days so 
not much has happened, i'm still getting black scans from the scanner 
when I remove the NO_CALIBRATION flag. Have you any idea which function 
will be causing this? Im guessing its going to be something trivial but 
I havent had the time to look through the extra functions that are being 
called when the flag is removed :/ Anyways i'l update you when I know 
more and if you have any advice please let me know

Thanks

Chris



[sane-devel] Backend for plustek Opticbook 3600

2010-02-03 Thread Chris Berry
On 02/02/2010 05:29 AM, stef wrote:
 Le lundi 1 f?vrier 2010 13:52:30 Chris Berry, vous avez ?crit :

 On 01/31/2010 09:21 PM, stef wrote:
  
 Le dimanche 31 janvier 2010 20:30:58 Chris Berry, vous avez ?crit :

 Ok Stef, ignore that last email, I just got a scan! its far from perfect
 but im on the right road at least (mostly your advice ;) ). One of my
 GPIO wasnt set correctly and you were right about the bit 8 being set on
 the control reg of the AFE.

 An upload of the image is at
 http://sites.google.com/site/bez625/updates-1 . Its under Update
 31/01/10 as an attachment. Im not sure what the next step here is but
 ill have a play myself. Any pointers from here are always welcome of
course.

 Since things are progressing well I would like to know what the best
 procedure would be for adding this to the stable version of the sane
 api? I know we are a little far from this but it might be good for me to
 have an idea as this is obviously the intended outcome.

 Thanks

 Chris
  
 Hello,

 good job. 'first light' is always a gratifying moment. For future
 inclusion of your work, you might consider using a local git tree with a
 dedicated branch. So that you will be able to generate patches.

 Regards,
 Stef

 Thanks Stef, how would I go about using the git tree? I've used SVN
 before but not git so it shouldn't take long for me to wrap my head
 around it. So far I just downloaded a copy of the development version
 from git and i've been working from that copy, i'm not sure how to make
 a new branch (or even if I have permission?).

 Also have you had a chance to look at the scan and suggest what i need
 to change? Im guessing that it might be a problem with the CCD, maybe it
 thinks the ccd is larger than it is?

 Thanks again

 Chris

  
   Hello,

   once you have cloned the master branch of SANE. You can create any 
 number of
 local branches. I have a few of them, about one by backend I touch. The few
 commands I use are:
 git branch to create or list branches
 git pull [--rebase] to get latest version
 git rebase to rebase a branch on lastest version
 git merge to merge a branch on master version
 git format-patch to generate patches from my local history
 git am to apply patches generated by by format patch
   You can do all these locally without write access to SANE's git tree. 
 At some
 point, you'll need it. Then you'll have to ask for an account on alioth and a
 project administrator will add you to the project.

   I have looked at the picture. What we see might relates to 'half ccd' 
 mode.
 It is a mode where coordinates on the CCD are expressed in a resolution, but
 the timings are such that effective resolution is only the half. See flag
 GENESYS_FLAG_HALF_CCD_MODE. Another idea would be to compare registers 52 to
 57 (AFE timings) with ones from an usb log.

 Regards,
   Stef



Cheers for the advice again stef, I just added the half ccd flag and it 
sorted out the image as it should look. The only issue now is that the 
scan seems a little dark, again ill upload the latest scan to the 
website (http://sites.google.com/site/bez625/updates-1/update020210). 
For the time being ill work with git to make sure im developing in the 
correct way ;), if you have a suggestion on the brightness issue let me 
know. Also I played with the offset and gain a little and neither seem 
to make any difference. Not sure what that is about.

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-02-01 Thread Chris Berry
On 01/31/2010 09:21 PM, stef wrote:
 Le dimanche 31 janvier 2010 20:30:58 Chris Berry, vous avez ?crit :

 Ok Stef, ignore that last email, I just got a scan! its far from perfect
 but im on the right road at least (mostly your advice ;) ). One of my
 GPIO wasnt set correctly and you were right about the bit 8 being set on
 the control reg of the AFE.

 An upload of the image is at
 http://sites.google.com/site/bez625/updates-1 . Its under Update
 31/01/10 as an attachment. Im not sure what the next step here is but
 ill have a play myself. Any pointers from here are always welcome of
   course.

 Since things are progressing well I would like to know what the best
 procedure would be for adding this to the stable version of the sane
 api? I know we are a little far from this but it might be good for me to
 have an idea as this is obviously the intended outcome.

 Thanks

 Chris

  
   Hello,

   good job. 'first light' is always a gratifying moment. For future 
 inclusion
 of your work, you might consider using a local git tree with a dedicated
 branch. So that you will be able to generate patches.

 Regards,
   Stef


Thanks Stef, how would I go about using the git tree? I've used SVN 
before but not git so it shouldn't take long for me to wrap my head 
around it. So far I just downloaded a copy of the development version 
from git and i've been working from that copy, i'm not sure how to make 
a new branch (or even if I have permission?).

Also have you had a chance to look at the scan and suggest what i need 
to change? Im guessing that it might be a problem with the CCD, maybe it 
thinks the ccd is larger than it is?

Thanks again

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-01-31 Thread Chris Berry
On 01/31/2010 01:11 PM, stef wrote:
 Le samedi 30 janvier 2010 15:29:50 Chris Berry, vous avez ?crit :

   Hello,

   the function you wrote is fine. What I wanted to share is that it is 
 easier
 to do experiments from within a really simple test program than the full blown
 scanimage or xsane.
   For instance, to get data from the HP3670, I had to set up registers 
 that
 aren't set up under windows. I also found that I had to use different values
 for offset and gain than the ones that could found in usbsnoop logs.
   I think you'll need much trial and errors before having it work. You 
 must
 also keep in mind that if GPIO aren't correctly set up, you may not get any
 data whatever you do with the AFE.

 Regards,
   Stef


Ah ok, is there any way I can tell if im starting to get any reasonable 
data from this scan? Currently I am only checking the pnm image so I 
have no real idea if im getting close or not. Are there any good ways to 
see if im getting any data at all?

Thanks

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-01-31 Thread Chris Berry
Ok Stef, ignore that last email, I just got a scan! its far from perfect 
but im on the right road at least (mostly your advice ;) ). One of my 
GPIO wasnt set correctly and you were right about the bit 8 being set on 
the control reg of the AFE.

An upload of the image is at 
http://sites.google.com/site/bez625/updates-1 . Its under Update 
31/01/10 as an attachment. Im not sure what the next step here is but 
ill have a play myself. Any pointers from here are always welcome of course.

Since things are progressing well I would like to know what the best 
procedure would be for adding this to the stable version of the sane 
api? I know we are a little far from this but it might be good for me to 
have an idea as this is obviously the intended outcome.

Thanks

Chris


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-01-30 Thread Chris Berry
On 01/30/2010 01:40 PM, stef wrote:
 Le jeudi 28 janvier 2010 11:26:56 Chris Berry, vous avez ?crit :

 No stef im almost certain this isnt a Wolfson, from an old project page
 I think it is an Analog Digital 9826

 Link:
 http://www.analog.com/en/audiovideo-products/cameracamcorder-analog-front-e
 nds/ad9826/products/product.html


 I too am puzzled why there are so many writes to the frontend, the XP200
 in the gl686 I think uses an AD frontend and even that only has a few fe
 writes, although the XP200 has separate functions for AD coarse grain
 calibration and AD offset calibration so im not sure if these extra
 writes are done then? Any advice?

 Chris

  
   Hello,

   I had a quick look at the data-sheet. It is coherent with the writes 
 you see.
 One thing that I find strange is that bit 7 of register 0 is set to 1, while
 it is recommended no to do so. Maybe it is a bug, or maybe your scanner hasn't
 the same exact component.
   During calibration there maybe a lots of writes to frontends. To go 
 further,
 I think it could be a good idea to have a test program to does a simple color
 scan with a fixed area. You could code directly in it various write to AFE
 until you get sensible data. I have appended the main C file and the build
 file as a possible example.
   I build like this make -DUNIT_TESTING  make -f mk .
 The wm.c is how I experimented with HP3470's AFE.

 Regards,
   Stef



Ok Stef, at the minute I have a separate function in gl841.c that is 
called during set_fe to skip the standard front end writes in that file 
and use the ones defined in my function. I have attached the function 
for you to look at.

My question is: is there any benefit to using the method you just 
recommended over the method im using now? If this function is required 
it is likely to implemented in the way i have so will it help me much to 
do what you have asked? Or is what i'm doing pretty similar.

Chris


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

-- next part --
An embedded and charset-unspecified text was scrubbed...
Name: set_ad_fe
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20100130/a9bf9ad8/attachment-0001.asc


[sane-devel] Backend for plustek Opticbook 3600

2010-01-28 Thread Chris Berry
Hey stef, i'm really struggling to work out what all these frontend 
writes are for. Below is a grep of the frontends from a scan, I have 
done several scans and they all roughly follow this format. I'm not sure 
why the offset (regs 05 - 07) have values 0x80 and 0xff and the values 
for both offset and gain (0x02 - 0x04) have some values that change per 
scan? Any light you could shed on this would be great,

Cheers

Chris
 

genesys_fe_write_data(0x000x00f8)
genesys_fe_write_data(0x010x0080)
genesys_fe_write_data(0x020x)  AFEINIT
genesys_fe_write_data(0x030x)
genesys_fe_write_data(0x040x)
genesys_fe_write_data(0x050x)
genesys_fe_write_data(0x060x)
genesys_fe_write_data(0x070x)
   
genesys_fe_write_data(0x020x)
genesys_fe_write_data(0x030x)
genesys_fe_write_data(0x040x) AFESET?
genesys_fe_write_data(0x050x0080)
genesys_fe_write_data(0x060x0080)
genesys_fe_write_data(0x070x0080)
   
genesys_fe_write_data(0x050x00ff)
genesys_fe_write_data(0x060x00ff) ??
genesys_fe_write_data(0x070x00ff)
   
genesys_fe_write_data(0x050x0127) \
genesys_fe_write_data(0x060x0126)  These values seem to change 
slightly per scan
genesys_fe_write_data(0x070x011b) /
   
genesys_fe_write_data(0x020x)
genesys_fe_write_data(0x030x)
genesys_fe_write_data(0x040x)
   
genesys_fe_write_data(0x020x002d)
genesys_fe_write_data(0x030x0019)
genesys_fe_write_data(0x040x001e) - This value also varies slightly
   
genesys_fe_write_data(0x050x0080)
genesys_fe_write_data(0x060x0080)
genesys_fe_write_data(0x070x0080)
   
genesys_fe_write_data(0x050x00ff)
genesys_fe_write_data(0x060x00ff)
genesys_fe_write_data(0x070x00ff)
   
genesys_fe_write_data(0x050x0121) \
genesys_fe_write_data(0x060x0124)   These values all seem to vary 
slightly
genesys_fe_write_data(0x070x0117) /
   
genesys_fe_write_data(0x050x011a) \
genesys_fe_write_data(0x060x0118)  These values all seem to vary 
slightly
genesys_fe_write_data(0x070x010d) /
   
genesys_fe_write_data(0x050x0109) \
genesys_fe_write_data(0x060x0004)  These values all seem to vary 
slightly
genesys_fe_write_data(0x070x000c) /
   
   
   




[sane-devel] Backend for plustek Opticbook 3600

2010-01-28 Thread Chris Berry
No stef im almost certain this isnt a Wolfson, from an old project page 
I think it is an Analog Digital 9826

Link:
http://www.analog.com/en/audiovideo-products/cameracamcorder-analog-front-ends/ad9826/products/product.html
 


I too am puzzled why there are so many writes to the frontend, the XP200 
in the gl686 I think uses an AD frontend and even that only has a few fe 
writes, although the XP200 has separate functions for AD coarse grain 
calibration and AD offset calibration so im not sure if these extra 
writes are done then? Any advice?

Chris



[sane-devel] Backend for plustek Opticbook 3600

2010-01-24 Thread Chris Berry
stef wrote:
 Le vendredi 22 janvier 2010 17:57:06 Chris Berry, vous avez ?crit :
   
 Hey Stef, I had to take a little time off the front end stuff to do some
 documentation but Im looking at it again now. Like you im fairly certain
 everything else is set, could you share with me a snoop of the HP3670?
 I'm curious to see the front end entries and whether they follow a
 similar pattern to the opticbook 3600.

 Cheers

 Chris
 

   Hello,

   I still can't get data for HP3670. After much tinkering, everything 
 when from 
 all black to all white...
   Here's all the frontend accesses (a grep result) for a 100 dpi color 
 scan.
  0x01 and 0x03 are control registers, 0x23 is offset and 0x28 is gain. I 
 opened the HP3670 Jack donated me, but I couldn't find a discrete chip which 
 could be the frontend. With the exact Wolfson chip, I'd be able to have a 
 datasheet that surely explain some things.

 sanei_genesys_fe_write_data(0x01,0x0007)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x01,0x0007)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x03,0x0002)
 sanei_genesys_fe_write_data(0x23,0x)
 sanei_genesys_fe_write_data(0x28,0x0002)
 sanei_genesys_fe_write_data(0x23,0x)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x23,0x0014)
 sanei_genesys_fe_write_data(0x23,0x00c2)
 sanei_genesys_fe_write_data(0x23,0x00be)
 sanei_genesys_fe_write_data(0x23,0x00be)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x28,0x0002)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x28,0x0002)
 sanei_genesys_fe_write_data(0x03,0x0002)
 sanei_genesys_fe_write_data(0x23,0x0080)
 sanei_genesys_fe_write_data(0x28,0x0002)
 sanei_genesys_fe_write_data(0x23,0x)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x23,0x0014)
 sanei_genesys_fe_write_data(0x23,0x00c0)
 sanei_genesys_fe_write_data(0x23,0x00be)
 sanei_genesys_fe_write_data(0x23,0x00be)
 sanei_genesys_fe_write_data(0x28,0x0008)
 sanei_genesys_fe_write_data(0x28,0x0004)
 sanei_genesys_fe_write_data(0x28,0x0006)
 sanei_genesys_fe_write_data(0x28,0x0005)
 sanei_genesys_fe_write_data(0x28,0x0005)
 sanei_genesys_fe_write_data(0x23,0x)
 sanei_genesys_fe_write_data(0x23,0x0014)
 sanei_genesys_fe_write_data(0x23,0x00c0)
 sanei_genesys_fe_write_data(0x23,0x00bc)
 sanei_genesys_fe_write_data(0x23,0x00bc)
 sanei_genesys_fe_write_data(0x03,0x0002)
 sanei_genesys_fe_write_data(0x23,0x00bc)
 sanei_genesys_fe_write_data(0x28,0x0005)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x03,0x0002)
 sanei_genesys_fe_write_data(0x23,0x00be)
 sanei_genesys_fe_write_data(0x28,0x0002)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x03,0x0002)
 sanei_genesys_fe_write_data(0x23,0x0080)
 sanei_genesys_fe_write_data(0x28,0x0002)
 sanei_genesys_fe_write_data(0x23,0x)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x23,0x0014)
 sanei_genesys_fe_write_data(0x23,0x00be)
 sanei_genesys_fe_write_data(0x23,0x00be)
 sanei_genesys_fe_write_data(0x23,0x00be)
 sanei_genesys_fe_write_data(0x28,0x0008)
 sanei_genesys_fe_write_data(0x28,0x0004)
 sanei_genesys_fe_write_data(0x28,0x0006)
 sanei_genesys_fe_write_data(0x28,0x0007)
 sanei_genesys_fe_write_data(0x28,0x0007)
 sanei_genesys_fe_write_data(0x23,0x)
 sanei_genesys_fe_write_data(0x23,0x0014)
 sanei_genesys_fe_write_data(0x23,0x00be)
 sanei_genesys_fe_write_data(0x23,0x00bc)
 sanei_genesys_fe_write_data(0x23,0x00bc)
 sanei_genesys_fe_write_data(0x03,0x0002)
 sanei_genesys_fe_write_data(0x23,0x00bc)
 sanei_genesys_fe_write_data(0x28,0x0007)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x01,0x0003)
 sanei_genesys_fe_write_data(0x01,0x0003)

 Regards,
   Stef


   
Yea that's a strange one Stef, are you sure this is a Wolfson AFE chip? 
Looking here http://www.wolfsonmicro.com/productListings/imaging you can 
see there are only about 6 AFE's that are three channel and reg values 
start at 0x01 (as opposed to one which starts at 0x00). The strange 
thing about this grep (or at least i find it strange) is that it only 
writes to PGA Red Gain and not Blue and Green (going off these 6 
datasheets from wolfson as they are all roughly the same), which is what 
makes me ask are you sure its a Wolfson. As there are only 6 I suppose 
you can just work through them one at a time...

I discovered where my problem was, I definitely DO NOT have a wolfson 
afe. I tracked the datasheet down from an old project page to be a 
AD9826 and it certainly marries up to the scans snoops. The only problem 
I have now is that I'm not really sure how to change the genesys files 
as my offsets are on reg 0x05, 0x06, 0x07 and my gain are on 0x02, 0x03, 
0x04 (as opposed to 0x20-22 and  0x28-2a respectively).

Do you have any

[sane-devel] Backend for plustek Opticbook 3600

2010-01-15 Thread Chris Berry
Hi Stef, in the course of trying to get the lamp working I was playing 
with the settings and after I removed my changes the lamp functions as i 
expected too so that issue is resolved.

If my understanding is correct the code should select whether to set cis 
or not based on the variable in genesys_driver.c. As it is currently 
hard coded I will try and put an if statement in to select based on the 
/* Is this a CIS scanner? */ sane boolean.

I am still not getting any picture data, after observing some of the 
front end logs I see that the windows driver only writes to *FRONT END* 
addresses 0x00 - 0x07, but the genesys driver is writing to 0x00 - 0x09 
and many others (0x20, 0x24 etc...). I am guessing this is very bad for 
the recovery of data from the DAC.

I will attach a new genesys log and a windows sniff to the project 
website today and maybe some pictures.

As usual any pointers are greatly appreciated

Thanks

Chris

On 01/15/2010 01:10 PM, stef wrote:
 Le jeudi 14 janvier 2010 17:47:41 Chris Berry, vous avez ?crit :

 Ok quick update, I have managed to get the lamp on during scans! The
 reason it was failing is because reg[0x01] was hard coded to CIS type
 and this is a CCD scanner. Hopefully this means that all I have to do is
 polish up the remaining register values at init time.

 Currently the light is on when the scan head moves down but turns itself
 off immediately before it comes back, is this normal behaviour for the
 genesys driver?

 Chris

  
   Hello,

   nice job. Do you get any picture data ?
   I don't think that the genesys backend switch off lamp after you scan on
 purpose. The planned behaviour is to switch off CCD only when the defined
 waiting time has elapsed. Maybe what you are seeing is the power saving
 function kicking in and switching off light by modifying GPIOs (see
 gl841_save_power function in genesys_gl841.c).
   While this doesn't hurt for CIS scanners, CCD may have to warm up each 
 time
 they light on. So this behaviour might not be desirable.

 Regards,
   Stef




-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-01-14 Thread Chris Berry
Ok I have set the values for the 0x6b and im still getting a completely 
black scan but the lamp is being turned off at the start of a scan.

When the scanner is plugged in the light is ON and when i start a scan 
the light is immediately turned off. The init reg is definitely sending 
the correct data to the scanner so I am assuming another part of the 
code is turning the lamp off.

I took a USB sniff of the lamp being turned on and off repeatedly which 
I will add to the project site 
(http://sites.google.com/site/bez625/home) and I am certain all that the 
lamp needs is to set register 0x03 to the value of 0x5f or 0xdf 
(difference here is lampdog on and off). I have tried various other 
settings including setting the lamp power to off and to no avail. Please 
bear in mind that I have only been changing the setting in the reg_init 
and no where else.

I cant see how I can test anything else is working until the lamp is on 
and why it wont turn on baffles me.

Thanks in advance

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-01-14 Thread Chris Berry
Ok quick update, I have managed to get the lamp on during scans! The 
reason it was failing is because reg[0x01] was hard coded to CIS type 
and this is a CCD scanner. Hopefully this means that all I have to do is 
polish up the remaining register values at init time.

Currently the light is on when the scan head moves down but turns itself 
off immediately before it comes back, is this normal behaviour for the 
genesys driver?

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-01-08 Thread Chris Berry
Thanks for the quick reply stef, hope you had a good christmas/new year :).

I have made changes to the GPIO settings as appropriate (i.e. matched 
the settings to what I believe is correct from register writes) but I 
could only find values for 0x6b, 0x6d, 0x6e and 0x6f. I couldn't find a 
write to 0x6c so I assumed that to be 0x00 and also I am unsure in which 
file the 0x6b register is set. Is 0x6b set in genesys_devices.c? If so 
which section?

Another concern is that in the logs there are no URB's of the form:

control  0x40 0x0c 0x89 0x00 len  (Output enable)
control  0xc0 0x0c 0x8a 0x00 len (read)
control  0x40 0x0c 0x8b 0x00 len (write)

I checked these after running the initial perl scripts and before the 
awk scripts you forwarded to me. Is it maybe possible that the control 
URBs for this have happened at a time that hasn't been caught by the 
logs or is it more likely that there is a different value being used as 
opposed to 0x89, 0x8a and 0x8b?

Would incorrect GPO affect the light being on and off? I know for sure 
that the value for 0x6b from the logs is different to the one set by the 
genesys driver at the moment so I think maybe correcting this could be a 
big break through for this project :)

Chris

stef wrote:
 Le jeudi 7 janvier 2010 15:14:20 Chris Berry, vous avez ?crit :
   
 Hi Stef,

 I have updates on this project at
 http://sites.google.com/site/bez625/updates-1/update070110 with some
 attachments. I am still struggling to work out why the scan lamp is off
 during scanning.

 My thoughts are that maybe the genesys backend is saying the lamp sleep
 mode if on before the scan as opposed to off. The log files seem to
 support this with the register values being set but any advice you could
 offer on where i should go from here would be appreciated.

 Thanks

 Chris

 

   Hello,

   have you made changes related to GPIO ? They often change meaning from 
 a 
 scanner to another. Sometimes you won't get any data until they are set up 
 correctly. 
   Locate writes to registers 6c/6d and 6b for values and 6e/6f for mask 
 in the 
 USB logs you have. You'll see quite a few places where we test for the model-
   
 gpo_type and write to GPIO registers. Try to adapt these to match what 
 you'll 
 
 see in logs.

 Regards,
   Stef

   




[sane-devel] Backend for plustek Opticbook 3600

2010-01-07 Thread Chris Berry
Hi Stef,

I have updates on this project at 
http://sites.google.com/site/bez625/updates-1/update070110 with some 
attachments. I am still struggling to work out why the scan lamp is off 
during scanning.

My thoughts are that maybe the genesys backend is saying the lamp sleep 
mode if on before the scan as opposed to off. The log files seem to 
support this with the register values being set but any advice you could 
offer on where i should go from here would be appreciated.

Thanks

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2010-01-07 Thread Chris Berry
lol no worries Jan, hopefully I can get the scanner working soon for you :)

Chris

On 01/07/2010 04:25 PM, Jan-Benedict Glaw wrote:
 On Thu, 2010-01-07 14:14:20 +, Chris Berrys0457957 at sms.ed.ac.uk  
 wrote:

 I have updates on this project at
 http://sites.google.com/site/bez625/updates-1/update070110 with some
 attachments. I am still struggling to work out why the scan lamp is off
 during scanning.

 My thoughts are that maybe the genesys backend is saying the lamp sleep
 mode if on before the scan as opposed to off. The log files seem to
 support this with the register values being set but any advice you could
 offer on where i should go from here would be appreciated.
  
 It's at least great to see someone working on a backend for the '3600.
 That will be a nice scanner once it's somewhat supported.  So I'm
 having some hope that, at some time, I can use my scanner myself,
 without asking my girlfriend to scan stuff for me :)

 MfG, JBG




-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2009-12-30 Thread Chris Berry
Ok thanks stef, i've been experimenting a little with the logs, there 
was a small error/issue with the parse1.awk script you sent me. I don't 
know if you have encountered this but around line 113 there is an if 
statement along the lines of:

if ($5 == 0x002])

this fails because of what I suspect is an end of line character in $5, 
so i replaced it with:

if (index($5, 0x002])  0) endpoint = BULK_OUT

and so on for the following values. I'm not very good with awk so I 
don't know if this is the best way of fixing this but it works for now.

After some playing I think I have the CCD settings right and the motor 
seems to be working so I havent really changed that much. I also think 
the GPIO settings are right which leads me to believe the DAC is the 
main issue at the moment.

 From my understanding the front end is accessed through registers 
0x51(address), 0x3a and 0x3b (values) but im not sure how this 
translates to the settings in genesys_devices.c:

   {DAC_PLUSTEK_3600,{0x00, 0x3d, 0x08, 0x00}
, {0x00, 0x00, 0x00}
, {0xe1, 0xe1, 0xe1}
, {0x93, 0x93, 0x93}
, {0x00, 0x19, 0x06}
}

Now I think the first 4 values correspond to addresses 0x00 - 0x03 of 
the DAC, but the following arrays are a bit of a mystery to me. I have 
had a look at the log from run-genesys and it seems that they are trying 
to set many DAC registers but the Snoop reveals that only fe_writes to 
addresses 0x00 - 0x07 are made.

As when I try a scan everything (aside from the light not being on) 
seems to be reasonable but results in a garbled image I think it might 
just be a case of getting the light on and setting up the DAC properly. 
If you could help me understand the DAC settings I might be able to 
investigate the matter further.

Thanks

Chris


On 12/29/2009 07:46 AM, stef wrote:
 Le jeudi 24 d?cembre 2009 06:07:23 Chris Berry, vous avez ?crit :

 Just a quick update, I had to take a little time off from the project
 but I should be able to work on it more now. I have an update at
 http://sites.google.com/site/bez625/updates-1/update with new log files
 for smaller scan and preview snoops.

 Stef is there any chance you could explain the layout of your script to
 me a little, for instance

 URB  7278  control  0xc0 0x0c 0x8e 0x20 len 1 read  0x01

 I take it this means:

 URBURB Num  URB Type  4 hex values  lenLength  r/w  data

 What are the 4 hex values for? Also anything else helpful will be
 appreciated. I'm not certain how I can better find the values I need for
 genesys_devices.c, I look for the hex values of the registers that need
 to be set and cant find them in the new reduced log files. Maybe some of
 these values are only set at power up and not before a scan or preview?

 Chris

  
   Hello,

   these numbers are to be converted in sanei_usb_control_msg() function 
 calls.
 You can have a look at the defines in genesys_low.h around line 113 for the
 known values. The 0x8e value isn't defined and currently used in the genesys
 backend. However, after looking at the logs you posted, I think it is some
 data reading. The trouble is that currently there is no such access to data
 for the supported models. While I think it could be turned to something like
 sanei_genesys_bulk_read(), you'll need to experiment. As far I understand,
 these are vendor specific accesses. I couldn't find these values in any USB
 documents.

   You are right that some register values don't change much and are set up
 early, and not at every scan.

 Regards,
   Stef
   



-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20091230/eb05b604/attachment-0001.htm


[sane-devel] Backend for plustek Opticbook 3600

2009-12-24 Thread Chris Berry
Just a quick update, I had to take a little time off from the project 
but I should be able to work on it more now. I have an update at 
http://sites.google.com/site/bez625/updates-1/update with new log files 
for smaller scan and preview snoops.

Stef is there any chance you could explain the layout of your script to 
me a little, for instance

URB  7278  control  0xc0 0x0c 0x8e 0x20 len 1 read  0x01

I take it this means:

URB URB Num URB Type 4 hex values len Length r/w data

What are the 4 hex values for? Also anything else helpful will be 
appreciated. I'm not certain how I can better find the values I need for 
genesys_devices.c, I look for the hex values of the registers that need 
to be set and cant find them in the new reduced log files. Maybe some of
these values are only set at power up and not before a scan or preview?

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2009-12-09 Thread Chris Berry
Hey Stef, the script you forwarded to me (decode-pl.sh) seems to be 
reliant on some .awk files (filtre.awk, swap.awk and refait.awk). I had 
a quick look online but could not find them, is there any chance you 
could send them to me :)

Chris

On 12/07/2009 08:24 PM, stef wrote:
 Le lundi 7 d?cembre 2009 19:30:15 Chris Berry, vous avez ?crit :

 Ok I have managed to use SniffUSB to extract some data during the
 calibration and preview stages, there is too much to post here but im
 not sure how to interpret it. I have tried usb-robot but am struggling
 to get it working (it tells me there is a problem finding libusb header
 which is installed?). Any advice of where to go from here would be great :)

 Thanks

 Chris
  
   Hello,

   once you have the usb log, you can parse it with the appended scripts 
 (from
 Pierre Willenbrock). You can then compare the processed output with the debug
 output of scanimage ran with full debug.
   A starting point is to add the USB ids in genesys.conf.in, then add a 
 model
 description in genesys_devices.c . Cloning the Lide 35 entry seems to be a
 sensible start. Then you'll have to set the flags to the same values than the
 HP2400 entry so that the backend doesn't try to do calibration and does an
 uncalibrated scan. With a script like the attached 'run-genesys' (to be put in
 backend subdir) you can try the code you have just compiled without installing
 it system-wide

 Regards,
   Stef




-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2009-12-07 Thread Chris Berry
Ok I have managed to use SniffUSB to extract some data during the 
calibration and preview stages, there is too much to post here but im 
not sure how to interpret it. I have tried usb-robot but am struggling 
to get it working (it tells me there is a problem finding libusb header 
which is installed?). Any advice of where to go from here would be great :)

Thanks

Chris

On 12/06/2009 10:07 PM, stef wrote:
 Le dimanche 6 d?cembre 2009 20:18:17 Chris Berry, vous avez ?crit :

 Thanks for the info Stef, I have run sane-find-scanner on the scanner
 and it confirms that the chipset is indeed GL482. I was under the
 impression the Genesys backend was for GL481, does it support GL482 as
 well?

 Thanks

 Chris

  
   Hello,

   yes, it already supports several gl842 scanners. You may start to add 
 support
 for the Opticbook 3600 by adding an entry in genesys_devices.c and in
 genesys.conf.in . You'll may have to tweak GPIO handling. In any case, windows
 usbsnoop of calibration and preview will be useful.

 Regards,
   Stef




-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2009-12-06 Thread Chris Berry
Thanks for the info Stef, I have run sane-find-scanner on the scanner 
and it confirms that the chipset is indeed GL482. I was under the 
impression the Genesys backend was for GL481, does it support GL482 as 
well?

Thanks

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




[sane-devel] Backend for plustek Opticbook 3600

2009-12-04 Thread Chris Berry
Hello,

As part of a project I am currently undertaking I am creating support 
for the opticbook 3600 under linux. It seems the best approach to this 
is to create a SANE backend for the scanner. After reading the available 
documentation I am of the understanding that I should post to this 
mailing list to prevent duplicate code.

I am assuming there are no other people working on this project so far 
(if so please let me know!) and I was wondering if anyone could give me 
a few pointers as where to start with this task? Any information 
supplied to me would be very gratefully appreciated :-)

Thanks

Chris

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.