Bliss album art manager package for Synology NAS

bliss-UI

 

Bliss is a Java application written by Dan Gravell which can manage file names, tags and album art for your music collection and which can also enforce their consistency. It is designed to be left running once installed so that albums you add later will have these same policies applied to them automatically. It supports a wide range of music formats, and effortlessly deals with very large collections – apparently even ones containing quite obscure recordings. My own collection didn’t really put this to the test, since it doesn’t contain bootlegs, live sets or rarities plus I had also already obtained cover art for it (from back when CoverFlow first graced the screen of my iPhone 2G).

I could see from referrals to this blog that people were asking Dan for a Synology package which he didn’t have the time to investigate, and so I thought that it would make an interesting little project, especially since a NAS is the ideal device to run Bliss on. Although there was already a Howto post on the Synology forums, that guide only really covered getting the basic functionality of Bliss up and running – it was missing the best bits: the filesystem watching and audio fingerprinting features. These depend on natively compiled binaries, which Bliss doesn’t include for ARM or PowerPC CPUs. Getting these working provided precisely the sort of challenge I like. Not only were they difficult to compile, but getting them integrated into the various OSGi ‘bundles’ that make up Bliss was quite involved too.

Bliss uses an open source library called Chromaprint, itself part of the wider Acoustid project. The aim is to scan an audio file, to produce a fingerprint of the sound, and then to compare this against an open online database such as MusicBrainz.org to identify music regardless of compression codec used. Its author Lukáš Lalinský explains how it works.

 

Synology Package Installation

  • In Synology DSM’s Package Center, click Settings and add my package repository:
    Add Package Repository
  • The repository will push its certificate automatically to the NAS, which is used to validate package integrity. Set the Trust Level to Synology Inc. and trusted publishers:
    Trust Level
  • Since Bliss is a Java application, you will need to install one of my Java SE Embedded packages first (Java 7 or 8) if you have not already done so. Read the instructions on that page carefully too.
  • Now browse the Community section in Package Center to install Bliss. The repository only displays packages which are compatible with your specific model of NAS. If you don’t see Bliss in the list, then either your NAS model or your DSM version are not supported at this time. DSM 5.0 is the minimum supported version for this package.
 

Package scripts

For information, here are the package scripts so you can see what it’s going to do. You can get more information about how packages work by reading the Synology Package wiki.

installer.sh

#!/bin/sh

#--------BLISS installer script
#--------package maintained at pcloadletter.co.uk


DOWNLOAD_URL="`wget -qO- http://www.blisshq.com/app/latest-linux-version`"
DOWNLOAD_FILE="`echo ${DOWNLOAD_URL} | sed -r "s%^.*/(.*)%\1%"`"
SYNO_CPU_ARCH="`uname -m`"
[ "${SYNOPKG_DSM_ARCH}" == "comcerto2k" ] && SYNO_CPU_ARCH="comcerto2k"
[ "${SYNOPKG_DSM_ARCH}" == "alpine" ] && SYNO_CPU_ARCH="comcerto2k"
NATIVE_BINS_URL="http://packages.pcloadletter.co.uk/downloads/bliss-native-${SYNO_CPU_ARCH}.tar.xz"   
NATIVE_BINS_FILE="`echo ${NATIVE_BINS_URL} | sed -r "s%^.*/(.*)%\1%"`"
#'ua' prefix means wget user-agent will be customized
INSTALL_FILES="ua${DOWNLOAD_URL} ${NATIVE_BINS_URL}"
[ "${SYNO_CPU_ARCH}" == "i686" ] && INSTALL_FILES="ua${DOWNLOAD_URL}"
[ "${SYNO_CPU_ARCH}" == "x86_64" ] && INSTALL_FILES="ua${DOWNLOAD_URL}"
PID_FILE="${SYNOPKG_PKGDEST}/bliss.pid"
TEMP_FOLDER="`find / -maxdepth 2 -path /volume?/@tmp | head -n 1`"
APP_TEMP="${TEMP_FOLDER}/${SYNOPKG_PKGNAME}"
source /etc/profile


preinst ()
{
  if [ -z ${JAVA_HOME} ]; then
    echo "Java is not installed or not properly configured. JAVA_HOME is not defined. "
    echo "Download and install the Java Synology package from http://wp.me/pVshC-z5"
    exit 1
  fi

  if [ ! -f ${JAVA_HOME}/bin/java ]; then
    echo "Java is not installed or not properly configured. The Java binary could not be located. "
    echo "Download and install the Java Synology package from http://wp.me/pVshC-z5"
    exit 1
  fi

  cd ${TEMP_FOLDER}
  for WGET_URL in ${INSTALL_FILES}
  do
    WGET_FILENAME="`echo ${WGET_URL} | sed -r "s%^.*/(.*)%\1%"`"
    [ -f ${TEMP_FOLDER}/${WGET_FILENAME} ] && rm ${TEMP_FOLDER}/${WGET_FILENAME}
    #this will allow blisshq.com to track the number of downloads from Synology users
    WGET_URL=`echo ${WGET_URL} | sed -e "s/^ua/--user-agent=Synology --referer=http:\/\/pcloadletter.co.uk\/2012\/09\/17\/bliss-package-for-synology /"`
    wget ${WGET_URL}
    if [[ $? != 0 ]]; then
      if [ -d ${PUBLIC_FOLDER} ] && [ -f ${PUBLIC_FOLDER}/${WGET_FILENAME} ]; then
        cp ${PUBLIC_FOLDER}/${WGET_FILENAME} ${TEMP_FOLDER}
      else     
        echo "There was a problem downloading ${WGET_FILENAME} from the official download link, "
        echo "which was \"${WGET_URL}\" "
        echo "Alternatively, you may download this file manually and place it in the 'public' shared folder. "
        exit 1
      fi
    fi
  done
 
  exit 0
}


postinst ()
{
  #run the installer
  cd ${TEMP_FOLDER}
  echo "INSTALL_PATH=${SYNOPKG_PKGDEST}" > ${TEMP_FOLDER}/bliss-synology.properties
  java -jar ${TEMP_FOLDER}/${DOWNLOAD_FILE} -options ${TEMP_FOLDER}/bliss-synology.properties > /dev/null && rm ${TEMP_FOLDER}/${DOWNLOAD_FILE}
  rm ${TEMP_FOLDER}/bliss-synology.properties
  sed -i "s%^#!/bin/bash%#!/bin/sh%" ${SYNOPKG_PKGDEST}/bin/bliss.sh
  
  #stow jar files containing Synology versions of native code
  #libjnotify, and fpcalc from the Chromaprint audio fingerprinting library
  if [ -f ${TEMP_FOLDER}/${NATIVE_BINS_FILE} ]; then
    mkdir ${SYNOPKG_PKGDEST}/syno-native
    cd ${SYNOPKG_PKGDEST}/syno-native
    tar xJf ${TEMP_FOLDER}/${NATIVE_BINS_FILE}
  fi
  #record the CPU architecture
  echo "${SYNO_CPU_ARCH}" > syno_cpu_arch.txt

  #make changes to Bliss launcher script so that pid file is created for Java process
  sed -r -i "s%^(exec .*)$%\1 > ${SYNOPKG_PKGDEST}/bliss.out 2>\&1 \&%" ${SYNOPKG_PKGDEST}/bin/bliss.sh
  echo "echo \$! > ${PID_FILE}" >> ${SYNOPKG_PKGDEST}/bin/bliss.sh

  #set some additional system properties (temp folder, prefs sync interval)
  EXTRA_OPTS="-Djava.io.tmpdir=${TEMP_FOLDER} -Djava.util.prefs.syncInterval=86400 -Djava.net.preferIPv4Stack=true"
  sed -r -i "s%-splash:bliss-splash.png%${EXTRA_OPTS}%" ${SYNOPKG_PKGDEST}/bin/bliss.sh
  sed -r -i "s%-XX:HeapDumpPath=/tmp%-XX:HeapDumpPath=${TEMP_FOLDER}%" ${SYNOPKG_PKGDEST}/bin/bliss.sh

  #create log file to allow package start errors to be captured
  [ -e ${SYNOPKG_PKGDEST}/bliss.out ] || touch ${SYNOPKG_PKGDEST}/bliss.out

  #add firewall config
  /usr/syno/bin/servicetool --install-configure-file --package /var/packages/${SYNOPKG_PKGNAME}/scripts/${SYNOPKG_PKGNAME}.sc > /dev/null

  exit 0
}


preuninst ()
{
  exit 0
}


postuninst ()
{
  #clean up temp
  [ -d ${TEMP_FOLDER}/Bliss ] && rm -rf ${TEMP_FOLDER}/Bliss

  #remove firewall config
  if [ "${SYNOPKG_PKG_STATUS}" == "UNINSTALL" ]; then
    /usr/syno/bin/servicetool --remove-configure-file --package ${SYNOPKG_PKGNAME}.sc > /dev/null
  fi

  #remove legacy daemon user and homedir
  DAEMON_USER="`echo ${SYNOPKG_PKGNAME} | awk {'print tolower($_)'}`"
  synouser --del ${DAEMON_USER}
  [ -e /var/services/homes/${DAEMON_USER} ] && rm -r /var/services/homes/${DAEMON_USER}

  exit 0
}


preupgrade ()
{
  #if identity from legacy package version exists migrate it
  DAEMON_USER="`echo ${SYNOPKG_PKGNAME} | awk {'print tolower($_)'}`"
  DAEMON_HOME="/var/services/homes/${DAEMON_USER}"
  if [ -d ${DAEMON_HOME}/.bliss ]; then
    mv ${DAEMON_HOME}/.bliss/ /root/
    chown -R root:root /root/.bliss/
  fi
  if [ -d ${DAEMON_HOME}/.java ]; then
    mv ${DAEMON_HOME}/.java/ /root/
    chown -R root:root /root/.java/
  fi
  
  exit 0
}


postupgrade ()
{
  exit 0
}
 

start-stop-status.sh

#!/bin/sh

#--------BLISS start-stop-status script
#--------package maintained at pcloadletter.co.uk


PKG_FOLDER="`dirname $0 | cut -f1-4 -d'/'`"
ENGINE_SCRIPT="${PKG_FOLDER}/target/bin/bliss.sh"
DNAME="`dirname $0 | cut -f4 -d'/'`"
PID_FILE="${PKG_FOLDER}/target/bliss.pid"
DLOG="${PKG_FOLDER}/target/bliss.out"
SYNO_CPU_ARCH="`cat ${PKG_FOLDER}/target/syno-native/syno_cpu_arch.txt`"
source /etc/profile
source /root/.profile


start_daemon ()
{
  #update the package version number in case of an in-app update
  #find must write out to a file because vars cannot be defined in subshells
  #http://mywiki.wooledge.org/BashFAQ/024
  find ${PKG_FOLDER}/target/felix-cache -name "*.info" > /tmp/bliss-v-check.txt 2>&1
  while IFS="" read -r FILE_TO_PARSE; do
    if [ -e ${FILE_TO_PARSE} ]; then
      if grep "com.elsten.bliss.bundle" ${FILE_TO_PARSE} > /dev/null; then
        BLISS_BUNDLE_DIR="`dirname ${FILE_TO_PARSE}`"
      fi
    fi
  done < /tmp/bliss-v-check.txt
  #read current version
  BLISS_VERSION=`grep "version" ${PKG_FOLDER}/INFO | sed -r "s/^.*([0-9]{8}).*$/\1/"`
  if [ -d ${BLISS_BUNDLE_DIR} ]; then
    find ${BLISS_BUNDLE_DIR} -name *.jar > /tmp/bliss-v-check.txt
    while IFS="" read -r FILE_TO_PARSE; do
      if [ -e ${FILE_TO_PARSE} ]; then
        DETECTED_VERSION=`unzip -p ${FILE_TO_PARSE} META-INF/MANIFEST.MF | grep Bundle-Version | cut -f4 -d'.' |  cut -c1-8`
      fi
      if [ ${DETECTED_VERSION} -gt ${BLISS_VERSION} ]; then
        BLISS_VERSION=${DETECTED_VERSION}
      fi
    done < /tmp/bliss-v-check.txt
  fi
  rm /tmp/bliss-v-check.txt
  sed -r -i "s/^version=\"[0-9]{8}/version=\"${BLISS_VERSION}/" /var/packages/Bliss/INFO
  
  #update the CPU-specific repository customizations (in case of an in-app update)

  #catch both armv5te and armv7l
  if [ "${SYNO_CPU_ARCH}" != "${SYNO_CPU_ARCH/arm/}" ]; then
    sed -i "s/jnotify\.linux\.x86/jnotify\.linux\.ARM_le/g" ${PKG_FOLDER}/target/bliss-bundle/repository.xml
    sed -i "s/policy\.tag\.auto\.linux\.x86/policy\.tag\.auto\.linux\.ARM_le/g" ${PKG_FOLDER}/target/bliss-bundle/repository.xml
  fi
  if [ "${SYNO_CPU_ARCH}" == "ppc" ]; then
    sed -i "s/jnotify\.linux\.x86/jnotify\.linux\.PowerPC/g" ${PKG_FOLDER}/target/bliss-bundle/repository.xml
    sed -i "s/policy\.tag\.auto\.linux\.x86/policy\.tag\.auto\.linux\.PowerPC/g" ${PKG_FOLDER}/target/bliss-bundle/repository.xml
  fi
 
  #overwrite native lib bundles with syno versions (in case of an in-app update)
  if [ -e ${PKG_FOLDER}/target/syno-native/ ]; then
    cp ${PKG_FOLDER}/target/syno-native/* ${PKG_FOLDER}/target/bliss-bundle
  fi

  cd ${PKG_FOLDER}
  ${ENGINE_SCRIPT} > /dev/null 2>> ${DLOG}
  if [ -z ${SYNOPKG_PKGDEST} ]; then
    #script was manually invoked, need this to show status change in Package Center
    [ -e ${PKG_FOLDER}/enabled ] || touch ${PKG_FOLDER}/enabled
  fi

  #set up symlink for the DSM GUI
  if [ -d /usr/syno/synoman/webman/3rdparty ]; then
    ln -s ${PKG_FOLDER}/target/DSM/${DNAME} /usr/syno/synoman/webman/3rdparty/${DNAME}
  fi
}
    
stop_daemon ()
{
  echo "Stopping ${DNAME}" >> ${DLOG}
  kill `cat ${PID_FILE}`
  wait_for_status 1 20 || kill -9 `cat ${PID_FILE}`
  rm -f ${PID_FILE}
  if [ -z ${SYNOPKG_PKGDEST} ]; then
    #script was manually invoked, need this to show status change in Package Center
    [ -e ${PKG_FOLDER}/enabled ] && rm ${PKG_FOLDER}/enabled
  fi
  #remove DSM icon symlink
  if [ -e /usr/syno/synoman/webman/3rdparty/${DNAME} ]; then
    rm /usr/syno/synoman/webman/3rdparty/${DNAME}
  fi
}

daemon_status ()
{
  if [ -f ${PID_FILE} ] && kill -0 `cat ${PID_FILE}` > /dev/null 2>&1; then
    return
  fi
  rm -f ${PID_FILE}
  return 1
}

wait_for_status ()
{
  counter=$2
  while [ ${counter} -gt 0 ]; do
    daemon_status
    [ $? -eq $1 ] && return
    let counter=counter-1
    sleep 1
  done
  return 1
}


case $1 in
  start)
    if daemon_status; then
      echo ${DNAME} is already running with PID `cat ${PID_FILE}`
      exit 0
    else
      echo Starting ${DNAME} ...
      start_daemon
      exit $?
    fi
  ;;

  stop)
    if daemon_status; then
      echo Stopping ${DNAME} ...
      stop_daemon
      exit $?
    else
      echo ${DNAME} is not running
      exit 0
    fi
  ;;

  restart)
    stop_daemon
    start_daemon
    exit $?
  ;;

  status)
    if daemon_status; then
      echo ${DNAME} is running with PID `cat ${PID_FILE}`
      exit 0
    else
      echo ${DNAME} is not running
      exit 1
    fi
  ;;

  log)
    echo "${DLOG}"
    exit 0
  ;;

  *)
    echo "Usage: $0 {start|stop|status|restart}" >&2
    exit 1
  ;;

esac
 

Changelog:

  • 20150522-0010 Substantial re-write (hence the long delay):
    Updated to Bliss version 20150522
    DSM 5.0 newer is now required (fpcalc is compiled to depend on FFmpeg 2.0.2)
    Now that Intel systems running DSM 5.0+ use a newer glibc, replacement Intel binaries are no longer needed
    Added support for Mindspeed Comcerto 2000 CPU in DS414j
    Added support for Intel Atom C2538 (avoton) CPU in various models
    Added support for ppc853x CPU in older PowerPC models
    Added support for Marvell Armada 375 CPU in DS215j
    Added support for Intel Evansport CPU in DS214Play and DS415Play
    Switched to using root account – no more adding account permissions, package upgrades will no longer break this
    DSM Firewall application definition added
    Tested with DSM Task Scheduler to allow package to start/stop at certain times of day, saving RAM when not needed
    Daemon init script now uses a proper PID file instead of the unreliable method of using grep on the output of ps
    Daemon init script can be run from the command line
    Switched to .tar.xz compression for native binaries to reduce web hosting storage footprint
    Improved accuracy of temp folder and plugins folder detection
    Package is now signed with repository private key
    User Agent customization while downloading Bliss package from blisshq.com to allow download stats gathering
  • 20130213-0009 Updated to Bliss 20130213, and will correctly report version in Package Center after an in-app update
  • 20130131-0008 Updated to Bliss 20130131
  • 20121112-0007 Fixes for DSM 4.2
  • 20121112-006 Updated to Bliss 20121112
  • 20121019-005 Updated to Bliss 20121019
  • 20121002-004 Updated to Bliss 20121002
  • 20120830-003 Added support for Freescale QorIQ PowerPC CPUs used in some Synology x13 series products, PowerPC processors in previous Synology generations with older glibc versions are not supported
  • 20120830-002 Hopefully fixed Java prefs polling issue that prevented NAS hibernation
  • 20120830-001 initial public release

 

Build Notes

Chromaprint uses some complex maths functions that FFmpeg can provide (specifically Fourier Transform), and FFmpeg’s shared libraries are already included with Synology DSM. Building Chromaprint linked to those existing libraries results in a minuscule 84KB build of fpcalc, rather than the statically compiled ones for various OS and CPU architectures included with Bliss, which weigh in at several megabytes each. I think I’m finally ‘getting’ what open source is all about, which is nice since that was my objective in experimenting with my NAS. To prevent fpcalc building and linking to its dynamic library libchromaprint.so and to get it to detect FFmpeg properly I had to carefully inspect the Makefiles to find the correct build syntax:
FFMPEG_DIR=${TOOLCHAIN} cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=NO .
FFMPEG_DIR is the base folder from which CMake will look for lib/libavcodec.so and include/libavcodec/avfft.h.

For watching the filesystem Bliss uses JNotify to hook into the Linux kernel’s inotify subsystem. Getting this compiled was tricky. It seems no one has reported successfully compiling it for an ARM CPU, and JNotify’s author Omry Yadan wasn’t aware of anyone doing this either. The problem is that compilation halts with these errors:

In file included from ../net_contentobjects_jnotify_linux_JNotify_linux.c:43:
../inotify-syscalls.h:35:1: error: "__NR_inotify_init" redefined
In file included from /opt/include/sys/syscall.h:25,
                 from ../inotify-syscalls.h:4,
                 from ../net_contentobjects_jnotify_linux_JNotify_linux.c:43:
/opt/include/asm/unistd.h:344:1: error: this is the location of the previous definition
In file included from ../net_contentobjects_jnotify_linux_JNotify_linux.c:43:
../inotify-syscalls.h:36:1: error: "__NR_inotify_add_watch" redefined
In file included from /opt/include/sys/syscall.h:25,
                 from ../inotify-syscalls.h:4,
                 from ../net_contentobjects_jnotify_linux_JNotify_linux.c:43:
/opt/include/asm/unistd.h:345:1: error: this is the location of the previous definition
In file included from ../net_contentobjects_jnotify_linux_JNotify_linux.c:43:
../inotify-syscalls.h:37:1: error: "__NR_inotify_rm_watch" redefined
In file included from /opt/include/sys/syscall.h:25,
                 from ../inotify-syscalls.h:4,
                 from ../net_contentobjects_jnotify_linux_JNotify_linux.c:43:
/opt/include/asm/unistd.h:346:1: error: this is the location of the previous definition

By searching in a very generic way for a solution I found this post on stackoverflow.com which helped me to patch the header inotify-syscalls.h to get around the problem. Since there was no JDK for ARM embedded systems at build time I included the headers from OpenJDK6 which I took from a Ubuntu VM.

Compiling for Intel also required a fix. I was getting the same error as featured in this post on the JNotify user forum on SourceForge.net:
expected specifier-qualifier-list before ‘pid_t’

Despite some people’s apparent success simply rearranging the order of the includes in net_contentobjects_jnotify_linux_JNotify_linux.c this didn’t help me. I’m not sure quite how I stumbled upon it, but I found the solution staring at me on this page:
The size_t, ssize_t, uid_t, gid_t, off_t and pid_t types are defined as described in sys/types.h

I inserted an additional include in for sys/types.h and it compiled ok. It’s worth pointing out that, although all Intel Synology units are x86-64 architecture, the Oracle JRE for Embedded is x86 (32 bit), so I used the i686 toolchain. Synology DSM’s FFmpeg shared libraries are also 32 bit so my build of fpcalc needed to comply with this. Bliss nonetheless expects the binary to be called fpcalc_linux64 since Bliss is detecting the underlying Linux CPU architecture.

Once I had got past the obstacle of compiling the native code, I needed to liaise back and forth with Dan to understand how Bliss was dealing with its libraries and how I could replace the built-in versions. Originally this was quite a kludge but Dan has since abstracted out the native binaries into their own OSGI bundle fragments which makes things a lot easier, and should allow Bliss to survive an in-app update. The Synology package provides the following architecture-specific jar files (with corresponding edits to their manifest). Thank you to Dan for all the quick answers!

  • net.contentobjects.jnotify.linux.ARM_le-0.94.0.jar
  • net.contentobjects.jnotify.linux.PowerPC-0.94.0.jar
  • com.elsten.bliss.policy.tag.auto.linux.ARM_le-1.0.0.jar – contains fpcalc.
  • com.elsten.bliss.policy.tag.auto.linux.PowerPC-1.0.0.jar – contains fpcalc.

Here are my fixes to JNotify to get the native library part compiled, since they may help someone else:

 

Patch for native compile of JNotify 0.94 on ARM Synology

diff -crB jnotify-vanilla/inotify-syscalls.h jnotify-arm/inotify-syscalls.h
*** jnotify-vanilla/inotify-syscalls.h	2005-11-30 15:07:56.000000000 +0000
--- jnotify-arm/inotify-syscalls.h	2012-09-14 02:43:44.032130098 +0100
***************
*** 32,40 ****
  # define __NR_inotify_add_watch	152
  # define __NR_inotify_rm_watch	156
  #elif defined (__arm__)
! # define __NR_inotify_init	316
! # define __NR_inotify_add_watch	317
! # define __NR_inotify_rm_watch	318
  #elif defined (__SH4__)
  # define __NR_inotify_init	290
  # define __NR_inotify_add_watch	291
--- 32,46 ----
  # define __NR_inotify_add_watch	152
  # define __NR_inotify_rm_watch	156
  #elif defined (__arm__)
! # ifndef __NR_inotify_init
! #  define __NR_inotify_init     316
! # endif
! # ifndef __NR_inotify_add_watch
! #  define __NR_inotify_add_watch 317
! # endif
! # ifndef __NR_inotify_rm_watch
! #  define __NR_inotify_rm_watch 318
! # endif
  #elif defined (__SH4__)
  # define __NR_inotify_init	290
  # define __NR_inotify_add_watch	291
diff -crB jnotify-vanilla/Release/subdir.mk jnotify-arm/Release/subdir.mk
*** jnotify-vanilla/Release/subdir.mk	2011-02-28 18:07:20.000000000 +0000
--- jnotify-arm/Release/subdir.mk	2012-09-14 02:29:00.000000000 +0100
***************
*** 17,23 ****
  %.o: ../%.c
  	@echo 'Building file: $<'
  	@echo 'Invoking: GCC C Compiler'
! 	gcc -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux -O3 -Wall -Werror -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
  	@echo 'Finished building: $<'
  	@echo ' '
  
--- 17,23 ----
  %.o: ../%.c
  	@echo 'Building file: $<'
  	@echo 'Invoking: GCC C Compiler'
! 	gcc -I/volume1/public/temp/jdk_include/ -I/volume1/public/temp/jdk_include/linux -O3 -Wall -Werror -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
  	@echo 'Finished building: $<'
  	@echo ' '
 

Patch for cross compile of JNotify 0.94 for other Synology CPU architectures, using Ubuntu Desktop 12

diff -crB jnotify-vanilla/net_contentobjects_jnotify_linux_JNotify_linux.c jnotify-i686/net_contentobjects_jnotify_linux_JNotify_linux.c
*** jnotify-vanilla/net_contentobjects_jnotify_linux_JNotify_linux.c	2011-02-28 18:07:20.000000000 +0000
--- jnotify-xcomp/net_contentobjects_jnotify_linux_JNotify_linux.c	2012-09-14 00:41:53.455010206 +0100
***************
*** 36,41 ****
--- 36,42 ----
  #include <sys/time.h>
  #include <sys/select.h>
  #include <sys/ioctl.h>
+ #include <sys/types.h>
  #include <errno.h>
  #include <stdio.h>
  #include <unistd.h>
diff -crB jnotify-vanilla/Release/makefile jnotify-i686/Release/makefile
*** jnotify-vanilla/Release/makefile	2011-02-28 18:07:20.000000000 +0000
--- jnotify-xcomp/Release/makefile	2012-09-14 00:37:56.475007855 +0100
***************
*** 28,34 ****
  libjnotify.so: $(OBJS) $(USER_OBJS)
  	@echo 'Building target: $@'
  	@echo 'Invoking: GCC C Linker'
! 	gcc -shared -o"libjnotify.so" $(OBJS) $(USER_OBJS) $(LIBS)
  	@echo 'Finished building target: $@'
  	@echo ' '
  
--- 28,34 ----
  libjnotify.so: $(OBJS) $(USER_OBJS)
  	@echo 'Building target: $@'
  	@echo 'Invoking: GCC C Linker'
! 	$(CC) -shared -o"libjnotify.so" $(OBJS) $(USER_OBJS) $(LIBS)
  	@echo 'Finished building target: $@'
  	@echo ' '
  
diff -crB jnotify-vanilla/Release/subdir.mk jnotify-i686/Release/subdir.mk
*** jnotify-vanilla/Release/subdir.mk	2011-02-28 18:07:20.000000000 +0000
--- jnotify-xcomp/Release/subdir.mk	2012-09-14 00:37:33.835007731 +0100
***************
*** 17,23 ****
  %.o: ../%.c
  	@echo 'Building file: $<'
  	@echo 'Invoking: GCC C Compiler'
! 	gcc -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux -O3 -Wall -Werror -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
  	@echo 'Finished building: $<'
  	@echo ' '
  
--- 17,23 ----
  %.o: ../%.c
  	@echo 'Building file: $<'
  	@echo 'Invoking: GCC C Compiler'
! 	$(CC) -I$(TOOLCHAIN)/include -O3 -Wall -Werror -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
  	@echo 'Finished building: $<'
  	@echo ' '
 
 

322 thoughts on “Bliss album art manager package for Synology NAS

  1. Harald

    Hi patters can u give me a hint with that bliss package on synology, since it runs as root
    i have the problem with the automatic renaming after that all files changed to owner root and the audio station package can no longer find the files :( when i change the owner manuallly with ssh it works again, may u have a solution for that ?? thanks ia. Harald

    Reply
  2. ziemowit

    Files that get moved through Bliss will not be detected by Sinology’s media indexing service. Is there a way to fix this, e.g. run /usr/syno/bin/synoindex -a /volume1/music/artist/album/filename.avi after bliss fixes a file path?

    Reply
    1. gravelld

      There’s no way of doing this in bliss unfortunately. Best I can suggest right now is hooking into inotify yourself but this can be difficult – there will be a lot of file changes!

      Reply
    2. Thesalan

      You can have instant indexation for changes from third apps with inotify and media-indexer. I use this hook since a while and it works great!

      Source (in french!) : http://blogmotion.fr/systeme/indexer-media-11535

      Quick translation :
      – Add new custom repository : http://synology.francis-besset.com
      – Install in order : inotify-tools and Media Indexer
      – Media Indexer ask which folders you want to watch : set your media directories (ex: /volume1/music/) separated by a colon (:)
      – It’s done!

      Reply
  3. Harald

    same problem here i think its because bliss is running as root, when i change ownership of the files to a user its indexed from syno again. Anyone knows a solution?

    Reply
  4. SW

    I tried a while ago to get this working on my 213j and failed… Looking through the comments I’m not even sure if anyone has managed to get it going.
    Any chance of a complete idiot’s step-by-step guide for getting it going on a 213j, including exactly which Java version, etc?
    (I’ve just updated to DSM 5.2-5644 Update 3)

    Reply
  5. ziemowit

    Has anyone figured out how to remove the leftover empty folders? Usually it doesn’t bother me much as I access the music through DS Audio, but when I want to copy something to an external drive it annoys me

    Reply
    1. gravelld

      Do you mean after renaming music files/folders? I have seen this with Synology because of extra hidden files the Synology sometimes places in the folders. Can you send a debug archive to see if there are more we need to cover? “Help” then “Download debug archive”.

      For now, you can normally use a third party empty folder remover from your desktop/laptop. Which OS are you on?

      Also please vote for http://ideas.blisshq.com/forums/21939-bliss/suggestions/3821233-removing-folders-after-files-move

      Reply
      1. ziemowit

        That’s what I mean. I am on OSX mainly, any recommendation which software to use?

        Will send debug archive later.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s