<div class="gmail_quote">2011/1/5 stef <span dir="ltr"><<a href="mailto:stef.dev@free.fr">stef.dev@free.fr</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Le Wednesday 05 January 2011 15:39:31 Stefan Larsson, vous avez écrit :<br>
<div><div></div><div class="h5">> 2011/1/4 stef <<a href="mailto:stef.dev@free.fr">stef.dev@free.fr</a>><br>
><br>
> > Le Friday 31 December 2010 13:36:20 Stefan Larsson, vous avez écrit :<br>
> > > Thank you for the information.<br>
> > ><br>
> > > I have extracted some information but it is a bit unclear how to<br>
> > > proceed.<br>
> ><br>
> > I<br>
> ><br>
> > > need to be able to isolate which portions are doing what. How do you<br>
> > > usually perform the analysis in an efficient manner? Since I am<br>
> > > totally unfamiliar with the protocol I am not sure how to start<br>
> > > finding the appropriate information.<br>
> > ><br>
> > > All the files are present in the attached file. Check readme.txt for<br>
> > > further information.<br>
> > ><br>
> > > I also contacted Canon Sweden to ask for any technical information or a<br>
> > > contact person which may simplify things. The support issue just got<br>
> > > escalated to another department. We will see what that could give.<br>
> > ><br>
> > > /Stefan<br>
> > ><br>
> > Hello,<br>
> ><br>
> > the decoded windows log seems to be missing the first URB when<br>
> ><br>
> > scanner is<br>
> > plugged. Important things happen then. You should logged it at least<br>
> > once. It<br>
> > helps determining the memory layout, the initial reigster set and the<br>
> > starting<br>
> > GPIO.<br>
> ><br>
> > Try to record it, then the first step you could try is to adjust<br>
> > the<br>
> ><br>
> > registers for the memory layout. There is a table 'layouts' in<br>
> > genesys_gl847.h<br>
> > where you should tune registers d0-d2, e0-e7 based on the value you'll<br>
> > find in<br>
> > the decoded log.<br>
> ><br>
> > The next step would be the GPIO, the registers to look are used in<br>
> ><br>
> > gl847_init_pio(), have special care for REG6C occurences.<br>
> ><br>
> > Regards,<br>
> ><br>
> > Stef<br>
><br>
> Ok, I have been able to get some initial very short "buzz"-sound out of the<br>
> scanner now, which means it is responding to the initial register<br>
> initialization. The execution is ending with the log below (I guess that<br>
> the problem is with the unsupported frontend type 0):<br>
><br>
> ...<br>
> [genesys_gl847] gl847_init_memory_layout completed<br>
> [genesys_low] sanei_genesys_write_gl847_register (0xf8, 0x01) completed<br>
> [genesys_gl847] gl847_cold_boot completed<br>
> [genesys_gl847] gl847_set_fe (init)<br>
> [genesys_low] sanei_genesys_read_gl847_register(0x04)=0x20<br>
> [genesys_gl847] gl847_set_fe(): unsupported frontend type 0<br>
> [genesys_gl847] gl847_set_fe completed<br>
> scanimage: open of device genesys:libusb:001:003 failed: Operation not<br>
> supported<br>
> [genesys] sane_exit: start<br>
> [genesys] sane_exit: exit<br>
><br>
> The changes so far are attached in the diff-file. I am not sure how such<br>
> changes are to be incorporated in the code. There needs to be some kind of<br>
> adaptability such as for the memory mapping.<br>
><br>
> I was also unable to find any values for 0xd1 and 0xd2.<br>
><br>
> Regarding the GPIO i am unsure how to interpret the rules in<br>
> gl847_init_gpio() and what I am seeing in the logs. I guess I have to<br>
> modify those rules to comply with what is seen below:<br>
><br>
> genesys_read_register(0x6c)=0x80<br>
> genesys_write_register(0x6c,0x80)<br>
> genesys_read_register(0x6c)=0x80<br>
> genesys_write_register(0x6c,0x80)<br>
><br>
> genesys_read_register(0x6c)=0x80<br>
> genesys_write_register(0x6c,0x81)<br>
> genesys_read_register(0x6c)=0x81<br>
> genesys_write_register(0x6c,0xc1)<br>
> genesys_read_register(0x6c)=0xc1<br>
> genesys_write_register(0x6c,0xd1)<br>
><br>
> genesys_read_register(0x6c)=0xd1<br>
> genesys_write_register(0x6c,0xd1)<br>
> genesys_read_register(0x6c)=0xd1<br>
> genesys_read_register(0x6c)=0xd1<br>
> genesys_write_register(0x6c,0xf1)<br>
> genesys_read_register(0x6c)=0xf1<br>
><br>
> genesys_read_register(0x6c)=0xf1<br>
> genesys_write_register(0x6c,0xf1)<br>
> genesys_read_register(0x6c)=0xf1<br>
> genesys_write_register(0x6c,0xf1)<br>
><br>
> genesys_read_register(0x6c)=0xf1<br>
> genesys_write_register(0x6c,0xf1)<br>
> genesys_read_register(0x6c)=0xf1<br>
> genesys_write_register(0x6c,0xf1)<br>
><br>
> /Stefan<br>
<br>
</div></div> Hello,<br>
<br>
for setting the fe, Wolfson type aren't supported. You'll have to copy<br>
the related part of gl841_set_fe to gl847_set_fe.<br>
For the d1, d2 registers, this isn't surprising since they are used for<br>
CIS scanners while the 700F is a CCD one. So value doesn't matter.<br>
For the 6C register, the value just before scan is the more important<br>
since some of its bits drive motor current.<br>
For the code, the memory layout is indeed driven by capability, there is<br>
a search in a table defined in genesys_gl847.h, please use it. In register<br>
init, don't replace existing values, but add them with code behind a 'if'. For<br>
instance register 01 should be set like this:<br>
if(dev->model->is_cis)<br>
{<br>
SETREG (0x01, 0x82);<br>
}<br>
else<br>
{<br>
SETREG (0x01, 0x42);<br>
}<br>
look at gl843_init_registers() has other examples on how handling<br>
different models.<br>
Also, don't init register A7,A6 they are driven by gpio. Tune gpio<br>
setting code instead. In init register, don't do SETREG() on registers they<br>
weren't set before. Other part of the code will take care of them.<br>
<br>
I think it would be a good idea to clone the git tree, create your own<br>
branch locally so that you can track your own developments in it and<br>
eventually send a nice diff.<br>
<br>
Regards,<br>
<font color="#888888"> Stef<br>
</font></blockquote></div><br>Hello again,<br><br>the 5600F is now giving more sound at startup and the lamp is<br>even flashing once. The startup writing of data is looking quite<br>good with some strange artifacts such as trying to write 0x80 to<br>
register 0x05 but getting 0x40 all the time... (see comments in<br>attached SANE-log). I think discussions on implementation<br>details have to wait. My focus right now is to get the scanner<br>responding properly, the implementation can be corrected later.<br>
<br>I am unsuccessful at getting the motor running so far. Any hints<br>on what to try next would be appreciated.<br><br>I am showing you what I have tried so far in the attached file where<br>one SANE-log and one USB-log is present. There is also a git-diff<br>
for the code so far.<br><br>I am currently getting stuck in a loop where the driver is waiting for<br>data:<br><br>[genesys_low] sanei_genesys_read_gl847_register(0x42)=0x00<br>[genesys_low] sanei_genesys_read_gl847_register(0x43)=0x00<br>
[genesys_low] sanei_genesys_read_gl847_register(0x44)=0x00<br>[genesys_low] sanei_genesys_read_gl847_register(0x45)=0x00<br><br><br>I am also a bit confused by for example some changing registers:<br><br>I have created a CCD-entry for the 5600F-scanner where registers<br>
0x52-0x5e are initialized according to the initial write.<br><br>genesys_write_register(0x52,0x0e)<br>genesys_write_register(0x53,0x00)<br>genesys_write_register(0x54,0x02)<br>genesys_write_register(0x55,0x04)<br>genesys_write_register(0x56,0x06)<br>
genesys_write_register(0x57,0x08)<br>genesys_write_register(0x58,0x52)<br>genesys_write_register(0x59,0xe1)<br>genesys_write_register(0x5a,0x40)<br>genesys_write_register(0x5e,0x15)<br><br>Later in the log when trying to start the scan the following is<br>
happening:<br><br>genesys_write_register(0x52,0x02)<br>genesys_write_register(0x53,0x04)<br>genesys_write_register(0x54,0x06)<br>genesys_write_register(0x55,0x08)<br>genesys_write_register(0x56,0x0a)<br>genesys_write_register(0x57,0x0c)<br>
genesys_write_register(0x58,0x72)<br>genesys_write_register(0x59,0x5a)<br><br>Which are quite different...<br><br>/Stefan<br><br>