Subsonic

Subsonic was a music server that let you store your music on one machine and play it from other machines, cell phones, via a web interface, or various other applications. It is no longer maintained. However, a maintained fork (airsonicAUR) exists.

Installation

The old, unmaintained version of subsonicAUR is still available. In addition, as of version 6, the software was not open source. Hence it is recommended for users to instead install the open-source fork airsonic-advanced-gitAUR.

Configuration

After performing any configuration, remember to restart subsonic.service.

Install transcoders

By default, Subsonic uses FFmpeg to transcode videos and songs to an appropriate format and bitrate on-the-fly. After installation, you can change these defaults so that, for example, Subsonic will transcode FLAC files using FLAC and LAME instead of FFmpeg. You should therefore install the ffmpeg, and you may also want to install flac and lame.

For security reasons, Subsonic will not search the system for any transcoders. Instead, the user must create symlinks to the transcoders in the /var/lib/subsonic/transcode folder. Create the symlinks like so:

$ cd /var/lib/subsonic/transcode
# for transcoder in ffmpeg flac lame; do ln -s "$(which $transcoder)"; done

With Subsonic

To enable HTTPS browsing and streaming, edit /var/lib/subsonic/subsonic.sh and change this line:

SUBSONIC_HTTPS_PORT=0

To this:

SUBSONIC_HTTPS_PORT=8443
Note: port 8443 seems hard-coded somewhere. When attempting to change it to port 8080 it will automatically redirect the browser to port 8443 after manually accepting the invalid HTTPS certificate. You will still be able to re-navigate to port 8080 after the warning page and have it work on that port.

With nginx

If you already have multiple web services running, it might be easier to use a single SSL configuration everywhere. The following nginx configuration runs Subsonic under https://example.com/subsonic:

server {
    listen              443 default ssl;
    server_name         example.com;
    ssl_certificate     cert.pem
    ssl_certificate_key key.pem

    location /subsonic {
      proxy_set_header X-Real-IP         $remote_addr;
      proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto https;
      proxy_set_header Host              $http_host;
      proxy_max_temp_file_size           0;
      proxy_pass                         http://127.0.0.1:4040;
      proxy_redirect                     http:// https://;
    }
}

To run Subsonic under a different path, you have to set the following options:

With lighttpd

The following configuration makes lighttpd accept HTTPS connections and proxies them to localhost. An advantage of this approach is that Subsonic does not need to be aware of SSL settings, and it can be left with default settings. This configuration is also designed to play well with the case where lighttpd is hosting multiple sites at a single IP address.

Troubleshooting

FLAC playback

The FFmpeg transcoder does not handle FLAC files well, and clients will often fail to play the resultant streams. Using FLAC and LAME instead of FFmpeg may solve this issue. This workaround requires that the FLAC and LAME transcoders have been installed, as explained in #Install transcoders.

Start Subsonic and go to settings > transcoding. Ensure that the default FFmpeg transcoder does not get used on .flac files, then add a new entry. You will end up with something like this:

NameConvert fromConvert toStep 1Step 2
mp3 default... NOT flac ...mp3ffmpeg ... 
mp3 flacflacmp3flac --silent --decode --stdout %slame --silent -h -b %b -

Accessing the database

Subsonic stores all its data inside a HyperSQL database in /var/lib/subsonic/db. You can access it with a simple web interface by going to http://localhost:4040/db.view (replace with your Subsonic URL).

You can also use the SQLTool command-line tool from the HyperSQL distribution, found in .

Warning: This tool cannot be run concurrently with your Subsonic instance and severely corrupt your database if misused, since newer versions of SqlTool automatically try to upgrade the database to a version that Subsonic does not support. The following assumes that you have a copy of the database in the db.copy directory.

This command can be run interactively without other arguments :

It can also run commands non-interactively. This command exports all the contents in the table :

This command exports the whole database as a SQL file :

Libresonic/Airsonic

Subsonic was subsequently forked as Libresonic. This was also open-source, but had removed the paid-licence checks, hence was also free as in free beer. However neither Subsonic nor Libresonic are maintained. The current fork continues with the name Airsonic-Advanced.

Madsonic

is a (non-free) fork of Subsonic with extra features.

Once you start the server, pay close attention to the Transcoding options, as you will probably have to change the command from "Audioffmpeg" to "ffmpeg".

Gonic

is a lightweight music streaming server which implements the Subsonic API

Clients

Sonixd

is a cross platform, desktop Subsonic API client player

Strawberry Music Player

has the ability to playback music from Subsonic API servers

Sublime Music

is a native, graphical Subsonic client.
gollark: Protected from viruses by the power of God, you know.
gollark: No, it's Temple OS.
gollark: https://voidlinux.org/
gollark: A Linux distribution.
gollark: Well, void now.

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.