HOWTO iRiver

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

[edit] Introduction

Getting your fancy new iRiver to work in Linux is suprisingly easy. Most people by now are using udev and a 2.6.x kernel so configuring your system to work with an iRiver or any USB mass storage device is easy to do.

However, the firmware of the player determines the connection type. The earlier firmware versions do not attach the device as a mass storage, even under Windows. The communication to the device in this case is established by the opensource ifp-driver. Instructions to both types are given.

This guide assumes you have at least a base Gentoo Linux system setup already. It is also assumed that you are using a 2.6.x kernel. You could probably use a 2.4 kernel but your kernel configuration will vary. The processes outlined here will probably work on other distributions but the file locations and installation methods would be slightly different.

[edit] Configuration as a mass storage device

[edit] Configuring the Kernel

You need to have USB support and USB mass storage support enabled in your kernel. If you know you already have this done, you can safely move on to the next step. Otherwise fire up your favorite method on configuring kernels and enable support for your computer's USB controller as well as USB mass storage support. I'll illustrate how to do this using make menuconfig below.

lspci | grep HCI
0000:00:1f.2 USB Controller: Intel Corporation 82801BA/BAM USB (Hub #1) (rev 04) (prog-if 00 [UHCI])
0000:02:01.0 USB Controller: NEC Corporation USB (rev 41) (prog-if 10 [OHCI])
0000:02:01.1 USB Controller: NEC Corporation USB (rev 41) (prog-if 10 [OHCI])
0000:02:01.2 USB Controller: NEC Corporation USB 2.0 (rev 02) (prog-if 20 [EHCI])
0000:02:09.0 USB Controller: NEC Corporation USB (rev 41) (prog-if 10 [OHCI])
0000:02:09.1 USB Controller: NEC Corporation USB (rev 41) (prog-if 10 [OHCI])
0000:02:09.2 USB Controller: NEC Corporation USB 2.0 (rev 02) (prog-if 20 [EHCI])

In this case, I need support for all of the controller types. The EHCI (USB 2.0), UHCI, and OHCI controllers. You may only have one of these controllers. As long as you have at least one (preferably the EHCI controller), you will be able to use your new iRiver in Linux. Simply choose to compile the driver directly into the kernel or as a module if you prefer and you're all set.

Linux Kernel Configuration: USB
Device Drivers  --->
 USB support  --->
  <*>   EHCI HCD (USB 2.0) support
  <*>   OHCI HCD support
  <*>   UHCI HCD (most Intel and VIA) support
  <*>   USB Mass Storage support
# mount /boot
# make && make modules && make modules_install && make install
# umount /boot

[edit] H10: Starting UMS Mode

The H10 6GB colour (and possibly other models) automaticaly try to transfer files by MTP (Media Transfer Protocol). This is a protocol that Windows recognises, and so treats the iriver as an external hard disk. Linux does not recognise MTP mode.

To have linux recognise the H10 as an external hard disk, the H10 must be switched to UMS mode. After configuring all modules in the kernel (as shown above), turn on the H10, and plug the USB cable into both the H10 and the computer. dmesg at this point will reveal that the device has been detected, but will not asign it a device node. The screen of the iriver will show that usb is connected. Now, three steps must be performed.

1. Hold down the 'o' button.

2. Disconnect and then quickly reconnect the usb cable to the h10.

3. Release the 'o' button.

If the above steps have been performed correctly, then at the top of the screen, the words "emergency connection" will appear. After a few moments, the original screen "USB connected" be displayed. At this point, the H10 is in UMS mode, and you can continue to the next step.

It is possible to set the H10 to always start in UMS mode. See http://www.misticriver.net/wiki/index.php/H10_Firmware_Conversion:_MTP/UMS

[edit] Creating a custom udev rule

NOTE: On recent udev versions you may not need to create a custom rule.Simply find your device in /dev/disk/ and then create an entry in /etc/fstab.Mine looks like this:

File: /etc/fstab
/dev/disk/by-id/H100             /mnt/iriver     auto            rw,user                 0 0


Now that you kernel is configured to use the iRiver, the next step is to mount it. 2.6 kernels will treat USB mass storage devices like SCSI drives in that they will be named /dev/sda /dev/sdb and so on. You could get by with just looking at the output of dmesg after you plug your iRiver in and seeing which device the kernel chose. However this could cause problems if you have multiple types of USB mass storage devices or SATA drives or actual SCSI drives. The naming scheme is not consistant. Fortunately if you are using udev (And you should be), you can create a custom rule to make a symlink to whichever device node the kernel decides to use. This is actually easier to do that you might think.

The first step is to find something that will uniquely identify your device. When I plug in my iRiver, udevinfo shows a "iRiver H300 Series". We will use this information to create our rule.

# dmesg | grep scsi #Look for the device name the kernel chose. (i.e. sda, sdb, sdc, etc.)
# udevinfo -a -p /sys/block/sda | grep product #Replace sda with the device name you found with dmesg.

Add the following to a new rules file. If you already have some custom rules, use the file you created instead of this one.

File: /etc/udev/rules.d/10-local.rules
 BUS=="scsi", SYSFS{product}=="iRiver H300 Series", KERNEL=="sd?", NAME+="%k", SYMLINK+="iriver"

[edit] Modifying /etc/fstab

Now your iRiver can be accessed by using the /dev/iriver no matter what device name the kernel is able to use. You will probably want to create an fstab entry so you can easily mount and unmount the iRiver. Create a new mount point (mkdir /mnt/iriver) and edit your fstab accordingly.

File: /etc/fstab
/dev/iriver             /mnt/iriver     auto            rw,user                 0 0

If you notice that transfers take a very long time and you have a usb 2.0 capable port and iriver, then try adding async to the mount options above.

That's it! Now any user should be able to simply mount /mnt/iriver and access the iRiver just like you would any directory on your system.

[edit] Configuration for the ifp-driver

[edit] Unofficial ebuilds

[edit] Installing the driver manually

Portage has the libifp driver, but you still have to fetch the ifp_gui ebuild from b.g.o.

# emerge libifp ifp_gui -va

Now you should be able to run the frontend as a normal user.

$ ifp_gui &

Enjoy.

[edit] Useful links

Personal tools