[sane-devel] HP Scanjet 2400 support for genesys backend

Julien TIERNY julien.tierny@wanadoo.fr
Sat, 17 Apr 2004 12:52:57 +0200


--Boundary-00=_JyQgA8cQWWjmWkE
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

hi all,

	Henning : sorry for my two weeks of silence but I had to work for my studies. 
You will find attached a basic patch for hp2400 scanjet's support in genesys 
backend.
	Except adding IDs of the scanner in the 'genesys_usb_device_list' array and 
adding a specific 'Genesys_Model' data structure, I don't know what to do.



	I compiled the sane distribution (1.0.13) patched with the genesys backend 
and here are various outputs:



"
# sane-find-scanner

  # No SCSI scanners found. If you expected something different, make sure 
that
  # you have loaded a SCSI driver for your SCSI adapter.
  # Also you need support for SCSI Generic (sg) in your operating system.
  # If using Linux, try "modprobe sg".

found USB scanner (vendor=0x03f0 [Hewlett-Packard], product=0x0a01 [hp scanjet 
scanner]) at libusb:005:002
found USB scanner (vendor=0x06b9 [ALCATEL], product=0x4061 [Speed Touch USB ]) 
at libusb:003:002
  # Your USB scanner was (probably) detected. It may or may not be supported 
by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Scanners connected to the parallel port or other proprietary ports can't 
be
  # detected by this program.
"



"
# scanimage genesys:libusb:005:002
scanimage: no SANE devices found
"


"
# xscanimage genesys:libusb:005:002
xscanimage: relocation error: /usr/lib/sane/libsane-genesys.so.1: undefined 
symbol: sanei_usb_init
"



	- Could someone explain me why the 'chip' field doesn't appear in 
sane-find-scanner's output ?
	- Why the scanimage frontend can't find the device while sane-find-scanner 
could ?
	- What's the deal with /usr/lib/sane/libsane-genesys.so.1's symbols ? Would I 
have too agressive CFLAGS ?


	thanx for your help, julien

--Boundary-00=_JyQgA8cQWWjmWkE
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="patch_HPscanjet2400"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="patch_HPscanjet2400"

*** backend_original/genesys_low.c	Sat Feb 28 12:00:08 2004
--- backend_modified/genesys_low.c	Sun Apr  4 19:53:41 2004
*************** static Genesys_Model canon_lide_50_model
*** 3902,3910 ****
--- 3902,3948 ----
      /* untested, values set by hmg */
  };
  
+ static Genesys_Model hp_scanjet_2400_model = {
+   "hp-scanjet-2400",            /* Name */
+   "Hewlett-Packard",            /* Device vendor string */
+   "ScanJet 2400",               /* Device model name */
+ 
+   1200,                         /* maximum optical sensor resolution */
+   1200,                         /* motor base steps */
+   2400,                         /* maximum motor resolution */
+ 
+   {1200, 600, 300, 150, 75, 0}, /* possible x-resolutions */
+   {2400, 1200, 600, 300, 150, 75, 0},   /* possible y-resolutions */
+   {48, 40, 32, 24, 16, 8, 0},   /* possible depths in gray mode */
+   {48, 40, 32, 24, 16, 8, 0},   /* possible depths in color mode */
+ 
+   SANE_FIX (3.5),               /* Start of scan area in mm  (x) */
+   SANE_FIX (7.5),               /* Start of scan area in mm (y) */
+   SANE_FIX (215.9),             /* Size of scan area in mm (x) */
+   SANE_FIX (297.2),             /* Size of scan area in mm (y) */
+ 
+   SANE_FIX (0.0),               /* Start of white strip in mm (y) */
+   SANE_FIX (1.0),               /* Start of black mark in mm (x) */
+ 
+   SANE_FIX (0.0),               /* Start of scan area in TA mode in mm (x) */
+   SANE_FIX (0.0),               /* Start of scan area in TA mode in mm (y) */
+   SANE_FIX (100.0),             /* Size of scan area in TA mode in mm (x) */
+   SANE_FIX (100.0),             /* Size of scan area in TA mode in mm (y) */
+ 
+   SANE_FIX (0.0),               /* Start of white strip in TA mode in mm (y) */
+ 
+   0, 8, 16,                      /* RGB CCD Line-distance correction in pixel */
+ 
+   COLOR_ORDER_BGR,              /* Order of the CCD/CIS colors */
+ 
+   SANE_FALSE,                    /* Is this a CIS scanner? */
+   GENESYS_FLAG_UNTESTED         /* Which flags are needed for this scanner? */
+     /* untested, values set by julien t. according to vendor's datasheet. */
+ };
  
  static Genesys_USB_Device_Entry genesys_usb_device_list[] = {
    {0x0638, 0x0a10, &umax_astra_4500_model},
    {0x04a9, 0x2213, &canon_lide_50_model},
+   {0x03f0, 0x0a01, &hp_scanjet_2400_model},
    {0, 0, NULL}
  };

--Boundary-00=_JyQgA8cQWWjmWkE--