Raspberry Pi as a USB audio capture device

The Raspberry Pi’s hardware and software support has come a long way in the few months it has been in the wild. I first tried this application in the summer, and the results were dismal. Now, thanks much improved USB driver support under Raspbian, I’m pleased to say it works flawlessly.

Earlier this year, I bought a turntable (ack!) for transferring vinyl to mp3. I have a TC-772 USB phono preamp, which spits out a 48 kHz stereo audio stream. If you plug the USB output of the preamp into a Rapberry Pi (running Raspbian Wheezy with all the updates), it’s instantly recognized as an audio device:

$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 08bb:2902 Texas Instruments Japan PCM2902 Audio Codec

If you install the ALSA recording utilities (sudo apt-get install alsa-utils pulseaudio – this should pull in a whole bunch of necessary packages), you can record directly from this device with the following command:

arecord -D 'pulse' -V stereo -c 2 -f dat -d 900 out.wav

which records from the ‘pulse’ audio device, displaying a stereo text VU meter (handy for setting levels), writing to a two channel 16-bit 48 kHz file called ‘out.wav’ for a maximum of 900 seconds (15 minutes). arecord has a baffling number of recording source options; arecord -L will show them. ‘pulse’ was the first one I tried.

So how does it sound? Here’s a 30 second excerpt from the only single I owned for years, The Music Tapes‘ “The Television Tells Us/Freeing Song by Reindeer”: Freeing Song by Reindeer – excerpt [mp3]. I’ve saved an even smaller snippet as lossless FLAC so you can see that the waveform’s pretty clean: FreeingSongbyReindeer-tiny_excerpt [flac].

Sounds pretty good. Not quite as good as having Julian play it in your house, I’ll allow, but not bad for a first try with a $35 computer.

Robyn Hitchcock Live at The Mod Club on 2007-11-14

Internet Archive: Details: Robyn Hitchcock Live at The Mod Club on 2007-11-14

Set 1: 81′ 28″

Balloon Man
Autumn Is Your Last Chance
Uncorrected Personality Traits
Olé! Tarantula
Only The Stones Remain
I’m Only You
I Something You
Glass Hotel
Cynthia Mask
No, I Don’t Remember Guildford
Alright, Yeah
Full Moon In My Soul
Swirling
Creeped Out
Queen Of Eyes
Are You Experienced?
You & Oblivion

Set 2: 21′ 24″

Visions of Johanna
(A Man’s Gotta Know His Limitations) Briggs
Adventure Rocket Ship

Casper and The Cookies – Lee’s Palace, Toronto – 20 February 2007

Casper and The Cookies – Lee’s Palace, Toronto – 20 February 2007
It was Jason‘s birthday …

  1. Sid from Central Park
  2. Kiss a Friend
  3. Barking in the Garden of Ill Repute
  4. Neo Dada Hey Day
  5. Sea Fingers
  6. Kroetenwanderung
  7. The Optimist’s Credo
  8. My Heart is in my Head
  9. Learn How to Disappear
  10. Hey Mr. Superstar
  11. Sweet Pea

If you must stream these, here are the playlists: m3u | xspf.

Update: this show is now available on the Internet Archive: Details: Casper and the Cookies Live at Lee’s Palace on 2007-02-20.

the late b.p. helium, live at The Boat, Toronto — 28 June 2006

  1. (intro)
  2. crying*
  3. reminder to self
  4. they broke the speed of light
  5. fela*
  6. i tried to make it with you
  7. (banter)
  8. bluebeard
  9. rabbit’s ear
  10. the curse of the trial
  11. raisa raisa
  12. the weeping soul

*: These short titles are taken from the setlist. I don’t have their full names.

Info page: the late b.p. helium, The Boat — 28 June 2006, which also includes a link to FLACs.

livemp3 – convert those big old audio torrents to something listenable

You’ll need Perl, and Config::IniFiles.

Program: livemp3.

A sample ini file so you can see how to set this up: welch_rawlings_shepherds_bush.ini.

At the moment, this just generates output that you’ll need to feed to sh, but it handles renaming, converting and tagging MP3s to my satisfaction.

Update: it doesn’t handle FLAC tags, even though they’d be a good source of metadata. I may look into implementing that some day.