SANE on Mac OS X


Navigation

Sane on Mac OS X

First a warning: It does not work! Not yet.

The instructions here are some hints to get a system that one could use to debug the problems, so please don't email me to complain that your scanner does not work under OS X. But feel free to provide fixes, more instructions or explanations why things don't work.

The following information was gathered using an iMac running Jaguar (OS X 10.2). I don't know if earlier versions of OS X behave differently, or if things will look different with the next release of the operating system.

OS X comes with all develpment tools to create applications, so there is no need to get any 3rd party software, or download any compiler or other development tools. The compiler is gcc version 3.1, but with a twist: It uses it's own preprocessor, which is incompatible with many free software packages. This preprocessor can be disabled with the -no-cpp-precomp flag. To make sure the configure scripts will use this setting, set the environment variable CFLAGS. The default shell in Mac OS X is tcsh:

setenv CFLAGS -no-cpp-precomp

OS X does however not come with an X11 server. This is of course required to get the graphical frontends to work. If all you need is scanimage, you are all set, but if you want xsane or xscanimage, you need XDarwin. In addition to XDarwin I run the OroborOSX window manager.

Then configure and compile glib and gtk. I was not sucessful in getting any gtk-2 version compiled, so I used 1.2.10. This should go without any problems. The -no-cpp-precomp setting is also necessary for the Sane packages.

The next step is to configure, compile and install the sane-backends and sane-frontends packages. Again, this should work without any problems. Once both packages are installed, give it a try and run the scanimage frontend with the test backend.

The next project is to compile xsane. This will not work as smooth as the other packages. The make step will stop with an error. The library liblib.a needs to be processed by ranlib: Just run the following command and restart make:

ranlib lib/liblib.a

Now you are ready to explore and fix all the problems with the Mac version of libusb... I don't have a SCSI interface in my iMac, and so far I have not tried anything with the IEEE-1394 interface.

I found one problem with oth xsane and xscanimage: The preview window is not updated correctly. Here are two screenshots of xsane, one right after the application was started, and the second one after I tried to create a preview from the test backend.

Update (3/11/2002)

I found and fixed one problem in sanei_usb.c. With this change, I got my EPSON backend almost working. I can initialize the backend, the frontend can get data from the scanner, a scan can be started, image data is transmitted, but the acknowledge message the backend sends after receiving the data (and signalling that the scanner can send more data) hangs. This could potentially mean that other backends can work with Mac OS X.

Some Links

The libusb can e found at http://libusb.sf.net, some information abut USB programming for OS X can be found at http://developer.apple.com/techpubs/macosx/Darwin/IOKit/DeviceInterfaces/USBBook/.

Last changed on Sun Nov 3 18:52:37 2002 Validated HTML 4.0
Karl Heinz Kremer
khk@khk.net
http://www.khk.net