Audio on FreeBSD

This page contains information on working with audio on FreeBSD.

Ripping CDs to MP3s

This is pretty easy: read the section in the FreeBSD Handbook on MP3 Audio

  1. Insert CD in CD-ROM drive
  2. Run cdda2wav (part of the sysutils/cdrtools port) (as root if you don't allow direct access to CD-ROM drives by regular users) using cdda2wav -D 0,5,0 -B to convert all the music files on a CD to WAV files. They will be named audio_##.inf and audio_##.wav, where ## is the right-justified, zero-padded track number.
  3. Run lame (the audio/lame port) to convert each WAV file to an MP3 file using lame -h -b 192 --tt "Song title" --tn "Track number (1-255)" --ta "Artist name" --tl "Album name" --ty "Year album recorded" --tc "notes like: cdda2wav, lame -h -b 192" --tg "Genre" audio_##.wav outputFile.mp3

Copying Files to an MP3 Player (or any old Flash Memory Drive) with a USB Port

I have an Innovation One DMP-100 1GB MP3 Flash Player, bought from Radio Shack (their part number 42-8085) for $120 less a $40 rebate in December, 2005. I also have a Memorex TravelDrive (new) 2GB flash drive (having a USB port). Here's how I copy files to and from the player and to/from the flash drive.

First, read the section of the FreeBSD Handbook on USB storage devices

Also, curiously, I've found that I can't write long filenames (longer than the old 8.3 format) onto a flash drive until I've inserted it into a Windows box and, possibly, used Windows to write to it a file with a long filename.

  1. insert the USB plug into one of the USB ports
  2. run tail /var/log/messages to read which device references the MP3 player
    Feb 17 22:43:12 machinename kernel: umass0: <USB MF> <USB PRODUCT>, rev 1.10/10.01, addr 2
    Feb 17 22:43:13 machinename kernel: da3 at umass-sim0 bus 0 target 0 lun 0
    Feb 17 22:43:13 machinename kernel: da3: <SigmaTel MSCN 0100> Removable Direct Access SCSI-4 device
    Feb 17 22:43:13 machinename kernel: da3: 1.000MB/s transfers
    Feb 17 22:43:13 machinename kernel: da3: 993MB (2034432 512 byte sectors: 64H 32S/T 993C)
  3. the MP3 player is on device da3; now determine which slice of that device to mount
    machinename# ll /dev/da3*
    crw-r-----  1 root  operator    0, 136 Feb 13 08:24 /dev/da3
    crw-r-----  1 root  operator    0, 138 Feb 13 08:24 /dev/da3s1
  4. mount the MP3 player by its appropriate slice using mount_msdosfs /dev/da3s1 /mnt
  5. find out how it is formatted through the command /sbin/newfs_msdos -N /dev/da3s1
  6. do all the copying, directory creating, and deleting you want
  7. unmount the MP3 player using umount /mnt
  8. disconnect the MP3 player from the USB port

Back to FreeBSD main page