iRiver ihp-120: Linux Usage and Notes

This player runs easily enough with no software. Provided you’re running a somewhat recent kernel with USB support compiled in, the device should be recognized as soon as you plug it in.The first step is to find out where your system thinks it is. Right after plugging in the unit, open a terminal and type dmesg. The output should say something like this:

hub.c: new USB device 00:0b.2-5, assigned address 2
usb.c: USB device 2 (vend/prod 0x1006/0x3002) is not claimed by any active driver.
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
scsi2 : SCSI emulation for USB Mass Storage devices
Vendor: TOSHIBA   Model: MK2004GAL         Rev: JA02
Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0
SCSI device sdb: 39063024 512-byte hdwr sectors (20000 MB)
sdb: sdb1

This tells you that the device lives at /dev/sdb1. Next step is to give it a mount point. Create a directory where you want the ihp to live while it’s mounted. On my system, it’s at /iriver.

Step three is to make an entry in fstab. You’ll need to put in a line similar to this:

/dev/sdb1        /iriver          vfat        noauto,user,rw   0   0

The first column is the device name, the second is where it’ll be mounted, and the third is the filesystem type. Make sure to specify vfat (same as FAT32) and not msdos, as the latter will hose your filenames and possibly render the disc on the ihp unresponsive. The fourth column specifies that the device is not automatically mounted on boot (noauto), that individual users can mount it (user), and that it can be read and written (rw). Provided the ihp shows up on your system as it does on mine, you could just copy this whole line into your own fstab.

With the preliminaries out of the way, just plug in the ihp and type mount /iriver, and you’re good to go. The /iriver directory will act like any other on your system as far as copying, moving or deleting files.. Make sure to unmount (umount /iriver) the device before disconnecting it.

As far as organization goes, it’s up to you. I recommend storing your files in folders named after their respective albums, as the player displays folder name/artist/song title from top to bottom. If you don’t have id3 tags enabled, it’ll just display folder and filename (ie. 01.mp3).

If you’re using the database, you’ll need to get your id3 tags in order. The best program I’ve used is Easytag, which is a gtk-based tag editor for mp3 and ogg. To enable the database, use iRipDb. Simply cd into /iriver and type iripdb . to run it. When you unmount the player, it’ll automatically scan the database. Note that it’s still beta, and all mp3s are lumped under the genre “Blues.” Ogg files, however, show up just fine.

For ripping/encoding, get Grip, which acts as a frontend for the other tools you’ll need. Your best bet for accurate ripping is cdparanoia, which should be included with your distro.

If you want to encode to mp3, use Lame, either with the --alt-preset standard or --r3mix for good-quality VBR files. There are also options in Lame for constant-bitrate files, but since VBRs take up less space and sound better, I don’t see a need to use them.

For ogg files, the default is oggenc. Ogg doesn’t think in terms of bitrate, but rather in quality, which is specified with the -q flag. For ~192kB/s files with accurate stereo separation, use -q 6. Either of these can be specified in Grip’s options. If you’re using ogg, make sure that you’re not telling Grip to write id3V2 tags, as it will corrupt them.

…and now the fun part: playlists. Here are the ground rules:

  • they have to be created on the player, as it reads everything from relative locations
  • they have to be in .m3u format, but
  • you can’t use the ones made in xmms or freeamp because their output isn’t formatted correctly.

So how do we do this? First off, download Fapg. It’s a small command-line tool to generate playlists. When run with the -wb flags, it’ll put out .m3u files with the proper (well, for Windows) backslash directory-separators. There’s an odd bug that causes it to add two backslashes instead of one, so you’ll have to work around it like so:

#fapq -wb Great* Chris* -o wayne_newton.m3u

where “Greatest\ Hits” and “Christmas\ Carols” are the actual names of the directories to be added. Truncating the directory names like this keeps that from happening, as I suppose the program is misreading the proper use of the backslashes in the directory names.

But that’s not all. Dos text-files use different endlines and carriage returns, so you’ll have to run the playlist through unixdos, so it’ll be read correctly on the player.

If anyone knows of an easier utility for this, please let me know. Better yet, pester iRiver to add on-the-fly playlists ASAP. It’s a glaring oversight in an otherwise stellar product.

Addendi: Meowsqueak has written a playlist-converter for the ihp-120, this one in Perl.

Usage: Change the $mount variable to your own mount point. Use it like this:

$ cat xmms-list.m3u | conv_m3u.pl > new-list.m3u

Here’s the actual script:

#!/usr/bin/perl -w

my $mount = '/mnt/iriver/';

while () {
s/$mount//g;
s/n/rn/g;
s////g if (! /#EXTINF/);
print $_;
}

There is also a script in Ruby available here.