December 14, 2007

4800x4800 dpi ... The eye of the ... Scanner

Puzzled...
Not just because the MP610 (and also MP630, MP970...) can now scan at 4800 dpi under Linux … before any 'Doze driver propose it ...?

But simply consider this Pixma scanner: can we call it a scanner? Or rather an electronic microscope?

Cannot see a detail on a photograph? just scan it with your Pixma at 4800 dpi …
and you get about 50 x zoom magnification!

Just take a look at the rightmost image. Open, it. Guess a new carpet design? Nope, simply a detail of a classic French "Marianne" stamp (here, a full view at 600 dpi), as seen by the Pixma MP610, at 4800 dpi...

Scanning at 4800 dpi is not for everyday’s usage, but this is a nice feature to have for particular tasks.

Now, some simple orders of magnitude...
  • 4800 dpi means a resolution of 2.54 cm/4800 = 5.3 µm
  • this is ~1/1.000 of a millimeter, or 1/1.000.000 of a meter
  • and also simply… ~10000 times the atom size (1 Angström = 1E-10 meters) …

So ... Will future scanners be able to display … the paper sheet atoms?!

Installation
Nothing new, the same procedure as for previous version of this driver applies:

  • simply install the latest sane-backends library (either 1.0.20 or latest git development and follow the installation instructions given in this post.
  • Then, select in your frontend (Xsane, Kooka, …) a scan resolution of 75, 150, 300, 600, 1200, 2400, or 4800 dpi ... and start scanning...

WARNING:

Be very careful when scanning at such high dpi values, because you’ll get TREMENDLY HUGE ENORMOUS amount of data and file sizes!

You could fill up your entire disk space in one scan!

Watch carefully the frontend indications about file sizes, before clicking the scan button!

Note also that in case of very large images (like more than 20000 pixels width or height in Xsane...), a frontend crash might occur, due to the large image size...


25 comments:

jbernardo said...

There is a problem with this version - with xsane 0.991 or kooka I get a "invalid argument" error at the end of the scan, be it final or preview, and with a resolution of 600, 1200, 2400 or 4800 dpi. I have yet to try smaller dpi values.

Nicolas said...

Using also xsane 0.991, but never get this error ...
If you get it in preview (this runs a basic 75 dpi scan), can you give the preview size and let me know the parameters you set in xsane ?

jbernardo said...

The preview size was "total", but I get the same error with DIN A4 portrait.
Apart from that, everything was set at the defaults.
Also, the button controled scan isn't working. xsane is waiting for something, but if I press the "color" button in the mp610, I get a color copy, and xsane still waits.

Nicolas said...

Before using button scan, did you set the MP610 in scanner mode, using the MP610 wheel ? If you are in copy mode, then the color button will produce a copy, not a scan.

Maybe you could take some traces to see what's going on:

1/ Recompile with debug infos:
$ make distclean
$ make

2/ reinstall the compiled lib:
$ sudo cp libsane-pixma.so /usr/lib/sane/libsane-pixma.so.1.0.18

3/ restart xsane like this from command line:
$ export SANE_DEBUG_PIXMA=10 ; /usr/bin/xsane

4/ run a preview, then quit xsane.

5/ Could you send me the lines in:
/var/log/syslog
that contain: [pixma-0.14.1]

Nicolas said...

Hi jbs,

I finally was able to reproduce the issue on a faster machine.

I've published a new version of the package with a fix.

Could you give a try ?

jbernardo said...

Sure, will try it straight away.

jbernardo said...

Thanks, this version now works well (and a 2400 dpi scan is huge, never mind a 4800).
Thanks a lot, you've done a great work.

Nicolas said...

That’s good news, feel free to report any other issues...

Hope you got also the multi-page scan working?

FYI, Canon has released a MP610 linux version of scangearmp. Currently testing it, but is limited to 1200 dpi, and less polyvalent than Xsane or Kooka, although it has some nice features for image correction (that can also be done with the Gimp…)

Thanks anyway for your feedback and patience to get everything working ;-)

jbernardo said...

Canon not only released a new version, but finaly released it in deb form too. I admit that now that you got us scanner support I am more interested in their printer support. I bought the turboprint drivers, but I have three pcs, so a "free" solution is better than nothing.

I'll test the multi-page later today or tomorrow, as soon as I have some free time.

Once again, thanks for everything!

Nicolas said...

The good news is that Canon seems to provide Linux drivers for new printers ... however, a little bit after products get released!

MP610 Printer tools look similar to MP600's, which worked for MP610 too, but now look nicer under GTK ;-)

Maintenance can be performed, but still no support for CD/DVD printing...

Having a free alternative in anycase is Linux / Open Source choice.
Above that, I agree that anyone is "free" to pay for any custom feature or different product, if needed.

Let me know for multipage, in fact, that's what caused me most headache while updating that driver!

Anonymous said...

Hi, you've done excellent work here, thank you!

I have a problem though. On my laptop (Ubuntu 7.10, 2.6 kernel) everything works fine.
But I have another computer - actually it's a Buffalo linkstation, which a flashed with freelink: http://nas-central.org/index.php?title=Category:FreeLink
Basicly it's a modified Debian with 2.4 kernel. And here the driver doesn't work

it compiles just fine, it detects the scanner, but cannot connect:

root@Buffalo:~/tmp/mp150-0.14.1-1u# ./scan -x 10 -y 15 -w 51 -h 25 -1 -d 10 -W test.pnm
Connected scanner(s):
1: Canon PIXMA MP610 (SN:04AZZZ5_205438)
Unable to connect to the scanner.

for the same reason make install doesn't work, manually copping libsane-pixma.so and running scanimage returns this:

root@Buffalo:~/tmp/mp150-0.14.1-1u# scanimage -L
scanimage: symbol lookup error: /usr/lib/sane/libsane-pixma.so.1: undefined symbol: pixma_dbg

dmesg returns:
usbdevfs: usb_submit_urb returned -22

uname -r:
2.4.20_mipsel_linkstation

This has probably something to do with the 2.4 kernel, but I cannot upgrade without the risk of braking my linkstation
I've been breaking my head with this for the lest few days and came up with nothing

Any ideas?

Anonymous said...

Hi nicolos,

do you plan to get this patch accepted into the official pixma-sane backend?

Michael

Nicolas said...

Hi Phoenix,
Just got your message today.

Never tested the driver with kernel 2.4 (I don't use it anymore), and I don't know whether the pixma lib works with it.

First, look only with the scan utility. Could you get some more debug infos like this:

1/ compile with debug infos:
# make distclean && make

2/ retry the following command, you should get more debug infos:
# ./scan -x 10 -y 15 -w 51 -h 25 -1 -d 10 -W test.pnm

Nicolas said...

Hi,

I would like also to have this new version of the libpixma driver "officially" integrated.

I've proposed twice to the maintainer of the official libsane-pixma library, M. Wittawat Yamwong, to conduct this update, but unfortunately for the moment, I didn't get any answer.

I'll also take contact with the Sane library administration team, to see if updating this lib via CVS could be acceptable.
Just waited a bit for user feedback, before proceeding this way.

Anonymous said...

Ok, I ran the scan with more debugging, here's the output:

# ./scan -x 10 -y 15 -w 51 -h 25 -1 -d 10 -W test.pnm
[pixma-0.14.1] Scanning devices under /proc/bus/usb
[pixma-0.14.1] find_config() found Canon PIXMA MP610
Connected scanner(s):
1: Canon PIXMA MP610 (SN:04A91725_209898)
[pixma-0.14.1] pixma_open(): Canon PIXMA MP610
[pixma-0.14.1] Set interface 0,0
[pixma-0.14.1] Found endpoints: 7 (OUT), 88 (IN), 89 (INTR,64)
[pixma-0.14.1] ERROR:pixma_set_interrupt_mode():usbSubmitUrb() failed Invalid argument
[pixma-0.14.1] ERROR:Unable to submit intr. URB
[pixma-0.14.1] pixma_connect() failed EIO
[pixma-0.14.1] pixma_open() failed EIO
[pixma-0.14.1] pixma_close(): Canon PIXMA MP610
Unable to connect to the scanner.

Nicolas said...

hi Phoenix,

Maybe a lucky day today?
I found in a dusty abandoned pile of CDs, a veteran PCLinuxOS liveCD, vintage 2003-2004... running kernel 2.4.23, but still a little fresher than your Buffalo's!

Put it in the drive, rebooted. Ok, no X11, just console (my nvidia card seems too recent...) but that's fine.

Installed, compiled the libsane pixma library: no errors too.

Started the scan program... did not work either, but at a later stage than you.

The at least 2 issues (yours and mine) are due to the libsane-pixma usb interface, obviously _not_ designed for kernel 2.4... Not a big surprise, as the libsane-pixma library started early 2006...

After reviewing the usb code and googling a bit, I propose you to try 2 changes in file usb.c
Note that it's running OK now in PClinuxOS (only first one needed but tested both)

- line 561, replace:
lurb->type = USBDEVFS_URB_TYPE_INTERRUPT;
by
lurb->type = USBDEVFS_URB_TYPE_BULK;
as earlier 2.4 kernels did not support interrupts, this "_should_" solve your usbSubmitUrb error issue...

- line 60, replace:
#define MAX_URB_BUFFER_SIZE (16*1024)
by
#define MAX_URB_BUFFER_SIZE (4*1024)
or maybe reduce 4 to 2, or to 1 if you still get a pixma_read() error when getting image from scanner.

Worth a try? recompile the whole thing, and retest ...
BTW, I could not test with scanimage, as the liveCD filesystem is read-only (cannot cp to /usr/...). Let us know too if other issues appear.

Maybe a good resolution for 2008: burry those antiques kernel for latest 2.6?
Who knows...I'll put the PClinuxOS liveCD back in the pile...

Anonymous said...

Hi, very nice job done Nicolos!

It worked very well under my Mandriva 2008 32bit, but is there the posibility to get a driver for a 64bit AMD-Version? A self compiling of the source wouldn't work for me, get alway some errors :'-(

I'll be very pleased for hints :-)

The head of autgen:

...cut..
processing .
Running libtoolize...
Running aclocal ...
Running autoheader...
autoheader: WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
autoheader: WARNING: and `config.h.top', to define templates for `config.h.in'
autoheader: WARNING: is deprecated and discouraged.
autoheader:
autoheader: WARNING: Using the third argument of `AC_DEFINE' and
autoheader: WARNING: `AC_DEFINE_UNQUOTED' allows one to define a template without
autoheader: WARNING: `acconfig.h':
autoheader:
autoheader: WARNING: AC_DEFINE([NEED_FUNC_MAIN], 1,
autoheader: [Define if a function `main' is needed.])
autoheader:
autoheader: WARNING: More sophisticated templates can also be produced, see the
autoheader: WARNING: documentation.
...cut...

This says make:

[root@localhost cngpij]# make
make all-recursive
make[1]: Entering directory `/home/gandalf/cnijfilter-common-2.80/cngpij'
Making all in cngpij
make[2]: Entering directory `/home/gandalf/cnijfilter-common-2.80/cngpij/cngpij'
gcc -DHAVE_CONFIG_H -I. -I.. -O2 -Wall -I../include/cncl -I../include/misc -I../../libs/paramlist -I../../libs/bjexec -O2 -MT bjcups.o -MD -MP -MF .deps/bjcups.Tpo -c -o bjcups.o bjcups.c
bjcups.c:30:18: Fehler: popt.h: Datei oder Verzeichnis nicht gefunden (File not found)
bjcups.c: In Funktion »init_option«:
bjcups.c:211: Fehler: Feldtyp hat unvollständigen Elementtypen (error: fieldtype not completed elements)
bjcups.c:214: Fehler: »POPT_ARG_NONE« nicht deklariert (erste Benutzung in dieser Funktion) (not declared - first use of this function)
... and much more errors of this kind...

Nicolas said...

Hi, thanks for your feedback!

I also gave a try compiling the Canon's drivers, I get the same warnings when executing the ./autogen.sh with a 32 bit distro (Ubuntu Gutsy) but these are just warnings and do not prevent autogen/automake from generating the makefiles.

Concerning your second error, it looks like you don't have the libpopt installed. You'll also need the libcups. Take a look at the README files in each driver subdirectory, they give some info on how to compile.

BTW, remember that this Canon driver is supplied with precompiled (32 bits) libraries, so there'll be at least some 32 bit code inside your 64 one...

Good luck, this is an interesting topic, let us know!

Anonymous said...

I am a Linux newbie but have done programming, etc. for about 40 years. I downloaded your driver archive and tried to do a make, but got a bunch of error messages (Ubuntu Gutsy). I wanted to test the driver on my Pixma MX700. It uses the same printer driver as the 610 and I was hoping it would use the same scanner driver. If it helps, the vendor code is OxO4a9 (of course) and the product code is 0x1729. I'm still interested in testing but would need some help.

Michael Schmidt

Nicolas said...

Hi,

Compilation on Gutsy should work out of the box. Could you tell which error messages you got ?

Also, very interested to know whether it will work with MX700. At a minimum, the MX700 needs to be declared in file pixma_mp150.c (in the #declare statements at the beginning, and at the end of this file).

Could you try that ?

Anonymous said...

Nicolos,
Michael Schmidt here. I tried to paste my log into a comment but some of the tags were misconstrued as html tags and this wasn't allowed. I'm happy to send it via an e-mail, and perhaps it would be better to not waste blog space but to take this back channel. My e-mail is MichaelMSchmidt@msn.com.

Anonymous said...

Hi,

I received a MP610 yesterday and it works perfectly (locally for the moment, I didn't check out how to set up samba yet).
Your work is amazing !
As a gentoo user, I modified the sane-pixma ebuild found on bugs.gentoo.org ( http://bugs.gentoo.org/show_bug.cgi?id=138238 ) to match it with your files (currently 0.14.4, bgo ebuild is older). It looks like this : http://nitrotoxine.free.fr/www/libre/Gentoo/sane-pixma-0.14.4.ebuild

Thanks again for your work !
Bye !

Nicolas said...

Thanks for your comment (Merci pour votre commentaire).

As you might have already noticed, the backend is now up to date in Sane CVS, so you can recompile/install Sane CVS, and get the latest pixma backend release.

Next Sane release should occur in August, so the latest pixma backend version should be included into forthcoming Linux distros soon...

Nicolas

Anonymous said...

Yeah I noticed that, but unfortunately, the device ended on a Windows box plus I didn't find any ebuild for Sane CVS and I wanted to keep my box "clean".
Anyway, your work definitely made me choose this printer and I'm not disappointed.
Thanks again for your work !
Btw, I posted my 0.14.4 ebuild on bgo. (in case some gentooer asks you)

Nicolas said...

" but unfortunately, the device ended on a Windows box "

Poor MP610, too bad to end up like this ... ;-))