<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:8pt"><div style="" class="">Dear Stef,</div><div style="" class=""><br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">Thanks a lot for your suggestions. I have studied genesys documentation, and indeed it is helpful :)</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;"><br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">I have collected usblogs for all useful scan modes. In case you would like to look at them, you can</div><div class="" style="color: rgb(0, 0, 0);
 font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">download processed (with your script) logs at: <a style="" class="" href="https://www.dropbox.com/sh/6je6fz2tsjy0r6x/AAA1yr9P6RrlEWaqk5lWjLNSa">CS8400F</a></div><div style="width:450px; font-family: 'Georgia', 'Times', 'Times New Roman', 'serif';" id="enhancrCard_0" class="" contenteditable="false"><table class="" style="width:450px; height:60px; position: relative; margin-top:5px; margin-bottom: 5px; display: block;" cellpadding="0" cellspacing="0"><tbody style="" class=""><tr style="" class=""><td colspan="6" class="" style="height: 1px; background-color: #e5e5e5;"><div class="" style="height: 1px; background-color: #e5e5e5;"></div></td></tr><tr style="" class=""><td rowspan="2" class="" style="width: 1px; background-color: #e5e5e5;"><div class="" style="width: 1px; background-color: #e5e5e5;"></div></td><td class="" rowspan="2" style="vertical-align: middle;
 width: 58px; height: 58px; background-color: #000000;"><div class="" style="width: 58px;" align="center"><a href="https://www.dropbox.com/sh/6je6fz2tsjy0r6x/AAA1yr9P6RrlEWaqk5lWjLNSa" class="" style="text-decoration: none !important; color: #000000 !important;"><img alt="image" src="https://www.dropbox.com/static/images/icons128/folder_dropbox.png" class="" style="display: block; margin: auto;" height="58" width="58"></a></div></td><td rowspan="2" class="" style="width: 1px; background-color: #e5e5e5;"><div class="" style="width: 1px; background-color: #e5e5e5;"></div></td><td class="" colspan="2" style="width: 100%; vertical-align: middle; font-family: 'Georgia', 'Times', 'Times New Roman', 'serif';"><div class="" style="line-height:16.5px; background-color: #ffffff; height: 34px; width: 389px;"><div class="" style="word-wrap: break-word; word-break: break-all; padding: 5px 20px 0px 9px;"><span style="" class=""></span><span style="" class=""></span><a
 href="https://www.dropbox.com/sh/6je6fz2tsjy0r6x/AAA1yr9P6RrlEWaqk5lWjLNSa" class="" style="text-decoration: none !important; color: #000000 !important;"><span class="" style="margin: 0; font-weight: normal;font-size: 13px; line-height: 18px; max-height: 19px; color: #000000; overflow: hidden !important; display: inline-block;">CS8400F</span></a><div style="font-size: 11px; line-height: 15px; color: #999999; max-height: 16px; margin-top: -2px; font-family: 'Arial', 'Helvetica Neue', 'Helvetica', 'sans-serif';overflow: hidden;" class="">Shared with Dropbox</div></div></div></td><td class="" rowspan="2" style="width: 1px; background-color: #e5e5e5;"><div class="" style="width: 1px; background-color: #e5e5e5;"></div></td></tr><tr style="" class=""><td class="" style="width: 100%; vertical-align: middle; font-family: 'Arial', 'Helvetica Neue', 'Helvetica', 'sans-serif';"><div class="" style="font-size: 0pt; padding: 1px 20px 1px 10px;"><a
 href="https://www.dropbox.com/sh/6je6fz2tsjy0r6x/AAA1yr9P6RrlEWaqk5lWjLNSa" class="" style="color: black; text-decoration: none !important;cursor:pointer !important;" target="_blank"><span class="" style="display: inline-block; line-height: 11px; max-width: 289px; min-width: 229px; overflow: hidden; max-height: 13px; word-break: break-all;"><span class="" style="vertical-align:middle; font-size: 9px; line-height: 11px; color: #999999; -moz-text-size-adjust: none; -ms-text-size-adjust: none; -webkit-text-size-adjust:none; text-size-adjust:none;">View on <span class="" style="font-weight: bold">www.dropbox.com</span></span></span></a></div></td><td class="" style="vertical-align: middle; width: 100px; font-family: 'Arial', 'Helvetica Neue', 'Helvetica', 'sans-serif';"><div class="" style="padding: 2px 20px 4px 0px;; max-width: 100px; min-width: 80px; overflow: hidden; text-align: right; line-height: 11px; max-height: 13px; font-size: 0pt;"><span class=""
 style="vertical-align:middle; font-size: 9px; line-height: 11px; color: #999999; -moz-text-size-adjust: none; -ms-text-size-adjust: none; -webkit-text-size-adjust:none; text-size-adjust:none;">Preview by Yahoo</span></div></td></tr><tr style="" class=""><td class="" colspan="6" style="height: 1px; background-color: #e5e5e5;"><div class="" style="height: 1px; background-color: #e5e5e5;"></div></td></tr></tbody></table></div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;"> </div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">I made summary of all possible sensor profiles. For each profile I wrote at which "dpi" setting of windows driver</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style:
 normal;">    it is used, value of the DPISET register, value of the AVEENB bit (average over few pixels or drop pixels):<br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;"> /*<br style="" class="">        {CCD_CS8400F, dpi, 22000, 0x0, 0xff, 0x0, 5168, 0,0x2a,0x 0, 0x 0, 0x 0, -1, 0x07, 0x08, -1, -1,<br style="" class="">        {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x0c, 0x10, 0x2a, 0x30, 0x00, 0x00, 0x9a},<br style="" class="">        {0x01, 0x04, 0x07, 0x0a, 0x0d, 0x10, 0x1b, 0x00, 0x40, 0x00, 0x00, -1, 0x88},<br style="" class="">        }, // Scanner init, DPISET=600; AVEENB=1<br style="" class="">        {CCD_CS8400F, dpi, 10800, 0xe3f, 0x0,
 0x1b6db, 5168, 0,0x2a,0x 0, 0x 0, 0x 0, -1, 0x01, 0x02, -1, -1,<br style="" class="">        {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0c, 0x13, 0x2a, 0x30, 0x00, 0x00, 0x84, },<br style="" class="">        {0x0d,0x10,0x01,0x04,0x07,0x0a,0x6b,0x00,0x40,0x00,0x00,-1,0x88,},<br style="" class="">        }, // Scanner init DPISET=2400, most probably TPU, AVEENB=1<br style="" class="">        {CCD_CS8400F, dpi, 7200, 0xe3f, 0x0, 0x1b6db, 5168, 0,-1,0xfffffffffffffeff, 0xfffffffffffffeff, 0xfffffffffffffeff, -1, 0x01, 0x02, -1, -1,<br style="" class="">        {-1, -1, -1, -1, -1, -1, 0x33, 0x0c, 0x13, -1, 0x30, -1, 0x00, 0x84},<br style="" class="">        {0x0d,0x10,0x01,0x04,0x07,0x0a,0x6b,-1,0x40,0x00,0x00,-1,0x88},<br style=""
 class="">        }, // 600 dpi DPISET=4800 (last value 0x88 -> 0x85); 400,300 dpi DPISET=2400, last number 0x85; 100 dpi DPISET=1200<br style="" class="">        {CCD_CS8400F, dpi, 7200, 0xe3f, 0x0, 0x1b6db, 5168, 0,0x2a,0x 0, 0x 0, 0x 0, -1, 0x01, 0x02, -1, -1,<br style="" class="">        {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0c, 0x13, 0x2a, 0x30, 0x00, 0x00, 0x84},<br style="" class="">        {0x0d, 0x10, 0x01, 0x04, 0x07, 0x0a, 0x6b, 0x00, 0x40, 0x00, 0x00,   -1, 0x85},<br style="" class="">        }, // 800 dpi, DPISET=4800<br style="" class="">        {CCD_CS8400F, dpi, 14400, 0x1ff, 0x0, 0x24924, 5168, 0,0x2a,0x 0, 0x 0, 0x 0, -1, 0x00, 0x01, -1, -1,<br style="" class="">        {0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0c, 0x11, 0x2a, 0x30, 0x00, 0x00, 0x84},<br style="" class="">        {0x0b, 0x0e, 0x11, 0x02, 0x05, 0x08, 0x63, 0x00, 0x40, 0x00, 0x00,   -1, 0x82},<br style="" class="">        }, // 1200, 1600 dpi; DPISET=4800<br style="" class="">        {CCD_CS8400F, dpi, 28800,   0x0, 0x0, 0x24924, 5168, 0,0x2a,0x 0, 0x 0, 0x 0, -1, 0x09, 0x0a, -1, -1,<br style="" class="">        {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0c, 0x10, 0x2a, 0x30, 0x00, 0x20, 0x84, },<br style="" class="">        {0x02, 0x05, 0x08, 0x0b, 0x0e, 0x11, 0x1b, 0x00, 0x40, 0x00, 0x00,   -1, 0x88},<br style="" class="">        }, // 3200,2400 scan; DPISET=4800 (last value can be 0x88 -> 0x81)</div><div class=""
 style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">        //</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">        // AVEENB=1 for dpi from 100-400 range; AVEENB=0 for dpi 600-3200 range</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">          */</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">   This values are almost ready to be plugged into the code. I have to replace at some places "-1" values. What is strange for me</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px;
 font-family: serif; background-color: transparent; font-style: normal;">   that DPISET values are very high with respect to dpi setting reported by driver.</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;"><br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">My questions are:</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">1) what does the second field (dpi) means in the scanner profile? Is this value of the DPISET register?</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">2) I did not manage to follow where actually sane decides which profile to use, which DPISET
 value to select?</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">   In other words how to make sure that the correct combination will be selected for scan if I pass resolution of dpi to scanimage.</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">3) From the logs I do not see how to extract motor tables (like one in the genesys_gl843.h at line 678). In the logs</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">I have seen setting up of the MTRTBL bit for downloading table (genesys_write_register(0x5b,0x01)genesys_write_register(0x5c,0x00))</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style:
 normal;">This statements are followed by data. Is that data a motor table?</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">Best regards,</div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;">Myroslav<br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 10.6667px; font-family: serif; background-color: transparent; font-style: normal;"> </div></div></body></html>