HOWTO: Bliss for Artwork Management

Questions about using 3rd party Media Streaming software may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.
nigel
I'm New!
I'm New!
Posts: 2
Joined: Fri Nov 18, 2011 1:09 pm

HOWTO: Bliss for Artwork Management

Postby nigel » Fri Nov 18, 2011 2:38 pm

I recently bought a Synology Diskstation DS411slim with the intention of running SqueezeBox Server on it. Getting the diskstation setup with my music and SqueezeBox Server running went fine but my collection had hardly any artwork in it making the user interface experience poor. I set about trying to get an automated tool installed directly on the DS411 to retrieve the relevant artwork. Having now succeeded thought I would share my results :)

Initial research led me to: http://www.blisshq.com:
bliss is a simple and accurate album artwork finder. Discover art for rare recordings. Free your art to view anywhere. Update existing art with one click. Configure once, then enjoy.


To get this to work, I had to do the following:
1) Install ipkg
2) Install Java
3) Install Bliss
4) Get Bliss to run on startup

Install iPkg
This is referred to as "Bootstrapping"; something which is much less scary than it sounds. Once done it allows you to install other command line utilities to use in your linux command shell on the Diskstation.
- Install iPkg:
http://forum.synology.com/wiki/index.php/Overview_on_modifying_the_Synology_Server,_bootstrap,_ipkg_etc#How_to_install_ipkg
- Install bash and nano using ipkg; Bash is needed to run the bliss.sh script. nano is an easier text editor to use in the console shell rather than vi:

Code: Select all

ipkg install bash nano


Install Java
Bliss is a java application, so first off you have to install Java.
- Locate your processor type; the DS411slim has a Marvell Kirkwood mv6282 1.6Ghz ARM Processor (Marvell ARMADA 300) which more googling details that it is based on ARMv5:
http://forum.synology.com/wiki/index.php/What_kind_of_CPU_does_my_NAS_have
- Download the correct version of java according to your processor. For the DS411slim I needed ejre-1_6_0_25-fcs-b06-linux-arm-sflt-eabi-headless-14_apr_2011.tar.tar:
http://www.oracle.com/technetwork/java/javase/downloads/ejre-6u25-download-355127.html
- Bizzarely installing java seems to be simply a case of unpacking the binary and putting it in a sensible place. I put it at /usr/java/ejre1.6.0_25.

You could also try instructions I found here: http://pcloadletter.co.uk/2011/08/23/java-package-for-synology/

Next we want to modify environmental variables to make java available to console sessions. These steps aren't strictly necessary, but will make things easier with the bliss install and configuration
- Edit /etc/profile to make java easily available to all sessions, I recommend using nano

Code: Select all

nano /etc/profile

- Add a line at the bottom to add the JAVA_HOME environmental variable:

Code: Select all

export JAVA_HOME=/usr/java/ejre1.6.0_25/bin/java

- Amend the path to include java. For my install this meant amending the PATH line to read

Code: Select all

PATH=/opt/bin:/opt/sbin:$PATH:/usr/java/ejre1.6.0_25/bin

- Save changes. In nano you press F3 or Ctrl X and then say yes to save changes

Setting these variables is discussed further at http://www.cyberciti.biz/faq/linux-unix-set-java_home-path-variable/

Install Bliss
Broadly speaking we follow http://www.blisshq.com/install-linux.html
- Download bliss to your Diskstation
- Open a terminal on the diskstation
- Change directory to where the file was downloaded to
- Install using

Code: Select all

java -jar bliss-install-20111108.jar -console

- I selected to install to /usr/bliss
- Edit bliss.sh

Code: Select all

nano /usr/bliss/bin/bliss.sh

- Amend the first line to read:

Code: Select all

#!/opt/bin/bash

- Save changes.

You should now be able to run bliss.sh in a console session by running the following:

Code: Select all

/usr/bliss/bin/bliss.sh

It will take a while to get started, but when started, you can access the userinterface at http://[YourDisktation]:3220. There's a good quickstart at http://www.blisshq.com/support/tutorials/first-steps.html

Note when it has found artwork, you'll need to get Squeezebox Server to rescan your entire collection from scratch, else it won't see the new artwork it has found associated with your existing music.

Get Bliss to run on startup
Running bliss from a console session will mean when you logout, or restart the Diskstation, bliss will stop. That may be fine as it may have "fixed" your music collection already, and you are ok to run as and when you need it to "fix" more of your music collection. I wanted it to run as a service, as that is how it is designed to be run, then you can just forget about it, and every time you import more music it will go and find the artwork for it.

To run bliss.sh as a service, we need an /etc/init.d script. This will allow us to make commands like:

Code: Select all

/etc/init.d/bliss start
/etc/init.d/bliss status
/etc/init.d/bliss stop


The support team at Bliss responded to my email asking for advice within 32 mins; and while they didn't have a script for a Diskstation, they sent me one I was able to modify:

- Place the following in a file called /etc/init.d/bliss

Code: Select all

#!/bin/sh
#
# chkconfig: 345 91 50
# description: Starts and stops the bliss
# pidfile: /opt/ps3mediaserver/bliss.pid

# Avoid using root's TMPDIR
unset TMPDIR

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 1

start() {
                # Check if it is already running
                echo -n $"Starting bliss daemon: "
                if [ ! "$(ps w w | grep [/]usr/bliss/bin/)" > /dev/null ]; then
               #daemon daemonize /opt/bliss/bin/bliss.sh
                nohup /usr/bliss/bin/bliss.sh > /usr/bliss/log/bliss.log &
                echo 'Started'
        else
                checkstatus
        fi
        return $RETVAL
}

stop() {
        echo -n $"Stopping bliss daemon: "
        for i in `ps w w | grep [/]usr/bliss/bin/ | cut -c0-5`
        do
                echo -n "Stopping process $i"
                kill $i
        done
        echo
}

restart() {
        stop
        sleep 5
        start
}

checkstatus() {
        if [ ! "$(ps w w | grep [/]usr/bliss/bin/)" > /dev/null ]; then
                echo -n $"bliss is stopped"
                echo
        else
                echo "bliss (pid `ps w w | grep [/]usr/bliss/bin/ | cut -c0-5`) is running"
        fi
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  status)
        checkstatus
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|status}"
        exit 2
esac
exit $?


- Amend /usr/bliss/bin/bliss.sh to specify the full path to java, and make sure the {INSTALL_HOME} variable appears near the start of the command, else it is harder to find bliss in the results from the ps command, and you are even more reliant on the w arguments to the ps command.

Code: Select all

exec /usr/java/ejre1.6.0_25/bin/java -cp ${INSTALL_HOME}/conf:${INSTALL_HOME}/lib/com.elsten.bliss.runtime.jar ${VMARGS} -Xmx128M -splash:bliss-splash.png -XX:HeapDumpPath=/tmp -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Djava.util.logging.config.file=${INSTALL_HOME}/conf/logging.properties -Djava.library.path=${INSTALL_HOME}/lib -Dbliss.periodicHeapDumpThreshold=0.9 com.elsten.bliss.main.Bootstrap com.elsten.bliss.main.Main "$@"

- add a symbolic link to the rc.d directory to have the service run on startup

Code: Select all

ln -s /etc/init.d/bliss /usr/syno/etc/rc.d/S99bliss.sh


Now when you start your diskstation, after it has started everything else, it will call the following which will start bliss:

Code: Select all

/usr/syno/etc/rc.d/S99bliss.sh start


Hopefully this will save some of you some time!

Nigel
TWismer
I'm New!
I'm New!
Posts: 1
Joined: Fri Aug 24, 2012 6:02 am

Re: HOWTO: Bliss for Artwork Management

Postby TWismer » Sat Aug 25, 2012 5:04 am

Fantastic write up!
Thanks!
patters
Experienced
Experienced
Posts: 125
Joined: Mon Feb 07, 2011 3:41 am

Re: HOWTO: Bliss for Artwork Management

Postby patters » Mon Sep 17, 2012 7:38 pm

You'd still be missing the filesystem watching functionality, and the audio fingerprinting too - both of which rely on native code. The Intel Synos won't run the binaries included with Bliss, and ARM isn't supported...

...but I just made a package which includes full native code support for ARM and Intel synos:
http://pcloadletter.co.uk/2012/09/17/bl ... -synology/

Enjoy!
For my packages (Java, Serviio, CrashPlan, CrashPlan PRO, CrashPlan PROe, Minecraft, Craftbukkit, OpenRemote, and Bliss), add my repo URL to Package Center: http://packages.pcloadletter.co.uk

Return to “Media Streaming Mods”

Who is online

Users browsing this forum: No registered users and 2 guests