[sane-devel] HP PSC 1315.
Hello, I'm new to this list but have searched through it quite a bit to find the information I've been looking for, as well as google.com and yahoo.com. Alas, those facets have failed and now I am here. So I'll give it to you straight and hopefully this issue can be solved: I have an HP PSC 1315 (1310 class) USB 2.0/1.1 all-in-one printer/scanner/copier. It is connected to a USB 2.0 port on an Asus A7N8X-E motherboard running an athlon xp 1700 cpu with 512 megs of DDR ram. The system itself runs Debian GNU/Linux [sid] with a compiled kernel 2.6.7 along with CUPS to handle the printing bit of things. Printing itself is phenominal, this is a SWEET printer. However, scanning doesn't want to work. I have installed sane (frontends is at version 1.0.12 currently in the distribution) along with hpoj (current distribution places it at version 0.91, which AFAIK should work). libusb is version 0.1.8 Here is some relevent information (please feel free to grind me for more information regarding anything - I'm a bit tired right now but I want to fix this because we have another one and need to get it setup and working in linux as well - IOW, we have 2 identical 1315's to play around with): --- celery:~# 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. found USB scanner (vendor=0x03f0 [hp], product=0x3f11 [psc 1310 series ]) at libusb:003:009 --- celery:~# lsusb | grep Hewlett Bus 003 Device 009: ID 03f0:3f11 Hewlett-Packard --- in /etc/usbmgr/usbmgr.conf I have added the following line: # PSC 1315 [HP] vendor 0x03f0 product 0x3f11 module usblp --- I have done some digging around and have discovered that as of 2.6.3 (correct me if I'm wrong) the scanner.o module is no longer used and instead libusb is what's there. When I start hpoj I get the following syslog entries: ep 19 04:42:41 celery ptal-printd: ptal-printd(mlc:usb:psc_1315) successfully initialized using /var/run/ptal-printd/mlc_usb_psc_1315*. Sep 19 04:43:10 celery ptal-mlcd: SYSLOG at /home/msp/src/debian/hpoj/hpoj-0.91/mlcd/ExMgr.h:646, dev=mlc:usb:psc_1315@/dev/usb/lp0, pid=1871, e=11, t=1095583390 ptal-mlcd successfully activated, mode=1284.4. --- Running the command: celery:~# xscanimage hpoj:mlc:usb:psc_1315 results with: Failed to open device `hpoj:mlc:usb:psc_1315': Error during device I/O. So I delve a little further celery:~# lsof | grep 1315 ptal-prin 1874 root4r FIFO 3,69 293251 /var/run/ptal-printd/mlc_usb_psc_1315 ptal-prin 1874 root5r FIFO 3,69 293252 /var/run/ptal-printd/mlc_usb_psc_1315__1 ptal-prin 1874 root6r FIFO 3,69 293253 /var/run/ptal-printd/mlc_usb_psc_1315__2 ptal-prin 1874 root7r FIFO 3,69 293254 /var/run/ptal-printd/mlc_usb_psc_1315__3 ptal-prin 1874 root8r FIFO 3,69 293255 /var/run/ptal-printd/mlc_usb_psc_1315__4 ptal-prin 1874 root9r FIFO 3,69 293256 /var/run/ptal-printd/mlc_usb_psc_1315__5 ptal-prin 1874 root 10r FIFO 3,69 293257 /var/run/ptal-printd/mlc_usb_psc_1315__6 ptal-prin 1874 root 11r FIFO 3,69 293258 /var/run/ptal-printd/mlc_usb_psc_1315__7 ptal-prin 1874 root 12r FIFO 3,69 293259 /var/run/ptal-printd/mlc_usb_psc_1315__8 ptal-prin 1874 root 13r FIFO 3,69 293260 /var/run/ptal-printd/mlc_usb_psc_1315__9 --- Some more pertinent info: celery:~# ptal-device mlc:usb:psc_1315 -- (in the following I separated each field to make reading it easier) celery:~# ptal-devid mlc:usb:psc_1315 MFG:hp; MDL:psc 1310 series; CMD:LDL,MLC,PML,DYN; CLS:PRINTER; 1284.4DL:4d,4e,1; SN:CN45VB61D0O2; S:038000820020002c1481061c250105f; Z:007; -- celery:~# ptal-hp mlc:usb:psc_1315 device Model name:psc 1310 series Model number: Q5765A Serial number: CN45VB61D0O2 Firmware version: R0012xxNx Firmware datecode: (unavailable) -- celery:~# ptal-hp mlc:usb:psc_1315 display [nothing appears, just a few blanks lines] -- celery:~# ptal-hp mlc:usb:psc_1315 clock Device clock: Jan-1-2000 12:00:00 AM I tried resetting the clock to a, pardon the pun, saner value but it refuses to budge, leading me to believe that the internal clock is not really used -- celery:~# scanimage -d hp:/dev/usb/scanner0 scanimage: open of device hp:/dev/usb/scanner0 failed: Invalid argument celery:~# scanimage -d hp:/dev/usb/scanner1 scanimage: hp-option.c:3710: hp_optset_fix_geometry_options: Assertion `tl_x tl_y br_x br_y' failed. Aborted -- I really can't think of much more... hpoj is listed at the bottom of /etc/sane.d/dll.conf I am thinking that perhaps I will have to checkout the latest CVS version of hpoj, but that will have to wait as I have a very busy weekend to complete. I did find the thread regarding the PSC
[sane-devel] posting usb logs
Mbosowo I Sampson wrote: I'm trying to reverse engineering the hp3970 scanjet. I have a couple of snooped logs I wanted some help deciphering. I didn't want to append or attach multi-megabyte files to the list, so I set up a source forge account to upload the snooped usb logs. It works but it doesn't keep the formatting when I up load them. Makes it next to impossible to read. Anyone have any suggestions on where to post logs for free? As far as I understand the sourceforge policies, you can either make it a file release or put it up on the project webspace (so it will appear on yourproject.sourceforge.net.) I think the project webspace is most appropriate for these kinds of documents. Oh, and I think it's best to zip or gzip the logs. Kind regards, Bertrik
[sane-devel] HP PSC 1315.
On Sun, 2004-09-19 at 09:00, Scott wrote: snip scanimage --version should show your sane-backends verson 1.0.14 is the latest. celery:~# 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. found USB scanner (vendor=0x03f0 [hp], product=0x3f11 [psc 1310 series ]) at libusb:003:009 --- celery:~# lsusb | grep Hewlett Bus 003 Device 009: ID 03f0:3f11 Hewlett-Packard --- in /etc/usbmgr/usbmgr.conf I have added the following line: # PSC 1315 [HP] vendor 0x03f0 product 0x3f11 module usblp --- I have done some digging around and have discovered that as of 2.6.3 (correct me if I'm wrong) the scanner.o module is no longer used and instead libusb is what's there. When I start hpoj I get the following syslog entries: ep 19 04:42:41 celery ptal-printd: ptal-printd(mlc:usb:psc_1315) successfully initialized using /var/run/ptal-printd/mlc_usb_psc_1315*. Sep 19 04:43:10 celery ptal-mlcd: SYSLOG at /home/msp/src/debian/hpoj/hpoj-0.91/mlcd/ExMgr.h:646, dev=mlc:usb:psc_1315@/dev/usb/lp0, pid=1871, e=11, t=1095583390 ptal-mlcd successfully activated, mode=1284.4. --- Running the command: celery:~# xscanimage hpoj:mlc:usb:psc_1315 xscanimage hpoj:libusb:003:009 check output form ls -l /proc/bus/ubs/003/009 should be at least rw-rw if not check your hotplug script in /etc/hotplug/usb check also /etc/hotplug/usb/libsane.usermap if your scanner is present, otherwise add a line for your scanner celery:~# scanimage -d hp:/dev/usb/scanner0 scanimage: open of device hp:/dev/usb/scanner0 failed: Invalid argument celery:~# scanimage -d hp:/dev/usb/scanner1 scanimage: hp-option.c:3710: hp_optset_fix_geometry_options: Assertion `tl_x tl_y br_x br_y' failed. Aborted If you have a kernel with a scanner.o or scanner.ko file remove the file or place the filename it in /etc/hotplug/blacklists -- I really can't think of much more... hpoj is listed at the bottom of /etc/sane.d/dll.conf if #hpoj, remove # -- -- m.vr.gr. Gerard Klaver
[sane-devel] SANE_Handle question
Paul wrote: Hi, I'm trying to implement using SANE within Scribus and I'm hitting a small snag. While the majority of the API is really simple to use, I'm having a problem with what SANE_Handle is. Its great to hear that Scribus will support Sane. The sane.h header has it defined as typedef void *SANE_Handle; There are plenty of functions which require SANE_Handle, but nothing which actually sets it! Well, there is a function which sets a SANE_Handle variable: SANE_Status sane_open (SANE_String_Const name, SANE_Handle * h); But it's easy to miss (or forget) this function while reading the docs -- that could have had easily happened for me too ;) According to the sane website, SANE does not require that a value of this type be a legal pointer value and an application shouldn't attempt to interpret the value of SANE_Handle. I think all currently existing backends interpret SANE_Handle as a pointer, but this is not required. A frontend should interpret SANE_Handle to be simply an identifier; any assumption that it might be possible to access some backend-internal stuff may fail. How should I set the handle? For instance, when I obtain the device list, I have two show for my USB webcam and one for my scanner. I have to be able to set the handle to the scanner. Is it enough to set the handle to the device name or should it be set to the physical /dev/sg0 value (which is not a good idea!) call sane_get_devices, and use the field SANE_Device.name from the elements of device_list as the first parameter in the of call sane_open. Using something like '/dev/sg0' will not work, because Sane does not know in this case, which backend should be used; 'mustek:/dev/sg0' might work. But I am not sure, if this is reasonable for a graphical frontend, where users are not supposed to have read the Sane documentation ;) The assignment of device names to real devices can offer some suprises. For example, /dev/sg0 means for Linux usually the device with the lowest SCSI ID on the first bus of the first adapter. But if this device was not powered when the SCSI adapter driver was loaded, it can later be made known to the SCSI system by a command like 'echo scsi add-single-device 0 0 4 0 /proc/scsi/scsi' , and if the system has already found three other SCSI devices, the new device will be assigned to the device file /dev/sg3. Abel
[sane-devel] SANE_Handle question
--=-QXjUhHAZchXguKpunTzh Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, I'm trying to implement using SANE within Scribus and I'm hitting a small snag. While the majority of the API is really simple to use, I'm having a problem with what SANE_Handle is. =20 Its great to hear that Scribus will support Sane. Still lots to do and a decision as to how much the support will be. Do I have it so that the scanner scans the image and then let GIMP deal with the rest or have a very basic area select mechanism? I'm happier to send things to GIMP, but then I'm lazy ;-p There are plenty of functions which require SANE_Handle, but nothing which actually sets it! =20 Well, there is a function which sets a SANE_Handle variable: =20 SANE_Status sane_open (SANE_String_Const name, SANE_Handle * h); =20 But it's easy to miss (or forget) this function while reading the docs=20 -- that could have had easily happened for me too ;) Actually, I didn't miss it, just it didn't register with me for some reason. I'm guessing that I spend way too much time doing C++ and C# now. How should I set the handle? For instance, when I obtain the device list, I have two show for my USB webcam and one for my scanner. I have to be able to set the handle to the scanner. Is it enough to set the handle to the device name or should it be set to the physical /dev/sg0 value (which is not a good idea!) =20 call sane_get_devices, and use the field SANE_Device.name from the=20 elements of device_list as the first parameter in the of call sane_open.=20 Using something like '/dev/sg0' will not work, because Sane does not=20 know in this case, which backend should be used; 'mustek:/dev/sg0' might=20 work.=20 I'll give it a spin and see what happens. Thanks for the tips. I have no doubt I'll be back to ask for more... TTFN Paul --=20 Homer: Donut?=20 Lisa: No, thanks. Do you have any fruit?=20 Homer: This has purple stuff inside. Purple is a fruit. --=-QXjUhHAZchXguKpunTzh Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBBTXEmusSVe5EZv3wRArVlAKCPPZseX/+0jd3xHMZUzk5AbA3+aQCeMaVf K4gA6dTPzO8Po4KtM83WzMI= =kZ0I -END PGP SIGNATURE- --=-QXjUhHAZchXguKpunTzh--
[sane-devel] SANE_Handle question
Paul wrote: Hi, I'm trying to implement using SANE within Scribus and I'm hitting a small snag. While the majority of the API is really simple to use, I'm having a problem with what SANE_Handle is. Its great to hear that Scribus will support Sane. Still lots to do and a decision as to how much the support will be. Do I have it so that the scanner scans the image and then let GIMP deal with the rest or have a very basic area select mechanism? I'm happier to send things to GIMP, but then I'm lazy ;-p Well, perhaps that's lazy, but reasonable: why reinvent the wheel ;) There might be an alternative: XSane or XScanimage as a plugin for Scribus, similiary as you can plug these programs into Gimp. This way, you don't have to bother with the details of the scanning UI and of the Sane API, while you get what Scribus needs: a pixel image. Moreover, XSane has many useful features, like automatic gamma correction. cheers Abel
[sane-devel] XSANE ... hotplug 'mail image' probs.
Hi, On Thu, Sep 16, 2004 at 08:48:26AM +0200, Bertrik Sikken wrote: In the 2.6.x range of kernels there is a weird issue (=bug?), i.e. there is a race between the hotplug event and the creation of the libusb 'device file' (in /proc/bus/usb). Uh, really? That makes the whole idea of hot-plug void. It hasn't happened for me, as far as I remember? The libusbscanner hotplug script does not take this into account so it may happen sometimes that the script tries to update permission for a file that doesn't exist yet. As far as I know, this race will be looked at in the next kernel series, So the fix will be there in 2 or three years? Strange. but for now you can use a dirty hack like a 'sleep 1' at the top of the hotplug script. Should we use that? Or is there a less ugly way e.g. by checking if the device file is already there? Bye, Henning
[sane-devel] HP C5100A with Mac PowerBook (OSX 10.3) via scsi/usb or scsi/firewire adapter
Hi, On Thu, Sep 16, 2004 at 04:01:50PM -0500, Albert Everett wrote: I would like to use an HP PhotoSmart Photo Scanner (C5100A, SCSI) with a Mac PowerBook G4. Does anyone know how I might get drivers for it that are compatible with OSX 10.3.5? Have you tried SANE? At least our list seems to indicate that the scanner is supported by the HP backend. Bye, Henning
[sane-devel] Problems with scsi filmscanner canon2700
Hi, On Fri, Sep 17, 2004 at 11:10:51PM +0200, Thomas Loescher wrote: did something went wrong with the kernel? In may this year, I'm very sure sane worked for me I had installed sane-backend 1.0.13 and kernel 2.4.22, now I'm using 2.4.26. The scsi controller is an tekram dc390 running with ncr53c8xx. Try if it still works with the older kernel. Bye, Henning
[sane-devel] XSANE ... hotplug 'mail image' probs.
Henning Meier-Geinitz wrote: Hi, On Thu, Sep 16, 2004 at 08:48:26AM +0200, Bertrik Sikken wrote: In the 2.6.x range of kernels there is a weird issue (=bug?), i.e. there is a race between the hotplug event and the creation of the libusb 'device file' (in /proc/bus/usb). Uh, really? That makes the whole idea of hot-plug void. It hasn't happened for me, as far as I remember? The libusbscanner hotplug script does not take this into account so it may happen sometimes that the script tries to update permission for a file that doesn't exist yet. As far as I know, this race will be looked at in the next kernel series, So the fix will be there in 2 or three years? Strange. Yes, there really is a problem, but it may have been fixed in the some of the 'generic' hotplug scripts already (I noticed a couple of sleeps here and there in usb.agent and usb.rc on my MDK10.1 system). I definitely had this problem earlier (with just about every USB device, scanner/minidisc/pendrive), but when I tried to reproduce it a moment ago but I didn't run into it anymore. So maybe I was a little paranoid. Here's a thread from linux-hotplug-devel that discusses the problem: http://marc.theaimsgroup.com/?l=linux-hotplug-develm=108034761409426w=2 (cut and paste it together if the link wraps) but for now you can use a dirty hack like a 'sleep 1' at the top of the hotplug script. Should we use that? Or is there a less ugly way e.g. by checking if the device file is already there? I'm not sure. Maybe it has really been 'fixed' in the latest hotplug package, in which case I think we need to know the exact version in which it was fixed. Instead of a sleep we could also use a loop to wait for the device (even uglier?). BTW I noticed that the cvs version of sane now has a work-around (by Jochen Eisinger) claiming # latest hotplug doesn't set DEVICE on 2.6.x kernels I think this observation is also caused by a hotplug race. Regards, Bertrik
[sane-devel] Calculating maxlen
--=-EyBgZc7L2eK+2KbXNi9a Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Just a small one here. I'm using sane_read. handle is fine, but I need to pass a buffer the size of maxlen for *data. How do I work out maxlen? Is it simply the bytes per line * pixels per line or is it found from sane_get_parameters (SANE_Params *params-size)? TTFN Paul --=20 Homer: Donut?=20 Lisa: No, thanks. Do you have any fruit?=20 Homer: This has purple stuff inside. Purple is a fruit. --=-EyBgZc7L2eK+2KbXNi9a Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBBTeBBusSVe5EZv3wRAlnwAJ9qLZVZYGqE56DYOdyJG9YgNVYIgQCdHVSK ZUchrle5CKU2yI8TRJNy8KQ= =37Y5 -END PGP SIGNATURE- --=-EyBgZc7L2eK+2KbXNi9a--
[sane-devel] Calculating maxlen
Hello Paul. max_len is set by the frontend. The buffer is allocated by the frontend and the size of the buffer must be at least max_len bytes. max_len and the size of the buffer are arbitary. The backend must be able to handle each size from max_len=1 to max_len size of the image. Best regards Oliver Am Son, 2004-09-19 um 21.38 schrieb Paul: Hi, Just a small one here. I'm using sane_read. handle is fine, but I need to pass a buffer the size of maxlen for *data. How do I work out maxlen? Is it simply the bytes per line * pixels per line or is it found from sane_get_parameters (SANE_Params *params-size)? TTFN Paul
[sane-devel] Calculating maxlen
--=-X2JfoKz2QG0ksGE+DK3H Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, max_len is set by the frontend. The buffer is allocated by the frontend and the size of the buffer must be at least max_len bytes. =20 max_len and the size of the buffer are arbitary. The backend must be able to handle each size from max_len=3D1 to max_len size of the image. Okay, I need to be clear here. max_len is some size large enough to scan something in. How do I know how big to make this to (say) scan an A4 picture at 8bpp resolution? To me, it looks like I multiply bytes_per_line * pixels_per_line * lines * depth to accomodate everything. I'm currently toying with the code so I know what has to be done when it comes to implementing the code for real. TTFN Paul --=20 Homer: Donut?=20 Lisa: No, thanks. Do you have any fruit?=20 Homer: This has purple stuff inside. Purple is a fruit. --=-X2JfoKz2QG0ksGE+DK3H Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBBTeauusSVe5EZv3wRAvoMAKCHwi6wgVbyFH07udD0WhrHfurZhQCfSMRK aSorSFwaCDufYDyD6HJzFfw= =S9gG -END PGP SIGNATURE- --=-X2JfoKz2QG0ksGE+DK3H--
[sane-devel] Calculating maxlen
Paul wrote: Hi, max_len is set by the frontend. The buffer is allocated by the frontend and the size of the buffer must be at least max_len bytes. max_len and the size of the buffer are arbitary. The backend must be able to handle each size from max_len=1 to max_len size of the image. Okay, I need to be clear here. max_len is some size large enough to scan something in. How do I know how big to make this to (say) scan an A4 picture at 8bpp resolution? To me, it looks like I multiply bytes_per_line * pixels_per_line * lines * depth to accomodate everything. I'm currently toying with the code so I know what has to be done when it comes to implementing the code for real. Paul, you can get the size of the entire image from the result of a call of sane_get_parameters. (Make sure that you call sane_get_parameters _after_ the call of sane_start. Earlier calls do not necessarily return precise values.) But you don't need to read all scan data with only one call of sane_read. An A4 size RGB scan with 300dpi has a data size of ~24 MB, and this is perhaps more than you want to keep in RAM. For a preview, lower resolutions are often preferable. I assume that Scribus has some way to calculate such a preview from a high resolution image. cheers Abel
[sane-devel] HP PSC 1315.
* gerard klaver (ger...@gkall.hobby.nl) cobbled forth: On Sun, 2004-09-19 at 09:00, Scott wrote: snip scanimage --version should show your sane-backends verson 1.0.14 is the latest. Yes. Running the command: celery:~# xscanimage hpoj:mlc:usb:psc_1315 xscanimage hpoj:libusb:003:009 Well I reinstalled and now it says it's at 003:011 so I checked permissions and sure enough it was at 644 so I switched it to 666 (for now) celery:~# xscanimage hpoj:libusb:003:011 returns with: Failed to open device `hpoj:libusb:003:011': Invalid argument. check also /etc/hotplug/usb/libsane.usermap if your scanner is present, otherwise add a line for your scanner It was not there, so I added it: # Hewlett-Packard|PSC 1315 libusbscanner 0x0003 0x03f0 0x3f110x 0x 0x00 0x000x000x000x00 0x00 0x If you have a kernel with a scanner.o or scanner.ko file remove the file or place the filename it in /etc/hotplug/blacklists I'm sticking with 2.6.7 for now in order to help stamp out bugs (2.6.8.* has a nasty bug right now that doesn't allow cd burning) I really can't think of much more... hpoj is listed at the bottom of /etc/sane.d/dll.conf if #hpoj, remove # Did that, I'm still stuck with no working scanner. I snagged the source package of hpoj 0.91 from debian and modified the debian/rules file to compile --with-libusb and with --with-usb but after I installed it, it wouldn't even detect it!! So I reverted and am going to try CVS soon. I am probably going to start cross-posting to the hpoj devel mailing list soon, as some people there appear to have gotten scanning to work. Thanks for the help so far! .oO Gnea [gnea at garson dot org] Oo. .oO url [http://gnea.net] Oo. You can tune a filesystem, but you can't tune a fish. -Kirk McKusick