I wanted to set up a music server, similar in functionality to songbird but with some differences. There may be alternatives out there, but sometimes you just want to do something because you can.
This guide is intended as much as a reminder to myself of what I did as it is a step by step guide to do it yourself, but if you are interested in doing something similar feel free. However I will assume some prior knowledge, such as setting up a Debian server, mySql, Apache2, php5 etc. If you get stuck, please feel free to contact me.
My Setup.
- Lacie NetworkSpace 1TB stores the music
- Asus Revo R3610 plays the music (via analogue out to my hifi for now)
- ‘Remote Control’ will be from my Android Phone (Samsung Galaxy) via a web page.
My Requirements.
- Must play audio tracks seemlessly (ie if tracks on CD merge into each other their should be no audible gap when I play the tracks over my new system)
- Must run from simple debian setup via command line, because I am a luddite and this is the system I know best.
- Must be controllable via web interface, so I can use my android phone to cue tracks without the need for a monitor to be switched on.
- Must be able to edit playlists on the fly without interupting playback of the current song.
- Must play flac files.
The tools I have chosen are Alsa: drivers for playing audio, sox: a sort of swiss army knife for audio, flac: required for playing flac files and mplayer which after a lot of trial and error proved to be almost perfect for what I wanted to do.
sudo apt-get install alsa-base sox flac mplayer
I used some of this guide to set up my alsa drivers, although I ignored the bits about xbmc and Dharma: http://forum.xbmc.org/showthread.php?t=106811. It is a very helpful guide, so thanks to gpuk – I hope he or she doesn’t mind me linking to their post. It may seem a little technical, but as long as you follow things carefully it all works fine
After following this I wanted to test my setup. I copied a music file to my current directory and named it test.flac (Lee Perry’s The upsetter – top tune!)
My first thoughts were to run
aplay test.flac
This just gave me white noise!!! Good job I remembered to turn my volume right down first. SoI tried “aplay –help” which showed that I needed to pass a flag to specify the format, and more importantly flac wasn’t supported.
-t, –file-type TYPE file type (voc, wav, raw or au)
I then tried using sox to pipe correctly formatted audio into aplay and although I got this working, it wasn’t very elegant and there was bugger all i could do with the file once aplay was playing it other than stop it (ctrl+c).
mplayer
It was at this point that I tried mplayer, which just worked, and it has a slave mode, and it plays playlists, and it takes commands from a fifo pipe.
I tried out a few different command line players and mplayer seems like the only one that satisfied my needs as it runs in slave mode and it will take commands from a fifo pipe
http://snipplr.com/view/18353/gapless-playback-for-mplayer-linux/
Database Needs
I use Exact Audio Copy to rip my cds, which pulls data from freedb – much of which is not to the data standards I require (I am a bit of a pedant!) as I continue to rip more of my collection (it’s quite a biggy) the data gets more messy and I don’t have time to tidy it whilst I rip. So i want to sit on an evening and listen to some tunes while I tidy my data.
For example, I have most of Captain Beefheart’s rather fine colection of albums which freedb has named, “Captain Beefheart”, “Captain Beefheart & His Magic Band” and “Captain Beefheart & The Magic Band” – I want to group all of these as one artist.
Categories/Genres
The Chemical Brothers are variously described as “Electronic”, “Electronic : Breakbeat, Techno, Big Beat” and “Big Beat” i would like to seperate these genres and apply as many of them as I see fit to the Chemical Brothers (ie I want to have a relational table of genres all of which can be applied to an artist or even a specific track by an artist.