SD Cards

I a similar vein, I’ve been looking around for a portable storage solution and an MP3 player, and I found a great combination in the RCA Lyra and SD Cards. I got the 64Mb model Lyra, because it was very cheap, and I put a 1Gb SD card in it, which is similarly cheap. I get 200 tracks on the card, leaving 350-odd Mbs free for files.

I did have a little trouble getting it working on Linux, but once I determined that the card was being mounted as /dev/sda1 (hurray for tail -f /var/log/messages) it was pretty easy. One other wrinkle was that the card is formatted as FAT16, which has an allocation-block limit of something silly, like 512 blocks in the root of the drive. I tried to fill the card with music, and got stopped at 90-odd files, about half-full, and I couldn’t figure it out. Eventually TLUG came to my rescue, and I learned that FAT16 breaks long filenames into blocks of a set size, so the 90-something files with long names became 512 full blocks. I created a directory on the card, dumped all the songs into it, and was able to fill the card. It seems that the limit is only for the root of the device. I’d love to use a better format, but I want it to work on any system I encounter – including the MP3 player, so I’m stuck for now. There is a 4Gb limit to FAT16 too, but I don’t think that’ll be a problem in the next year or two.

Randomized Backdrops 2.0

#!/usr/bin/perl -w

# This little program sets my background image
# randomly in blackbox (and now openbox).
# It's called when I startx.

$isxrunning = `ps -C startx | grep "startx"`;

if ($isxrunning =~ "startx") {
    changebackdrop();
} else {
    exit;
}

sub changebackdrop {
    if (!defined $ARGV[0]) {
        $backdrop_directory = "/home/willyyam/misc/bmps/";
        # Set this to your backdrop files directory.

        opendir(BD, "$backdrop_directory") or die;
        # Normally we'd report errors, but since we will be
        # running this via script and discarding the STDOUT
        # that it generates, that would be a waste of time.

        @backdrops = readdir(BD);
        # Grab the contents of the backdrop directory.

        @spordkcab = reverse(@backdrops);
        pop(@spordkcab);
        pop(@spordkcab);
        # The first two entries readdir() finds are
        # . and  ..  We don't want to hand these
        # entries to bsetbg, so I reverse the array
        # and do away with them.  There is a smooth,
        # tidy way to do this.  I don't care :-)

        $randpic = $spordkcab[ rand @spordkcab];
        $randpic = $backdrop_directory . $randpic;
        `/usr/bin/Esetroot -display :0.0 $randpic`;
        #`/usr/bin/X11/xli -display :0.0 -onroot $randpic > /dev/null &`;

        exit;
    } else {
        # If backdrop is called with an argument, use the argument
        # as the backdrop.
        `/usr/bin/Esetroot -display :0.0 $ARGV[0]`;
        #`/usr/bin/X11/xli -display :0.0 -onroot $ARGV[0] > /dev/null &`;
        exit;
    }
}

# William O'Higgins yam@nerd.cx

Resolved: 2.6.8 and USB

Well, I got things sorted. I got them sorted quite a while ago, but I have just emerged from the cave of my Masters and I resolve to begin catching up on my blogging – I haven’t been hibernating, I just haven’t done any reporting on my activities.

Okay, back to the kernel – I went through the process again, and I still had USB issues, but everything else worked. I got a bit of help from TLUG and discovered that my problems went away if I typed sudo modprobe ehci_hcd and sudo modprobe uhci_hcd, which are the modules for USB 2.0 and USB 1.1 respectively. After a bit more looking, I found that the reason I had some old, unused modules loading was that they were in /etc/modules. So, I extrapolated, put the USB modules in and commented the obsoleted ones out, and Bob’s your uncle, everything works.