Subsonic

Nowadays I use Jellyfin and Plex

Subsonic is an open source media server capable of streaming your entire music and video library to any phone or computer connected to the internet. It works like VLC, but has several extra features, such as real-time transcoding and scrobbling to Last.fm.

Check out the demo for a better idea: http://www.subsonic.org/pages/demo.jsp

Subsonic is cross-platform as it is written in Java. It can be installed independently (standalone) or as a Web Application Archive. Here, I used the standalone form for simplicity.

  1. Install all dependencies

    julio@julio-acer ~ $ sudo pacman -S jre lame ffmpeg flac
    
  2. Download and install Subsonic available on AUR

  3. Edit the startup script

    julio@julio-acer ~ $ sudo vim /var/subsonic/subsonic.sh
    SUBSONIC_HOME=/var/subsonic
    SUBSONIC_HOST=0.0.0.0
    SUBSONIC_PORT=4040
    SUBSONIC_HTTPS_PORT=0
    SUBSONIC_CONTEXT_PATH=/
    SUBSONIC_MAX_MEMORY=200
    SUBSONIC_PIDFILE=
    SUBSONIC_DEFAULT_MUSIC_FOLDER=/media/externo/Musicas
    SUBSONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast
    SUBSONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists
    export LC_CTYPE=en_US.UTF-8
    
    quiet=0
    

    Leave SUBSONIC_HOST as 0.0.0.0 so you can access it from any computer. Change it to 127.0.0.1 if you only want local access.

    The HTTPS_PORT is not necessary, but you can set it as SUBSONIC_HTTPS_PORT=4041. You will also need to configure SSL.

    I added the last line with an export because I had issues with folders and files with accents, and this solved the problem. Other possible variables to be exported can be seen in $ locale.

  4. If in the previous step you left the default music folder. Create a symbolic link in /var/music to the music folder on your hard drive. Example:

julio@julio-acer ~ $ sudo ln -s /media/external/Music/ /var/music/

In any case, later on, you can add music and video folders through the web interface.

  1. Run the script you just edited
julio@julio-acer ~ $ sudo /var/subsonic/subsonic.sh
Started Subsonic [PID 7635, /var/subsonic/subsonic_sh.log]
  1. Access http://localhost:4040 and change the default password to a more secure one

  2. Settings:

    • Music folders: Set the music folders to be accessed
    • General: Set the playlists folder, language, theme, and messages
    • Advanced: Configure the LAME
    • Personal: User settings, such as avatar and lastfm account
    • Users: Create new users, edit their permissions, and change their password. In addition to the admin, I recommend creating another user with fewer permissions, to follow the principle of least privilege.
    • Players: Set the players and transcodes
    • Network: DO NOT check the option “Automatically configure your router to allow incoming connections to Subsonic,” as we will open the port manually.

    Check “Access your server over the Internet using an easy-to-remember address.” and enter any username (jbsilva is mine). You can use this account for free for 30 days, after which you must donate 10 euros or use an external service like DynDNS (explanation below).

    Open the router page (10.0.0.1 here).

    In LANSetup, reserve IP 10.0.0.2 for the computer running Subsonic.

    In Port Forwarding, click on Add Custom Service and fill in the following details:

    Service Name: Subsonic
    Service Type: TCP/UDP
    Starting Port: 4040
    Ending Port: 4040
    Server IP Adress: 10.0.0.2
    

    Test the settings, checking if the router redirected port 4040 to your computer.

    Example: http://189.19.170.215:4040/ and http://jbsilva.subsonic.org should display the Subsonic login screen.

    • Transcoding: Add commands for format conversion.
    • Internet TV/radio: Add links for online TV/radio streaming.
    • Podcast: Configure podcast downloads
    • Search: Configure index update for searches
  3. Create a symbolic link for each program used for transcodes:

    julio@julio-acer ~ $ sudo ln -s /usr/bin/lame /var/subsonic/transcode/
    julio@julio-acer ~ $ sudo ln -s /usr/bin/flac /var/subsonic/transcode/
    julio@julio-acer ~ $ sudo ln -s /usr/bin/ffmpeg /var/subsonic/transcode/
    

iPhone

Since the web interface’s flash player doesn’t work on the iPhone, the best solution is to install some App.

I only found free Apps for Android, for iPhone I found two for $4.99 each: iSub and Z-Subsonic.

Here I will comment on iSub, which I downloaded because it’s more popular and handles albums and covers better, based on the reviews I read. Maybe someday I’ll test Z-Subsonic. If you want a tutorial on setting up Z-Subsonic, the developer created one: http://blog.intulon.com/?p=8

Setting up iSub is quite simple.

  1. Download the App from the AppStore and open it

  2. Click on Settings -> Servers

  3. Add a new server

    If you use the Subsonic server itself, just enter http://jbsilva.subsonic.org, without the port.
    But if you use DynDNS configured as in the tutorial linked in the next topic, also include the port.
    Eg.: http://jbsilva.dyndns.org:4040 or http://casa.juliobs.com:4040/

  4. In settings » settings, enable scrobble for Last.fm and limit the bitrate for 3G connections.

Dynamic DNS

After 30 days, you won’t be able to access your files using the address provided by Subsonic (http://jbsilva.subsonic.org).
You will need to make a donation of at least 10 euros to Subsonic, access your computer directly by IP, or use a dynamic DNS service to associate your computer’s dynamic IP with a static address.

I created a post explaining the entire process to create and configure a hostname on DynDNS. Click HERE to access it.


Julio Batista Silva
Julio Batista Silva
Data Engineer

I’m a computer engineer passionate about science, technology, photography, and languages. Currently working as a Data Engineer in Germany.

comments powered by Disqus