[Hp5400backend-devel] Trouble with driver: Segmentation fault
Status: Alpha
Brought to you by:
soumarmt
From: Lilith <luc...@nt...> - 2003-06-02 12:30:16
|
Hi, Thank you for for putting the work in on this driver. I've tried to list everything I think you'll need to help resolve this: I've complied sane-backends-1.0.12 on RH8, but my hp5400 scanner is not being recognised by scanimage or xsane: scanimage -L No scanners were identified. If you were expecting something different, check that the scanner is plugged in, turned on and detected by the sane-find-scanner tool (if appropriate). Please read the documentation which came with this software (README, FAQ, manpages). sane-find-scanner -q found USB scanner (vendor=0x03f0, product=0x1005) at /dev/usb/scanner0 found USB scanner (vendor=0x03f0 [Hewlett-Packard], product=0x1005 [HP Scanjet 5400C Series]) at libusb:002:002 dll.conf contains hp5400 hp5400.conf # HP 5400C usb 0x03F0 0x1005 # # Device filename to use for scanner access /dev/usb/scanner0 (I have tried commenting out 'usb 0x03F0 0x1005' and changing it to 'usb 0x3F0 0x1005) dmesg stuff hub.c: new USB device 00:1f.4-1, assigned address 2 usb.c: USB device 2 (vend/prod 0x3f0/0x1005) is not claimed by any active driver. Adding Swap: 3068404k swap-space (priority -1) usb.c: registered new driver usbscanner scanner.c: USB scanner device (0x03f0/0x1005) now attached to scanner0 scanner.c: 0.4.12:USB Scanner Driver scanner.c: probe_scanner: User specified USB scanner -- Vendor:Product - 3f0:1005 SANE_DEBUG_HP5400=255 scanimage -d hp5400 [sanei_debug] Setting debug level of hp5400 to 255. [hp5400] sane_init: SANE hp5400 backend version 1.0-2 (from sane-backends 1.0.12) [hp5400] Reading config file [hp5400] Trying to attach /dev/usb/scanner0 [hp5400] vendor/product 0x03F0-0x1005 opened [hp5400] Read: reqtype = 0xC0, req = 0x04, value = 1200 [hp5400] Read: reqtype = 0xC0, req = 0x04, value = C500 [hp5400] Command 12 verified [hp5400] Sorry, unknown scanner version. Attempted match on 'SilitekIBlizd C3 ScannerV0.84' and 'SilitekIBlizd C3 ScannerV0.86' [hp5400] Vesion is '' [hp5400] attach_one_device: couldn't attach /dev/usb/scanner0 [hp5400] Discarding line 15 [hp5400] sane_open: Segmentation fault modules.conf #added for HP5400 scanner alias /dev/usb/scanner0 scanner options scanner vendor=0x03f0 product=0x1005 (I've also tried vendor as 0x3f0) I can see that Thomas Soumarmon's solution here (https://sourceforge.net/mailarchive/message.php?msg_id=4094726) fits my problem: > You have to modify the C code in hp5400.c to be able to run the backend. > The scanner is queried about a version string which is typically : > 'SilitekIBlizd C3 ScannerV0.84' or 'SilitekIBlizd C3 ScannerV0.86' on the > scanner we tested. > You may disable this test, changing > > if( memcmp( szVersion+1, MatchVersion, sizeof(MatchVersion)-1 ) ) > { > if( memcmp( szVersion+1, MatchVersion2, sizeof(MatchVersion2)-1 ) ) > { > DBG(DBG_MSG, "Sorry, unknown scanner version. Attempted match on '%s' > and '%s'\n", MatchVersion, MatchVersion2 ); > DBG(DBG_MSG, "Vesion is '%s'", szVersion ); > ret = -1; > goto hp5400_close_exit; > } > } But I couldn't find the above in hp5400.c. I found it in hp5400_internal.c in this form: #ifndef NO_STRING_VERSION_MATCH if (memcmp (szVersion + 1, MatchVersion, sizeof (MatchVersion) - 1)) { if (memcmp (szVersion + 1, MatchVersion2, sizeof (MatchVersion2) - 1)) { DBG (DBG_MSG, "Sorry, unknown scanner version. Attempted match on '%s' and '%s'\n", MatchVersion, MatchVersion2); DBG (DBG_MSG, "Vesion is '%s'\n", szVersion); ret = -1; goto hp5400_close_exit; } } #else DBG (DBG_MSG, "Warning, Version match is disabled. Version is '%s'\n", szVersion); #endif /* NO_STRING_VERSION_MATCH */ Is that correct? Do I still need to do this: > into : > > #ifdef 0 > if( memcmp( szVersion+1, MatchVersion, sizeof(MatchVersion)-1 ) ) > { > if( memcmp( szVersion+1, MatchVersion2, sizeof(MatchVersion2)-1 ) ) > { > DBG(DBG_MSG, "Sorry, unknown scanner version. Attempted match on '%s' > and '%s'\n", MatchVersion, MatchVersion2 ); > DBG(DBG_MSG, "Vesion is '%s'", szVersion ); > ret = -1; > goto hp5400_close_exit; > } > } > #endif Also, do I need to alter this as well: #ifndef NO_STRING_VERSION_MATCH /* Match on everything except the version number */ if (memcmp (szVersion + 1, MatchVersion, sizeof (MatchVersion) - 4)) { if (memcmp (szVersion + 1, MatchVersion2, sizeof (MatchVersion2) - 4)) { DBG (DBG_MSG, "Sorry, unknown scanner version. Attempted match on '%s' and '%s'\n", MatchVersion, MatchVersion2); DBG (DBG_MSG, "Vesion is '%s'\n", szVersion); goto hp5400_close_exit; } } #else DBG (DBG_MSG, "Warning, Version match is disabled. Version is '%s'\n", szVersion); #endif /* NO_STRING_VERSION_MATCH */ Any ideas? Is there any other info you need from me? Thanks for your time. |