Wed, 03 Dec 2008

Ubuntu and Scanning


Keywords: linux ubuntu 8.10 intrepid ibex sane hp scanjet 5370C avision

Another of the things that broke when I upgraded Ubuntu to 8.10 was the scanning. To be fair, it had barely been working since the upgrade to 8.04, but with 8.10 scanimage just crashed. I debugged it a little and discovered that by uncommenting "option disable-calibration" in /etc/sane.d/avision.conf I could avoid the crash, but after scanning in one direction the scanner wouldn't return to its resting position.

Eventually, I decided that if I was going to fix the crash I'd have to build a debugging version of the code, and that if I was going to do that I should get the latest version available. It turns out that was in a CVS repository and was fairly easy to obtain and build:

cvs -z3 -d:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/sane co sane-backends
./configure --sysconfdir=/etc --prefix=/usr/local/pkg/sane
make
make install

And BINGO! The crash was fixed, and I didn't had to change any code at all.

I still had the problem, which was also there in 8.04, that the preview in xsane has diagonal stripes. Do I decided to do away with xsane and replace it by a small shell script which I imaginatively named scan:

#!/bin/sh

out=$1
shift

LD_LIBRARY_PATH=/usr/local/pkg/sane/lib/sane:$LD_LIBRARY_PATH
/usr/local/pkg/sane/bin/scanimage -d avision -v -p --resolution=300 "$@" > /tmp/out.pnm
convert -quality 90 -verbose /tmp/out.pnm $out
gimp $out

So now, when I scan album art, for example, (which is what I most commonly scan nowadays), I can just type scan front.jpg and the cover is scanned and thrown up in gimp for me to crop and save. This has been working well so far.

[/unix] permanent link

Tue, 02 Dec 2008

Ubuntu and Pulseaudio


Keywords: linux ubuntu 8.10 intrepid ibex pulseaudio problems solution success multimedia keys volume

I recently upgraded my desktop box from Ubuntu 8.04 (Hardy Heron) to 8.10 (Intrepid Ibex). (I've written down the names so I can look them up when I need to. At least they seem to have settled on some sort of alphabetical system nowadays.)

Anyway, one of the things that broke during the process was sound. And for me it didn't just work, which is bad and wrong. So I searched the web and discovered that 8.10 is now using pulseaudio by default and that I wasn't alone with my sound problem, with many people claiming that pulseaudio just wasn't yet ready for primetime.

So I read up a little on pulseaudio, found out lots of things I didn't really want to know, tweaked all sorts of stuff and eventually got sound out of amarok, but not flash or any of the video players. And not after I had rebooted until I messed with things again. The "solution" involved killing pulseaudio and forcing things to use alsa or oss or something, and it also broke the remaining working multimedia buttons including the volume control, the rest already having been seen off by the upgrade.

Eventually, I really needed to hear something that was on flash, so I searched the web again, and came across a page on the ubuntu forum. I followed it, I set the resample-method to the highest quality, and everything just worked again.

Well, mostly.

Some of the tracks I played caused pulseaudio to crash. So I reduced the resample-method by one notch and things seem OK there so far. I got the volume and mute multimedia keys on my keyboard to work by setting the Default Mixer Track in System/Preferences/Sound to the appropriate "Playback: ALSA" device. I got the rest to work by running the Gnome Multimedia Key's script in the amarok script manager (the author must have been a greengrocer in a previous life).

Of course, the display, the scanner and other stuff were all just as broken as before. But that's another story.

(I'm not sure whether adding the new repositories is strictly necessary - no packages were installed from them - but I can't be bothered to mess with it any more.)

[/unix] permanent link




November 2022
Sun Mon Tue Wed Thu Fri Sat