How to work with DION-MX MP3 Player/Voice recorder under Linux

Abstract

This document describes how to force DION-MX MP3 player/voice recorder to work under Linux and how to decode files created by this device in voice recording mode. Another name of this device is ORACOM ORC-100.

Introduction

Compact device DION-MX announced by the Digital Global Network in August 2002 developed by ORACOM Co., Ltd. is able to perform among others three useful functions: 1) to play MP3 audio files via headphones; 2) to serve as a voice recorder -- it can record up to 8 hours at 8000 Hz sampling rate; 3) to serve as a portable data storage of 128 Mb. The Web site of the Digital Global Network announces proudly that their device is supported by Linux. The same was written on the packing box. However it should not been interpreted as purchasing this gadget you will find in the box software under Linux and the manual explaining how to use this device with Linux: you will find inside a CD with software only for Windows. Manual tells nothing about Linux. A representative of the Digital Global Network technical support claims that
> Our product is compatible to connect and download with Linux and Mac, and it
> doesn't mean that we provide software.
> Hope we explained enough for you.
By another words the manufacturer assumes that, unlike subjects of the Microsoft empire, Linux users are smart enough to figure out how to enable to work their device and to write software themselves. I will try to show how to do it.

I recommend first to read a paper of Theodore Kilgore and responses on that paper. The recipes related to the JamMP3 MP3 players turned out applicable to the DION-MX device.

Setting your system for getting access to DION-MX

The paper cited above considers this subject in details, so here is the brief summary.

Step one.

Check your kernel. Log in as a root, go to the directory where you keep the kernel source code and type make menuconfig. You should check your configuration at enable support in the following sections: In section General setup ---> :
   Support for hot-pluggable devices
In section SCSI support --->:
     SCSI support 
     SCSI disk support             
     SCSI generic support
     Verbose SCSI error reporting (kernel size +=12K)
In section USB support ---> : USB verbose debug messages Preliminary USB device filesystem USB Mass Storage support At least one of the USB controller drivers:
--- USB Host Controller Drivers
      EHCI HCD (USB 2.0) support (EXPERIMENTAL)
      OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support   
If all these options are applied, fine, if not, you have to re-compile your kernel. If you did not do it before, read first the Linux kernel HOWTO and follow instructions. If you compile one of these options as modules, please do not forget to load these modules. If you have kerntel 2.6.8, 2.6.9, 2.6.10 and perhaps some new kernels. You have to apply a patch:
  1. cd {kenrel_source_root}
  2. cd drivers/usb/storage
  3. open with an editor file unusual_devs.h
  4. Check for lines with signature 0x0f19 . If not foudn then append to the end of unusual_devs.h the following patch:
    /* Reported by Leonid Petrov on 2005.03.03 */
    UNUSUAL_DEV(  0x0f19, 0x0101, 0x0100, 0x0100, 
    		"ORACOM",
    		"Digital Audio", 
    		US_SC_DEVICE, US_PR_DEVICE, NULL,
    		US_FL_IGNORE_RESIDUE ),
              
  5. cd {kenrel_source_root}
  6. (as a root) Compile kernel:
  7. reboot

Step two.

If your kernel has these option applied, connect DION-MX to the USB port, turn the power of the MP3 player on, and then re-boot your computer. NB: You need to boot your computer with MP3 plugged in only when you are using the device the first time.

Then examine your system log-file, which you can obtain by executing command dmesg. It should contain something like that

usb.c: USB device 5 (vend/prod 0xf19/0x101) is not claimed by any active driver.
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
scsi1 : SCSI emulation for USB Mass Storage devices
  Vendor: ORACOM    Model: Digital Audio     Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 5
usb.c: usb-storage driver claimed interface c2f04440
USB Mass Storage support registered.
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
sda: Write Protect is off
 /dev/scsi/host1/bus0/target0/lun0: p1
If you execute command usbview, you should see DION-MX as a usb-storage device. If your log file does not have messages about the USB mass storage device, check your player: power, cable, contact; check your kernel configuration. If you compiled USB and SCSI support as modules, check whether the modules are properly loaded, etc.

Step three.

Create a mount point. F.e., if you selected name /dion then execute as a root mkdir /dion . Then add the following line to your file /etc/fstab
/dev/sda1               /dion           vfat    noauto,user           0 0

How to use DION-MX under Linux

Attach your DION-MX player to the USB port, turn the power of the player on, wait for 2-3 seconds and execute command mount /dion Contents of the DION-MX flash memory will be displayed as directory /dion . The device comes formatted. It means that the flash memory has three directories: logo, music and voice. DION-MX plays files in the mp3 format located in music directory and records files in voice directory. You can create other directories if you like.

After you have mounted your player, you can read, write and remove files from the internal memory of the player. When you "format" device using buttons in the control panel you remove all files in the flash memory, all directory except directories logo, music and voice. You can do the same when your device is connect to your computer using commands rm, rmdir .

Upload the music file

Copy file in /dion/music directory (if the mount point of your DION-MX player is /dion). The music file must be in MP3 format. If the audio file which you would like to play is in another format, you should convert it to mp3 format. You can use Lame, NotLame encoder or whatever else program you might prefer. After copying do not forget to unmount device (command umount /dion) or execute command sync before you unplugging the device, otherwise the audio file may not be written correctly. The speed of read/write is about 0.5 MBytes/sec, so you may need to wait for a while.

Downloading voice files

Recorded files are in directory voice. They have names vi{nnn}.vrf where {nnn} is the index of the voice file. Voice files are in an internal player format. Before playing them you have to decode these files. You can install a simple program dion2wav for that. This program reads the file created by DION-MX and writes audio file in wav format in standard output. DION-MX records in 8000 Hz sampling rate. You can convert voice recorder file to wav format by a command dion2wav input_vrf_file > output_wav_file.

Quality of recorded voice is significantly improved if to re-sample sound at 16000 Hz. You can use program sox for converting sampling rate. You can use sox for playing vrf files directly if you configured ossdsp device driver during sox installation.

#!/bin/csh
#
#  This C-shell program plays voice file created by DION-MX
#
set DION2WAV = dion2wav # or whatever else path to dion2wav program
if ($#argv == 0) then 
    echo "Usage: dion_play vrf-file"
    exit 0
endif
#
if (-f $1) then 
  else
    echo "File $1 not found"
    exit 1
endif
if ( `where sox` == "" ) then
     echo "Program sox was not found"
     exit 1
endif
#
$DION2WAV $1 | sox -t wav - -r 16000 -t ossdsp -l /dev/dsp polyphase vol -6 Db 

Editing voice files

Presumably, you may need to edit your voice file: to extract the portion of the voice file which you are interested in. You should first to convert the voice file to wav-format. Then you can use a decent audio editor program, for example sweep.

Using DION-MX as a data storage.

You can create any other directory in the flash memory of the DION-MX and store there files of any type. For example, you can create directory /dion/data/ (when the device is attached to the USB port, of course). You will not see this directory on the screen of the player, but you will see the data when you connect DION-MX to a computer.

Graphic User Interface

Do you really need it? I am quite happy with command line interface, but if would like to have graphic interface, feel free to develop it. GPMM is a good starting point.


Web page was prepared by Leonid Petrov
Last update: 03-MAR-2005 22:14:06