Fixing Sansa attributes

As previously mentioned, I have had some file attribute problems with my new Sansa e200 series MP3 player. Basically, when I plugged it in to charge, the "hidden" attribute on various directories on the device's FAT32 filesystem were being changed.

Well, I have now automated the correction of that particular annoyance. With a simple script and udev rule, the attributes are now reset automatically whenever I plug in the device.

The script to change the attributes is as follows:

#!/bin/bash

DEV_PATH="/dev/$1"
export MTOOLS_SKIP_CHECK=1

mattrib -i "$DEV_PATH" +h ::\TMP
mattrib -i "$DEV_PATH" -h ::\MUSIC
mattrib -i "$DEV_PATH" -h ::\PLAYLISTS

Note that this script requires no changes to the mtools configuration. Instead, the -i parameter and the environment variable take care of the stuff we did with .mtoolsrc last time.

To fire this script when the device is plugged in, I added to following to my /etc/udev/rules.d/80-programs.rules file:

KERNEL=="sd[a-z][0-9]", ACTION=="add", ATTRS{model}=="Sansa e2[0-9]0*", RUN+="/home/pageer/bin/sansa-perm-fix.sh %k"

This runs when a new SCSI drive device is added and the model string matches the Sansa e200 series. It then runs the above script, passing it the name of the device, e.g. sdb1.

So, that fixes that. Now I only see the files and directories I want to see in the Rockbox file browser. I consider this a small victory for the picky among us.

My new MP3 player

As I alluded to in my last post, I finally broke down and bought a new MP3 player. In fact, it's the first MP3 player I've bought for myself. Up until now I've been using the MPIO FL100 my parents gave me as a gift 4 or 5 years ago. It's a nice player, but with 128MB of internal storage plus a 1GB SD card, it's been feeling a little cramped. Plus I cracked the screen a few weeks ago, so I fear its days may be numbered.

Sansa and MPIOFor my new player, I chose a SanDisk Sansa e280. I paid $130 for it at New Egg. I chose the Sansa because it received generally positive reviews (some even went so far as to call it an iPod killer), has a color screen, small form-factor, microSD expansion port, and, most importantly, it doesn't require special software to load music.

Hardware-wise, the Sansa e280 comes with 8GB of internal flash storage and a microSD port to allow for extra space. In addition to playing MP3's, it also has an FM radio receiver and a voice recorder. The screen is 1.8-inches and full color, running at 220x176 pixels. It has a mechanical scroll wheel with 4 buttons surrounding it. The controls are a little awkward at first, but you get used to it quickly. On the down side, the Sansa has a non-standard USB port, very similar to the iPod - but not close enough that the plugs are interchangeable.

The Sansa firmware has its ups and downs. Probably the nicest feature is that it includes a metadata database for browsing media. However, rather than requiring special client software to keep the database up-to-date, the Sansa simply auto-generates the database from the media file ID3 tags when it boots. You can just mount the Sansa as a USB mass storage device, copy your files anywhere under its music directory, and they will be detected. On the down side, this means that you may have to wait a minute or two after boot while the Sansa rebuilds the database - it does this in the foreground, so you can't listen to anything until it's done.

My main complains about SanDisk's firmware is that the Sansa's native data formats are fairly non-standard. This means that, unless you use the bundled Windows-only conversion software, it's a pain to use any of the media features other than generic MP3 playing. In particular, while the Sansa supports movies, pictures, and playlists, its native formats are Quicktime, 16 bit-per-pixel bitmap, PLP/PLA respectively. No MPEG or WMV, no JPEG or PNG, and no M3U.

All in all, the Sansa is a good MP3 player out of the box. I like it and I wouldn't hesitate to recommend it to anyone.

But on the other hand, if you're willing to do a little hacking....

One of the reviews on New Egg led me to a project called Rockbox. It's an open-source firmware replacement that runs on a number of MP3 players, including the iPod and the Sansa e200 series. Rockbox is still a work in progress, but the main features are all stable and it is more than usable for every-day purposes.

If you have or want a Sansa, I definitely recommend installing Rockbox on it. Rockbox takes the Sansa from "good" to "exciting." Just take a look at some of the key features. Rockbox offers more music navigation options than the SanDisk firmware, includes an MPEG viewer, a JPEG viewer, M3U playlists, theme support, and assorted games and applications. You can play DOOM on Rockbox, for crying out loud! They have solitaire, Pacman, a Gameboy emulator, a text editor, and a paint program, among others. Of course, the controls for all this are a little awkward, but the point is that using Rockbox over the SanDisk firmware buys you a lot of functionality compared to the little that you lose (mainly WMA support and control through the USB port).

While the Rockbox installation is isn't graphical, it's quite easy: run one interactive command to install the boot loader and then just extract a ZIP archive into the Sansa's root directory. That's it. To remove it, you just re-run to boot loader installer and tell it to uninstall. It's also worth mentioning that installing Rockbox is not an all-or-nothing deal. The boot loader includes a dual-boot feature. By holding the "prev" button during boot, you can boot back into the standard SanDisk firmware.

So if you're searching for good MP3 player, give the Sansa a look. And if you're looking for a great MP3 player, give Rockbox a look.