Posted: May 24, 2011 | Author: Sideb0ard | Filed under: future, history, music, visualization | Leave a comment »
couple of nice visualizations I’ve come across recently..
First one is a graph of vinyl record sales from 1973-2010..

“In 2010, vinyl shipments were 4 million, according to US-based data tracked by the RIAA. In 1977, that figure was 344 million. This also may not be the first bout of nostalgia: in 1998, sales were 3.4 million, while the 2009 tally was 3.2 million.” Digital Music News
This second graph puts those vinyl sales into perspective amongst the highwater mark of CD sales..

From Business Insider
Posted: May 10, 2011 | Author: Sideb0ard | Filed under: music, pain, unix | Leave a comment »

Today, one of my tasks was identifying and transferring approx 403k MP3 recordings from an office in the states over a VPN to a local NFS mount here in London. Each file is approx 4MB (128kbps files), so a total of ~1,6TB of data.
I tried a few test copies with rsync and scp but both were giving me ridiculous transfer rates, taking ~3mins to transfer 10 test files even though each file individually was achieving around 2.65MB/s. With that transfer rate I should have been able to copy 10files in about 15 seconds. I attribute the extra time to the connection setup and tear down for each file coming through. No way, thats gonna work.
I’ve had several bosses over the years who’ve been complete Unix masters – One of them showed me the wonders of DD – supposedly meaning “Data Description” but also known as “Disk Destroyer” because of how, if you get your Input and Outputs wrong, it can easily (and quietly) destroy your data. (info here).
DD is used for low-level block copying of data, but like many unix tools is quite versatile. My old boss used it for creating files of any specified size, and then timed how long it took to copy across a network link, thereby giving a measurement of transfer rate, which is how i was using it today.
To create a file of 1GB in size:
dd if=/dev/zero of=./1000MB bs=1024 count=1024000
(/dev/zero is a special Unix file which will return as many null characters as you ask it for. It’s of the same family as /dev/null and /dev/full)
Back then, we were using FTP, but these days SCP does actually tell you the transfer rate:
thorsten@invincible:~$ time scp 1000MB foreignhost:
Scp tells me transfer rate was 10.0MB/s however real time says it tooks 1m54sec, so my calculations actually say 8.77MB/s
So, 403k x 4MB = 1612000MB. With a transfer rate of 8.77MB it should take 183808.43 seconds = 3063mins = 2.12 days.
Just over 2 days is acceptable, it is a decent amount of data, and certainly better than 3mins for 10MP3s which would be, what, 121083.3 mins=84 days? phew! Thankfully in this case, there’s a decent amount of space on both servers, so I can tar up the required files up and do a single rsync and hopefully should be able to use the full bandwidth.
Posted: May 5, 2011 | Author: Sideb0ard | Filed under: metadata, music, pain, sql | Leave a comment »
yow. must admit, I had to overcome a couple of obstacles during the installation and setup of a Musicbrainz Next Generation Schema replicated DB.

I’m not sure this will prove to be a particularly useful post, but I’ll post it up here as a record of my own, in case I need to do it again.
The NGS requires PostgreSQL 9 and a bunch of perl modules be installed.
Initially I started with a PSQL9.1 beta binary provided by EnterpriseDB, however later ran into problems with missing user contributed modules for Cube, a “Multidimensional-cube datatype”. After much faffing about I just removed the binary install, then grabbed the sources and compiled PSQL9 from source. Mostly quite simple except for one issue,
undefined reference to `optreset’
Fixed via installing libreadline6-dev (I’m running Ubuntu 11.04 on x86_64). Also had to make clean, before it would then compile and install.
After it’s installed, you’ll need to do all the standard post-install steps – create system user, init DB, start server etc. (Follow the INSTALL file in the source dir, under the ‘Getting Started’ section).
In order to install the contrib/cube modules, from the postgres9 source dir:
cd contrib/
make
cd cube
sudo make install
cp sql/cube.sql /usr/local/pgsql/share/contrib/ <- required for musicbrainz install later..
Once you have the postgres server up and running, su to the postgres user you’ve created and create a user to own the musicbrainz DB you’ll be creating. Depending on your security requirements you might want to alter this next line, i set options to allow the musicbrainz user to create DBs, but not be a superuser or create other roles, with this line:
createuser -d -S -R musicbrainz -P
Next create a system user to own and run the musicbrainz-server software. I simply named the account ‘musicbrainz’ too.
For the actual NGS Server setup, you can find the provided Setup instructions here, most of what I type in the next section will be a repeat of them:
Launch CPAN shell:
cpan>
Install local::lib
install App:cpanminus
Exit cpan then install some more modules via apt:
apt-get install libossp-uuid-perl
apt-get install libtest-www-mechanize-perl
apt-get install libicu-dev
Then grab the musicbrainz-server from git (you might need to install git first)
git clone git://git.musicbrainz.org/musicbrainz-server.git musicbrainz-server
cd musicbrainz-server
cpanm .
Barfs at Module-signature – you have to install a specific version:
cpanm http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Module-Signature-0.66.tar.gz
Rerun: cpanm .
I had to manually install Test::WWW::Selenium::Catalyst via CPAN as it was launching Firefox to do *something* but just hanging there. Also manually installed Cache::Memcached::Fast as it was failing due to the Musicbrainz DB not being installed yet. duh!
Next, download the NGS SQL tables we’ll be importing:
wget ftp://ftp.musicbrainz.org/pub/musicbrainz/data/ngs/20110427/mbdump.tar.bz2
wget ftp://ftp.musicbrainz.org/pub/musicbrainz/data/ngs/20110427/mbdump-editor.tar.bz2
wget ftp://ftp.musicbrainz.org/pub/musicbrainz/data/ngs/20110427/mbdump-derived.tar.bz2
cp lib/DBDefs.pm.default lib/DBDefs.pm
vi lib/DBDefs.pmlib/DBDefs.pm
Change sub REPLICATION_TYPE { RT_SLAVE } // (WAS RT_STANDALONE)
Change sub DB_STAGING_SERVER { 0 } // (WAS 1)
Amend the login details to the musicbrainz DB user you created.
Install postgresql-unaccent (under the musicbrainz-server directory – just make and make install)
Do the same for postgresql-musicbrainz-collate
Finally with all supporting modules installed, su to the musicbrainz system user. Ensure you can login to the postgres9 DB, using the same details you have entered in the DBDefs.pm file. Then, from the musicbrainz-server directory:
./admin/InitDb.pl –createdb –import <DIR-WHERE-YOU-DOWNLOADED-DUMPFILES>/mbdump*.tar.bz2 –echo
If all is successful, in about 30mins you should have a working MusicbrainzDB up and running. If you encounter any error messages, and need to re-run InitDb, you’ll first need to login to postgres and drop the two DBs it has installed - musicbrainz_db and musicbrainz_db_raw, but hopefully I think i’ve covered all the errors I ran into..
