Archive for the 'Programming & configuration' Category

Airport Express: Linux and Mac

Sunday, April 6th, 2008

Knox got an Airport Express for his Mac. For now, we’ll use it as our music streaming solution, though my eventual goal is to get something like a Squeezebox or Sonos.

Setting up the AEX to work with the Mac was mostly simple, with one caveat: to get onto our existing wireless network, we had to provide the hex version of our 64-bit ASCII WEP key as the 40-bit WEP key the Mac dialog was asking for.

For Linux, it’s slightly more involved. I found out about raop_play, a simplistic music client that, most importantly, includes a driver such that ALSA applications can stream music to a virtual audio card which actually gets streamed to the AEX. Pretty nifty.

I followed Nils Winkler’s instructions for setting up raop_play. Here’s the additional stuff I had to do to get this to work:

  • Before compiling, install the following packages libsamplerate-devel fltk fltk-devel libid3tag-devel fltk-fluid

  • Delete the line #include <linux/config.h> in drivers/alsa_raoppcm.c

  • Patch the kernel module source

  • Create Nils’s suggested scripts: load_airport_express_driver, start_airport_express, and stop_airport_express. Modify start_airport_express to have the IP address of the AEX.

At this point, the basic infrastructure was working:

  • Run start_airport_express

  • Verify the sound “card” is installed: cat /proc/asound/cards

  • Play some music: sudo mplayer -ao alsa:device=hw=1.0 some_song.mp3

Unfortunately, I couldn’t run as non-root. My devices on /dev/snd look like this:

 drwxr-xr-x   2 root root        180 2008-04-06 07:44 .
 drwxr-xr-x  14 root root       5200 2008-04-06 07:44 ..
 crw-rw----+  1 root root     116, 6 2008-04-06 07:42 controlC0
 crw-rw----   1 root root     116, 8 2008-04-06 07:44 controlC1
 crw-rw----+  1 root root     116, 5 2008-04-06 07:42 pcmC0D0c
 crw-rw----+  1 root root     116, 4 2008-04-06 07:42 pcmC0D0p
 crw-rw----   1 root root     116, 7 2008-04-06 07:44 pcmC1D0p
 crw-rw----+  1 root root     116, 3 2008-04-06 07:42 seq
 crw-rw----+  1 root root     116, 2 2008-04-06 07:42 timer

The C1 entries are used raop_play, but you’ll notice they don’t have a + in the permissions column. Why is that? What does the + mean? Tell me if you know!

On a hunch, though, I chowned controlC1 and pcmC1d0p to my user group—and I could play as non-root.

Well, mostly. I can stream music from applications that let me select the ALSA device, such as mplayer and xmss. Unfortunately, I don’t see how to configure rhythmbox to use raop_player. (Tell me if you know!)

Sharing printer

Sunday, February 17th, 2008

Knox upgraded to Leopard, and the simple printer sharing (Linux to mac) that had been so easy to set up before stopped working. After implementing the tips here and here, I discovered that the shared printer can be found under the “Default” tab of “Print & Fax”, not under the “IP” tab. Before the upgrade, the shared printer just showed up immediately.

It should always be this easy

Sunday, January 27th, 2008

A friend gave us a new Epson Stylus R280 printer (he’s been getting several free ones with his computer and related purchases). This is good; we’ve been needing an everyday-type printer.

I started looking for drivers. The Epson site does not support Linux, but it did point me to the Avasys site, which has a driver. Unfortunately, the source RPM wouldn’t compile, but the downloaded tarball seemed to be working fine. It asked me for the name and location of the device, at which point, crossing my fingers, I proceeded to unpack the printer and hook it up….

And CUPS just recognized it instantly! I didn’t even have to finish the manual setup of the driver I had downloaded. The test page came out fine!

Is this what life is like for Mac users?

Fedora 8

Sunday, December 30th, 2007

During this vacation, I upgraded to Fedora 8. Here are some gotchas and caveats I encountered:

  • Make sure you check the install image checksum. If first downloaded the installation DVD using BitTorrent. It took over a day and the file wound up corrupt. I had to download the image directly, which took only a couple of hours and worked fine. I’ve only tried to use BitTorrent for these Fedora updates, so I’m not sure whether it is inherently slow or I have it badly misconfigured; I do know it’s supposed to checksum the files to prevent corruption.

  • The Anaconda installer would not run off the DVD on the laptop. I read that the fix is to append the following to the kernel boot line:

    floppy.allowed_drive_mask=0 clocksource=acpi_pm

  • When attempting to initiate the install on my desktop (which I tackled before the laptop, so as to have one computer operational during the process), which has migrated over the years from customized RedHat through various incarnations of Fedora, I got an error saying that filesystems “should be specified by label, not by device name”. The fix is to rename, in fstab, /dev/hd... to /dev/sd...

  • When Anaconda was trying to resolve package dependencies, it would hang at 26%. Switching to tty3, I saw the message “No package matched to remove”. It turns out this is a bug in yum. The fix is to append the following to the kernel boot line:

    updates=http://katzj.fedorapeople.org/updates-f8-yumloop.img

  • I installed the Suspend2 (now TuxOnIce) kernel. I could not get it from mhensler’s repository, so I installed it from the livna repository instead. Hibernation works fine, but suspend-to-RAM is no longer working (I can’t resume, and often it seems as though the kernel is fine but the display does not turn on on resume). I am playing around with the sleep quirks to see wheter there’s some incantation that will resolve the problem, but no luck thus far. It’s a shame, too; it’s really useful to suspend at the touch of a button as I could with F7.

  • The official recommendation from Fedora is not to install the proprietary nVidia video driver, as it does not play well with the rest of the system in case you need to uninstall it later. Packaged drivers are available from livna, but they are compiled against the vanilla kernel and not the TuxOnIce kernel. I tried briefly to compile the proprietary nVidia driver against the TuxOnIce kernel, but the installer had problems finding the kernel sources. I suspect this is a book-keeping problem in yum or the repos (since the sources and headers are marked as installed), but I haven’t tracked this down yet.

  • At the application level, as always, I refer as needed to mjmwired for the installation of useful packages.

While the suspend-to-RAM issue is big demerit, the rest of the distribution is looking pretty good in use. I got updates of packages I use all the time, and a few things are more polished (such as the mail notification on the panel and the new gdm greeter).

Fedora Core 7 Upgrade

Saturday, August 18th, 2007

Not an early adopter, I. Not for technologies I’m not helping develop….

I finally upgraded to Fedora Core 7. It went smoothly, with just two hiccups, one which Fedora could ease, and the other which was entirely my fault but serves as a good warning of how things could go wrong.

When updating the laptop, Anaconda complained about there not being enough space to proceed with the installation. I had to resize my root partition. Partition resizing is relatively easy in general if you’re using Logical Volume Management (LVM), as I am, but has an extra wrinkle when you’re trying to resize the root partition itself. Here are the steps that I took, gleaned from various sourced but mostly from the LVM HOWTO:

  • Boot from the rescue disk, mount filesystems when prompted
  • Unmount the partition you’ll be shrinking to make room for the partition you’ll be extending. My shrinking partition was /dev/VolGroup00/LogVol06, mounted on /mnt/sysimage/scratch

    umount /mnt/sysimage/scratch
    
  • Check the shrking partition’s filesystem

    e2fsck -f /dev/VolGroup00/LogVol06
    
  • Resize the shrinking partition’s filesystem. The second argument below is the new size of the partition expressed as the number of 4K blocks

    resize2fs /dev/VolGroup00/LogVol06 965120
    
  • Reduce the shrinking partition, extend the growing partition. In my case, the growing partition was /dev/VolGroup00/LogVol00

    cd /usr/sbin
    lvm lvreduce -L-350M /dev/VolGroup00/LogVol06
    lvm lvextend -L+350M /dev/VolGroup00/LogVol00
    
  • Reboot from rescue disk, do not mount filesystems when prompted

  • Expand the growing partition’s filesystem

    cd /usr/sbin
    lvm vgchange -a y
    e2fsck -f /dev/VolGroup00/LogVol00
    resize2fs  /dev/VolGroup00/LogVol00
    

After doing all this, I could successfully upgrade my system.

The second hiccup occurred on my desktop. After upgrading and a day or so of subsequent use, I suddenly found that post-boot, the login screen (gdm) would not appear; in its place, X showed only a message box that said Greeter application appears to be crashing. Attempting to use a different one. VNC sessions would not boot up properly, logging instead (in ~/.vnc) a different message: GConf Error: Failed to contact configuration server; ...

After much web research, I found two possible culprits. One was the accessibility option in gdm, so I turned that off: I sshd in remotely, ran gdmsetup and turned off accessibility. That made the greeter show up, and I could log in….but my session immediately terminated with a different dialog box showing a log message that I was out of disk space. VNC sessions still would not initiate properly.

The other possible culprit was my root partition being full. Unlike my laptop, my desktop does not use LVM, as I’ve been upgrading through several generations of Linux for, egads, eight years now. df showed my root partition being full at 100%, although, interestingly, the ratio of the df-reported Used and Available space was clearly less than 100%. Apparently, the system restricts about 10% of the disk from non-root use (otherwise Really Bad Unrecoverable Things Happen), and df takes that into account when reporting the Use% column.

Anyway, I deleted or moved/symlinked all the files or directories that I thought were safe, but to no avail. I discovered on the Internet that a standard utility, parted, will resize partitions—but you can’t change the starting location of an ext2 or ext3 partition, and in my case, the root partition was the last one on the disk. I was really SOL, up a creek without a paddle, on a trip without a toothbrush….you get the idea.

This particular story had a happy ending, though. Looking through / again, I discovered backup directories that shouldn’t have been there. Apparently something had gone wrong with my automatic back-up scripts and they had been written to the wrong location. I deleted those directories, my root partition usage fell by almost half, and my system is functional again.

The morals of this story are:

  • never let your root filesystem get too full
  • use LVM whenever you can to make partition resizing easier

“Captain’s log…”

Wednesday, December 13th, 2006

One of the problems I’ve noticed in my trips is that it is something of a hassle to record your adventures after the fact. On the Newfoundland bike trip, for example, every few days I would sit in camp updating my hand-written journal. When I got back home, it took me several weeks to slowly transcribe those notes into my computer, and several weeks more to actually pull a few entries and blog about them. In fact, it was so much hassle that my life had already moved on and I did not get to blog as much as I wanted.

To fix this problem, I’ve been lusting after a voice-recording solution so I can record my adventures on the fly. Finally, last night I bought a Belkin TuneTalk for iPod. I just tested it out, and it seems to work fine! I’ll be using it on the cross-country move trip.

My dream is to get voice recognition on my computer so that I can automatically transcribe my audio logs into text files. Unfortunately, voice recognition on Linux appears to be pretty much dead at this moment (email me if you know of a one that is currently available). I may have to take a risk and buy Naturally Speaking and hope it works on Wine….

Webcam

Sunday, November 26th, 2006

I am now Webcam-enabled! Give me a call! You need to use software that complies with the SIP or H.323 protocols. AFAIK at the moment, here’s how:

SIP: I have an SIP address registered at ekiga.net. (You should get one too, BTW!) Give me a heads-up and then point your videoconferencing software my way:

  • On Linux, use Ekiga
  • On Windows, get an SIP client, such as the free 3CX VOIP (not an endorsement; I haven’t tried them)

H.323: This is the protocol that Windows NetMeeting uses. Go to Start > Run… and type conf. If I know your username and hostname/IP, I can initiate a call. You can probably do the same if you have that information on me.

IM: Gaim does not yet seem to support video chat, and Ekiga does not seem to support the usual IM protocols (I think). I’ve read that Windows Messenger (but not MSN Messenger nor Windows Live Messenger) supports these protocols. Let us hope Microsoft will start/continue being SIP/H.323 compliant, and that the open source packages will learn to work with IM protocols.

One caveat is that I’ve only tried this within my intranet— so it may take some fiddling the first time to make sure it works fine across my router/firewall.

Here’s a list of programs that work with Ekiga.


Technical Details

I bought a Logitech QuickCam for Notebooks Pro

I downloaded the UVC driver using

svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk

and installed it using

# gmake clean
# gmake
# gmake install

On my desktop (but not on my laptop) I ran into an Anaconda installer problem: the wrong architecture is set up for compiling header modules. The fix is here.

I ran ekiga, and it just worked (after configuration the input and output audio devices)

Fedora Core 6

Friday, November 17th, 2006

I upgraded my desktop and laptop to Fedora Core 6. I downloaded the discs using BitTorrent for the first time (I first installed BitTorrent using yumex). The installation went smoothly. Here are some caveats:

  • The Anaconda installer’s dependency resolution takes a long time when upgrading, but it really is running. One just has to be patient. Really.
  • I think there’s a bug with the synaptic touch pad driver. A bunch of the windowing utilities on the laptop (buttons and menu) do not respond after you make a selection until you move the mouse some more. This is not happening on my desktop, which is why I suspect a bug in the driver and not in Gnome.
  • To update the previously installed packages using yumex, you must first go to the yumex Tools menu and select Reset Repository Cache.
  • The FC-provided nVidia driver works out of the box—but it does not support the desktop effects. Since the proprietary driver is free, I am installing this manually instead.
  • Software suspend (suspend2) works out of the box when you run, as root, /usr/sbin/hibernate…and even when you choose Suspend from the Gnome menu. Nice! It appears to be unnecessary to force the nvidia module to unload when suspending.
  • To install the fancy desktop effects, you need to install the compiz package, which adds a Desktop Effects option to your menus. Neither my desktop nor laptop video drivers supports Desktop Effects. Here’s how to configure the nVidia driver for the effects—but this seems to work only for beta versions of compiz, which I have not yet installed.
  • I recommend using mjmwired’s reference page to finish updating the installation with useful utilities. In the process, I found I had to resize my root partition. Since system-config-lvm insisted on unmounting the root partition (impossible in a normal boot), I booted from a rescue disk and did vgdisplay and lvscan to display the logical volumes and partitions, and pvextend to resize the logical partition. I then booted the system normally and did resize2fs for online resizing of the file system into the larger partition.

Fast User Switching

Saturday, June 10th, 2006

Since Knox’s laptop (Windows, poor soul) is getting repaired from its deathbed, I wanted to let him use mine without logging out of my terminal session. I just could not find the user-switch option or applet which I was sure I’d seen in FC4. After Googling for a while, it turns out that the fast [console] user switch is still there but turned off in the menu by default. To turn it on, just right click on the menus and choose “Edit Menus,” then select “New login.” I learned of this here

Fedora Core 5 Upgrade

Tuesday, May 16th, 2006

Boston under water

It’s been pretty cold and rainy in Boston. Perfect time to upgrade Linux to Fedora Core 5.

DESKTOP UPGRADE: I began upgrading my desktop system using ISO images I burned onto CD RWs. On the second CD, installation failed saying the media could not be read. I re-burned disk two and retried it, and it kept failing. At that point I rebooted into the partial FC5 system (the kernel and core packages had been updated, but not the rest of the packages) and follows the unofficial directions on upgrading via yum. From there, it went without a hitch.

I like the new FC5 system, and everything seems to work, albeit with some changes. Evolution 2.6.1 took a while to migrate everything over, but it did, eventually; I like its new “Memos” feature. The automatically mounted USB hard disk is mounted differently than with FC4 (now it does not automatically mount all the partitions, though it thinks it has; this is a small bug). My flash card reader is now mounted as a VFAT system, which means all the names are uppercase; I took this as an opportunity to upgrade my scripts to accept uppercase filenames, though I would still like to find out how to revert back to the FC4 behavior here. Lastly, I noticed that the gramps entry in my application menu disappeared, though the package and binary are still installed.

LAPTOP UPGRADE: I began to update the VAIO VGN S580 laptop using yum, but ran into exactly the same dependency issues mentioned there. I figured I’d switch over to the CD installation, but I had media problems consistently on the third disk. All these media problems make we wonder whether the CD burner is bad or the CD RW media are bad.

At any rate, I figured that since I had the first two CDs installed, I might as well tried switching over to the yum installation again. I ran into a known boot udev problem that caused the system to hang. I followed the directions here to disable udev:

# cd /mnt/sysimage
# mv sbin/pcmcia-socket-startup sbin/pcmcia-socket-startup.bak
# cd ..
# reboot

Rebooting from the hard disk did not start up my network automatically (I am using an ethernet cable rather than the wireless for the upgrade), so I rebooted and ran

# /usr/sbin/system-config-network-cmd

I was then able to update the pcmciautils package

# yum update pcmciautils

and continue with the yum-mediated FC5 upgrade.

Once this one done, the system would not boot up the XOrg server (nor the network, since I had the setwork configured to not start up automatically). This was true even if I tried to install the nVidia driver. I rebooted with the rescue CD, did

# chroot /mnt/sysimage
# yum remove xorg-x11-server-*

to remove the XOrg packages, and

# yum install xorg-x11-server-*

to reinstall them. I then re-installed the nVidia server, and then rebooted. I got the nVidia splash screen, and then the graphical boot scrren but the login manager did not show up– the system seemed to hang. Looking at the nVidia forums, I came across a set of directions. I followed these to the letter and had the same problem. After a few days of tinkering, I tried running startx from runlevel 3 as root: I got the nVidia splash screen. This provided the crucial clue: nVidia was installed correctly, but somehow the gdm package had gotten removed. Grrrr.

All systems go at this point. Now I will make sure that the packages on the desktop and the laptop are in sync.