Install Madsonic Ubuntu Streaming Media Server

madsonic-logoInstall Madsonic Streaming Media Server on Ubuntu to enjoy your media from anywhere in the world. Like Plex, Madsonic allows you to listen to music from your home in a browser or watch videos and transcodes them if necessary. Madsonic is written in Java and has an array of apps for Android, Windows Phone, iOS. The best Android app is Subsonic (similar to Madsonic) which works with Madsonic. You will be able to enjoy your media very easily after installing Madsonic on Ubuntu – basically having a personal Netflix and Spotify in one. Madsonic is a viable alternative to Plex worth exploring.

Pi Unit
Processor
RAM
RAM Bus
Network
WiFi
USB
SATA
Cost
Raspberry Pi 3
1.2 GHz ARMv8
Quad Core
1 GB DDR2
450 MHz
100 Mbit
Yes
4
No
$35
Raspberry Pi 2
900 MHz ARMv7
Quad Core
1 GB DDR2
450 MHz
100 Mbit
No
4
No
$35.00
Raspberry Pi
700 MHz ARMv6
Single Core
512 MB SDRAM
400 MHz
100 Mbit
No
4
No
$25
Banana Pi
1 GHz ARMv7
Dual Core
1 GB DDR3
432 MHz
Gigabit
No
2
Yes
$36.99
Banana Pi Pro
1 GHz ARMv7
Dual Core
1 GB DDR3
432 MHz
Gigabit
Yes
2
Yes
$45.00

Install Madsonic Ubuntu Streaming Media Server

Here is the full list of Madsonic features

Madsonic also has Jamstash built-in which is a HTML5 mini player to stream your media from anywhere.

Install Java on Ubuntu first, accept the license

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
sudo apt-get update
sudo apt-get install oracle-java8-installer -y

I have done some bash voodoo here to extract the correct latest Madsonic download URL so you can copy the whole block and paste it.

If the Madsonic autodownload below fails go here and click on Debian installer, a new page will pop up and right click on here in this line
In case of problem, please click here to start download manually.

MADSONIC=$(wget -q http://beta.madsonic.org/pages/download.jsp -O - | grep .deb | awk -F "[\"]" ' NR==1 {print $2}')
MADSONICVER=$(echo $MADSONIC | awk 'match($0, /[0-9]\.[0-9]/) {print substr($0, RSTART, RLENGTH)}')
MADSONICFILE=$(echo $MADSONIC | awk 'match($0, /[0-9][0-9].+/) {print substr($0, RSTART, RLENGTH)}')
cd /tmp
wget http://www.madsonic.org/download/$MADSONICVER/$MADSONICFILE -O madsonic.deb

After grabbing the madsonic deb, installation is easy

sudo dpkg -i madsonic.deb
rm madsonic.deb

Change the user Madsonic runs as (by default it's root)

sudo nano /etc/default/madsonic

Change MADSONIC_USER to your main user (like htpcguides)

MADSONIC_USER=htpcguides

If you want to limit memory and change the port (the default is 4040) add these values to the uncommented line (the one without the #)

MADSONIC_ARGS="--port=8080 --https-port=8443 --init-memory=256 --max-memory=512"

Ctrl+X, Y and Enter to save, you'll restart Madsonic after installing the transcoding tools-

Install Madsonic Transcoding Tools

To enable Madsonic's transcoding functions for videos, music and other media files install these packages

sudo apt-get install libav-tools xmp lame flac -y

Remove the old symliks for Madsonic's transcoding

sudo rm /var/madsonic/transcode/ffmpeg
sudo rm /var/madsonic/transcode/lame
sudo rm /var/madsonic/transcode/xmp
sudo rm /var/madsonic/transcode/flac

Create new symlinks and trick

sudo ln -s /usr/bin/avconv /var/madsonic/transcode/ffmpeg
sudo ln -s /usr/bin/flac /var/madsonic/transcode/flac
sudo ln -s /usr/bin/xmp /var/madsonic/transcode/xmp
sudo ln -s /usr/bin/lame /var/madsonic/transcode/lame

Restart Madsonic for everything to take effect

sudo service madsonic restart

The Madsonic default port is 4040 and you can now reach it in your browser. You will have to port forward to reach Madsonic outside your home network.

If you need to set up a Madsonic reverse proxy with nginx, read how to do it here.