[sane-devel] Re: SANE LS50ED
Hello, On Monday 14 February 2005 10:19, Johannes Berg wrote: Yes. Call Nikon, they'll point you to the application forms. You have to sign a NDA and they send you the docs on CDs. well, i sent the request for the SDK some weeks ago, and now i called to know the status of my request and they tell me that they are discussing it and that they will tell me in 2 weeks... oh well... Cheers, Ariel
[sane-devel] Re: SANE LS50ED
Hubert Figuiere wrote: Can we have the documentation of the scanner protocol ? :-) Yes. Call Nikon, they'll point you to the application forms. You have to sign a NDA and they send you the docs on CDs. johannes
[sane-devel] Re: SANE LS50ED
Thanks a lot Ariel. I have no time at all these days, anyone like to volunteer to have a look? Can we have the documentation of the scanner protocol ? :-) Ah! that way it would be easy... the whole fun is doing that without it!! ;-)) Ariel
[sane-devel] Re: SANE LS50ED
On Wed, 2005-02-09 at 00:57 +, Major A wrote: Thanks a lot Ariel. I have no time at all these days, anyone like to volunteer to have a look? Can we have the documentation of the scanner protocol ? :-) Hub -- Crazy French - http://www.figuiere.net/hub/
[sane-devel] Re: SANE LS50ED
i've put the full logs of the nikonscan communication with the coolscan LS50ED in http://cvs.fzk.de/~ariel/linux/scanner/cs2usb.log.gz http://cvs.fzk.de/~ariel/linux/scanner/cs2usb.cleaned.log.gz Thanks a lot Ariel. I have no time at all these days, anyone like to volunteer to have a look? Andras
[sane-devel] Re: SANE LS50ED
Hi Johannes and Andras, yes, it has been a long time since my last mail... :-( i've been quite busy but i also spent some time trying to do a usb dump of the Nikonscan communication with the scanner. After spending some time searching for how to make it i was amazed to see that a simple mini-scan was creating a 100MBy log... oh well I did a timed log and i could more or less identify where each thing is happening. But... trying to compare the sane and nikonscan logs i see many differences... it is difficult to make something out of that without knowing how is the protocol (i know... reading the sane code of the driver should help but that also takes time... did not do that yet). Having a short list of important commands as of the specs would help... yes, i know, the NDA... Under windows for instance i see a kind of ping blocks every 2 seconds which do are not seen at all under sane. Perhaps they are not needed? These blocks have always the same structure (and data also except for few bytes), and they are also sent with a 1 millisec interval just 10ms prior to starting the preview. What seems to be quite different is that under windows the data sent to the scanner is initially in packets of size 1, 6, or 64 (=0x40) bytes (also a few of 10, 58), whereas under sane i see writes of 1,6,10,20,58 bytes since the beginning, but no 64 by ones. A typical block is appended, i will put the full log online tomorrow, i'll let you know. Cheers, Ariel - A ping block 106572 ms -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER Flags: USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK : 00 00 00 00 00 00 106574 ms -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER Flags: USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK 106574 ms -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER Flags: USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK : d0 106576 ms -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER Flags: USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK 106576 ms -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER Flags: USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK : 00 00 00 00 00 00 00 00 00 74 00 a0 0f a0 00 00 0010: 00 00 00 00 00 00 00 00 04 80 00 00 06 c2 00 00 0020: 00 02 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 0030: 00 01 01 02 02 ff 00 03 3a 40 00 00 00 00 00 00 106578 ms -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER Flags: USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK : 01 106578 ms -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER Flags: USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK : 06 106579 ms -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER Flags: USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK 106579 ms -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER Flags: USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK : 01 00 00 00 00 00 00 00 00 74 00 a0 0f a0 00 00 0010: 00 00 00 00 00 00 00 00 04 80 00 00 06 c2 00 00 0020: 00 02 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 0030: 00 01 01 02 02 ff 00 03 3a 40 00 00 00 00 00 00 106580 ms -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER Flags: USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK : 00 00 00 00 00 00 00 00 - This message was sent using IMP, the Internet Messaging Program.
[sane-devel] Re: SANE LS50ED
Any suggestions for further tests/debugging info is welcome. What we need is someone to spare a few hours and check the USB log of VueScan or Nikonscan against the Coolscan2 code. There's something the scanner doesn't like which is probably not even prohibited by the specs. Any takers? I can send you the latest version of Coolscan2 with which I've been playing, and a log as well, just let me know. Andras
[sane-devel] Re: SANE LS50ED
Oh. Weird, ok. I'll keep looking. Do you have access to the technical=20 specs of the 50/5k? Yes, and I can't see anything obviously wrong. But then I don't have time to go through it in detail anyway. Could you send me said patch? I don't have the device (yet) but would=20 like to look over it. The patch is at the end of this email. Please give it a go. Andras --- coolscan2.c 2004-10-18 17:19:15.0 +0100 +++ /tmp/coolscan2.c2005-01-05 12:15:39.0 + @@ -43,7 +43,7 @@ =20 This file implements a SANE backend for Nikon Coolscan film scanners. =20 - Written by Andr=E1s G. Major (and...@users.sourceforge.net), 2001-200= 4. + Written by Andr=E1s Major (and...@users.sourceforge.net), 2001-2002. =20 The developers wish to express their thanks to Nikon Corporation for providing technical information and thus making this backend @@ -56,7 +56,6 @@ /* Revision log: =20 - X 0.1.8, 27/09/2002, andras: added subframe and load options 0.1.7, 22/08/2002, andras: added exposure correction option and hack for LS-40 IR readout @@ -80,6 +79,10 @@ #include ctype.h #include unistd.h #include time.h +/* +#include limits.h +#include sys/types.h +*/ =20 #include ../include/sane/sane.h #include ../include/sane/sanei.h @@ -231,7 +234,6 @@ /* device characteristics */ char vendor_string[9], product_string[17], revision_string[5]; cs2_type_t type; - int boundary_type; int maxbits; unsigned int resx_optical, resx_min, resx_max, *resx_list, resx_n_list= ; unsigned int resy_optical, resy_min, resy_max, *resy_list, resy_n_list= ; @@ -1795,24 +1797,6 @@ return SANE_STATUS_UNSUPPORTED; } =20 - switch (s-type) -{ -case CS2_TYPE_LS30: -case CS2_TYPE_LS2000: -case CS2_TYPE_LS8000: - s-boundary_type =3D 1; - break; -case CS2_TYPE_LS40: -case CS2_TYPE_LS50: -case CS2_TYPE_LS4000: -case CS2_TYPE_LS5000: -case CS2_TYPE_LS9000: - s-boundary_type =3D 2; - break; -case CS2_TYPE_UNKOWN: - break; -} - if (sp) *sp =3D s; else @@ -2072,6 +2056,7 @@ size_t n_data, n_status; static SANE_Byte status_buf[8]; int status_only =3D 0; + long nn; /* LL */ =20 DBG (20, cs2_issue_cmd(): opcode =3D 0x%02x, n_send =3D %lu, n_recv =3D= %lu.\n, s-send_buf[0], (unsigned long) s-n_send, (unsigned long) s-n_r= ecv); @@ -2146,6 +2131,10 @@ status =3D SANE_STATUS_GOOD; break; case CS2_INTERFACE_USB: + /* */ + for (nn =3D 0; nn s-n_cmd; nn ++) +fprintf (stderr, %02x , s-send_buf[nn]); + fprintf (stderr, \n); status =3D sanei_usb_write_bulk (s-fd, s-send_buf, s-n_cmd); switch (cs2_phase_check (s)) { @@ -2155,6 +2144,10 @@ DBG (4, Error: cs2_issue_cmd(): Unexpected data out phase.\n); return SANE_STATUS_IO_ERROR; } + /* */ + for (nn =3D 0; nn n_data; nn ++) +fprintf (stderr, %02x , s-send_buf[s-n_cmd+nn]); + fprintf (stderr, \n); status =3D sanei_usb_write_bulk (s-fd, s-send_buf + s-n_cmd, n_data); break; @@ -2676,86 +2669,45 @@ int i_boundary; unsigned long lvalue; =20 + return SANE_STATUS_GOOD; /* */ + cs2_scanner_ready (s, CS2_STATUS_READY); cs2_init_buffer (s); + cs2_parse_cmd (s, 2a 00 88 00 00 03); + cs2_pack_byte (s, ((4 + s-n_frames * 16) 16) 0xff); + cs2_pack_byte (s, ((4 + s-n_frames * 16) 8) 0xff); + cs2_pack_byte (s, (4 + s-n_frames * 16) 0xff); + cs2_parse_cmd (s, 00); =20 - if (s-boundary_type =3D=3D 1) -{ - cs2_parse_cmd (s, 2a 00 88 00 00 03); - cs2_pack_byte (s, ((4 + s-n_frames * 16) 16) 0xff); - cs2_pack_byte (s, ((4 + s-n_frames * 16) 8) 0xff); - cs2_pack_byte (s, (4 + s-n_frames * 16) 0xff); - cs2_parse_cmd (s, 00); - - cs2_pack_byte (s, ((4 + s-n_frames * 16) 8) 0xff); - cs2_pack_byte (s, (4 + s-n_frames * 16) 0xff); - cs2_pack_byte (s, s-n_frames); - cs2_parse_cmd (s, 00); - for (i_boundary =3D 0; i_boundary s-n_frames; i_boundary++) - { - lvalue =3D s-frame_offset * i_boundary + s-subframe / s-unit_mm; - cs2_pack_byte (s, (lvalue 24) 0xff); - cs2_pack_byte (s, (lvalue 16) 0xff); - cs2_pack_byte (s, (lvalue 8) 0xff); - cs2_pack_byte (s, lvalue 0xff); - - lvalue =3D 0; - cs2_pack_byte (s, (lvalue 24) 0xff); - cs2_pack_byte (s, (lvalue 16) 0xff); - cs2_pack_byte (s, (lvalue 8) 0xff); - cs2_pack_byte (s, lvalue 0xff); - - lvalue =3D s-frame_offset * i_boundary + s-subframe / s-unit_mm + = s-frame_offset - 1; - cs2_pack_byte (s, (lvalue 24) 0xff); - cs2_pack_byte (s, (lvalue 16) 0xff); - cs2_pack_byte (s, (lvalue 8) 0xff); - cs2_pack_byte (s, lvalue 0xff); - -
[sane-devel] Re: SANE LS50ED
Hi, What we need is someone to spare a few hours and check the USB log of VueScan or Nikonscan against the Coolscan2 code. There's something the scanner doesn't like which is probably not even prohibited by the specs. Any takers? I can send you the latest version of Coolscan2 with which I've been playing, and a log as well, just let me know. i would be glad to do that, will have to wait until the weekend though. I saw your patch to the list also, so i will try that one instead of (or in addition to) the normal code. Which log can you send? the one of the Nikonscan? I hope i can reproduce that, but if you have it at habd it is also welcome. Cheers, Ariel This message was sent using IMP, the Internet Messaging Program.
[sane-devel] Re: SANE LS50ED
I saw your patch to the list also, so i will try that one instead of (or in addition to) the normal code. Which log can you send? the one of the Nikonscan? Use the code with caution, I realized after posting that I commented out a few parts of the code just to eliminate possible sources of error. This means that some features would be missing (i.e., the scanner won't set focus before the scan) even if it worked with the scanner. I hope i can reproduce that, but if you have it at habd it is also welcome. I can have a look and find it, please remind me. I can't remember what log it was, someone else sent it to me, I think it's Nikonscan. Andras
[sane-devel] Re: SANE LS50ED
Il giorno mer, 05-01-2005 alle 12:12 +, Major A ha scritto: Any suggestions for further tests/debugging info is welcome. What we need is someone to spare a few hours and check the USB log of VueScan or Nikonscan against the Coolscan2 code. There's something the scanner doesn't like which is probably not even prohibited by the specs. Any takers? I can send you the latest version of Coolscan2 with which I've been playing, and a log as well, just let me know. I might try to do it, but I only have nikon scan on MacOSX. How do I get an USB log on this platform? Bye, Giuseppe
[sane-devel] Re: SANE LS50ED
Hi, Apparently it does not work, sorry. As you noticed, I had cross-posted to sane-devel, and Andras said he also had tried that. I'm waiting for him to send me more of his recent code now. i've being playing with the trivial add-the-missing-ids patch today, and i realized that there is a hardcoded device-id in the cs2_open function, that is why your patch was not not even reporting a connected scanner for me: LS50 / 5000 have device ids of 0x4001 / 0x4002 while apparently all the other usb-coolscans(only the LS40?) have 0x4000. @@ -1679,6 +1681,8 @@ sanei_config_attach_matching_devices (scsi Nikon *, cs2_attach); try_interface = CS2_INTERFACE_USB; sanei_usb_attach_matching_devices (usb 0x04b0 0x4000, cs2_attach); + sanei_usb_attach_matching_devices (usb 0x04b0 0x4001, cs2_attach); + sanei_usb_attach_matching_devices (usb 0x04b0 0x4002, cs2_attach); return SANE_STATUS_GOOD; } With this add'l patch now the scanned is detected, and if run scanimage -d coolscan2:usb:libusb:001:002 --ae then the scanner does all the scanning noise for a while, but ends however with a IO_ERROR: --- (...) cs2_phase_check(): Phase check returned phase = 0x01. Error: cs2_issue_cmd(): Unexpected non-data phase, but n_data != 0. n_data=11838 sane_read() status=9 scanimage: sane_read: Error during device I/O --- The same happens if i run scanimage without options, the error cames pretty soon in this case: -- $ /mnt/soft/source/sane-backends-1.0.15/frontend/.libs/scanimage [sanei_debug] Setting debug level of sanei_usb to 4. [sanei_usb] sanei_usb_init: found libusb device (0x04b0/0x4001) interface 0 at libusb:001:002 [sanei_usb] sanei_usb_find_devices: vendor=0x04b0, product=0x4000 [sanei_usb] sanei_usb_find_devices: vendor=0x04b0, product=0x4001 [sanei_usb] sanei_usb_open: opened usb device `libusb:001:002' (*dn=0) cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x12, n_send = 6, n_recv = 36. [sanei_usb] sanei_usb_find_devices: vendor=0x04b0, product=0x4002 [sanei_usb] sanei_usb_open: we already have a bulk-out endpoint (address: 1), ignoring the new one [sanei_usb] sanei_usb_open: we already have a bulk-in endpoint (address: 130), ignoring the new one [sanei_usb] sanei_usb_open: opened usb device `libusb:001:002' (*dn=0) cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x12, n_send = 6, n_recv = 36. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x12, n_send = 6, n_recv = 4. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x12, n_send = 6, n_recv = 87. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x15, n_send = 18, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x2a, n_send = 30, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x2a, n_send = 32778, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x2a, n_send = 32778, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x2a, n_send = 32778, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x24, n_send = 68, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x24, n_send = 68, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x24, n_send = 68, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0xe0, n_send = 23, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0xc1, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x1b, n_send = 9, n_recv = 0. P6 # SANE data follows 3946 5782 255 sane_read() called, maxlen = 32768. cs2_issue_cmd(): opcode = 0x00, n_send = 6, n_recv = 0. cs2_issue_cmd(): opcode = 0x28, n_send = 10, n_recv = 11838. Error: cs2_issue_cmd(): Unexpected non-data phase, but n_data != 0. sane_read() status=9 scanimage: sane_read: Error during device I/O --- Actually cs2_phase_check() returns CS2_PHASE_STATUS, but with n_data == 11838 Any suggestions for further tests/debugging info is welcome. Cheers, Ariel This message was sent using IMP, the Internet Messaging Program.
[sane-devel] Re: SANE LS50ED
This is a multi-part message in MIME format. --070209090002000602030408 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Ariel Garcia schrieb: great, then send me the code, i will test it asap to see how far is goes with that So I've been looking through the code and the specs and couldn't really find anything that differs between the LS50ED specs and the current coolscan2 code. Here's a trivial patch to enable the detection of the LS50 and LS5000, maybe this is all that is required to get these devices to work for a start. You may need to adjust usb IDs too, not sure. johannes --070209090002000602030408 Content-Type: text/plain; name=ls50.patch Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=ls50.patch --- coolscan2.c.orig2004-12-15 00:28:00.439585600 +0100 +++ coolscan2.c 2004-12-15 00:47:25.174392000 +0100 @@ -114,8 +114,10 @@ CS2_TYPE_UNKOWN, CS2_TYPE_LS30, CS2_TYPE_LS40, + CS2_TYPE_LS50, CS2_TYPE_LS2000, CS2_TYPE_LS4000, + CS2_TYPE_LS5000, CS2_TYPE_LS8000 } cs2_type_t; @@ -1769,10 +1771,14 @@ s-type = CS2_TYPE_LS30; else if (!strncmp (s-product_string, LS-40 ED, 16)) s-type = CS2_TYPE_LS40; + else if (!strncmp (s-product_string, LS-50 ED, 16)) +s-type = CS2_TYPE_LS50; else if (!strncmp (s-product_string, LS-2000 , 16)) s-type = CS2_TYPE_LS2000; else if (!strncmp (s-product_string, LS-4000 ED , 16)) s-type = CS2_TYPE_LS4000; + else if (!strncmp (s-product_string, LS-5000 ED , 16)) +s-type = CS2_TYPE_LS5000; else if (!strncmp (s-product_string, LS-8000 ED , 16)) s-type = CS2_TYPE_LS8000; @@ -2505,7 +2511,7 @@ cs2_parse_cmd (s, 25 01 00 00 00); cs2_pack_byte (s, cs2_colour_list[i_colour]); cs2_parse_cmd (s, 00 00 3a 00); - s-n_recv = 58; + s-n_recv = 0x3A; /* = 50 + 8 */ status = cs2_issue_cmd (s); if (status) return status; --070209090002000602030408--
[sane-devel] Re: SANE LS50ED
So I've been looking through the code and the specs and couldn't really find anything that differs between the LS50ED specs and the current coolscan2 code. Here's a trivial patch to enable the detection of the LS50 and LS5000, maybe this is all that is required to get these devices to work for a start. You may need to adjust usb IDs too, not sure. johannes That's my problem exactly. I've tried the patch you attached, and a few things more, without any success so far. There's one major difference between the specs and the code: the LS-50/5k doesn't support Boundary information, only Boundary2. I've changed the code (not in CVS yet) to reflect that, no success nevertheless. Andras
[sane-devel] Re: SANE LS50ED
Major A schrieb: That's my problem exactly. I've tried the patch you attached, and a few things more, without any success so far. Oh. Weird, ok. I'll keep looking. Do you have access to the technical specs of the 50/5k? There's one major difference between the specs and the code: the LS-50/5k doesn't support Boundary information, only Boundary2. I've changed the code (not in CVS yet) to reflect that, no success nevertheless. Could you send me said patch? I don't have the device (yet) but would like to look over it. Thanks, johannes