Serviio 1.6.1 package for Synology NAS

Serviio 1.6 in DSM Package Center

Running the Serviio DLNA server on a NAS is a very efficient solution. It allows all your media to be constantly available to all your devices, all without the need for a dedicated media PC. Most TV and Bluray players are already capable media renderers – so indexing the library, retrieving metadata, and streaming the content are where Serviio fits in. Device support is continually improved by a community of contributors, and this crowd-sourced aspect was what initially drew me to the project, leading me to create the Sony Bluray device profile back in 2010. Serviio can also connect to online sources of content such as catch-up TV portals and allow fuss free content playback without advertising, even on devices which lack native support. These online plugins are also community maintained.

This new version of the Synology package updates Serviio to version 1.6.1 (release notes). The most significant enhancement from version 1.6 onwards is the new web management console which removes the need to install the separate Serviio Console application on a computer. The web console uses a modern adaptive design which works well on mobile devices, and it is now integrated with DSM so you will see its icon in the application menu when the package is running:

Serviio-DSM-integration
Serviio 1.6 web console
The package supports hardware transcoding on the DS214play and DS415play with Intel Evansport media processor. This support required substantial personal effort and was made possible by the very kind donation of a new DS214play unit from Thomas Kupper (MrK/Boretom) a fellow package maintainer for ASUStor devices.

Once Synology publishes the sources for DSM 6.0 I hope to add hardware transcoding support for the DS716+, DS216+ and the DS216play, and to update the Evansport build of FFmpeg from 2.0.2 to 2.7.1 which the new VideoStation package is using. This is still not published at the current time (late May 2016).

 

Limitations

If you use a TV, Bluray or media player bought in the last few years it is likely to have very good format support. In this case even a low specification NAS will be adequate for streaming most video content. There are some limitations however, in particular with video transcoding.

Serviio’s MediaBrowser is a Pro version only feature, and is designed to allow direct playback of media on tablet devices without the need for dedicated apps. Please note that Apple iOS devices require video in H.264 and audio in stereo AAC format when streaming. With the exception of the Play models already mentioned, most Synology NAS models lack the CPU power to transcode video into H.264 in realtime. Even if the source video is already H.264, ARMv5 family CPUs (which lack an FPU) in the older models lack the power even to transcode AAC audio in realtime without libfdk_aac. Unfortunately I am unable to distribute an FFmpeg binary compiled against this library under the terms of its software license.

Ever since Serviio version 1.2 renderers that do not natively support subtitles via DLNA can have them burned into the video during transcoding, but as already explained a NAS usually lacks the CPU power to do this (more info on subs here). If you absolutely need hard subs for a particular film, you could start playback on your device then stop it and Serviio will continue transcoding. Then you will be able to try again in a few hours since it will play from the transcode cache folder.

I was able to compile FFmpeg for all seven supported architectures (ARMv5, ARMv7, ARM hard float with NEON, Intel i686, Intel x64, Intel Evansport media processor, and PowerPC e500v2) with the additional libraries Serviio requires while using the libs included within DSM as far as possible. I have published my compilation methods to make the process easier for others in future since parts of it were exceptionally difficult to figure out. Only the Intel CPU or higher end Annapurna Alpine ARM CPUs are likely to be of any practical use transcoding to H.264, since the other CPU types lack vector units (no AltiVec in QorIQ/PowerQUICC, and no NEON in Armada 370/XP). This build’s libx264 is compiled with NEON support for the DS414j and this should also work for DS215+, DS715, and DS1515 systems (untested). Somewhat curiously the spec sheet of the Armada 375 used in the DS215j states that it has NEON, but Synology built its DSM Linux using the regular Armada 370/XP toolchain so NEON cannot be used.

 

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
  • Serviio now requires Java 8 for OS-native filesystem watching, so you will need to install my Java SE Embedded package first 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 Serviio:
    Community-packages
    Community packages are not listed in the All category for some reason. The repository only displays packages which are compatible with your specific model of NAS. If you don’t see Serviio 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.
  • When Serviio is started for the first time, a plugins folder will be created in the public shared folder (usually /volume1/public/serviio/plugins/). Download any Serviio online content plugins that you require and place the .groovy files in that location.
  • If you need subtitle support for glyphs not present in the default DejaVu fonts, add additional fonts to the following folder inside your NAS’s public shared folder (usually /volume1/public/serviio/fonts/).
 

Notes

  • You should reserve an IP address for your NAS (most home broadband routers will let you do this in the DHCP options), or use a static IP address. This will prevent Serviio from appearing multiple times in the menus of your renderer devices as its IP changes.
  • In the console disable ‘Generate thumbnails for local videos’ in the Metadata tab. Failure to do this can make adding videos to your library very slow on older NAS systems. With this disabled Serviio will still fetch thumbnail images automatically from the online databases.
  • Don’t alter the transcoded files location on the Transcoding tab, it’s already set to a sensible location for Synology systems. This particular folder is deleted each time your NAS restarts, and Serviio cleans up its temp files automatically in any case.
  • When adding folders to the media library use the Browse button. This will show the root of the entire NAS Linux filesystem, so you will find your DSM shared folders inside /volume1.
  • If you’re upgrading from a previous Serviio version you should check for updates of your online content plugins.
  • MediaBrowser (Pro only feature) can be opened using the link in the side bar of the web console (http://IPofYourNAS:23424/mediabrowser). If you want to use the MediaBrowser from a remote location you would need to either port forward 23424 on your router, or use SSH tunnelling. You can also manage Serviio remotely by SSH tunnelling port 23423 which the console uses. Both of these service definitions are added to the DSM Firewall.
  • Advanced users who wish to edit device profiles or enable debug logging can find the Serviio files in /var/packages/Serviio/target. You will need to use an SSH session to access this folder – it cannot be navigated to using DSM’s File Station. You will need to restart the Serviio package for profile changes to take effect.
  • Some users may wish to restrict running Serviio to specific times of day in order to free up RAM for a scheduled backup window for instance. This can be achieved by creating tasks to start and stop Serviio using the Task Scheduler in DSM Control Panel:
    Schedule service start
  • The package uses an FFmpeg wrapper script to modify the usual transcoding behaviour of Serviio in some cases. The first is to use the integer maths libshine MP3 encoder which allows you to listen to FLAC music transcoded to MP3 in realtime on ARMv5 systems. The second is to use the Intel Evansport hardware decoding and encoding available in the DS214play and DS415play models. I have left the FFmpeg wrapper scripts in the package even when not in use (in the Serviio/bin folder), because they are still useful for people trying to test a particular workaround or encoder setting. The wrapper was a tricky script to get working due to variable expansion precedence issues and quote handling. If you need it, just change the ffmpeg.location system property in /var/packages/Serviio/target/bin/serviio.sh to point to your modified wrapper script.
  • If additional fonts are not working as expected, some troubleshooting is available. You can re-create the fontconfig cache by connecting to the NAS via an SSH session as root, and running:
    rm -rf ~/.fontconfig.cache
    FC_DEBUG=128 /var/packages/Serviio/target/bin/fc-cache --verbose
 

Hardware transcoding support on DS214play and DS415play

  • FFmpeg will use hardware decoding where possible.
  • Although multiple hardware assisted decodes can take place simultaneously, only a single hardware encode is available. The package intelligently avoids race conditions for this.
  • Any FFmpeg commandline to encode using libx264 will automatically be sent to the hardware encoder when available.
  • profiles.xml has been modified so that the preferred transcode format for most devices for non-natively supported videos is H.264.
  • In order to add hardware H.264 encoding to a device profile, specify h264 as the desired codec and the FFmpeg wrapper script will make the necessary substitution automatically.
  • When the hardware encoder is used, the low quality settings in Serviio’s default libx264 options to favour encoding speed are ignored. The hardware encoder performance is not altered by quality settings.
  • If a media stream is being both hardware decoded and hardware encoded, it will use pipelined mode. Based on responses from Synology support during development this means that both jobs occur on the media processor without exposing the intermediate bitstream to FFmpeg. Consequently it is not possible to burn subtitles in pipelined mode. As a result my FFmpeg wrapper script will run the decode part of the job in software in order to do this. The unfortunate result is that the encoder cannot quite achieve real time transcoding during subtitle compositing. For full 1080p HD material it achieves around 20fps, whereas most movies are 24fps. This means that in order to watch a film with hard subs you would need to start it off, pause or stop the renderer and return a bit later to view. An alternative would be to mux the content into an MKV container with the desired subtitles before adding it to the Serviio library, assuming that your device supports SRTs in MKV.
  • The hardware encoded H.264 streams are not 100% compliant with the specification and fail validation using the tool DGAVCDec. For most tested renderers this does not affect playback (Bravia, Sony Bluray, iOS). However FlowPlayer (the Flash player in MediaBrowser) does not play these files satisfactorily and drops many frames resulting in jerky playback. Since the Evansport CPU is capable of encoding regular Flash Video when the decode of the source file is hardware accelerated, MediaBrowser does not use hardware encoding for FlowPlayer. iOS and Android devices browsing content via MediaBrowser do benefit from hardware transcoding.
  • The hardware transcoding enabled FFmpeg 2.0.2 seems to fail to transcode DTS audio. FFmpeg 2.7.1 does not exhibit this bug, and DSM 6.0 appears to use this version. Once Synology publishes its forked source code I will update the Evansport FFmpeg to 2.7.1.
 

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 3rd Party Developer Guide.

installer.sh

#!/bin/sh

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


DOWNLOAD_PATH="http://download.serviio.org/releases"
DOWNLOAD_FILE="serviio-1.6.1-linux.tar.gz"
EXTRACTED_FOLDER="serviio-1.6.1"
DOWNLOAD_URL="${DOWNLOAD_PATH}/${DOWNLOAD_FILE}"
SYNO_CPU_ARCH="`uname -m`"
[ "${SYNO_CPU_ARCH}" == "x86_64" ] && [ ${SYNOPKG_DSM_VERSION_MAJOR} -gt 5 ] && SYNO_CPU_ARCH="x64"
[ "${SYNO_CPU_ARCH}" == "x86_64" ] && SYNO_CPU_ARCH="i686"
[ "${SYNOPKG_DSM_ARCH}" == "comcerto2k" ] && SYNO_CPU_ARCH="armhfneon"
[ "${SYNOPKG_DSM_ARCH}" == "armada38x" ] && SYNO_CPU_ARCH="armhfneon"
[ "${SYNOPKG_DSM_ARCH}" == "alpine" ] && SYNO_CPU_ARCH="armhfneon"
[ "${SYNOPKG_DSM_ARCH}" == "alpine4k" ] && SYNO_CPU_ARCH="armhfneon"
[ "${SYNOPKG_DSM_ARCH}" == "monaco" ] && SYNO_CPU_ARCH="armhfneon"
[ "${WIZARD_ENC_HW}" == "true" ] && SYNO_CPU_ARCH="i686evansport"
NATIVE_BINS_URL="http://packages.pcloadletter.co.uk/downloads/serviio1.5-native-${SYNO_CPU_ARCH}.tar.xz"   
NATIVE_BINS_FILE="`echo ${NATIVE_BINS_URL} | sed -r "s%^.*/(.*)%\1%"`"
FONTS_URL="http://sourceforge.net/projects/dejavu/files/dejavu/2.35/dejavu-fonts-ttf-2.35.tar.bz2"
FONTS_FILE="`echo ${FONTS_URL} | sed -r "s%^.*/(.*)%\1%"`"
#'ua' prefix means wget user-agent will be customized
INSTALL_FILES="ua${DOWNLOAD_URL} ${NATIVE_BINS_URL} ${FONTS_URL}"
PID_FILE="${SYNOPKG_PKGDEST}/serviio.pid"
DNAME="serviio"
COMMENT="# Synology Serviio Package"
TEMP_FOLDER="`find / -maxdepth 2 -path '/volume?/@tmp' | head -n 1`"
PUBLIC_FOLDER="`synoshare --get public | sed -r "/Path/!d;s/^.*\[(.*)\].*$/\1/"`"
PLUGINS_PATH="${PUBLIC_FOLDER}/serviio"
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

  JAVA_VER=`java -version 2>&1 | sed -r "/^.* version/!d;s/^.* version \"[0-9]\.([0-9]).*$/\1/"`
  if [ ${JAVA_VER} -lt 8 ]; then
    echo "This version of Serviio requires Java 8 or newer. Please update your Java package. "
    exit 1
  fi

  if [ -z ${PUBLIC_FOLDER} ]; then
    echo "A shared folder called 'public' could not be found - note this name is case-sensitive. "
    echo "Please create this using the Shared Folder DSM Control Panel and try again."
    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 serviio.org 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\/01\/25\/serviio-syno-package /"`
    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 ()
{
  #extract the downloaded Serviio archive
  cd ${TEMP_FOLDER}
  tar xzf ${TEMP_FOLDER}/${DOWNLOAD_FILE}
  rm ${TEMP_FOLDER}/${DOWNLOAD_FILE}
  cp -R ${TEMP_FOLDER}/${EXTRACTED_FOLDER}/* ${SYNOPKG_PKGDEST}
  if [ ! -z "${EXTRACTED_FOLDER}" ]; then
    rm -r ${TEMP_FOLDER}/${EXTRACTED_FOLDER}
  fi
  if [ ! -d "${PLUGINS_PATH}/plugins" ]; then
    mkdir -p ${PLUGINS_PATH}/plugins
  fi
  if [ ! -d "${PLUGINS_PATH}/fonts" ]; then
    mkdir -p ${PLUGINS_PATH}/fonts
  fi

  #extract CPU-specific additional binaries
  cd ${SYNOPKG_PKGDEST}/lib
  tar xJf ${TEMP_FOLDER}/${NATIVE_BINS_FILE} && rm ${TEMP_FOLDER}/${NATIVE_BINS_FILE}
  mv ${SYNOPKG_PKGDEST}/lib/ffmpeg ${SYNOPKG_PKGDEST}/bin
  mv ${SYNOPKG_PKGDEST}/lib/fc-cache ${SYNOPKG_PKGDEST}/bin
  ${SYNOPKG_PKGDEST}/bin/ffmpeg -version > /dev/null 2>&1 || (
    #Fix missing libgmp dependency edge case on Synology DS3612xs running DSM 5.0 (the first x64 system I think)
    NATIVE_BINS_URL=`echo ${NATIVE_BINS_URL} | sed -e "s/.tar.xz/-add.tar.xz/"`
    NATIVE_BINS_FILE="`echo ${NATIVE_BINS_URL} | sed -r "s%^.*/(.*)%\1%"`"
    wget ${NATIVE_BINS_URL}
    tar xJf ${NATIVE_BINS_FILE} && rm ${NATIVE_BINS_FILE}
  )

  #remove legacy package font versions
  [ -d ${PLUGINS_PATH}/fonts/dejavu-fonts-ttf-2.33/ ] && rm -rf ${PLUGINS_PATH}/fonts/dejavu-fonts-ttf-2.33/
  [ -d ${PLUGINS_PATH}/fonts/dejavu-fonts-ttf-2.34/ ] && rm -rf ${PLUGINS_PATH}/fonts/dejavu-fonts-ttf-2.34/

  #extract open source font package for subtitle support during transcoding
  cd ${PLUGINS_PATH}/fonts
  tar xvjf ${TEMP_FOLDER}/${FONTS_FILE} && rm ${TEMP_FOLDER}/${FONTS_FILE}
  sed -i "s|WINDOWSFONTDIR|${PLUGINS_PATH}/fonts|" ${SYNOPKG_PKGDEST}/config/fonts/fonts.conf
  sed -i "s|WINDOWSTEMPDIR_FONTCONFIG_CACHE|~/.fontconfig.cache|" ${SYNOPKG_PKGDEST}/config/fonts/fonts.conf

  #wrapper script can be useful for testing different encoder options
  if [ -e "${SYNOPKG_PKGDEST}/bin/ffmpeg-wrapper-${SYNO_CPU_ARCH}.sh" ]; then
    #we need to use the wrapper to make FFmpeg use libshine on ARM systems and to use hardware decode/encode on Intel Evansport systems
    FFMPEG_PATH="\$SERVIIO_HOME/bin/ffmpeg-wrapper-${SYNO_CPU_ARCH}.sh"
  else
    FFMPEG_PATH="\$SERVIIO_HOME/bin/ffmpeg"
  fi

  #modifications to device profiles (evansport hardware transcoding)
  if [ -e "${SYNOPKG_PKGDEST}/config/profiles-${SYNO_CPU_ARCH}.xml" ]; then
    mv "${SYNOPKG_PKGDEST}/config/profiles.xml" "${SYNOPKG_PKGDEST}/config/profiles-orig.xml"
    mv "${SYNOPKG_PKGDEST}/config/profiles-${SYNO_CPU_ARCH}.xml" "${SYNOPKG_PKGDEST}/config/profiles.xml"
  fi

  #modification to application profiles to natively play AAC audio in Media Browser, minimizing transcoding
  #removed owing to issues with 48000 sample rate not valid in flv
  #mv ${SYNOPKG_PKGDEST}/config/application-profiles.xml ${SYNOPKG_PKGDEST}/config/application-profiles-orig.xml
  #mv ${SYNOPKG_PKGDEST}/config/application-profiles-syno.xml ${SYNOPKG_PKGDEST}/config/application-profiles.xml

  #modifications to application profiles (evansport hardware transcoding)
  #removed owing to frame drops in FlowPlayer because encoder does not produce 100% valid streams, evansport has sufficient power for flv encoding
  #if [ -e "${SYNOPKG_PKGDEST}/config/application-profiles-${SYNO_CPU_ARCH}.xml" ]; then
  #  mv "${SYNOPKG_PKGDEST}/config/application-profiles-${SYNO_CPU_ARCH}.xml" "${SYNOPKG_PKGDEST}/config/application-profiles.xml"
  #fi

  #make changes to Serviio launcher script so that pid file is created for Java process
  sed -r -i "s%Execute the JVM in the foreground%Execute the JVM in the background%" ${SYNOPKG_PKGDEST}/bin/serviio.sh
  sed -r -i "s%^(exec \"$JAVA.*)$%\1 \&%" ${SYNOPKG_PKGDEST}/bin/serviio.sh
  echo "echo \$! > ${PID_FILE}" >> ${SYNOPKG_PKGDEST}/bin/serviio.sh

  #set some additional Serviio system properties (temp folder, FFmpeg path, plugins folder)
  #http://www.serviio.org/index.php?option=com_content&view=article&id=43
  EXTRA_OPTS="-Dserviio\.defaultTranscodeFolder=${TEMP_FOLDER} -Dffmpeg\.location=${FFMPEG_PATH} -Dplugins\.location=${PLUGINS_PATH}"
  #fix Java prefs checking which was preventing NAS hibernation http://forum.serviio.org/viewtopic.php?f=5&t=6878
  EXTRA_OPTS="${EXTRA_OPTS} -Djava.util.prefs.syncInterval=86400"
  if [ "${SYNO_CPU_ARCH}" == "armv5tel" ]; then
    #use integer math (not floating point) Dolby AC-3 encoder for better performance on ARM CPUs
    #http://ffmpeg.org/ffmpeg.html#ac3-and-ac3_005ffixed
    EXTRA_OPTS="${EXTRA_OPTS} -Dserviio\.fixedPointEncoders"
  fi
  sed -r -i "s% -Dffmpeg\.location=ffmpeg%%; s%^(JAVA_OPTS=.*)\"$%\1 ${EXTRA_OPTS}\"%" ${SYNOPKG_PKGDEST}/bin/serviio.sh

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

  #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 ()
{
  #remove fontconfig configuration
  sed -i "/${COMMENT}/d" /root/.profile

  #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
  [ -e /var/services/homes/serviio ] && synouser --del serviio
  [ -e /var/services/homes/serviio ] && rm -r /var/services/homes/serviio

  exit 0
}


preupgrade ()
{
  #if a media database exists we need to preserve it
  if [ -d ${SYNOPKG_PKGDEST}/library/db ]; then
    mkdir ${SYNOPKG_PKGDEST}/../${SYNOPKG_PKGNAME}_db_migration
    mv ${SYNOPKG_PKGDEST}/library/db ${SYNOPKG_PKGDEST}/../${SYNOPKG_PKGNAME}_db_migration
  fi

  exit 0
}


postupgrade ()
{
  #use the backed up media database from the previous version
  if [ -d ${SYNOPKG_PKGDEST}/../${SYNOPKG_PKGNAME}_db_migration/db ]; then
    mv ${SYNOPKG_PKGDEST}/../${SYNOPKG_PKGNAME}_db_migration/db ${SYNOPKG_PKGDEST}/library
    rmdir ${SYNOPKG_PKGDEST}/../${SYNOPKG_PKGNAME}_db_migration
  fi
  chown -R root:root ${SYNOPKG_PKGDEST}

  exit 0
}
 

start-stop-status.sh

#!/bin/sh

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

PKG_FOLDER="/var/packages/Serviio"
ENGINE_CFG="${PKG_FOLDER}/target/bin/serviio.sh"
ENGINE_SCRIPT="${PKG_FOLDER}/target/bin/serviio.sh"
PID_FILE="${PKG_FOLDER}/target/serviio.pid"
DNAME="Serviio"
DLOG="${PKG_FOLDER}/target/log/serviio.log"
COMMENT="# Synology Serviio Package"
TIMESTAMP="`date "+%F %X,000"`"
source /etc/profile
source /root/.profile


EnvCheck ()
#updates to DSM will reset these changes so check them each startup
{
  #/root/.profile should contain 2 lines added by this package tagged with trailing comments
  COUNT=`grep -c "$COMMENT$" /root/.profile`
  if [ $COUNT != 2 ]; then

    #remove any existing mods
    sed -i "/${COMMENT}/d" /root/.profile

    #add required environment variables
    echo "export FONTCONFIG_FILE=fonts.conf ${COMMENT}" >> /root/.profile
    echo "export FONTCONFIG_PATH=${PKG_FOLDER}/target/config/fonts ${COMMENT}" >> /root/.profile
  fi
}

start_daemon ()
{
  EnvCheck
  source /root/.profile

  #create/refresh fontconfig cache - prevents delay the first time that FFmpeg renders hard subs
  #FC_DEBUG=128 fc-cache --verbose
  ${PKG_FOLDER}/target/bin/fc-cache

  #refresh hostname in Serviio instance name - recently DSM has modified the hosts file and broken localhost name resolution
  sed -i -r "s%Serviio \((\{computerName\})\)%Serviio \(`hostname`\)%" $PKG_FOLDER/target/config/profiles.xml

  #set appropriate Java max heap size
  RAM=$((`free | grep Mem: | sed -e "s/^ *Mem: *\([0-9]*\).*$/\1/"`/1024))
  if [ $RAM -le 128 ]; then
    JAVA_MAX_HEAP=80
  elif [ $RAM -le 256 ]; then
    JAVA_MAX_HEAP=192
  elif [ $RAM -le 512 ]; then
    JAVA_MAX_HEAP=384
  #Serviio's default max heap is 512MB
  elif [ $RAM -gt 512 ]; then
    JAVA_MAX_HEAP=512
  fi
  sed -i -r "s/(^..JAVA.) -Xmx[0-9]+[mM] (.*$)/\1 -Xmx${JAVA_MAX_HEAP}m \2/" "${ENGINE_CFG}"
  echo "${TIMESTAMP} Starting ${DNAME}" >> ${DLOG}
  ${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
}

stop_daemon ()
{
  echo "${TIMESTAMP} 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
}

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
 

ffmpeg-wrapper-armv5tel.sh

#!/bin/sh

#FFmpeg wrapper script to use libshine fixed point maths MP3 encoder on ARM CPUs
#as originally posted here: http://forum.serviio.org/viewtopic.php?f=7&t=6458

PARAMS=""
FFMPEG_BIN="ffmpeg"
INPUT=0
for PARAM in "$@"; do
  if [ ${INPUT} = 1 ]; then
    #the FFmpeg input filename/URL needs quotes adding back on
    #because it may contain spaces, and the shell has removed them
    PARAMS="${PARAMS} \"${PARAM}\""    
    INPUT=0
  else
    PARAMS="${PARAMS} ${PARAM}"
  fi
  if [ "${PARAM}" == "-i" ]; then
    #this loop is the -i parameter, the next loop will be the input filename/URL
    INPUT=1
  fi
done

#make libshine encoder substitution, 320Kbps since it's no more expensive
if [ "${PARAMS}" != "${PARAMS/libmp3lame/}" ] || [ "${PARAMS}" != "${PARAMS/-f mp3/}" ]; then
  PARAMS="`echo ${PARAMS} | sed -r "s|libmp3lame|libshine|;s|-b:a [0-9]+k|-b:a 320k|"`"
fi

#make libfdk_aac encoder substitution, 128Kbps since we're usually transcoding to AAC stereo only
#if [ "${PARAMS}" != "${PARAMS/-c:a aac/}" ]; then
#  PARAMS="`echo ${PARAMS} | sed -r "s| aac -strict experimental | libfdk_aac |;s|-b:a [0-9]+k|-b:a 128k|"`"
#fi


#invoke FFmpeg
FOLDER="`dirname $0`"
echo "${FOLDER}/${FFMPEG_BIN} ${PARAMS}" > ${FOLDER}/../log/ffmpeg-wrapper.log
#need to use eval here otherwise the quotes aren't handled properly
#http://fvue.nl/wiki/Bash:_Why_use_eval_with_variable_expansion%3F
eval ${FOLDER}/${FFMPEG_BIN} ${PARAMS}

#return FFmpeg status
exit $?
 

ffmpeg-wrapper-i686evansport.sh

#!/bin/sh

#FFmpeg wrapper script to enable hardware decoding and encoding on Intel Evansport CPUs
#wrapper originally posted here: http://forum.serviio.org/viewtopic.php?f=7&t=6458

FOLDER="`dirname $0`"
PARAMS=""
COMMANDLINE=$@
FFMPEG_BIN="ffmpeg"
INPUT=0
for PARAM in "$@"; do
  if [ ${INPUT} = 1 ]; then
    #the FFmpeg input filename/URL needs quotes adding back on
    #because it may contain spaces, and the shell has removed them
    PARAMS="${PARAMS} \"${PARAM}\""    
    INPUT=0
  elif [ "${PARAM}" == "-i" ]; then
    INPUT=1
    #enable hardware decoding by default, but not when Serviio is either:
    # gathering media metadata,
    # remuxing video,
    # generating thumbnails,
    # or rendering subtitles into the video stream (pipeline mode not supported for subs),
    if [ $# -lt 3 ] || \
       [ "${COMMANDLINE}" != "${COMMANDLINE/ -c:v copy /}" ] || \
       [ "${COMMANDLINE}" != "${COMMANDLINE/ pipe:/}" ] || \
       [ "${COMMANDLINE}" != "${COMMANDLINE/ -vf subtitles=/}" ]; then
      PARAMS="${PARAMS} -i"
    # or gathering online stream metadata 
    elif [ $# -eq 4 ] && [ "${COMMANDLINE}" != "${COMMANDLINE/-analyzeduration /}" ]; then
      PARAMS="${PARAMS} -i"
    else
      PARAMS="${PARAMS} -prefer_smd -i"
    fi
  else
    PARAMS="${PARAMS} ${PARAM}"
  fi
done

#Is this FFmpeg commandline a candidate for the hardware encoder?
HWENC=0
if [ "${PARAMS}" != "${PARAMS/libx264/}" ]; then
  #check whether H.264 encoder is already busy with another Serviio/VideoStation session
  PID_HWENC=`cat /tmp/VideoStation/enabled 2> /dev/null | sed -r "s/.*\"PID\":([0-9]+),\"hardware_transcode.*$/\1/;s/\[//;s/\]//"`
  #is there an indicated PID?
  if [ -n "${PID_HWENC}" ]; then
    #there is an indicated PID - is it running? 
    if ! kill -0 ${PID_HWENC}; then
      #the indicated PID is not in fact running, HW encoder is therefore available
      rm /tmp/VideoStation/enabled
      #make hardware H.264 encoder substitution to replace libx264
      HWENC=1
    fi 
  else
    #there is no indicated PID, HW encoder is therefore available
    HWENC=1
  fi  
fi

if [ ${HWENC} = 1 ]; then
    #make hardware H.264 encoder substitution to replace libx264
    PARAMS=${PARAMS/ libx264 / h264_smd }

    #by default Serviio's libx264 transcoding is intended for speed over quality, with SMD we can opt for better quality
    PARAMS="`echo ${PARAMS} | sed -r "s/ -crf [0-9]+ / /; s/ -g [0-9]+ / /"`"
    PARAMS=${PARAMS/ -preset veryfast / }
    PARAMS=${PARAMS/ -profile:v baseline / -profile:v high }
    PARAMS=${PARAMS/ -level 3 / -level 4.1 }
fi

#invoke FFmpeg
#log commandline, except media probes
#[ $# -gt 2 ] && echo "${FOLDER}/${FFMPEG_BIN} ${PARAMS}" >> ${FOLDER}/../log/ffmpeg-wrapper.log

#need to use eval here otherwise the quotes aren't handled properly
#http://fvue.nl/wiki/Bash:_Why_use_eval_with_variable_expansion%3F
eval ${FOLDER}/${FFMPEG_BIN} ${PARAMS}

#return FFmpeg status
exit $?
 

Changelog:

  • 0030 21/May/16 – Updated to Serviio 1.6.1
  • 0029 28/Jan/16 – Updated to Serviio 1.6, integrated the new built-in web console into DSM, fixed stupid wrapper bug which had broken evansport hardware transcoding on DS214play and DS415play, fixed online content when using evansport build. You must have already upgraded to version 1.5.2-0028 or else Package Center will report a TCP port conflict and will fail to upgrade the package. If you missed the 0028 update, install it manually in Package Center using the .spk file: (DS214play/DS415play), (all other models).
  • 0028 08/Jan/16 – Serviio instance uses hostname rather than localhost, more accurate detection of DSM 6.0 on Intel CPUs which need x64 FFmpeg build, added DS216play support, fixed missing libgmp on DS3612xs running DSM 5.0, change to allow easy package upgrade to forthcoming Serviio 1.6
  • 0027 12/Nov/15 – Substantial package re-write hence the long delay since the last release
    Completely refreshed documentation, please re-read
    Updated to Serviio version 1.5.2
    Java 8 is now required – this is a Serviio imposed requirement
    DSM 5.0 or newer is now required
    Updated to FFmpeg 2.7.1 and many libs e.g. x264 at latest versions from late July 2015
    Added optional hardware transcoding support for Intel Evansport systems (DS214play, DS415play) built using Synology-modified sources for FFmpeg 2.0.2
    FFmpeg is now compiled with https support via GNUTLS library (useful for online streams via plugins)
    Switched to using root account which was necessary for Evansport hardware encoding – no more adding account permissions, package upgrades will no longer break this
    Added support for Mindspeed Comcerto 2000 CPU (comcerto2k – ARM Cortex-A9 with NEON) in DS414j
    Added support for Intel Atom C2538 (avoton) CPU in DS415+
    Fontconfig fc-cache utility now included to allow troubleshooting issues with adding new fonts for additional subtitle language support
    Fontconfig variables checked on each package startup so DSM upgrades no longer break hard subs support
    Updated DejaVu subtitle font to version 2.35
    DSM Firewall application definitions 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
    Improved accuracy of temp folder and plugins folder detection
    Switched to .tar.xz compression for native binaries to reduce web hosting storage footprint
    Package is now signed with repository private key
    User Agent customization while downloading Serviio binaries from serviio.org to allow download stats gathering
  • 0026 25/Mar/14 – Updated to Serviio 1.4.1.2
  • 0025 18/Mar/14 – Updated to Serviio 1.4.1.1
  • 0024 30/Jan/14 – Updated to Serviio 1.4
  • 0023 07/Nov/13 – Updated to FFmpeg 2.1 stable release
  • 0022 30/Oct/13 – Added support for Intel Atom Evansport and Armada XP CPUs in new DSx14 products
  • 0021 18/Oct/13 – Fixed zlib linking issue in QorIQ and Intel builds of FFmpeg
  • 0020 05/Sep/13 – Updated to Serviio 1.3.1
  • 0019 25/May/13 – Added support for Armada370 SoC used in DS213j (ARMv7 CPU with FPU)
  • 0018 29/Mar/13 – Updated to Serviio 1.2.1, recompiled FFmpeg to use the libRTMP source code from serviio.org for consistency
  • 0017 01/Mar/13 – Updated to Serviio 1.2
  • 0016 23/Jan/13 – Fixes for DSM 4.2
  • 015 30/Dec/13 – Updated to Serviio 1.1, fixed garbled ac3 encoding issue on ARM CPUs by compiling FFmpeg natively, rather than cross compiling. Remember to update your computer’s Serviio Console to 1.1 before connecting to manage.
  • 014 28/Oct/12 – Added support for Freescale QorIQ PowerPC CPUs used in some Synology x13 series products, switched to shared library compile of FFmpeg with some minor changes, ARM build now uses libshine encoder which allows realtime audio transcoding to MP3, edited FlowPlayer config to play AAC audio natively to make Media Browser more usable with online feed items.
  • 013 Fixed a bug in the plugins folder creation, fixed deletion of home directories after user deletion (DSM 4.1)
  • 012 Reduced Java prefs checking interval to once every 24 hours to allow the NAS to hibernate (was 30 seconds by default – remember to increase the time between library refreshes if you want hibernation)
  • 011 Updated Serviio to 1.0.1, slightly altered how the plugins folder path is determined
  • 010 Updated to Serviio 1.0, removed WebUI, FFmpeg wrapper no longer needed on ARM, plugins folder moved to /volume1/public/serviio/plugins to make adding/updating plugins easier
  • 009 Installation fails unless User Home service is enabled, unified the installer scripts, merged ARM and Intel packages into one which downloads the FFmpeg binary separately, used integer maths Dolby AC-3 encoder on ARM systems (no floating point)
  • 008 Fixed DST timezone support, installer no longer assumes /volume1 is primary storage volume
  • 007 Updated Serviio to 0.6.2, kairoh’s WebUI to 0.6.2c, changed package to download Serviio from the official website during installation, temp path is set by default to /volume1/@tmp on first run, and finally some CSS improvements
  • 006 Updated to Serviio 0.6.1, switched to kairoh’s Java WebUI, added timezone support, removed DSM icon when Serviio is not running, adjusted Java max heap size for systems with low RAM, specified FFmpeg path directly rather than creating a symlink in /bin so as not to interfere with other packages which may use different versions of FFmpeg
  • 005 Added Web Station dependency, EULA dialog, and links for Web UI and user forum in More Info
  • 004 Test for package repo to allow update notification
  • 0.6.0.1 v3 Hopefully fixed an issue with the Serviio DSM icon in DSM 3.2 on NAS units without Optware installed
  • 0.6.0.1 v2 Inclusion of a modified version of the PHP Web UI
  • 0.6.0.1 v1 New minor Serviio release 0.6.0.1 with some updated international translations – will upgrade 0.6 preserving the media library
  • 0.6 v1 23/Sep/11 – First public release – Serviio 0.6
  • 0.6b4 v2 Fixed permissions on transcode temporary folder following upgrade, avoiding the need for a reboot
  • 0.6b4 v1 Updated to Serviio 0.6 beta 4, added upgrade scripts to allow media database migration (install future packages over the top of this one – database is preserved)
  • 0.6b3c v2 Fixed HOME env var for serviio user (to fix librtmp issues with BBC iPlayer) and removed the need to edit the passwd file to change the shell (safer)
  • 0.6b3c v1 Initial spk test release – Serviio 0.6 beta 3

 
 

1,320 thoughts on “Serviio 1.6.1 package for Synology NAS

  1. Nick

    Thanks for all your effort Patters. I keep getting informed that I need to update. Before I do can you please answer this:

    I’m running version 0027 and am about to update. Do I need to manually install version 0028 before 0029 or can I just click install package update from within DSM Package Manager? If I interpret comments above correctly, there was something installed/changed in 0028 that might not be present in 0029?

    Thanks.

    Reply
  2. don

    Hi Patters,
    Got already version 1.5.2-0028 installed, and get the tcp port conflict problem?!
    Any idea? Thank’s
    (Serviio on DS415+ – DSM 5.2-5644 update5 – java1.8.0_65-0035)

    Reply
  3. Philip Dijkstra

    Serviio works awesome but my Synology DS415+ stopped hibernating. Version 012 says up the library refresh time but i don’t see that option anywhere.

    Reply
    1. Andrey Semiuglov

      It’s working partially. Media in library played but new videos are not added. In the logs: Unknown video file type.

      Reply
      1. eljub

        I have almost the same behavior but with a different error message that says :
        “[MetadataExtractionCoordinator] Skipping processing metadata for an unsupported file /volume/…/”

      2. Syno H

        Same here! I’m glad I’m not the only one experiencing it.
        It took me a long time to find this forum comment, and I was looking for an error in my installation. Media in library plays, but new files are not added.
        I can also see a “Unknown video file type.” in serviio.log.

    2. Marc Léonard

      the new release of Java SE embedded 8.77 doesn’t start so Serviio neither…
      I have this error :
      /var/packages/java8/scripts/start-stop-status.sh: line 74 : java : command not found
      Can you help me please?

      Reply
    3. Thomas

      I’m struggling to get this to work. Running DSM6 and have followed Java installation and Serviio instructions to the letter. It fails to recognize any files in the selected media folder. So confused.

      Reply
      1. nbat42

        I have a DS216. I just noticed there was a JAVA update. I will update and Java and then let you know. Thanks for helping.

  4. sander zijl

    I cannot get this to work on my ds114. I have deleted java and serviio, restarted, reinstalled java, restarted, reinstalled serviio, restarted.

    The server is running, the web console can be opened, but when I add a folder to the library the log file shows a lot of errors.

    the sequence below is repeated continously, when serviio starts scanning the library.

    Exception in thread “Thread-224” java.lang.ArrayIndexOutOfBoundsException: 0
    at sun.nio.cs.UTF_8$Decoder.decode(UTF_8.java:441)
    at java.lang.StringCoding$StringDecoder.decode(StringCoding.java:153)
    at java.lang.StringCoding.decode(StringCoding.java:193)
    at java.lang.String.(String.java:426)
    at java.util.jar.Attributes.read(Attributes.java:418)
    at java.util.jar.Manifest.read(Manifest.java:199)
    at java.util.jar.Manifest.(Manifest.java:69)
    at java.util.jar.JarFile.getManifestFromReference(JarFile.java:199)
    at java.util.jar.JarFile.getManifest(JarFile.java:180)
    at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:944)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:450)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.apache.log4j.spi.LoggingEvent.(LoggingEvent.java:165)
    at org.apache.log4j.Category.forcedLog(Category.java:391)
    at org.apache.log4j.Category.log(Category.java:856)
    at org.slf4j.impl.Log4jLoggerAdapter.error(Log4jLoggerAdapter.java:575)
    at org.serviio.upnp.protocol.soap.ServiceInvoker.invokeOperation(ServiceInvoker.java:264)
    at org.serviio.upnp.protocol.soap.ServiceInvoker.invokeService(ServiceInvoker.java:93)
    at org.serviio.upnp.webserver.ServiceControlRequestHandler.handleRequest(ServiceControlRequestHandler.java:66)
    at org.serviio.upnp.webserver.AbstractRequestHandler.handle(AbstractRequestHandler.java:61)
    at org.apache.http.protocol.HttpService.doService(HttpService.java:423)
    at org.serviio.upnp.webserver.ServiioHttpService.doService(ServiioHttpService.java:78)
    at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:341)
    at org.serviio.upnp.webserver.WebServer$WorkerThread.run(WebServer.java:204)

    Reply
  5. sander van zijl

    This is the error in my log file. It is repeated several times.
    what can i do to get serviio to index my library?
    I am running it on a ds114 with dsm 6 and latest version of servio and java 8

    this is the error that i get in the log files:

    Exception in thread “Thread-224” java.lang.ArrayIndexOutOfBoundsException: 0
    at sun.nio.cs.UTF_8$Decoder.decode(UTF_8.java:441)
    at java.lang.StringCoding$StringDecoder.decode(StringCoding.java:153)
    at java.lang.StringCoding.decode(StringCoding.java:193)
    at java.lang.String.(String.java:426)
    at java.util.jar.Attributes.read(Attributes.java:418)
    at java.util.jar.Manifest.read(Manifest.java:199)
    at java.util.jar.Manifest.(Manifest.java:69)
    at java.util.jar.JarFile.getManifestFromReference(JarFile.java:199)
    at java.util.jar.JarFile.getManifest(JarFile.java:180)
    at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:944)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:450)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.apache.log4j.spi.LoggingEvent.(LoggingEvent.java:165)
    at org.apache.log4j.Category.forcedLog(Category.java:391)
    at org.apache.log4j.Category.log(Category.java:856)
    at org.slf4j.impl.Log4jLoggerAdapter.error(Log4jLoggerAdapter.java:575)
    at org.serviio.upnp.protocol.soap.ServiceInvoker.invokeOperation(ServiceInvoker.java:264)
    at org.serviio.upnp.protocol.soap.ServiceInvoker.invokeService(ServiceInvoker.java:93)
    at org.serviio.upnp.webserver.ServiceControlRequestHandler.handleRequest(ServiceControlRequestHandler.java:66)
    at org.serviio.upnp.webserver.AbstractRequestHandler.handle(AbstractRequestHandler.java:61)
    at org.apache.http.protocol.HttpService.doService(HttpService.java:423)
    at org.serviio.upnp.webserver.ServiioHttpService.doService(ServiioHttpService.java:78)
    at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:341)
    at org.serviio.upnp.webserver.WebServer$WorkerThread.run(WebServer.java:204)

    Reply
      1. sander zijl

        I reinstalled everything, but still the same or similar errors. I have posted a log file in the serviio forum.

  6. John D

    I stopped and restarted serviio, then did a forced refresh of the library and it found new files, so maybe a process is dying, or you need to reboot/restart after installing new java/DSM ?

    Reply
    1. nbat42

      I’m struggling to get this to work on my DS214. I have followed the instructions to install the java package and then serviio 1.6. When it does work it doesn’t recognize any media in the selected shared folder. Any thoughts on what I might try?

      Reply
  7. nico .las

    Same as John D.
    I Need to refresh library to find new files..
    Process Dying, and can’t play video, Need reboot for play…

    Reply
  8. MisterB

    Got the same Problem, too after DSM 6.0 latest release update. Didn’t find any new files also after forced scan. Will try to stop and start service later. Maybe it works…

    Reply
  9. rubenschollaert

    I have an issue on my DS216, some files are not picked up and require a hard refresh via the console. Is anyone else experiencing this kind of issue or any idea where to start looking?

    Reply
    1. patters Post author

      No more Serviio Console application on Serviio 1.6. Use a browser. Follow the Serviio application link in DSM to find the URL. Now you can manage it from a mobile device too.

      Reply
  10. Hammer

    Hi,
    Really old and out of date question here, I’m running 1.0.1 on Synology DS211j and it has been running really well for a few years. I recently upgraded my router and now Serviio stops/crashes every 15mins or so. Any suggestions?

    I’m reluctant to upgrade too far in fear of going past my outdated hardware.
    The last item in the log file before the crash is usually: WARN [OutputTextReader] Error reading output of an external command:Stream closed
    I updated the Java version hoping that would fix it, but unfortunately it didn’t (Java ejre-7u75-fcs-b13-linux-arm-sflt-headless-18_dec_2014).

    Any thoughts?

    Reply
  11. Ghost

    Hello,
    How can i fix the setting of the language in the console ? The start-language is always english in firefox. What can i do ?

    Reply
    1. patters Post author

      If it doesn’t remember the preference then it’s not going to be a Synology-specific issue. It would be best for you to post on the Serviio forum.

      Reply
  12. Neil

    Is the update to 1.6.1 seamless? i.e., does it require backing up the library or removing the 1.6 app or anything like that?

    Thanks!

    Reply
    1. patters Post author

      Yes, seamless. A couple of people reported problems with Package Center complaining about the Serviio TCP port already being in use, but it’s likely they had some issues in the transition from 1.5.2 to 1.6.

      Reply
      1. Juergen

        Update from 1.6.0 to 1.6.1 was complete seamless. Many thanks for keeping this masterpiece of software up to date!

      2. Neil

        Yes, my update proceeded without a single glitch as well.

        Thank you very much, patters, for this wonderful system!!

        Neil

  13. zxxuzxxu

    When I upgrade it failed saying something (I forgot)couldn’t download, then when I retry it says ‘port undefined configured for this package is either used by another service or reserved for system use’. I restarted the NAS (DS213) but no help. I’m stuck here. Please help.

    Reply
  14. zxxu

    What does ‘port undefined for this package is in use by another service’? I cannot upgrade to 1.6.1. Even restart doesn’t help.

    Reply
    1. patters Post author

      Hi please log in via SSH and post the result of running the following two commands:
      uname -a
      cat /proc/cpuinfo

      Thanks
      To log in as root, connect as admin using the same password you normally use for DSM. Then once connected, run “sudo -i” which will request the same password once again. Now you are root.

      Reply
  15. MisterB

    Hello!
    I got a strange problem after upgrading my DSM some time ago and now Serviio won’t start anymore.
    The following errors are in the log:
    Exception in thread “main” java.lang.UnsupportedClassVersionError: org/serviio/MediaServer : Unsupported major.minor version 52.0
    and then some more following…
    Anybody with the same problem or got a solution for this?
    have reinstalled serviio and java (latest version) several time…
    thx in advance and grettings,
    MB

    Reply
    1. patters Post author

      Hi, which NAS please? I think that some of the ARM CPUs which used to require a soft float ABI Java runtime, now use the hard float ABI with DSM 6.0. Seems to be ARMADA 375 and ARMADA XP systems, so I’ll need to update the Java package to take this into account.

      Reply
      1. Mr. B

        Hi! thanks for your answer. Sorry, my fault. It’s the Synology DS713+ running DSM 6.0.1-7393 Update 1 with Intel Atom D2700 and 1GB Ram.
        Hope it’ll help you but it’s no ARM-CPU…
        Greetings

  16. Thomas Haselböck

    Hello,

    i have updated Serviio on my DS214 to 1.6.1-0030

    Now the protocol says:

    2016-08-18 22:02:25,988 WARN [MediaFileIndexer] Cannot add file Fack ju Goethe.mkv because of an unexpected error. Message: Cannot find media item by file path: /volume1/Speicher/Filme/Fack ju Goethe.mkv org.serviio.db.dao.PersistenceException: Cannot find media item by file path: /volume1/Speicher/Filme/Fack ju Goethe.mkv at org.serviio.library.dao.MediaItemDAOImpl.getMediaItem(MediaItemDAOImpl.java:89) at org.serviio.library.dao.MediaItemDAOImpl.isMediaItemPresent(MediaItemDAOImpl.java:61) at org.serviio.library.local.service.MediaService.isMediaPresentInLibrary(MediaService.java:43) at org.serviio.library.local.indexing.MediaFileIndexer.addNewMediaFile(MediaFileIndexer.java:71) at org.serviio.library.local.indexing.DefaultLibraryMonitor.fileAdded(DefaultLibraryMonitor.java:49) at org.serviio.library.local.indexing.pipe.PipeManager$PipeProcessingConsumer.lambda$run$9(PipeManager.java:174) at java.util.Optional.ifPresent(Optional.java:159) at org.serviio.library.local.indexing.pipe.PipeManager$PipeProcessingConsumer.run(PipeManager.java:169) at java.lang.Thread.run(Thread.java:745) Caused by: java.sql.SQLSyntaxErrorException: Table/View ‘MEDIA_ITEM’ does not exist. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.

    Whats can i do? My actual DSM version is DSM 6.0.1-7393 Update 1

    Thanks Thomas

    Reply
  17. Illico

    Hi Patters,
    I just have a new DS116 NAS.
    Do you think your package will work fine ?
    Regards

    illico@SynoDS116:~$ uname -a
    Linux SynoDS116 3.10.77 #8451 SMP Wed Aug 17 05:12:58 CST 2016 armv7l GNU/Linux synology_armada38x_ds116
    illico@SynoDS116:~$ cat /proc/cpuinfo
    processor : 0
    model name : ARMv7 Processor rev 1 (v7l)
    BogoMIPS : 3719.16
    Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant : 0x4
    CPU part : 0xc09
    CPU revision : 1

    processor : 1
    model name : ARMv7 Processor rev 1 (v7l)
    BogoMIPS : 3726.54
    Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant : 0x4
    CPU part : 0xc09
    CPU revision : 1

    Hardware : Marvell Armada 380/381/382/383/384/385/388 (Device Tree)
    Revision : 0000
    Serial : 0000000000000000

    Reply
  18. Nicolai

    Hi Patters
    I’m having library problems, all of a sudden it won’t update, and force refresh doesn’t work. I tried removing the folders and adding them again, but for some unknown reason it won’t save my changes either. I’m completely at a loss, do you have any ideas?
    I’m running on a DS214+ DSM 6.0.2-8451 Update 1, latest java and serviio 1.6.1

    Reply
    1. Nicolai

      Found some weird java errors in the log…
      Exception error in Thread-222/280/281 ArrayIndexOutOfBoundsException: 0

      Reply
  19. John D

    I had some cause to rebuild my database from scratch, and found there are issues with the two versions of Java commonly used with Serviio. Patters latest version would not build a database from scratch, but it would show the files as available on my Sony Bravia, and in the Serviio browser. The Synology version of Java would build the database, but not show any files on the Bravia, nor in the Serviio Media Browser. In the end, I built the database with the Synology Java, then switched to the Patters version to keep it updates (though I only ever force refresh).

    Reply
  20. jirka

    Hi, I have the same problem with the new installation. The mentioned forum just boils down to removing file “/usr/local/etc/services.d/Serviio.sc”, but I don’t have such file on my Synology.

    What does the message actually mean? Where should be the undefined port defined?

    Reply
    1. patters Post author

      The error is reporting that something else on your NAS is already using the ports which the Serviio package wants to use (destination ports 23423, 23424, 1900, 8895, and source ports 1900 & 8895). Perhaps you have another DLNA server installed using some of those generic DLNA ports?

      Reply
  21. Ionut B

    Hi Petr,
    Thanks a lot for the effort put in developing this great app.
    I have just installed Serviio on my NAS
    Could you please specify whether DS115j is supported?
    It seems I cannot login by any means to the MediaBrowser. The login window said I should configure the password in the console but it is impossible to find where the setting is located.

    thank you!

    Reply
    1. patters Post author

      Hi, Petr develops the Serviio application but this package is not maintained by him. In answer to your questions, yes that model is supported. You set the MediaBrowser password in the Serviio Console in the Remote section (User password).

      Reply
  22. Eric McCormick

    I’ve asked in a few different places but I shall ask here as well. What is the ETA for 1.7 on the Synology? Really excited to have the option of forcing the audio in transcoding. All my AC3 needed to be changed so that Chromecast will play the audio instead of it passing thru.

    Reply
    1. patters Post author

      I would like to get 1.7 done but it’s going to require me to re-compile ffmpeg for the 7 different CPU architectures which is usually quite difficult. I had hoped Synology would have released their sources for the hardware transcoding ffmpeg builds which they are obligated to do under the terms of the GPL software license, but they’ve decided that they would rather just commit licence infringement despite months of reminders from me and others. Since Serviio improves Synology’s product it seems to me that I would be rewarding bad behaviour to continue to develop for their systems. I have considered taking down my software package repository entirely in protest. That might even get some traction with tech news sites and shame them publicly.

      Reply
      1. Eric McCormick

        As a pro user I would hate for that. From being on their forums, I don’t think anyone in the company really pays attention to the conversations going on. You probably need to send an email to the legal/marketing department. Have you tried contacting them through telephone +44 (0) 1908 274659 or email uk_support@synology.com? If you get a crummy response, I would send your correspondence to The Verge and Engadget.
        Even though I am already a paid user, I would be willing to pay for an upgrade to 1.7 given the additional benefits.
        Thanks for your hard work on this product and I hope to see 1.7 on Synology soon.

      2. Eric McCormick

        I have sent a message to their support team letting them know that ffmpeg is open source and their custom code for the evansport should also be open source. That I can’t find it anywhere and to let me know where the repository is for it. I will update with any feedback.

      3. Eric McCormick

        Seems like their tech support are useless. They say they don’t provide support to developers and to sign up to be a developer. Submitting to their developer page requesting information got no response. Due to their lack of support, I don’t plan to purchase from them in the future.

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