Update Airsonic on Raspberry Pi 3

Written by pmd - - no comments

How to update a standalone Airsonic

  • Stop the current running Airsonic:
$ sudo systemctl stop airsonic.service
$ cd /var/airsonic/
$ sudo mv airsonic.war airsonic.war.10.1.1.bak
$ sudo wget https://github.com/airsonic/airsonic/releases/download/v10.1.2/airsonic.war --output-document=/var/airsonic/airsonic.war
  • Put good rights to all folder (new airsonic.war is not owned by airsonic), and verify it has been applied:
$ sudo chown -R airsonic:airsonic /var/airsonic
$ ls
total 151M
-rw-r--r--  1 airsonic airsonic 760K Oct 11 19:52 airsonic.log
-rw-r--r--  1 airsonic airsonic  11M Oct  3 00:20 airsonic.log.1
-rw-r--r--  1 airsonic airsonic  978 Oct 11 04:00 airsonic.properties
-rw-r--r--  1 airsonic airsonic  70M Jul 28 22:10 airsonic.war
-rw-r--r--  1 airsonic airsonic  70M Dec 16  2017 airsonic.war.10.1.1.bak
drwxr-xr-x  2 airsonic airsonic 4.0K Oct 11 19:49 db
drwxr-xr-x  2 airsonic airsonic  20K Sep 14 16:08 lastfmcache
drwxr-xr-x  7 airsonic airsonic 4.0K Jul 22 10:36 lucene2
-rw-r--r--  1 airsonic airsonic  741 Oct 11 19:50 rollback.sql
drwxr-xr-x 16 airsonic airsonic 4.0K Oct  4 17:45 thumbs
drwxr-xr-x  2 airsonic airsonic 4.0K Jul 22 10:54 transcode
  • Start updated Airsonic and restart proxy server:
$ sudo systemctl start airsonic.service
$ sudo service nginx restart

Nothing too hard, basically, you need to replace the airsonic.war by the updated one.

Install Airsonic on Raspberry Pi 3

Written by pmd - - no comments

Stand-alone WAR installation integrated within systemd

Let's see how to install a stand-alone Airsonic on a Raspberry 3 integrated with Systemd.

First of all, we need Java to be installed:

$ sudo apt-get updateinstall openjdk-8-jre

By following these systemd setup instructions, Airsonic will be available at http://localhost:8080/airsonic.

  1. Setup dedicated airsonic user:
    $ sudo useradd airsonic
  2. Setup Airsonic data dir:
    $ sudo mkdir /var/airsonic
    $ sudo chown airsonic /var/airsonic
  3. Download the stand-alone WAR:
    $ sudo wget https://github.com/airsonic/airsonic/releases/download/v10.1.1/airsonic.war --output-document=/var/airsonic/airsonic.war
  4. Setup systemd service:
    $ sudo wget https://raw.githubusercontent.com/airsonic/airsonic/master/contrib/airsonic.service -O /etc/systemd/system/airsonic.service
    $ sudo systemctl daemon-reload
    $ sudo systemctl start airsonic.service
    $ sudo systemctl enable airsonic.service
    $ sudo wget https://raw.githubusercontent.com/airsonic/airsonic/master/contrib/airsonic-systemd-env -O /etc/sysconfig/airsonic

    Note: On Debian systems you need to replace /etc/sysconfig with /etc/default)

  5. Go configure http://localhost:8080/airsonic.

Set up a reverse proxy: nginx

  1. Go edit nginx configuration:
    $ sudo nano /etc/nginx/sites-available/default
  2. location ^~ /airsonic {
            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://localhost:8080;
            #proxy_redirect http:// https://;
  3. Restart nginx:
    $ sudo service nginx restart

Set up the transcoder

$ sudo apt-get install ffmpeg

Then we need to link Airsonic with the transcoder ffmpeg.

$ sudo mkdir /var/airsonic/transcode
$ cd /var/airsonic/transcode
$ sudo ln -s /usr/bin/ffmpeg /var/aisonic/transcode/ffmpeg
$ ls -alh
total 8.0K
drwxr-xr-x 2 airsonic airsonic 4.0K Jul 22 10:54 .
drwxr-xr-x 5 airsonic tomcat8  4.0K Jul 22 10:48 ..
lrwxrwxrwx 1 root     root       15 Jul 22 10:54 ffmpeg -> /usr/bin/ffmpeg
$ sudo chown -R airsonic:airsonic /var/airsonic
$ ls -alh
total 8.0K
drwxr-xr-x 2 airsonic airsonic 4.0K Jul 22 10:54 .
drwxr-xr-x 5 airsonic airsonic 4.0K Jul 22 10:48 ..
lrwxrwxrwx 1 airsonic airsonic   15 Jul 22 10:54 ffmpeg -> /usr/bin/ffmpeg

Interact with server from Android

I use the Ultrasonic application:

Source 1, 2, 3,

NTFS HDD plugged to Raspberry Pi 3

Written by pmd - - no comments

Choose where to mount the disk:

mkdir /home/pi/HDD

Partition is NTFS, so if we wanna write on it:

sudo apt-get install ntfs-3g

To know the UUID of the HDD:

sudo blkid

Edit how to mount disk partition:

sudo nano /etc/fstab

Add this line and save:

UUID=AADEEA03DEE9C7A1 /home/pi/HDD ntfs-3g uid=1000,gid=1000,auto,umask=000 0 0

Mount  all filesystems mentioned in fstab to be mounted as indicated :

sudo mount -a


Subsonic on Raspberry Pi 3

Written by pmd - - 2 comments

Install java:

sudo apt-get install openjdk-8-jre

Download the Subsonic .deb package and install it:

sudo dpkg -i subsonic-x.x.deb

Change user (i have set pi instead of root) :

sudo nano /etc/default/subsonic

For troubleshooting interesting files are here: /var/subsonic

It was interesting because it allowed me to understand why Subsonic web interface was OK but impossible to play a file :

cat /var/subsonic/subsonic.log
[2018-01-14 10:59:44,539] INFO TranscodeInputStream - Starting transcoder: /var/subsonic/transcode/ffmpeg -i /home/pi/Music/Paul Kalkbrenner - Berlin Calling/07_Paul_Kalkbrenner_-_Torted_Original Mix.mp3 -map 0:0 -b:a 128k -v 0 -f mp3 -
[2018-01-14 10:59:44,551] INFO InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg) /var/subsonic/transcode/ffmpeg: 1: /var/subsonic/transcode/ffmpeg: Syntax error: "(" unexpected

It was a problem linked with ffmpeg. I think the problem comes from the fact that ffmpeg given in deb is made for ubuntu/debian but probably not ARM processor. THis is why I install ffmpeg from repository and then linked Subsonic folder to this ffmpeg freshly installed:

sudo apt-get install ffmpeg
sudo rm /var/subsonic/transcode/ffmpeg
sudo ln -s /usr/bin/ffmpeg /var/subsonic/transcode/ffmpeg

Restart Subsonic:

sudo service subsonic restart

Configure Subsonic using web interface and admin account.

It worked! I could play my music from Astana, Kazakhstan while it was actually stocked in my Raspberry in Paris!

In my opinion it works quiet nice! Not laggy I mean.

Rss feed of the tag