[Tutorial] The Complete Guide for Installing Your Own Subsonic Music Streaming Server

IMPORTANT: This guide is continually updated from time to time.


  • Guide to setting up transcoding.
  • Changing the subsonic source code and compile.


Subsonic (or Subsonic Music Streamer) is an open source media player server that allows even normal user to share their multimedia files online. The following tutorial is prepared to guide you to fresh install SubSonic mods such as MusicCabinet and Madsonic on Mac OS X. The setup is done on a Mountain Lion 10.8.2 system.

At the end of this tutorial you will:
  • Have a Subsonic streaming server setup on your Mac.
  • Setup Subsonic registration engine so that other user can register without manually creating the users.


  • Java 7
  • Tomcat 6
  • Postgre
  • Macports
Before you proceed with this tutorial, you must make sure that you have the aforementioned components setup. This guide will cover the installation of Tomcat and Postgre as well.

You will have to download the installer from Oracle to install the latest Java 7 as it is not distributed by Apple.

NOTE: The latest Java version distributed by Apple is Java 6, which doesn’t meet the minimum requirements of Subsonic.

The mods might comes with two distribution, namely:
  • Standalone - Bundle together with Jetty Web Server. This is the easiest deployment. 
  • WAR (Web Archive) format - To be deployed on a Java Web Server such as Tomcat. More complicated.

Method 1 - Standalone Deployment (e.g. Music Cabinet)

1. Download the latest standalone deployment here at http://forum.subsonic.org/forum/viewforum.php?f=11

2. Extract it to somewhere convenient, e.g. /Desktop and change your working directory there

cd /Desktop/subsonic-installer-standalone

3. The archive file normally have name such as subsonic-installer-standalone which contains files such as subsonic.war, subsonic-booter-jar-with-dependencies.jar, subsonic.bat (startfup script for windows) and subsonic.sh (startup script for *NIX/Mac)

4. Before launching the startup script, you will need to assign +x rights to the subsonic.sh file.
sudo chmod +x subsonic.sh

5. Create a new directory called /subsonic under /var/ and assign the ownership to it. This directory is used to store subsonic database and log files.
$ sudo mkdir /var/subsonic
$ sudo chown dsync /var/subsonic

6. Launch the script by entering:

7. Access the page by going to http://localhost:4040. You should see a login page.

8. Log in using the default admin account using ‘admin’ for both the username and password.

9. You should see a getting started page that require you to have a Postgre database setup. Proceed here install Postgre if you haven’t got it setup.

10. After setting it up, click on the Configure System. You will be asked to enter a password for the user ‘postgres’. The default password is ‘postgres’ if you installed it using the installation guide on step 8. Otherwise enter the password that you supplied when installing PostgreSQL.

11. That’s it, you’re done.

Method 2 - WAR deployment using Tomcat

Currently it is stated in the site that Subsonic only works well on Tomcat version 6. So this tutorial will proceed to install with Tomcat 6.

1. Refer to the guide (http://wolfpaulus.com/journal/mac/tomcat7)

2. To start the server, simply type:
$ /Library/Tomcat/bin/startup.sh
or the following to stop the server:
$ /Library/Tomcat/bin/shutdown.sh

3. To check which JRE that Tomcat is running, enter (http://localhost:8080) and click the Manager.

4. By default, there isn’t any user created to access the manager interface. You will need to create it by editing:
$ nano /Library/Tomcat/conf/tomcat-users.xml

Then paste the following code just above the '<'/tomcat-users'>'. This will create a user with the name ‘tomcat’ and password ‘s3cret’.
<role rolename="manager-gui">
<user password="s3cret" roles="manager-gui" username="tomcat">

5. Now click the Status and make sure the JVM running is 1.7+. If it is running on version 1.6.x or below, refer here.

6. After making sure that Tomcat is running using JVM version 1.7.x, move the .war file to the following path:
$ mv /Desktop/subsonic.war /usr/local/apache-tomcat-6.0.35/webapps

7. Restart and run the server again. If all goes well you will see the page loading at http://localhost:8080/subsonic

Installing PostgreSQL 9.2

There are two ways of installing it, one is to directly using the .pkg installer found on Postgre official site. The second one is through MacPorts. This tutorial will cover the second method:

1. Update to the latest MacPorts version. Go grab a coffee because this will take up quite some time.
$ sudo port –v selfupdate
$ sudo port –v install postgresql92-server

2. Create the initial database for Music Cabinet:
$ sudo mkdir –p /opt/local/var/db/postgresql92/musiccabinet
$ sudo chown postgres:postgres /opt/local/var/db
$ sudo su postgres –c ‘/opt/local/lib/postgresql92/bin/initdb –D /opt/local/var/db/postgresql92/musiccabinet

3. To run the server manually:
$ sudo su postgres -c '/opt/local/lib/postgresql92/bin/postgres -D /opt/local/var/db/postgresql92/musiccabinet'

NOTE: The default user created is ‘postgres’ with the same password ‘postgres’.


How to increase Postgre maximum connection number?
NOTE: Proceed only if you see any FATAL ERROR: too many clients already in the terminal.

If you wish to increase the maximum connection number of Postgre from the default value of 20 to a higher number, the SHMMAX read by the kernel need to be increased as well.

You can check the current SHMMAX value by your running kernel by issuing
$ sysctl –a

and then you will find the following which is the default.
kern.sysv.shmmax: 4194304

To increase this value, you will need to create a file under /etc/sysctl.conf and enter the following lines as recommended by Postgre README file for MBP 2GB RAM. The purpose of creating the file is so that the changes made will be persistent each time you reboot the system.
$ nano /etc/sysctl.conf


How to Set Java Path to Java 7
1. Go to /Applications/Utilities and select Java Preferences.
2. Drag and drop Java SE 7 so that it is located at the top.

By doing so, your system is now configured to use JRE 7 as its priority and will only fallback if the Java application doesn’t support it.

3. In the terminal, type
/usr/libexec/java_home --version 1.7

4. This should return with a path such as

5. To include this as the $JAVA_PATH:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home

NOTE: Using the following command would not register JAVA 7 because the latest Java 7 is not distributed by Apple, instead it is by Oracle.
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

How to integrate PHP-CGI and Tomcat 6

1. Download php-cgi from MacPorts.
sudo port install php5 +fastcgi fcgi php5-gd php5-mysql php5-sqlite php5-curl php5-iconv

2. Add the following lines into /TOMCAT_DIR/conf/web.xml.
PhpJavaServlet php.java.servlet.PhpJavaServlet PhpCGIServlet php.java.servlet.PhpCGIServlet prefer_system_php_execOn php_include_javaOn PhpJavaServlet *.phpjavabridge PhpCGIServlet *.php
3. Follow the instructions here.

4. After extracting the files, put both JavaBridge.jar and php-servlet.jar into /TOMCAT_DIR/lib

5. Open context.xml found under the /TOMCAT_DIR/conf/

6. Append the following line to the Context header.
reloadable="true" privileged="true"

For example:
<Context reloadable="true" privileged="true">

<!-- Default set of monitored resources -->
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<Manager pathname="" />

<!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />



1. Where is the Subsonic log file?
A. It is located under /var/subsonic.

2. Where is Tomcat Log file?
A. It can be found under /tomcat dir/logs. It is very useful to troubleshoot why a page refuses to load.

3. How to increase Tomcat heap size to prevent OutOfMemory error?
Type the following command in the terminal.
export JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m"

Additional Setup

1. Subsonic Registration Engine - http://www.schattorie.com/subsonic-registration-engine/
2. Hiding server status and usage to public user - http://forum.subsonic.org/forum/viewtopic.php?f=3&t=8040&p=36224&hilit=hide#p36224

A. Subsonic Registration Engine

1. Follow the instruction here.

2. Extract and put the file into /TOMCAT_DIR/webapps.

3. Make some necessary changes to the following files:
- register.php

Change the domain name into your subsonic address.

- /lib/config.php
- /lib/mailconf.php

- /lib/mail/passresetmail.txt
Contains the format of the mail received by the user when they reset their password.

- /lib/mail/regmail.txt
Contains the format of the mail received by the user when they register.

Add the following to login.jsp so that it will display both the register and forgot password link.

<td align="left"><br><a href="http://musicscrape.zapto.org:8080/register/register.php" >Register</a>
<br><a href="http://musicscrape.zapto.org:8080/register/forgotpass.php">Forgot password</a></td>



  1. Installing PostgreSQL9.2 on OS X Mountain Lion - http://phlippers.net/blog/2012/08/03/install-postgresql-9-dot-2-on-os-x-mountain-lion/
  2. Postgres Max Connections and Shared Buffers - http://gabe.grayum.name/?p=postgres_max_connections_and_shared_buffers
  3. FATAL: could not created shared memory segment - http://grokbase.com/t/postgresql/pgsql-general/12a76zj50s/mac-os-x-mountain-lion-fatal-could-not-create-shared-memory-segment-cannot-allocate-memory
  4. Installing TomCat 7.0.x on OS X - http://wolfpaulus.com/journal/mac/tomcat7
  5. Setting JAVA_HOME on Mac OS X 10.5 - http://www.mehtanirav.com/2008/09/02/setting-java_home-on-mac-os-x-105/
  6. Installing Java 7 on Mac OS X - http://www.vineetmanohar.com/2011/03/installing-java-7-on-mac-os-x/
  7. MusicCabinet - http://dilerium.se/musiccabinet/#installation
  8. http://www.helloyi.cn/index.php/2011/09/30/mac-osx-lion-macport-nginx-php/
  9. Serve PHP with Tomcat - http://www.thomasknierim.com/140/java/serve-php-with-tomcat/

musicScrape - Yet Another Music Streaming Service

Just to kill some free time in the past two days, I had decided to play with a new toy, this time it is yet another music streaming service simply name musicScrape. The sole purpose is to enable music streaming by genre (or called radio) and enable easy on-the-go streaming experience. Streaming can be done using HTML5 or any other external player.

This service is provided so that I can listen to music anywhere in the campus, but due to the usage of IPv6 I had decided to allow access to the public too. Don't abuse it.

Visit the site at http://musicscrape.zapto.org:8080.

Setting up mpd + ncmpcpp + others on Windows & OSX

Recently I had been playing around with MPD (Music Player Daemon) on my two separate box (Windows + OSX) and they both work wonderfully. I am very impressed with how lightweight mpd is. In case if you are wondering, the entire concept of mpd is based on server and client architecture. So you can be assured that there is a bunch of flexibility. Imagine that all the music is controlled by mpd and you can use any client as the frontend for communicating with mpd. I, for one, had adopted ncmpcpp as my front end. The best part of mpd is that you can stream it into multiple outputs, including http stream thanks to the httpd output!

Here is the basic flow on how mpd and mpd client works:
  1. mpd runs on the server (local) with the server ip and using the default port 6600. By default it will listen and accept for any connection that attempts to communicate with that port.
  2. On the remote client, a mpd client such as ncmpcpp is run to communicate with mpd. ncmpcpp is essentially a front-end that present a graphical user interface in the terminal. Any actions (such as creating playlist, playing song, stopping song, searching song, etc.) is sent to mpd via commands. By using ncmpcpp, this routine is simplified as ncmpcpp will automatically create the command for you. If you were to use mpc, you will have to type command such as mpc play to play a song.

Just a setting example of mine. I have mpd running on my Window 7 box and my OSX box running ncmpcpp to control mpd.

More fun things to do with foobar2k!

Here are some of the fun things that you could do with foobar!
  • Adding random pool of soundtracks from your library into your playlist. Fully customizable. Thanks to foo_random_pool.
  • Adding search function to VGMdb by right clicking on an album.
  • Have the song title spoken to you.

VGMPulse BETA registration is OPEN NOW!

Good news guys!

I am happy to announce that VGMPulse (a music streaming site) is open for beta registration now! What are you waiting for? Click on the logo below for more information! Don't forget to share it among your friends!

Using Final Cut Pro X to import and export video for stream (YouTube)

Final Cut Pro X is very choosy when it comes to importing media, and most often you might in a situation where you need to convert your media into FCP friendly format, such as .avi.

This guide will teach you to:
  • Convert 'non FCP-friendly' videos into 'friendly' videos using MPEG Streamclip.
  • Create a template in Compressor using x264Encoder and complies with YouTube video upload standard.

Quick Start Guide for Using Dolphin (Wii Emulator)


Who should read this guide?

This guide should serve as a quick pointer for first time Dolphin user.

A couple of things you should know about Dolphin:
  • Previously Dolphin had used the subversion numbering, e.g. Dolphin r7990. In the recent months the developer had switched to git numbering, resulting in a release name such as Dolphin 3.0-458. Higher number means latest version.
  • You might find that some games are playable on a certain version, yet unplayable with the subsequent/later versions. So always choose the best version to play the games. For example, Rhythm Heaven Fever will only playble on older version of Dolphin.
  • There are a couple of games that require a customized or patched Dolphin version to play properly. E.g. Xenoblade Chronicles.
  • To check whether a game is compatible to play in Dolphin, check out their Wiki for a list of compatible Wii games. This list will also contains the issue that the games are having and workarounds for fixing it.

More after the break.

The Ultimate Guide to Download Like a PRO from File Hosts (Part 3)

Finally we are at the final part of this tutorial.

In this final part you will learn to:
  • Understand the concept of 'free premium account'.
  • Know reliable sites to search for free premium account that actually works.
  • Add premium account username and password in IDM.
  • Add and use premium account cookies.

Steps after the break.

The Ultimate Guide to Download Like a PRO from File Hosts (Part 2)

Welcome to the second part of the tutorial on how to download like a PRO from various FileHosting sites.

In this part of the tutorial you will learn the following:
  • Know your download manager in terms of user interface, settings, and tweaks.
  • Customizing your download manager to suit your preference (e.g. internet speed, download behaviour).

Without further ado, let's introduce you to two of the widely used and versatile download manager - Internet Download Manager (IDM) and JDownloader.

Steps after the break.

The Ultimate Guide to Download like a PRO from File Hosts (Part 1)

Internet is truly an amazing place. What is not to love about it when it is free? However with these vast information it is hard to find the files (be it movie, music, tv series, or what not) that you wanted to search.

This tutorial will guide you to search for files and download them as effective as possible. It will not cover the torrents.

This tutorial will be divided into 3 parts, which each parts covering different section.

In this part of the tutorial you will learn the following:
  • Know where to search as well as getting familiarize with each selected sites.
  • Know how to use a search query that is concise to nail your search.

Steps after the break.

Bandicam - A competitive game video capture software

Many have complaint that the crack for the latest version of Bandicam (v1.7.5 onwards) didn't work as expected. Or if it had somehow worked but the watermark is still present in the recorded video even after applying the crack. So I had decided to upload the one that I had used and really does work.

Although the version that I uploaded is from the older version (v1.7.1.133), but I couldn't see any major changes when compared to the latest version. At least the video doesn't have the watermark on it after crack.

Watermark on the recorded video even after applying the crack

More after the break.

Fatal Frame 4 Ghosts Image Gallery

Well here is the Image Gallery for the Ghosts (that I had unlocked during my first playthrough) in Fatal Frame 4.

Fatal Frame 4 - Result

Here is my game result after spending nearly 12 hours.

Not bad for my first attempt, if I do say so myself. For the record I never spent a single point in the shop. The ranking is solely based on clear time.
More unlockables after the break.

Fatal Frame 4 - Normal Ending (Screenshots)

Screenshots taken from the Normal Ending.

I guess the picture is self-explanatory.

Fatal Frame 4 - The Final Chapter (Screenshot Storytelling)

Screenshots taken throughout Chapter 12.

Warning: Heavy image load.  

Chapter 12

Finally reaching the final chapter.

More screenshots taken from Fatal Frame 4

More screenshots taken from Fatal Frame 4 just to kill some time.

Chapter 9 - Ruka


Looks more like zombie than ghosts to me.

What's with all these stairs.

More screenshots after the break.

Fatal Frame 3 vs Fatal Frame 4 - A brief comparison

Having play through both Fatal Frame 3: The Tormented (PS2) and Fatal Frame 4: Mask of the Lunar Eclipse (Wii), I got the huge urge to write a quick article about these two amazing horror game that are unique in its own style. This article will mainly discusses about the differences between these two great games as well as improvements in FF4 than its predecessor.

The term 'Ghosts' are referred in both series. Some might refer this as 'Spirit'.
Fatal Frame 3 is abbreviated as FF3 and the same goes for Fatal Frame 4 (FF4)


Theme / Background Setting

FF3: The central theme behind Fatal Frame 3 is the old japanese kind of shrine and wooden manor. You will find yourself exploring these buildings in your dream.

FF4: Unlike the third series that took place in traditional and typical shrine, this latest series took place in a more modern setting where we are most probably born - Hospital.

How to connect/pairing wiimote with PC for Dolphin

Today my purchase of original Wiimote Motion (Black), original Nunchunk (Black) and wireless sensor bar had arrived at my doorstep. Noticed how I use the work Original as I intend to use it with the dolphin emulator. Using third party wiimote might not work in high chance. This guide was created following my successful attempt on pairing it with my PC.

I had tested it with games such as Wii Sports Resort, Legend of Zelda Skyward Sword, Fatal Frame IV and they all work perfectly.

More shots and guide after the break.

Guide on how to recover from a failed or corrupted partition/hard disk

Recently my Rosetta, which is an 1TB external hard disk from Western Digital Mybook series had saw its day. It is the first WD hard drive that had failed over me and it is also the second external hard drive that failed, with the first one being Maxtor Basics 1TB. I had never saw it coming as I believed I took great care of it. Not a single drop, not even once. Initial inspection is that it is a software fault rather than a hardware fault because there is no 'clicking' sound a.k.a click of death. Actually I had this coming all along. Viewing the windows native Event Viewer had shows that the hard disk had suffered from some bad sectors since months ago, and Hardware Controller error few weeks ago. Yet I didn't bother to check through the Event Viewer. It is very rare for computer user to check through the Event Viewer unless there is a need to. I had no idea what causes it but every hard disk do have its own life span. Though WD lasted longer.

There are some great things to be relief of. First, that hard disk only stores some game roms which I had burned it via DVD few days before the disaster. So what's left of it are half of my 500GB of unwatched Animes (which I doubt I will spent time watching them) a couple of TV series and TVB dramas.

This unfortunate incident had proves the following statement to be true, and I will be remember it for the days to come in my whole life.

"All hard disk will certainly failed. Do not think IF my hard disk will fail. Instead, try to think WHEN will my hard disk fail."

Bearing this statement in mind, make sure you took the following steps to identify early symptoms of a hard drive failure.

1. Check through the Event Log for Critical or Error messages from time to time, say weekly to be safe.

2. If there is any bad sectors, even one, that drive might be failed in the days/months to come. Even if the bad sectors are fixed, it would be just delaying it from being deteriorating. Why? Because the bad sectors is only marked as bad or 'dirty' by the OS. So the OS will not write any further data to that sector, at its best. It means that you should start backing up that drive instantly.

Over the past few days I had spent quite some time trying to figuring out the best way to salvage the datas, or what's left of it. So I thought why not write an article that explains the best way to deal with situation such as this in case of the need arises again in the future (which I certain hope not). This article could also help those that experience the same problem that I had, I hope.

Read the basic introduction on how NTFS works written by me, hopefully it is understandable to have a better understand on how NTFS works.

How to Spot Fake Lossless Music

I'm sure that if you had downloaded and stored lossless file in your music library you would have thought that they are indeed lossless. 

Sadly but true, this kind of misconception is false as there are chances that some of those music files that you had downloaded are 'fake' lossless. 

Just some general FAQ's before we proceed with the tutorial.

How 'fake' lossless music is created
So there is this 'fake' lossless file, but how are they created? The answer is simple, which is by the means of upscalling a lossy mp3 files (could be varies in bitrate, even 128 kbps!). However, when played back using media player it will labelled as lossless or havinga  bitrate highter than 320 kbps, which is the highest bitrate for mp3. 

Why upload 'fake' lossless music
This might be done for the purpose of getting people to download it or generate high visitor counts for the site that shared these. 

Where are these 'fake' lossless music can be found?
It varies. But they can be mostly found from forum sharing site, e.g. vnsharing.net or VeryCD.

How to early spot true or fake lossless music
In most, but not all cases of a true lossless music, the uploader will include the EAC (Exact Audio Copy) log file that include additional AccurateRip information, if the album is in the AccurateRip database. Missing this log file doesn't necessary means that the album is fake lossless though.

How to spot 'fake' lossless music
Since the perception of music hearing is subjective and varies from people to people. In times it might be hard to actually hear the difference between a lossy or lossless music, even for those with highly trained ears. This happens because of the improvement that had progressed in the lossy music codec and the high transparency rate that can be achieved. 

An alternative would be using expensive and exotic audio equipment, including speakers, DAC (Digital Analog Converter), pre-amplifier, amplifier, etc.). This coupled with a high trained ears of an audiophile will surely spot the difference instantly. But seriously, how many of us can actually afford those kind of equipments.

And so comes the final solution, which is by the means of using software. If you are a foobar media player user, which is very popular among audiophiles), you could try out the following tools, fooaucdtect. 

Nintendo 3DS mini product review

What's up guys. Here's my first product review just to kill some free time of mine. Frankly speaking, I had intended to do product review since I started this blog but alas, I just couldn't find the proper digital camera, experience, and time to do it.

After long time of hesitation I finally get ahand of Nintendo latest portable gaming console, the Nintendo 3DS. At first I had been juggling between PS Vita and 3DS. So what make me choose 3DS over the PS Vita? For me, the primary factor in choosing a console is the games library. As PS Vita is just launched in JP and HK few weeks ago, the game library is still in its infancy and the current game title is countable by fingers! Even the future release games list doesn't appeal much (to me at least), with the exception of probably Persona 4 and Disgaea. For 3DS, a list of promising titles had been announced, in development, and in my wish list. To name a few, Harvest Moon, Etrian Odyssey, Pokemon, Mario, Zelda, Resident Evil, Kirby, and Phoenix Wright.

Another issue is the pricing, as of now the price is a bit pricy and only after it is released in MY/SG can we expect to see a price drop. But for the time being, purchasing it doesn't seemed to be a wise choice, not if I had a limited budget at hand. 3DS, on the other hand, had seen a price drop and it had helped Nintendo to rise up the sales target once again. Previously, many had speculated that the sales number for 3DS is not so promising and will never compete against the sales record of PSP. But look at the chart now, it is without a doubt that 3DS leads the number among other portable handheld gaming device. Only time will tell whether PS Vita will triumph over 3DS.

Another factor that leads me to choose 3DS over PS Vita is the 3D effect. As you might probably aware of, a majority of people had said that 3D is just a hype of the moment while some are still standing on the fence, hesitating. Yea one can live without 3D but 3D will enhance the gameplay even more.

Hardware spec for PS Vita is definitely overpowered, with 4 cores (only 3 cores are usable), touch front and back screen, dual analog control, and the massive 5 inch OLED screen, what's not to like. But at the end of the day, it's the games that matters, not the hardware. Given the most powerful handheld device in the world, if there are no popular games to unleash its potential, what good will it be?

Speculations had it that 3DS Lite might be announced in E3 but I highly doubt so as it took 18 months for DS Lite to emerged and another 12 months for DSi. It is CNY and I thought why not having a 3DS to spur the moment for this festive season.

Enough talk. My 3DS package consist of crystal case by FunBox, Hori Screen Protector, Acekard 2i and a 3DS game, Super Mario 3D Land! The console is Flare Red color and it is MY/SG set, which is also a US set.

More pictures after the break.

Playing video on 60 FPS (Update 2)

So you had played games on your PC on 60 FPS, your eyes had been used to it and you are sick of the console frame rate that capped on 30 FPS. And on top of it, you got yourself a 60 Hz capable monitor yet you are playing your HD video collection on the native NTSC (23.976) or PAL (25.000) frame rate. However, not all of us are financial capable enough to purchase a 120Hz HDTV. If you ever had question on whether it is possible to play those HD videos that you treasured so much on your beloved 60 Hz monitor, ask no further as it is possible, provided that you have a decent processor (Core 2 Duo and above).