Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


More on LinuxToday


Making the KB Gear JamMP3 Portable MP3 Player Work under Linux

Aug 17, 2001, 22:30 (26 Talkback[s])
(Other stories by Theodore Kilgore)

Fred Mobach writes:

Theodore Kilgore, a long time Linux user and Linux Today reader, has sent me a funny story. Funny, because the manufacturer delivered only Windows support to this device which didn't work at all. And he got this device working under Linux without so much problems. And that his son is impressed with Linux and what his father can do with that. Have fun, Fred


Making the KB Gear Jamp3 Portable MP3 Player Work under Linux


I often read comments on Linux websites and discussion groups to the effect
that there are too many pieces of hardware out there which are unsupported
under Linux. However, it can happen that a device which is supposed to work
under Windows for some reason does not, but it is nevertheless possible to
use the device under Linux.

As an actual case history, I give some recent experiences with a KB Gear
Jamp3, a portable mp3 player which connects to the computer via USB for
downloading files. The device came with a brochure telling how to put
batteries in it, how to plug it into a USB port, how to install the Windows
software on the accompanying CD, and it also gave some basic specifications,
for example that the device will store 16 megabytes of data, upgradable to
32 megabytes with an expansion card which can be ordered.


I obtained this KB Gear Jamp3 from someone who had bought it for $49.95 from
the local WalMart and could not make it work. It seems that the supporting
software provided on the accompanying CD could not be made to function. Any
attempt to copy files onto the Jamp3 device simply resulted in a lockup of
the Windows machine, and any attempt to exit from the control program
resulted in a forcible reboot. My 11-year-old son very much wanted it to
work, and thus I decided that it would be interesting, educational, and
character-building to try to set the device up under Linux. I knew nothing
about the device other than what was in the glossy brochure and had no
previous experience with USB devices or mp3 players, under Linux or any
other operating system. I am not a computer professional by trade, and I do
not consider myself a programmer.

First, I realized that I would need USB kernel support for a USB device.
Therefore, I recompiled the kernel, adding USB support. The fact that I had
recently upgraded to a 2.4 kernel helped a lot at this stage. Naturally, I
also read whatever seemed relevant in /usr/src/linux/Documentation/usb. It
was recommended there to inspect the file /proc/bus/usb/devices. After I
rebooted with my new kernel, with the mp3 player attached and turned on, I
got the following output from "cat /proc/bus/usb/devices":


T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=d800
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=084e ProdID=0004 Rev= 0.50
S:  Manufacturer=STMicroelectronics
S:  Product=JamP3 Portable Player
S:  SerialNumber=0123456789ABCDEF
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=d400
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms


This seemed promising but quite mysterious. The output was of a format
explained in /usr/src/linux/Documentation/usb/proc_usb_info.txt, but a lot
of the entries did not yet make sense. Especially, it seemed that one would
need to decipher the line

I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

I followed the leads in /usr/src/linux/Documentation/usb-help.txt, and
I also did some Google searches for

linux usb portable mp3 player jamp3,

which turned up absolutely nothing,

linux usb portable mp3 player,

which turned up a number of hits,

linux usb driver,

and things like that. After following some false leads, I found a document
called

"Programming Guide for Linux USB Device Drivers,"

authored by Detlef Fliegl, <deti@fliegl.de>, which can be found at

<http://usb.cs.tum/edu/usbdoc>

I also found a list of USB ids, compiled by Vojtech Pavlik <vojtech@suse.cz>.
The KB Gear Jamp3 was duly listed as 084e:0004 (no surprise at this point).
More importantly, this document also contains a list of "known device
classes, subclasses and protocols." There, I found that Class 08 is "Mass
Storage," and Subclass 06 is "SCSI," and Protocol 50 is "Bulk (Zip)."

Someone more experienced than myself would no doubt have known exactly what
to do at this point. After some trial and error, I found out that I needed
to install kernel support for SCSI, SCSI disk, and USB mass storage. After
this, on rebooting with the new kernel and my Jamp3 plugged into the USB
port and turned on, I got some bootup messages about the device, and "dmesg"
gave more details, describing the device as "Transparent SCSI." I also got
the following response to "cat /proc/scsi/scsi":

Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: KBGear   Model: JamP3 Player     Rev: 0.93
  Type:   Direct-Access                    ANSI SCSI revision: 02


And "cat /proc/usb/drivers" gave:

         usbdevfs
         hub
         usb-storage

It seemed at this point that the machine was happy indeed, but the Jamp3
would not yet sing and I still did not know what to do... I continued my
internet searching, and I found two lists of USB devices known to work with
Linux. One of these listed an Iomega mp3 player under "mass-storage"
devices, and its driver was given as "usb-storage." The remarks said to
mount the device as a vfat file system. With this hint, I tried

mount -t vfat /dev/sda1 /mnt

Success!!!

I copied two mp3 files onto the Jamp3 player, and umounted it and
disconnected it. It played them. I reconnected and remounted it and deleted
one of the files and replaced it with another. No problems at all. And
clearly it is possible to use the Jamp3 player, too, as a small portable
storage device for any kind of files, too. Naturally, if the files are not
mp3 files, they would make little sense if played.

Summary:

Though I was without any documentation supplied by the manufacturer, I had a
device which uses industry standard protocols, in a completely standard
manner. Installation of Linux support is in fact completely routine and
trivial, once the user knows what to do. Doubtless, such statements are not
true of all devices (the infamous winmodems and winprinters come to mind).
However, it would seem that any device which uses industry standard
protocols exclusively is therefore supported under Linux, even it doesn't
seem to work under Windows. It makes one wonder how many other pieces of
hardware are out there which fit into this interesting category.


Still to be done:

-- It remains to be seen what would happen if a memory add-on card were
installed. The glossy brochure mentions something about "reformatting." It
might be that under Linux the add-on card would be addressed as /dev/sda2,
or as /dev/sdb1, or not at all. I can only speculate.

-- Using modular support instead of compilation of support directly into
the kernel (I was lazy and wanted a quick solution, if possible).

-- That Windows program sure did look pretty and impressive. Too bad it
didn't work. How prosaic it is to use a command line or the Midnight
Commander to copy files back and forth to an external device. GUI is the
wave of the future, and we are definitely behind the times if we don't have
a GUI program for this. We may already have one, and the program just needs
to be pasted together with the basic device support. I don't know. Me, I
just wanted the thing to work. And my son knows how to use a CLI and the
Midnight Commander, too. He was raised to respect such things and has not
quite reached the rebellious teens, yet :-)

Bottom line:

Right now my son is pleased as punch that this thing works. He was already
impressed with Linux, but now he is very impressed. And I am impressed with
the efforts of those who provided the documentation which I found so useful.
And I am grateful to the kernel developers who have put together the basic
system, which simply does what it is supposed to do. Support for a new piece
of hardware like this one is an opportunity, in a small way, to give
something back.

Theodore Kilgore <kilgota@banach.math.auburn.edu>