[sane-devel] Possible bug in canon backend or scanimage
Dear Stef, I have changed the canon.c file as you have suggested. This fixed the bug. Here is the output of the diff command between modified and original canon.c files: 1613d1612 s-opt[OPT_CALIBRATION_GROUP].cap=SANE_CAP_ADVANCED; 1657d1655 s-opt[OPT_EJECT_GROUP].cap=SANE_CAP_ADVANCED; Please commit this change to the git repository. Best regards, Myroslav --- On Sun, 11/14/10, stef stef.dev at free.fr wrote: From: stef stef.dev at free.fr Subject: Re: [sane-devel] Possible bug in canon backend or scanimage To: Myroslav Kavatsyuk m.kavatsyuk at yahoo.com Cc: sane-devel at lists.alioth.debian.org Date: Sunday, November 14, 2010, 8:36 PM Le Saturday 13 November 2010 14:12:19 Myroslav Kavatsyuk, vous avez ?crit : Dear Stef, Please find attached log of initialization and preview done wit the Canoscan 8400F, using correct program. What shell we do with the bug in canon backend? Are you going to fix it, or shell I change the code and send you corrected version? Best regards, Myroslav ??? Hello, ??? thanks for the data. I'll have a look at it soon. ??? Since you have to device to test, I think it would be better if you could create a patch for the canon backend. The fix in canon.c to try is to add a line: s-opt[OPT_CALIBRATION_GROUP].cap=SANE_CAP_ADVANCED; and: s-opt[OPT_EJECT_GROUP].cap=SANE_CAP_ADVANCED; before the test for SANE_CAP_INACTIVE. Once you have it working, send the patch to the list so we can apply it. Regards, ??? Stef
[sane-devel] Possible bug in canon backend or scanimage
Le Saturday 13 November 2010 14:12:19 Myroslav Kavatsyuk, vous avez ?crit : Dear Stef, Please find attached log of initialization and preview done wit the Canoscan 8400F, using correct program. What shell we do with the bug in canon backend? Are you going to fix it, or shell I change the code and send you corrected version? Best regards, Myroslav Hello, thanks for the data. I'll have a look at it soon. Since you have to device to test, I think it would be better if you could create a patch for the canon backend. The fix in canon.c to try is to add a line: s-opt[OPT_CALIBRATION_GROUP].cap=SANE_CAP_ADVANCED; and: s-opt[OPT_EJECT_GROUP].cap=SANE_CAP_ADVANCED; before the test for SANE_CAP_INACTIVE. Once you have it working, send the patch to the list so we can apply it. Regards, Stef
[sane-devel] Possible bug in canon backend or scanimage
Le Wednesday 10 November 2010 09:55:10, vous avez ?crit : Dear Stef, I did not manage to compile SANE with the internal getopt_long. At least with my distribution (Ubuntu 10.10) SANE was always built with the glibc getopt_long and disregarding the definitions in the config.h. However I modified the fetch_options function (scanimage.c:859) by adding a line if(opt-name == NULL) continue; at 895. After this modification scanimage works as expected, namely it recognizes all options! May be this is a bug in the glibc implementation of getopt_long (it stops once it reaches NULL option). But I would suggest to modify the scanimage.c. Nice debugging. It looks to me it may be a canon backend bug. From reading the code it appears that all options including groups options are set up to SANE_CAP_SOFT_SELECT and SANE_CAP_SOFT_DETECT. While some groups have their cap value correctly set to 0 later, this is not the case for OPT_CALIBRATION_GROUP. The cap should be set to 0 before testing if it is inactive (this is done for other group options). Without that the group is 'settable' with a null name, which causes your problem. OPT_EJECT_GROUP has the same issue. Please find attached the usb log file of the canoscan 8400F. I am not sure if it is complete (the log was recorded while scanner reset and preview, but during the preview I notice that number of recorded packets was not changing). Please let me know if you need more information/tests. My scripts are tuned for this usb snoop program http://www.pcausa.com/Utilities/UsbSnoop/ , so I cannot parse the log you sent. The canoscan 3200F I will try during the Christmas holidays. Best regards, Myroslav Regards, Stef
[sane-devel] Possible bug in canon backend or scanimage
Dear Stef, I did not manage to compile SANE with the internal getopt_long. At least with my distribution (Ubuntu 10.10) SANE was always built with the glibc getopt_long and disregarding the definitions in the config.h. However I modified the fetch_options function (scanimage.c:859) by adding a line if(opt-name == NULL) continue; at 895. After this modification scanimage works as expected, namely it recognizes all options! May be this is a bug in the glibc implementation of getopt_long (it stops once it reaches NULL option). But I would suggest to modify the scanimage.c. Please find attached the usb log file of the canoscan 8400F. I am not sure if it is complete (the log was recorded while scanner reset and preview, but during the preview I notice that number of recorded packets was not changing). Please let me know if you need more information/tests. The canoscan 3200F I will try during the Christmas holidays. Best regards, Myroslav --- On Mon, 11/8/10, stef stef.dev at free.fr wrote: From: stef stef.dev at free.fr Subject: Re: [sane-devel] Possible bug in canon backend or scanimage To: sane-devel at lists.alioth.debian.org Cc: Myroslav Kavatsyuk m.kavatsyuk at yahoo.com Date: Monday, November 8, 2010, 9:35 PM Le Monday 08 November 2010 12:54:11 Myroslav Kavatsyuk, vous avez ?crit : Dear colleagues, Thank you for your replies. I find that addition of the --all-options is a nice idea to improve the user interface. Unfortunately it does not solve my problem. This weekend I tried to debug sane to find the source of the error. Just to remind you the problem: scanner canoscan 2700F is supposed to have extra options (reported when using --all-options flag, works with xsane) but this options are not accessible with a scanimage (reported error scanimage: unrecognized option '--af=yes') As was pointed earlier, the message is coming from the getopt_long function (frontend/scanimage.c:2094). With my compilation, the glibc implementation of the getopt_long is used, therefore I could not debug it. However, I have modified the scanimage.c in a way, to printout all command-line parameters and the content of full_optstring and all_options -- parameters of getopt_long function (frontend/scanimage.c:2094). The output you can see in the attachment (scanimage.out.highlight and scanimage.out.af). What I do not like in the output is some (null) option-names in the printed all_options (see line 29 of scanimage.out.af). This (null) string is following after the ae option, which is still working. All options below that (null) line do not work. ??? Option group don't have a name, so it's normal you get null for them. I see nothing obvious from the appended files. You can force the build and use of the internal getopt_long by undef'ing HAVE_GETOPT_LONG in include/sane/config.h, so you can really step in it with a debugger. Here, just in case, few lines which I added to scanimage.c just before while loop at the line 2094 to print parameters: ? ? ???fprintf(stderr,Full_options: %s\n,full_optstring); ? ? ???for(i=0;iall_options_len;i++) ??? ? fprintf(stderr,ap: %s\n,all_options[i].name); Please let me know your opinion on this investigation. I just noticed that there is active development of the genesys backend. I have a canoscan 8400F scanner which is build with the GL843 chip. I would like to help to make backend for this scanner. Please let me know how can I help you. ??? ??? To check how much it is different, we need a usbsnoop log of a preview done under windows. By processing it with scripts, I can extract the information needed to add it to the gl843 scanners. I also have a canoscan 3200F scanner, which I would like to rebuild to a film scanner. But before taking it completely apart I can try to see if we can make it ruining with sane. ??? In older CVS there was an experimental backend for this scanner. Maybe you could look at it. Please find attached the output of the sane-find-scanner utility. Best regards, Myroslav Regards, ??? Stef -- next part -- A non-text attachment was scrubbed... Name: Canoscan8400F.usblog Type: application/octet-stream Size: 14969 bytes Desc: not available URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20101110/f6da5346/attachment-0001.obj
[sane-devel] Possible bug in canon backend or scanimage
Hello, Just recently I bought CanoScan 2700F film scanner (SCSI, canon ackend). It works fine with the xsane/xscanimage frontends. However, I have troubles to make it working with the scanimage frontend. Namely, I can not path some scanner-specific options (--af, --afonce, --highlight). According to the manual this options are there: scanimage -d canon:/dev/sg2 -h ?? --highlight 0..255 [255] ??? Selects what radiance level should be considered white. ? Focus: ??? --af[=(yes|no)] [yes] ??? Enable/disable auto focus ??? --afonce[=(yes|no)] [yes] ??? Do auto focus only once between ejects When I execute scanimage -d canon:/dev/sg2 --resolution 2720 --film-type Slides --highlight 150 out.pnm I get the error message: scanimage: unrecognised option --highlight I have checked the source code of the canon backend and I can not see gross mistakes. Moreover I can control these options with the xsane GUI. Please give me a hint where should I look to find a solution of the problem. Thank you in advance, Best regards, Myroslav
[sane-devel] Possible bug in canon backend or scanimage
If xsane works correctly with the scanner, the problem should not be in the Canon backend. Kind regards, Ulrich Deiters -- Prof. Dr. Ulrich K. Deiters __ Institut f. Physikalische Chemie \ Luxemburger Str. 116, D-50939 Koeln Universitaet zu Koeln /\/\...\ Tel. +49 (0)221 470-4543, Fax -4900 ___L|L|__|_\ http://www.uni-koeln.de/deiters/
[sane-devel] Possible bug in canon backend or scanimage
Le Thursday 04 November 2010 22:01:48 m. allan noah, vous avez ?crit : try American English- unrecognized allan On Thu, Nov 4, 2010 at 4:53 PM, stef stef.dev at free.fr wrote: Le Thursday 04 November 2010 14:57:05 Myroslav Kavatsyuk, vous avez ?crit : Indeed, it is much better that way. This message is printed by getopt_long in scanimage. I see no other option than debugging scanimage. Especially look at the fetch_options() () which builds the list of usable options in the all_options global var. The SANE_OPTION_IS_SETTABLE test is a good place for a breakpoint. This global var is used later by getopt_long() to check command lines arguments. Regards, Stef