[sane-devel] GPL driver for Samsung SCX-4200 MFP
Hi Abel, > > Great work! Having done some reverse engineering myself sone years ago, > I believe that have an idea how much sweat you must have put into > analyzing the data traffic. > > A small remark: The third byte of many commands you list on the web page > seem to be SCSI commands: > > 06 - this one does not match... > 12 - INQUIRY > 16 - RESERVE UNIT > 17 - RELEASE UNIT > 24 - SET WINDOW > 28 - READ > 29 - READ GENERATION > 31 - OBJECT POSITION (used to load or unload a sheet in the ADF) Well, it is pretty well possible that it is based on this; however, I've just tried some other scsi commands, and they don't work (namely: 00 - test unit ready, 03 - request sense, 1D - send diagnostic) - there is no answer from scanner for those :( On the other hand, output of cmd12 can be somehow meaningfully matched to what a scsi device should return ('SAMSUNG ', 'ORION ', ... and even those flags before these strings do make some sense..), and also 2nd byte of answers could be scsi status byte directly - 02 would be 'check condition' (ie some kind of error), 08 is 'busy' which matches the semantics of 'read' that can't be finished at this time and should be tried again... So it is probably worth having a look at those scsi specs; however right now the code ignores error responses at all, and as it is pretty stable for my scx-4200 (I did get an error message only during my attempts to format configuration command, and never afterwards) I'll rather look first to other issues (like estimating pixel size of scanned area before we get all data or making a backend out of it ;) But anyway, thanks for the pointers, maybe it will shed some more light to this.. (I wouldn't even be surprised if it turns out to be the same protocol as some other devices use - I have no idea what is currently 'out there', my last experience with scanners was good old hp scanjet :) Vlado > > You can find a general description of SCSI command here: > http://t10.org/ftp/t10/drafts/s2/s2-r10l.pdf > > If my guess is right that these Samsung devices use SCSI commands, you > might consider to issue a REQUEST SENSE command when a "regular" command > fails with the (one-byte) status code "CHECK CONDITION". The sense data > often give a better clue, what went wrong -- though without the > documentation from Samsung it can be quite hard to figure out the > meaning of some responses to REQUEST SENSE. Example: Some SCSI scanners > call tell that the fuse of the stepper motor is blown. Though there are > some quite useful generic error messages. IIRC, byte 16 and 17 of the > REQUEST SENSE response often point to those byte of a command sent to > the device that have an invalid value. Very handy for debugging :) > > Anyway, it is possible that I am writing nonsense (admittedly, I did not > look into your source code, and I do not have a Samsung MFP and don't > intend to buy one...) -- but if my guess is correct, I could send you > some PDF files with the specs of some Fujitsu scanners and image files > of the specs of some Sharp scanners. Might help you to figure out some > details of the commands these Samsung devices expect. > > Abel
[sane-devel] xsane-0.995 released
Hello. I just released xsane-0.995 as sourcecode with the appended changes. Thanks to everyone who sent code improvements and for everyone who cares about the translations. I hope we have a stable version with xsane-0.995. Have a lot of fun and good results. Best regards Oliver List of changes: - changed layout of copy setup, removed border around all setup tabs - changed layout of xsane main window - xsane-front-gtk.c: xsane_browse_filename_callback: xsane.cms_function_option_menu is only up - xsane-save.c: write_smtp_header(): it is allowed to specify multiple mail receivers in a com - xsane-save.c: write_smtp_header(): MAIL FROM and RCPT TO use syntax "" inst - xsane-front-gtk.c: created xsane_progress_bar_set_fraction which uses the gtk2 functions when available and which only updates the progress_bar every 2.5 percent what speeds up several functions - especially saving file routines - xsane*.c: replaced all gtk_progress_bar_update() by xsane_progress_bar_set_fraction() - xsane-back-gtk.c: in function xsane_back_gtk_value_update() replaced comparison for SANE_FIX values if (new_val != val) by if (abs(new_val - val) > 1) - changed all "scanarea" to "scan_area" or "scan area" - xsane-gtk-1_x-compat.h: changed gtk_progress_bar_set_ellipsize() to gtk_progress_bar_set_ellipsize(pbar, mode) - xsane_help_no_devices() changed buf size to 1024 - translations: U=updated, N=not updated, A=added/new ca cs da de es fi fr hu it ja nl pa U N U N N A N N U N N U 99599 99599 96 99595 99 99595 99 995 pl pt pt_BR ro ru sk sl sr sv tr vi zh zh_CN N N N N N U N U N N N N N 99 96 9696 99 99599 99592 99 96 96 992
[sane-devel] Canon FB630U problems
I have a screwy problem I cannot figure out with a FB630U scanner. When you first plug it in scanimage -L finds the printer, but if you run scanimage -T you here the scanner recalibrate the scan bar, but then you wait for quit a while for the scan to start anywhere from 30 secs to several minutes or never start scanning and have to kill the command. After it does scan the first time everyting works perfectly from then on, Until yo either reboot or unplug/re-plug the scanner. Slackware 12 distro. Plus, the /tmp/canon.conf file appears every so ofton to cause the Device Busy error. 999alfred
[sane-devel] Formulardaten
=== == Neuer Eintrag === --- -- Formular: 'adddev' --- 1. Your email address: 'theo at vanrietpaap.nl' 2. Manufacturer (e.g. "Mustek"): 'Xerox (or Samsung) ' 3. Model name (e.g. ScanExpress 1200UB): 'Workcentre PE16' 4. Bus type: 'USB' 5. Vendor id (e.g. 0x001): '0x0924' 6. Product id (e.g. 0x0002): '0x4220' 7. Chipset (e.g. lm9831): '' 8. Comments (e.g. similar to Mustek 1234): 'The printer of this MF works perfect with the Samsung Unified Driver. (scx-4x16Series) The scanner is still huge a problem. If I go through scanner to properties/prescan a popup message says I/O error. In the Sane-list unsupported devices I read about USB descriptors that differs between Xerox and Samsung. When I click prescan or scan I hear the scanner starting up (warming up) but still the behaviour as describted above. PLEASE HELP Let me know if you need any more information from my side.' 9. Data (e.g. sane-find-scanner -v -v): 'This is sane-find-scanner from sane-backends 1.0.18-cvs # sane-find-scanner will now attempt to detect your scanner. If the # result is different from what you expected, first make sure your # scanner is powered up and properly connected to your computer. searching for SCSI scanners: checking /dev/scanner... failed to open (Invalid argument) checking /dev/sg0... failed to open (Access to resource has been denied) checking /dev/sg1... failed to open (Invalid argument) checking /dev/sg2... failed to open (Invalid argument) checking /dev/sg3... failed to open (Invalid argument) checking /dev/sg4... failed to open (Invalid argument) checking /dev/sg5... failed to open (Invalid argument) checking /dev/sg6... failed to open (Invalid argument) checking /dev/sg7... failed to open (Invalid argument) checking /dev/sg8... failed to open (Invalid argument) checking /dev/sg9... failed to open (Invalid argument) checking /dev/sga... failed to open (Invalid argument) checking /dev/sgb... failed to open (Invalid argument) checking /dev/sgc... failed to open (Invalid argument) checking /dev/sgd... failed to open (Invalid argument) checking /dev/sge... failed to open (Invalid argument) checking /dev/sgf... failed to open (Invalid argument) checking /dev/sgg... failed to open (Invalid argument) checking /dev/sgh... failed to open (Invalid argument) checking /dev/sgi... failed to open (Invalid argument) checking /dev/sgj... failed to open (Invalid argument) checking /dev/sgk... failed to open (Invalid argument) checking /dev/sgl... failed to open (Invalid argument) checking /dev/sgm... failed to open (Invalid argument) checking /dev/sgn... failed to open (Invalid argument) checking /dev/sgo... failed to open (Invalid argument) checking /dev/sgp... failed to open (Invalid argument) checking /dev/sgq... failed to open (Invalid argument) checking /dev/sgr... failed to open (Invalid argument) checking /dev/sgs... failed to open (Invalid argument) checking /dev/sgt... failed to open (Invalid argument) checking /dev/sgu... failed to open (Invalid argument) checking /dev/sgv... failed to open (Invalid argument) checking /dev/sgw... failed to open (Invalid argument) checking /dev/sgx... failed to open (Invalid argument) checking /dev/sgy... failed to open (Invalid argument) checking /dev/sgz... failed to open (Invalid argument) # No SCSI scanners found. If you expected something different, make sure that # you have loaded a kernel SCSI driver for your SCSI adapter. searching for USB scanners: checking /dev/usb/scanner... failed to open (Invalid argument) checking /dev/usb/scanner0... failed to open (Invalid argument) checking /dev/usb/scanner1... failed to open (Invalid argument) checking /dev/usb/scanner2... failed to open (Invalid argument) checking /dev/usb/scanner3... failed to open (Invalid argument) checking /dev/usb/scanner4... failed to open (Invalid argument) checking /dev/usb/scanner5... failed to open (Invalid argument) checking /dev/usb/scanner5... failed to open (Invalid argument) checking /dev/usb/scanner7... failed to open (Invalid argument) checking /dev/usb/scanner8... failed to open (Invalid argument) checking /dev/usb/scanner9... failed to open (Invalid argument) checking /dev/usb/scanner10... failed to open (Invalid argument) checking /dev/usb/scanner11... failed to open (Invalid argument) checking /dev/usb/scanner12... failed to open (Invalid argument) checking /dev/usb/scanner13... failed to open (Invalid argument) checking /dev/usb/scanner14... failed to open (Invalid argument) checking /dev/usb/scanner15... failed to open (Invalid argument) checking /dev/usbscanner... failed to open (Invalid argument) checking /dev/usbscanner0... failed to open (Invalid argument) checking /dev/usbscanner1... failed to open (Invalid argument) checking /dev/usbscanner2... failed to open (Invalid argument) check
[sane-devel] hs2p backend
On 11/21/07, jazz_johnson at verizon.net wrote: > On Tuesday 20 November 2007, m. allan noah wrote: > > my flags from backend/Makefile (generated by stock configure) > > > > CFLAGS = -g -O2 -W -Wall -Wcast-align -Wcast-qual > > -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith > > -Wreturn-type -Wstrict-prototypes -pedantic -ansi > > > > not sure why yours are not the same? > > I finally figured out that I needed to specifiy --enable-warnings for > configure: > if test "${ac_cv_c_compiler_gnu}" = "yes"; then > NORMAL_CFLAGS="\ > -W \ > -Wall" > WARN_CFLAGS="\ > -W \ > -Wall \ > -Wcast-align \ > -Wcast-qual \ > -Wmissing-declarations \ > -Wmissing-prototypes \ > -Wpointer-arith \ > -Wreturn-type \ > -Wstrict-prototypes \ > -pedantic" > > So I re-configured: > sane-backends# autoheader;autoconf;./configure --enable-warnings > and finally got gcc to run with warnings! > ahh, you are rebuilding configure. i'm lazy, i've just been manually adding your backend name to it. > I've placed latest hs2p_patch.gz on my hs2p_sane_backend website. > It compiles on both x86 and x86_64 with the aforementioned warnings > related to free(sane.name) and free(sane.model) in sane_exit(): > > # zgrep warn x86_*.gz > x86_64_log.gz:hs2p.c:1394: warning: cast discards qualifiers from pointer > target type > x86_64_log.gz:hs2p.c:1395: warning: cast discards qualifiers from pointer > target type > x86_log.gz:hs2p.c:1394: warning: cast discards qualifiers from pointer target > type > x86_log.gz:hs2p.c:1395: warning: cast discards qualifiers from pointer target > type > ok, i've not tried it yet, but i think you've reached the limits of my ability. i think that since sane.name is const, either free or the cast is going to complain. maybe someone else has an idea. allan -- "The truth is an offense, but not a sin"
[sane-devel] hs2p backend
On Tuesday 20 November 2007, m. allan noah wrote: > my flags from backend/Makefile (generated by stock configure) > > CFLAGS = -g -O2 -W -Wall -Wcast-align -Wcast-qual > -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith > -Wreturn-type -Wstrict-prototypes -pedantic -ansi > > not sure why yours are not the same? I finally figured out that I needed to specifiy --enable-warnings for configure: if test "${ac_cv_c_compiler_gnu}" = "yes"; then NORMAL_CFLAGS="\ -W \ -Wall" WARN_CFLAGS="\ -W \ -Wall \ -Wcast-align \ -Wcast-qual \ -Wmissing-declarations \ -Wmissing-prototypes \ -Wpointer-arith \ -Wreturn-type \ -Wstrict-prototypes \ -pedantic" So I re-configured: sane-backends# autoheader;autoconf;./configure --enable-warnings and finally got gcc to run with warnings! With warnings enabled I was finally able to eliminate all the warnings except the two free(sane.name) and free(sane.model) in sane_exit(); Finally figured out that I can cast something to const but not the reverse, ie. char *s; (const char *)s; /* this is OK */ const char *s; (char *)s; /* this cast discards qualifiers from pointer target type */ > > ok, current code recompiled on older 64 bit gcc, with above CFLAGS, my > comments in []: > > In file included from hs2p.c:95: > hs2p-scsi.c: In function 'print_bytes': > hs2p-scsi.c:70: warning: cast discards qualifiers from pointer target type > > [use const in your casts, since the arg is const void *] > > hs2p.c: In function 'sane_hs2p_exit': > hs2p.c:1394: warning: cast discards qualifiers from pointer target type > hs2p.c:1395: warning: cast discards qualifiers from pointer target type > > [this one i am not sure, cause we are trying to free a const string?] I tried every type of cast I could think of, but I can't remove this warning. I fixed the following warnings by changing get_list_index( char **, char *) to get_list_index( const char **, char *) and then making the opposite casts in my macro function calls: # grep get_list_index hs2p*.h hs2p.h:#define get_paddingtype_id(s) (get_list_index( paddingtype_list, (char *)(s) )) hs2p.h:#define get_halftone_code_id(s) (get_list_index( halftone_code, (char *)(s) )) hs2p.h:#define get_halftone_pattern_id(s) (get_list_index( halftone_pattern_list, (char *)(s) )) hs2p.h:#define get_auto_binarization_id(s) (get_list_index( auto_binarization_list, (char *)(s) )) hs2p.h:#define get_auto_separation_id(s) (get_list_index( auto_separation_list, (char *)(s) )) hs2p.h:#define get_noisematrix_id(s)(get_list_index( noisematrix_list, (char *)(s) )) hs2p.h:#define get_grayfilter_id(s)(get_list_index( grayfilter_list, (char *)(s) )) hs2p.h:#define get_paper_id(s) (get_list_index( paper_list, (char *)(s) )) hs2p.h:#define get_compression_id(s) (get_list_index( (const char **)compression_list, (char *)(s) )) hs2p.h:#define get_scan_source_id(s) (get_list_index( (const char **)scan_source_list, (char *)(s) )) > > hs2p.c: In function 'sane_hs2p_control_option': > hs2p.c:1869: warning: cast discards qualifiers from pointer target type > > [paper_list is declared a SANE_String_Const array, but its cast to (char > **)] > > hs2p.c: In function 'set_window_data': > hs2p.c:2140: warning: cast discards qualifiers from pointer target type > hs2p.c:2144: warning: cast discards qualifiers from pointer target type > hs2p.c:2165: warning: cast discards qualifiers from pointer target type > hs2p.c:2195: warning: cast discards qualifiers from pointer target type > hs2p.c:2203: warning: cast discards qualifiers from pointer target type > hs2p.c:2216: warning: cast discards qualifiers from pointer target type > hs2p.c:2219: warning: cast discards qualifiers from pointer target type > hs2p.c: In function 'sane_hs2p_start': > hs2p.c:2326: warning: cast discards qualifiers from pointer target type > > [same as above?] > > again, this not at all required, and we've got the ansi C ones taken > care of, so dont worry too much. > > allan > -- > "The truth is an offense, but not a sin" I've placed latest hs2p_patch.gz on my hs2p_sane_backend website. It compiles on both x86 and x86_64 with the aforementioned warnings related to free(sane.name) and free(sane.model) in sane_exit(): # zgrep warn x86_*.gz x86_64_log.gz:hs2p.c:1394: warning: cast discards qualifiers from pointer target type x86_64_log.gz:hs2p.c:1395: warning: cast discards qualifiers from pointer target type x86_log.gz:hs2p.c:1394: warning: cast discards qualifiers from pointer target type x86_log.gz:hs2p.c:1395: warning: cast discards qualifiers from pointer target type