iRiver works with Amarok!

Trying to get my iRiver ifp 890 to work with amarok was my Everest. I had already conquered many of the smaller hills leading up to this, like player firmware upgrades via a linux gui for the 890 and getting my collection into ogg format, but this final hurdle was a stretch…even for me.

I didn’t want to use the ifp driver, I wanted drag and drop simplicity that the UMM firmware provided. I also did not want to apply a kernel patch, I am running Kubuntu Dapper flight 6 and who knows what that might do to my daily apt-get dist-upgrade.

With that, I had a few ideas to work out. One, the device name changes depending on the USB bus I use and if another device is in use on that bus already. I have to have a consistant device name. Also, I wanted Amarok 1.4 that is supposed to handle ifp devices “out of the box”…I found out later that that probably meant iRivers using the ifp drivers, not the UMM firmware. Since Amarok’s interface has a button to connect to the player and supports pre-connect commands, I did not want the player to automount, I wanted to handle that via a command in the amarok interface.

Here is what I did:

Update Amarok
sudo echo “deb http://kubuntu.org/packages/amarok-latest dapper main” >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install amarok amarok-engines

Now run amarok and update your collection.

Now I had to contend with the dynamic device name thing. Here is a quote from a HOW-TO I found “udev allows the assignment of a persistant device node, /dev/…, based on a rule match defined by your specific hardware. In other words, if a device is attached that matches certain criteria it is given it’s own device node, rather than being assigned a dynamic one”

So I needed a udev rule to “map” my iRiver to a static name like /dev/iriver whenever it gets plugged in.

Collect information:
First, determine the normal dynamic device name that the player gets assigned. With the player unplugged:
tail -f /var/log/messages
and then plug in the player and watch the terminal.
This is what I saw:
Jun 1 20:14:15 localhost kernel: [4295310.473000] Vendor: iriver Model: MassStorage Disc Rev:
Jun 1 20:14:15 localhost kernel: [4295310.473000] Type: Direct-Access ANSI SCSI revision: 00
Jun 1 20:14:15 localhost kernel: [4295310.475000] SCSI device sda: 512001 512-byte hdwr sectors (262 MB)
Jun 1 20:14:15 localhost kernel: [4295310.476000] sda: Write Protect is off
Jun 1 20:14:15 localhost kernel: [4295310.478000] SCSI device sda: 512001 512-byte hdwr sectors (262 MB)
Jun 1 20:14:15 localhost kernel: [4295310.478000] sda: Write Protect is off
Jun 1 20:14:15 localhost kernel: [4295310.478000] sda:
Jun 1 20:14:15 localhost kernel: [4295310.482000] sd 1:0:0:0: Attached scsi removable disk sda
Jun 1 20:14:15 localhost kernel: [4295310.482000] sd 1:0:0:0: Attached scsi generic sg0 type 0
Jun 1 20:14:35 localhost kernel: [4295330.152000] usb 3-3: USB disconnect, address 4
Jun 1 20:18:17 localhost kernel: [4295552.358000] usb 3-3: new high speed USB device using ehci_hcd and address 5
Jun 1 20:18:17 localhost kernel: [4295552.473000] scsi2 : SCSI emulation for USB Mass Storage devices
Jun 1 20:18:22 localhost kernel: [4295557.473000] Vendor: iriver Model: MassStorage Disc Rev:
Jun 1 20:18:22 localhost kernel: [4295557.473000] Type: Direct-Access ANSI SCSI revision: 00
Jun 1 20:18:22 localhost kernel: [4295557.475000] SCSI device sda: 512001 512-byte hdwr sectors (262 MB)
Jun 1 20:18:22 localhost kernel: [4295557.476000] sda: Write Protect is off
Jun 1 20:18:22 localhost kernel: [4295557.478000] SCSI device sda: 512001 512-byte hdwr sectors (262 MB)
Jun 1 20:18:22 localhost kernel: [4295557.479000] sda: Write Protect is off
Jun 1 20:18:22 localhost kernel: [4295557.479000] sda:
Jun 1 20:18:22 localhost kernel: [4295557.482000] sd 2:0:0:0: Attached scsi removable disk sda
Jun 1 20:18:22 localhost kernel: [4295557.482000] sd 2:0:0:0: Attached scsi generic sg0 type 0

Now I know that I am concerned with device “sda”

Now I have to have some unique identifying information about the player to create the rule later.
udevinfo -a -p /sys/block/sda | grep product (replace sda with your device)
NOTE: you will also have to know if your device is using the “usb” or “scsi” bus…repeat the above code without the grep and find the section with the product information and note the “BUS==”usb” line for example.

Create custom udev rule
sudo nano /etc/udev/rules.d/10-local.rules

BUS=”usb”, SYSFS{product}=”IFP-800 HIGH SPEED”, KERNEL=”sd?”, NAME=”iriver890”, SYMLINK=”iriver”

the first 2 sections are what I found with udevinfo…KERNEL is only going to look at sda, sdb, sdc and so on. NAME will create a persistant node called /dev/iriver890 and SYMLINK will create a symlink to that node called /dev/iriver (that symlink is optional)

Now create your fstab file entry.
sudo nano /etc/fstab
I added the following entry:

/dev/iriver /media/iriver vfat rw,uid=1001,gid=1001,sync,noatime,nosuid

The uid and gid are found in the KDE control panel for my user account…I hear rumor that you can just type “user” in the stead of both these entries.

Now restart udev to pick up the device (plug-in and power-on the player first)
sudo /etc/init.d/udev restart

you can test if it works now by typing
sudo mount /media/iriver (or whatever mount point you used…NOT the device name)
mount (look at the last line and see if it mounted the way it was supposed to)

If it is all fine,
sudo umount /media/river

In amarok configuration -> media devices create a new device manually and enter the name you want and the mount point. in the pre-connect line, enter “kdesu mount %m” and in the pre-disconnect line type “kdesu umount %m” both without the quotes.

You should be all set…I was!


One Response to “iRiver works with Amarok!”

  • lunchb0xNo Gravatar Says:

    dude i so have to try this out!!! Thanks in advance for putting this information out. For us “not quite newbs” but far from being “gurus” to linux, this type of info is invaluble. Thanks in advance, even if it doesn’t work.

    -lunchb0x

Leave a Reply

You must be logged in to post a comment.