Wednesday, November 18, 2009

Linux "just works"!

We just got two new toys: a Mac Mini (the basic model), and a printer/scanner (HP Deskjet). The Mac -- both the tiny little machine and the OS that it runs -- looks spectacular, even though the peripherals are all non-Apple (Dell monitor, Logitech keyboard and mouse).

The printer came with a Mac OS driver CD; we inserted, installed, and... it didn't work. The scanner program quit with an "unknown error", and offered to send a bug report to Apple. We suspect that a newer driver is required: the CD says it is for Mac OS X 10.3, 10.4 and 10.5, but the Mini has 10.6 (Snow Leopard).

So I tried plugging the printer into my Linux laptop. No driver downloads, because the HP-supported linux printer drivers were already installed. I then tried scanning an image: the scanning program (xsane) detected the scanner, and it Just Worked.

I expect the updated Mac drivers will work too. If not, it's over to consumer support. But the interesting thing to me is this: unlike many Linux drivers, which are developed by third parties, the HP drivers are from HP -- as "official" as things ever get on Linux. But the way it is done is very different. HP's Mac (and Windows) drivers are binary "blobs" that are designed for a particular OS and its particular driver model; when the OS is updated, the driver can break. Windows Vista was notorious for malfunctioning peripherals, for this reason; apparently Snow Leopard is not immune. Linux drivers are provided (mostly) as source code, and compiled against the kernel source, which is a constantly evolving object (essentially no two Linux distributions use exactly the same Linux kernel, and the kernels they use are not the "official" kernels released by Linus Torvalds). So the user does not get the HP drivers from HP's website or installation media, but bundled with the OS itself -- and it works.

Linux is sometimes criticised for evolving too rapidly, making it extremely difficult for device manufacturers to supply binary "drivers". The linux developers respond that it is better for the companies to work with the kernel community, open-source their drivers, and, if possible, include them in the "mainline kernel". That way, first, users will not need to download drivers or run "installation CDs" to get their hardware to work; second, the drivers will generally stay working. (Here's a position statement from Linux developers.)

Based on my one data point (I don't use Windows and this is my first experience with a Mac), I'd say the Linux developers have a point.


Rahul Basu said...

Rahul S: yes, but to stress your own statement - you have one data point. I have several -- 15 years of linux, 2 years of Mac and I have never had problems with any drivers for my Mac (both desktop and laptop) and infinite ones for linux. My scanner/printer just wouldn't work except as a basic printer with no options. The scanner never worked. In the earlier years even my camera, my usb stick wouldn't be recognised by linux.

I am all for open source and used it for 15 years, and I don't particularly like all the proprietary software one needs to deal with, in the Mac. (Though most open source software is available for the Mac too). But the linux community makes a fetish of wanting to make people hack their way through everything - rarely does anything 'just work' even now with fairly stable versions of Ubuntu and Debian. Apparently we are told, that is the way to learn things 'properly' which may be true but some people would rather use the computer as a tool and get on with doing what they are paid to do rather than become a linux expert. This sneering holier than thou attitude which I have found in many linux geeks including here in my institute is what puts people off (which also includes juvenile appellations like Windoze and Macintrash). I moved to Mac just to avoid such people and the hassle of having to 'make things work' (and while I am not a computer expert or geek, I am not a complete techno-dud either). BTW even now I have had problems with connecting to something as standard as WiFi using a linux laptop, particularly in IISc!

About your Snow Leopard problem -- indeed there are such issues with it and I suspect they will get resolved soon. When I bought my desktop with Leopard my scanner/printer driver worked only with Tiger but Canon had a new version on their web site which worked for Leopard and which I downloaded and used. This is one reason I haven't upgraded to Snow Leopard (yet).

Proprietary software bashing is all fine and I obviously hold no brief for them, but when innumerable things don't work on linux nobody writes a post on it --if one driver doesn't work on Mac it's time to write a post pointing out how terrible Mac is really. That's not a very balanced view.

Rahul Siddharthan said...

RB - my point was not so much about open source, but why not integrate driver development with the OS, as Linux does? It's fine if Mac or Windows are closed source, but I haven't come across non-working peripherals on Linux for years, with the single exception of the SD-MMC reader on my laptop (which didn't work on windows either -- at least, it refused to read my wife's card, which her camera reads fine). But even granted that linux peripherals are sometimes a bumpy ride (mostly due to non-cooperation from vendors), why should that be a problem for Mac or Windows?

Which leads to the second point: the reason we didn't already download the driver was its size -- a whopping 128 MB! So we will do it during the "free" hours. Now obviously if every device has a driver that size, the operating system cannot cater for every device out there. Indeed, reportedly Snow Leopard frees up a lot of disk space precisely by omitting a lot of printer drivers, compared to earlier editions of OS X. Why are Linux device drivers so compact that pretty nearly every device on the planet can be supported in around 50 MB, while a single printer/scanner driver under Mac OS X occupies 128 MB? I just checked, actually -- the hplip driver on ubuntu (for all HP printers, not just my particular model) is about 26 MB in total. And it works nicely. I think the Windows/Mac model of "insert driver CD" or "download driver" is insane: it is only justifiable for very new devices which did not exist when the OS was released and are not sufficiently similar to the OS.

I remember when a lot of storage devices -- IOmega Zip drives, etc -- did not work on Linux. That problem went away because the USB mass storage protocol became a standard. Similarly, digital cameras used to be a problem, but today they all use USB mass storage or PTP protocols. Webcams use the USB video protocol. And so on. Why do we still need driver CDs on other systems, then?

Rahul Siddharthan said...

PS - I actually have two data points. I used to have a usb-to-serial device for use with my Tata Indicom wireless phone. On linux, it worked; on Windows, I installed the driver and it worked -- until I inserted the driver into a different USB port. Then it asked me for the driver CD again. When I inserted it into the USB port I had originally used, it worked. As I said, insanity...

Anonymous said...

Windows/Mac drivers are written by device manufacturers and fair number of them until recently of them couldn't care less about Linux. But things have changed v.rapidly in the last 3-4 years since the advent of Ubuntu. The Linux community has worked with device makers to get them to part with specs so that the developer community can write these drivers. For printers/scanners HP has been the most helpful, contrasted with Lexmark and Canon (borders on foul). Which is why I ditched my Canon basic inkjet even though I got my Ubuntu box to "fool it" into working. I use an HP all in while which - yes thanks to XSane - works like a charm! Some things like dialup modems, old style webcams, digital cameras, will probably never work with Linux. But who needs them anyway.

Rahul Siddharthan said...

jbeck -- what I left unsaid was that I chose the HP printer precisely because HP supports Linux, and I also checked that this model is listed as supported on the hplip website. But Apple users do the same thing, only even more so. Most products say on the box whether or not Apple is supported; if it is not supported, you can safely assume that it will not work, and you cannot hack the system to get it to work. A few products mention linux support on the box, but for most products, it is third-party support -- but easily verifiable before purchase in any case. As you say, dial-up modems were always a problem but thankfully aren't needed by most people any more. Similarly, it was a problem using CD-RW media like floppy disks -- but that was slow and problematic even under Windows, and now everyone uses USB sticks. Today the problem people have with linux is not the hardware but the absence of certain proprietary software (Microsoft Office, Adobe Photoshop, etc) for which the free versions (, The Gimp) are deemed "still not good enough".

Among the general public, Apple's most widely used products today are not their computers but the iPod and the iPhone. And there, Paul Graham thinks they are making a big mistake by alienating programmers, and it will cost them in the long run (as it cost Microsoft in the 1990s).