Posts Tagged ‘Music’

transcoding mp3-to-mp3 in mt-daapd

Posted in General on August 24th, 2009 by slacy – Be the first to comment

Introduction

mt-daapd is an iTunes daap-protocol server for Unix systems.  I’m using mt-daapd on by Ubuntu 9.04 system to stream music over the internet to my workplace.   The issue is that many of my mp3 files are 256kbps mp3 files, and streaming these takes up more bandwidth than necessary.

mt-daapd includes a transcoding system called “ssc” for “Server Side Conversion”.  This system works by either a shared-object plugin (i.e. ssc_ffmpeg) or via an external script file (i.e. ssc_script).

using the ssc_script functionality, one can invoke ‘lame’ (the mp3 encoder) to transcode high bitrate mp3 files into lower bitrate mp3 files.  The setup for this in mt-daapd wasn’t very obvious, so I’ll document it here.

Install mt-daapd

The version of mt-daapd provided by Ubuntu 9.04 includes support for transcoding, so you can just run:

$ sudo apt-get install mt-daapd

Turn on ssc

Edit your /etc/mt-daapd.conf file, and make sure you have the following lines in the correct places:

ssc_codectypes = mpeg

always_transcode = mpeg

ssc_prog = /path/to/script/shown/below/mt-daapd-mp3-ssc.sh

[plugins]

plugins = ssc-script.so

Create mt-daapd-mp3-ssc.sh

You’ll need to create a shell script to do the transcoding via ssc_scrpit / ssc_prog.  Here’s the script I’m using:

#!/bin/bash

FILE=$1
OFFSET=0

if [ "$2" == "" ]; then
OFFSET=0
else
OFFSET=$2
fi

if [ "$3" == "" ]; then
FORGELEN=$3
fi

lame -V6 –quiet “$FILE” -

Note that I’m looking at the 2nd and 3rd args, but I’m not doing anything with them.  These arguments are used to make sure that seeking works properly in your daap client.  I don’t care about seeking, and doing it properly is somewhat hard, so I’ve just ignored those arguments.  I think that this could be accomplished properly using the program ‘mp3splt’ but I haven’t looked into it enough to see what it would take.

Make sure the script above is put somewhere accessible by the user specified as ‘runas’ in your mt-daapd.conf.   Make sure the script is executable by this user as well.

Restart mt-daapd and see if it works

Restart mt-daapd via:

$ sudo /etc/init.d/mt-daapd restart

Then reconnect your daap client (I use rhythmbox).  You can see if the script is working by running “ps auwxww | grep lame” just after pressing play on a song.  You should see your script executing lame and doing realtime transcoding.

Running amazonmp3 downloader on Ubuntu 9.04 amd64 (Jaunty) via a chroot

Posted in General on August 13th, 2009 by slacy – 3 Comments

The one biggest (and most annoying) missing package for Ubuntu 9.04 amd64 is the amazon mp3 downloader package.  This is critical being able to download special cheap albums from amazon, and is only available as a 32-bit package for Ubuntu 8.04 (Intrepid).

There are several descriptions on the net on how to hack around missing library dependencies and download them (via getlibs) or to tweak out the pkgconfig file to shoe horn the amazonmp3.deb file into an amd64 system.

I like to keep my installs really pristine, and avoid workarounds like getlibs and modified packages, so I’ve decided to go with a 32-bit chroot for running amazonmp3.  Generally, the process involves downloading another version of Ubuntu (in our case, 8.04, which is what the amazonmp3 package was built against), and then chroot-ing into this install area to run the 32-bit program.  Several existing tools make this easier than it sounds.

Get Ready

There are several dependent packages that you should install first.  In your base system, please run:

$ sudo apt-get install debootstrap schroot

Install 32-bit Intrepid into a subdirectory

Using the new debootstrap package that you just installed, you can now run:

$ mkdir ~/chroots

$ sudo debootstrap –arch=i386 intrepid ~/chroots/intrepid-32

The second command will take a while to run, and will download several hundred MB of intrepid packages, and install them under the newly created directory ~/chroots/intrepid-32

Edit /etc/schroot/schroot.conf

You should add a section to /etc/schroot/schroot.conf that looks like this:

[intrepid-32]
type=directory
description=Intrepid 32-bit
location=/home/YOUR_USERNAME/chroots/intrepid-32
priority=3
users=YOUR_USERNAME,root
groups=YOUR_USERNAME,root
root-groups=root,adm
run-setup-scripts=true
run-exec-scripts=true
personality=linux32

Do a little bit of post-install cleanup.

I’ve found that by default, I don’t have sudo permissions inside the chroot, so I do this one small step:

$ sudo cp /etc/sudoers ~/chroots/intrepid-32/etc/sudoers

That way, when I enter the chroot, I have sudo permissions available as well.

Get inside the chroot and make sure it works

You can now go inside the chroot via the following command:

$ schroot -c intrepid-32

You should see that while inside the chroot, your prompt should start with “(intrepid-32)” indicating that you’re chrooted.  Great.  Give a simple sudo command a try to make sure it works, like this:

$ sudo ls ~

Type your password, and confirm that you can run things as root.

At this point, you can do anything else you want in the chroot, like installing other packages, or cleaning things up.  You may want to run “sudo apt-get update ; sudo apt-get dist-upgrade” just for fun.

Install amazonmp3.deb in the chroot

The chroot shares your home directory, /tmp, and several other directories with your main system (so be careful!).  But, this also makes life easier.  While you’re outside of the chroot, download amazonmp3.deb and put it in /tmp or your home directory. Then, get inside the chroot, and run:

(intrepid-32)$ sudo dpkg -i amazonmp3.deb

It will complain about some missing dependencies.  Install those libraries via apt-get, and then run the dpkg -i again, and you should be in business.  To run amazonmp3, you may need to double-check your DISPLAY environment variable and make sure that it’s properly set inside the chroot.  Once you’ve done that, you should be able to easily run amazonmp3 inside the chroot, and download music to your home directory.

Good luck!

I’ve given up on web-based music services.

Posted in General on August 13th, 2009 by slacy – 1 Comment

It was a long and tumultuous affair, but now I’ve officially given up on web-based streaming of my personal music collection.

I started out with netjuke, which died and got absorbed into the horrible jinzora project.   So then I switched to Ampache, which worked fairly well, but needs some serious UI upgrades/changes to make it reasonably useful.

Now that I’m fully ubuntu-ized, I’m using mt-daapd through an SSH tunnel to listen via a native client app.  This solution has lots of interesting benefits:

  1. Running mt-daapd locally means other people in my house can see my music, including my TiVo and any other desktops with an iTunes/daap compatible frontened.
  2. I don’t have to worry about security issues with having all my music accessible via a web portal that could be hacked.
  3. mt-daapd is available as a package in Ubuntu, so that means upgrades are easy.  Doing upgrades (by hand) of php-based web apps was really becoming a drag.
  4. This means less junk on my slacy.com web server, which I’m trying to significantly trim down and make more secure by having less applications.

Unofficial SXSW 2008 mp3 torrent

Posted in General on February 21st, 2008 by slacy – Be the first to comment

Here’s a link to an unofficial SXSW 2008 mp3 torrent. Happy listening!

Ripping daytrotter mp3 files

Posted in General on February 20th, 2008 by slacy – 2 Comments

My friend Rich pointed me at daytrotter.com, and it looks like they have a really nice collection of live recordings by a bunch of interesting artists. All the files are available for download on their site, so using some trickery, I created a txt file of all the mp3 URLs so that you can use the same old wget trick to download them all. Watch out, there’s 869 files in there, so I’d expect over 4GB of music…

Ripping SXSW 2008 mp3 files

Posted in General on February 19th, 2008 by slacy – 9 Comments

I’ve grown impatient waiting for 2008.sxsw.com to release their torrent of mp3 files. I’m wondering if they’re going to do it at all.

So, I decided to just suck down the whole site and scrape out all the URLs to all the mp3 files and download them. It was very straightforward.

First, scrape the site by doing something like this:

wget -nd -nH -r –no-parent -nc http://2008.sxsw.com/music/showcases/alpha/0.html

Then, do something like:

grep mp3_download *.html

(Yes, they were silly enough to use a CSS class for all their mp3 download links named ‘mp3_download’.)

Then, you’ll have a file with a bunch of raw HTML links. Pull that into something like emacs and do some replace-regexp commands to trim it to just the URLs themselves. (There are 740 of them). I then took the resulting list of mp3s, split it into 2 files, and am running two copies of wget in parallel to suck them all down. Here’s a copy of the list of all 740 mp3 files.

Send me an e-mail to my private account if you’d like me to hook you up with a .tar.bz2 of all 740 files. I wonder if they’ll release that .torrent soon? :)

UPDATE: The download completed overnight, and the resultant files are about 3.4GB.

The sound of…blue?

Posted in General on February 15th, 2008 by slacy – Be the first to comment

First, Cognitive Daily had an interesting post about how people associate sound & color. Their goal was to see if certain musical pieces evoke a (random) color.

Then, I heard about soundofcolor.com. (Note: flash & music) Their goal was to create music that evoked a certain color.

Compare & contrast?

Kimya Dawson

Posted in General on January 12th, 2008 by slacy – Be the first to comment

She totally rocks, in a kind of “campfire songs for adults” kind of way. Check her out on eMusic, or watch some videos on youtube:

Kimya Dawson on YouTube

A composite Pitchfork “Best of” list

Posted in General on December 18th, 2007 by slacy – Be the first to comment

I saw that Pitchfork released their staff’s picks for the top 25 albums of the year. The problem is, I have no idea who these people are, and which ones are interesting. So I sucked the whole thing in, and counted up which albums were most referenced in the list. Here’s the composite top-25 albums from the staff’s picks. The second number is the count of times that album appeared in someone’s top-25 list. Note: There were 36 contributing staff members.

  1. 26 LCD Soundsystem: Sound of Silver
  2. 24 M.I.A.: Kala
  3. 21 Radiohead: In Rainbows
  4. 18 Panda Bear: Person Pitch
  5. 17 Burial: Untrue
  6. 15 Animal Collective: Strawberry Jam
  7. 15 Jay-Z: American Gangster
  8. 14 Battles: Mirrored
  9. 14 Spoon: Ga Ga Ga Ga Ga
  10. 12 Jens Lekman: Night Falls Over Kortedala
  11. 12 The Field: From Here We Go Sublime
  12. 11 Kanye West: Graduation
  13. 11 Lil Wayne: Da Drought 3
  14. 10 Of Montreal: Hissing Fauna, Are You the Destroyer?
  15. 9 Deerhunter: Cryptograms / Fluorescent Grey EP
  16. 8 Dirty Projectors: Rise Above
  17. 8 Feist: The Reminder
  18. 8 The National: Boxer
  19. 7 Caribou: Andorra
  20. 7 Dinosaur Jr.: Beyond
  21. 7 No Age: Weirdo Rippers
  22. 7 Sally Shapiro: Disco Romance
  23. 7 Simian Mobile Disco: Attack Decay Sustain Release
  24. 7 Various Artists: After Dark
  25. 7 Wu-Tang Clan: 8 Diagrams

Crazy 80’s

Posted in General on December 6th, 2007 by slacy – Be the first to comment

I mentioned the “Crazy 80’s” mix back in 2005, and I wanted to mention it again today because its one of the few “I found it on the web” music downloads that I keep coming back to, and actually listen to on a fairly regular basis.

You know that feeling when you’re at work and feeling like you need something to perk you up a bit? Well, Crazy 80’s is the solution to that problem, and it’ll give you a dose of Journey at the same time. Go download it from ytcracker’s website NOW…