Tuesday Feb 17, 2009

Start Believing in Artists, not the Music Industry

A few months ago, while driving home from the in-laws, we heard Normcast episode 119, a German podcast full of nice little fragments, pieces of music and other fun stuff. In this episode, Norman played Matthew Ebel's song "Everybody Needs a Robot" (lyrics, YouTube video) and, being the geek that I am, I liked it a lot.

Goodby Planet Earth Album CoverI asked Norman whether the song was podsafe, it turned out it was not, so I asked Matt directly for permission to use his song in a podcast. He kindly agreed and so we played it during HELDENFunk episode 22 around September 2008. As a way of saying "Thanks!" I bought Matt's latest album "Goodbye Planet Earth" off of CDBaby.com, a website where independent artists such as Matt can publish their own CDs without the need of a traditional record company.

Later, during an event called "Mission Future", which was part of Ars Electronica 2008, I watched a presentation from Pim Betist about a cool new website called "Sellaband". Sellaband is a crowdfunding website that brings musicians together with their fans (called "Believers") and help them raise real money ($50,000) to record an album in a high-quality studio, with professional producers and market it using a real distribution chain.

Now, the two powers have collied: Matt recently joined Sellaband and he's on his way to financing his next album there!

Why am I telling you all of this? Because this is the biggest shift in the entertainment industry since the introduction of recordable media.

Think of it: Now artists can create their own CDs, all by themselves, from writing the lyrics, writing the music, producing demos, connecting with fans, raising funds, managing production and selling their work, all without a single mention of what was formerly known as "the recording industry". While the RIAA and their likes are still behaving like little kids who have lost their toys, music artists have started to take control over their carreers and simply optimized away unnecessary intermediaries out of the equation.

Beer and Coffee Album CoverSo how does this work? A little bit like owning stock, but with more fun and better "dividends": The $50,000 budget that is needed to produce an artist's album is split into 5,000 "parts", at $10 each. For as little as $10 (1 part), you can become a "Believer" in an artist that is listed on Sellaband. Being a Believer gives you the right to receive a limited edition of that artist's album, once it is recorded. Think of it: This is cheaper than most regular CDs, so there's nothing to lose here. Actually, this is just where the fun starts: Each part entitles its owner to 0,01% of the album's revenue. So if you have a good "nose" for finding successful artists, you can even get some money back out of your investment! You can own more than one part and the more parts you buy, the nicer the perks become. From "Believer" (1 part) to "Promoter" (2 parts), "Publisher" (5 parts and you start earning publishing revenue), "V.I.P." (10), "Crew" (50), "Music Angel" (100) all the way to "Executive Producer" (1000 parts, free trip to the studio baby!). Check out the full "what's in it for me" list.

Back to Matt: His music is a modern version of songwriter-style piano rock. A little bit like Billy Joel, maybe with some Elton John thrown in, but with a modern twist: He likes to add loops, electronic sounds or samples into his songs to add to the atmosphere without them becoming distracting. The lyrics are insightful, full of life, spirit, humor and a little irony. Check out his bio for a much better description of him and his music.

But Matt is more than that: He is a leading example of how an artist can connect to his audience using Web 2.0: He has his own paid subscription service, sells his music online on iTunes, CDBaby and MySpace, including online merchandise on Spreadshirt.com, he blogs, has over 100 videos on YouTube and you can follow him on Twitter. His concert calendar is online and if you can't make it to one of his shows, you can watch him online on UStream. To me he's simply the Piano Man 2.0.

And now you can enjoy a part of his next album, too! Check out his profile on Sellaband.com and feel free to invest in his work.

BTW, Sellaband is a social network, too: You can check out my profile and add me as your friend there, too. Then we can together check out other great artist and change the way the music industry works, just by Believing in the artists we like.

Thursday Mar 20, 2008

How to compile/run MediaTomb on Solaris for PS3 and other streaming clients

MediaTomb showing photos on a PS3Before visiting CeBIT, I went to see my friend Ingo who works at the Clausthal University's computing center (where I grew up, IT-wise). This is a nice pre-CeBIT tradition we keep over the years when we get to watch movies in Ingo's home cinema and play computer games all day for a weekend or so :).

To my surprise, Ingo got himself a new PlayStation 3 (40GB). The new version is a lot cheaper (EUR 370 or so), less noisy (new chip process, no PS2 compatibility), and since HD-DVD is now officially dead, it's arguably the best value for money in Blu-Ray players right now (regular firmware upgrades, good picture quality, digital audio and enough horsepower for smooth Java BD content). All very rational and objective arguments to justify buying a new game console :).

The PS3 is not just a Blu-Ray player, it is also a game console (I recommend "Ratchett&Clank: Tools of Destruction" and the immensely cute "LocoRoco: Cocoreccho!", which is a steal at only EUR 3) and can act as a media renderer for DLNA compliant media servers: Watch videos, photos and listen to music in HD on the PS 3 from your home server.

After checking out a number of DLNA server software packages, it seemed to me that MediaTomb is the most advanced open source one (TwonkyVision seems to be nicer, but sorry, it isn't open source...). So here is a step-by-step guide on how to compile and run it in a Solaris machine.

Basic assumptions

This guide assumes that you're using a recent version of Solaris. This should be at least Solaris 10 (it's free!), a current Solaris Express Developer Edition (it's free too, but more advanced) is recommended. My home server runs Solaris Express build 62, I'm waiting for a production-ready build of Project Indiana to upgrade to.

I'm also assuming that you are familiar with basic compilation and installation of open source products.

Whenever I compile and install a new software package from scratch, I use /opt/local as my base directory. Others may want to use /usr/local or some other directory (perhaps in their $HOME). Just make sure you use the right path in the --prefix=/your/favourite/install/path part of the ./configure command.

I'm also trying to be a good citizen and use the Sun Studio Compiler here where I can. It generally produces much faster code on both SPARC and x86 architectures vs. the ubiquitous gcc, so give it a try! Alas, sometimes the code was really stubborn and it wouldn't let me use Sun Studio so I had to use gcc. This was the path of least resistance, but with some tinkering, everything can be made to compile on Sun Studio. You can also try gcc4ss which combines a gcc frontend with the Sun Studio backend to get the best of both worlds.

Now, let's get started!

MediaTomb Prerequisites

Before compiling/installing the actual MediaTomb application, we need to install a few prerequisite packages. Don't worry, most of them are already present in Solaris, and the rest can be easily installed as pre-built binaries or easily compiled on your own. Check out the MediaTomb requirements documentation. Here is what MediaTomb wants:

  • sqlite3, libiconv and curl are available on BlastWave. BlastWave is a software repository for Solaris packages that has almost everything you need in terms of pre-built open source packages (but not MediaTomb...). Setting up BlastWave on your system is easy, just follow their guide. After that, installing the three packages above is as easy as:
    # /opt/csw/bin/pkg-get -i sqlite3
    # /opt/csw/bin/pkg-get -i libiconv
    # /opt/csw/bin/pkg-get -i curl
  • MediaTomb uses a library called libmagic to identify file types. It took a little research until I found out that it is part of the file package that is shipped as part of many Linux distributions. Here I'm using file-4.23.tar.gz, which seems to be a reasonably new version. Fortunately, this is easy to compile and install:

    $ wget ftp://ftp.astron.com/pub/file/file-4.23.tar.gz
    $ gzip -dc  file-4.23.tar.gz | tar xvf -$ cd file-4.23
    $ CC=/opt/SUNWspro/bin/cc ./configure --prefix=/opt/local
    $ gmake
    $ su
    # PATH=$PATH:/usr/ccs/bin:/usr/sfw/bin; export PATH; gmake install

    Notice that the last step is performed as root for installation purposes while compilation should generally be performed as a regular user.

  • For tag extraction of MP3 files, MediaTomb uses taglib:
    $ wget http://developer.kde.org/~wheeler/files/src/taglib-1.5.tar.gz
    $ cd taglib-1.5
    $ CC=/usr/sfw/bin/gcc CXX=/usr/sfw/bin/g++ ./configure --prefix=/opt/local
    $ gmake
    $ su
    # PATH=$PATH:/usr/ccs/bin:/usr/sfw/bin; export PATH; gmake install
  • MediaTomb also uses SpiderMonkey, which is the Mozilla JavaScript Engine. Initially, I had some fear about having to compile all that Mozilla code from scratch, but then it dawned on me that we can just use the JavaScript libraries that are part of the Solaris Firefox standard installation, even the headers are there as well!

That was it. Now we can start building the real thing...

 Compiling and installing MediaTomb

Now that we have all prerequisites, we can move on to downloading, compiling and installing the MediaTomb package:

  • Download the MediaTomb source from http://downloads.sourceforge.net/mediatomb/mediatomb-0.11.0.tar.gz
  • Somehow, the mediatomb developers want to enforce some funny LD_PRELOAD games which is uneccesary (at least on recent Solaris versions...). So let's throw that part of the code out: Edit src/main.cc and comment lines 128-141 out by adding /\* before line 128 and \*/ at the end of line 141.
  • Now we can configure the source to our needs. This is where all the prerequisite packages from above are configured in:
    ./configure
    --prefix=/opt/local --enable-iconv-lib --with-iconv-h=/opt/csw/include
    --with-iconv-libs=/opt/csw/lib --enable-libjs
    --with-js-h=/usr/include/firefox/js --with-js-libs=/usr/lib/firefox
    --enable-libmagic --with-magic-h=/opt/local/include
    --with-magic-libs=/opt/local/lib --with-sqlite3-h=/opt/csw/include
    --with-sqlite3-libs=/opt/csw/lib
    --with-taglib-cfg=/opt/local/bin/taglib-config
    --with-curl-cfg=/opt/csw/bin/curl-config

    Check out the MediaTomb compile docs for details. One hurdle here was to use an extra iconv library because the MediaTomb source didn't work with the gcc built-in iconv library. Also, there were some issues with the Sun Studio compiler, so I admit I was lazy and just used gcc instead. 

  • After these preparations, compiling and installing should work as expected:
    gmake
    PATH=$PATH:/usr/ccs/bin:/usr/sfw/bin; export PATH; gmake install

Configuring MediaTomb

Ok, now we have successfully compiled and installed MediaTomb, but we're not done yet. The next step is to create a configuration file that works well. An initial config will be created automatically during the very first startup of MediaTomb. Since we compiled in some libraries from different places, we either need to set LD_LIBRARY_PATH during startup (i.e. in a wrapper script) or update the linker's path using crle(1).

In my case, I went for the first option. So, starting MediaTomb works like this:

LD_LIBRARY_PATH=/opt/csw/lib:/opt/local/lib:/usr/lib/firefox
/opt/local/bin/mediatomb --interface bge0 --port 49194 --daemon
--pidfile /tmp/mediatomb.pid
--logfile=/tmp/mediatomb.log

Of course you should substitute your own interface. The port number is completely arbitrary, it should just be above 49152. Read the command line option docs to learn how they work.

You can now connect to MediaTomb's web interface and try out some stuff, but the important thing here is that we now have a basic config file in $HOME/.mediatomb/config.xml to work with. The MediaTomb config file docs should help you with this.

Here is what I added to my own config and why:

  • Set up an account for the web user interface with your own user id and password. It's not the most secure server, but better than nothing. Use something like this in the <ui> section:
    <accounts enabled="no" session-timeout="30">
      <account user="me" password="secret"/>
    </accounts>
  • Uncomment the <protocolInfo> tag because according to the docs, this is needed for better PS3 compatibility.
  • I saw a number of iconv errors, so I added the following to the config file in the import section. Apparently, MediaTomb can better handle exotic characters in file names (very common with music files) with the following tag:
    <filesystem-charset>ISO-8859-1</filesystem-charset> 
  • The libmagic library won't find its magic information because it's now in a nonstandard place. But we can add it with the following tag, again in the import section:
    <magic-file>/opt/local/share/file/magic</magic-file>
  • A few mime types should be added for completeness:

    <map from="mpg" to="video/mpeg"/>
    <map from="JPG" to="image/jpeg"/>
    <map from="m4a" to="audio/mpeg"/>

    Actually, it should "just work" through libmagic, but it didn't for me, so adding theses mime types was the easiest option. It also improves performance through saving libmagic calls. Most digital cameras use the uppercase "JPG" extension and MediaTomb seems to be case-sensitive so adding the uppercase variant was necessary. It's also apparent that MediaTomb doesn't have much support for AAC (.m4a) even though it is the official successor to MP3 (more than 95% of my music is in AAC format, so this is quite annoying).

  • You can now either add <directory> tags to the <autoscan> tags for your media data in the config file, or add them through the web interface.

MediaTomb browser on a PS3This is it. The pictures show MediaTomb running in my basement and showing some photos through the PS3 on the TV set. I hope that you can now work from here and find a configuration that works well for you. Check out the MediaTomb scripting guide for some powerful ways to create virtual directory structures of your media files.

MediaTomb is ok to help you show movies and pictures and the occasional song on the PS3 but it's not perfect yet. It lacks support for AAC (tags, cover art, etc.) and it could use some extra scripts for more comfortable browsing structures. But that's the point of open source: Now we can start adding more features to MediaTomb ourselves and bring it a few steps closer to usefulness.

About

Tune in and find out useful stuff about Sun Solaris, CPU and System Technology, Web 2.0 - and have a little fun, too!

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Bookmarks
TopEntries
Blogroll
OldTopEntries