Serviio 2.0 package for Synology NAS

Serviio 1.6 in DSM Package Center

Update – Serviio version 2.0 is a new major version, so existing Serviio 1.x licences will not unlock the Pro features without a fresh licence purchase. If you wish to downgrade back to version 1.10.1 you may manually install the older package (merged architectures, or evansport) but your media library will need to be rebuilt.

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 2.0 which fixes some issues and introduces multiple user support (release notes). Version 1.10 improved MediaBrowser, and also 4K media support. Version 1.9 replaced the Flash Player dependency in MediaBrowser with an HTML5 player. Serviio 1.7 brought audio track selection preferences, and automatic subtitle downloading. 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 MrK/Boretom a fellow package maintainer for ASUStor devices.

 

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. Newer TVs tend to support inline SRT subs, but for those with older models I can recommend the PlayStation 4 Media Player as a competent DLNA renderer with inline subs support.

I was able to compile FFmpeg for all eight supported architectures (ARMv5, ARMv7, ARMv7 with NEON, ARMv8, 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 difficult to figure out. Only the Intel CPU or higher end 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).

 

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 6.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 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 admin, and then running:
    sudo -i
    (enter admin password to become root)
    rm -rf ~/.fontconfig.cache
    FC_DEBUG=128 /var/packages/Serviio/target/bin/fc-cache --verbose
 

Hardware transcoding support

  • DS214play and DS415play with Intel Evansport SoC are the only models supported for hardware transcoding. Serviio uses the multimedia tool FFmpeg for manipulating media files, and I am only able to build a hardware-assisted FFmpeg for DS214play and DS215play. Subsequent to those products, Synology has marketed a number of other systems with hardware transcoding features but these are not supported by Serviio.
    The DS216play with STiH412 Monaco SoC uses a specialised build of Gstreamer for the Synology transcoding solution rather than FFmpeg, so its hardware features cannot be used by Serviio.
    It seems likely that Synology is also using Gstreamer for the Intel Braswell or newer generation CPUs with QuikSync, since DSM ships with an older FFmpeg (2.7.1) than the version which introduced QuikSync support (2.8.0). To implement FFmpeg QuikSync hardware transcoding support requires Linux kernel patches for libmfx support which is not currently included in DSM 6.x, so Serviio support for Intel QuikSync on Synology is unlikely unless Synology in future switches to using FFmpeg for its own hardware transcoding solution.
    The DS218play with Realtek RTD1296 SoC uses Gstreamer with OpenMAX drivers for the Synology transcoding solution. Although I was able to compile the ARMv8 build of FFmpeg with libomx support, unfortunately the Belaggio OpenMAX IL will not register these Realtek drivers which are distributed in the VideoStation package, therefore the hardware transcoding features of this model cannot be used by Serviio.
  • For the supported systems FFmpeg will use hardware decoding wherever 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). FlowPlayer which had been the embedded player in MediaBrowser did not play these files satisfactorily and dropped many frames resulting in jerky playback. However since Serviio version 1.9 MediaBrowser uses an HTML5 player which is not affected by this issue.
 

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-2.0-linux.tar.gz"
EXTRACTED_FOLDER="serviio-2.0"
DOWNLOAD_URL="${DOWNLOAD_PATH}/${DOWNLOAD_FILE}"
SYNO_CPU_ARCH="`uname -m`"
[ "${SYNO_CPU_ARCH}" == "x86_64" ] && SYNO_CPU_ARCH="x64"
[ "${SYNOPKG_DSM_ARCH}" == "comcerto2k" ] && SYNO_CPU_ARCH="armneon"
[ "${SYNOPKG_DSM_ARCH}" == "armada375" ] && SYNO_CPU_ARCH="armneon"
[ "${SYNOPKG_DSM_ARCH}" == "armada38x" ] && SYNO_CPU_ARCH="armneon"
[ "${SYNOPKG_DSM_ARCH}" == "alpine" ] && SYNO_CPU_ARCH="armneon"
[ "${SYNOPKG_DSM_ARCH}" == "alpine4k" ] && SYNO_CPU_ARCH="armneon"
[ "${SYNOPKG_DSM_ARCH}" == "monaco" ] && SYNO_CPU_ARCH="armneon"
[ "${WIZARD_ENC_HW}" == "true" ] && SYNO_CPU_ARCH="i686evansport"
NATIVE_BINS_URL="http://packages.pcloadletter.co.uk/downloads/serviio-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.37/dejavu-fonts-ttf-2.37.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"
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


pre_checks ()
{
  #These checks are called from preinst and from preupgrade functions to prevent failures resulting in a partially upgraded package
  if [ -z ${JAVA_HOME} ]; then
    echo "Java is not installed or not properly configured. JAVA_HOME is not defined. " >> $SYNOPKG_TEMP_LOGFILE
    echo "Download and install the Java Synology package from http://wp.me/pVshC-z5" >> $SYNOPKG_TEMP_LOGFILE
    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. " >> $SYNOPKG_TEMP_LOGFILE
    echo "Download and install the Java Synology package from http://wp.me/pVshC-z5" >> $SYNOPKG_TEMP_LOGFILE
    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. " >> $SYNOPKG_TEMP_LOGFILE
    exit 1
  fi

  if [ -z ${PUBLIC_FOLDER} ]; then
    echo "A shared folder called 'public' could not be found - note this name is case-sensitive. " >> $SYNOPKG_TEMP_LOGFILE
    echo "Please create this using the Shared Folder DSM Control Panel and try again." >> $SYNOPKG_TEMP_LOGFILE
    exit 1
  fi
}


preinst ()
{
  pre_checks
  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, " >> $SYNOPKG_TEMP_LOGFILE
        echo "which was \"${WGET_URL}\" " >> $SYNOPKG_TEMP_LOGFILE
        echo "Alternatively, you may download this file manually and place it in the 'public' shared folder. " >> $SYNOPKG_TEMP_LOGFILE
        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
  [ -e ${SYNOPKG_PKGDEST}/lib/omxregister-bellagio ] mv ${SYNOPKG_PKGDEST}/lib/omxregister-bellagio ${SYNOPKG_PKGDEST}/bin

  #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/
  [ -d ${PLUGINS_PATH}/fonts/dejavu-fonts-ttf-2.35/ ] && rm -rf ${PLUGINS_PATH}/fonts/dejavu-fonts-ttf-2.35/

  #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

  #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}/conf/${SYNOPKG_PKGNAME}.sc > /dev/null

  exit 0
}


preuninst ()
{
  `dirname $0`/stop-start-status stop

  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 ()
{
  `dirname $0`/stop-start-status stop
  pre_checks
  #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%<FriendlyName>Serviio \((\{computerName\})\)%<FriendlyName>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-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 [ ${INPUT} = 2 ]; then
    #the FFmpeg subtitles filename needs quotes adding back on
    #because it may contain spaces, and the shell has removed them
    PARAM=${PARAM/\[*.*\]subtitles=filename=/subtitles=filename=\"}
    PARAM=${PARAM/:original_size/\":original_size}
    PARAMS="${PARAMS} ${PARAM}"    
    INPUT=0
  elif [ "${PARAM}" == "-filter_complex" ]; then
    #next parameter will be subtitles filtergraph including subtitle filename
    #which needs special treatment, so set a flag
    INPUT=2
    PARAMS="${PARAMS} ${PARAM}"
  elif [ "${PARAM}" == "-i" ]; then
    #next parameter will be input filename which needs special treatment, so set a flag    
    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/ -filter_complex \[*:*\]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

#older Evansport FFmpeg version 2.7.1 needs "-strict -2" to use experimental aac encoder
if [ "${PARAMS}" != "${PARAMS/ -c:a:* aac /}" ]; then
  PARAMS="${PARAMS/ aac / aac -strict -2 }"
fi

#Is this FFmpeg commandline a candidate for the hardware encoder?
HWENC=0
if [ "${PARAMS}" != "${PARAMS/ -c:v 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:v 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:

  • 0037 05/Jun/19 – Updated to Serviio 2.0, clear your web browser cache to fix Serviio Console issues
  • 0036 17/Apr/19 – Updated to Serviio 1.10.1, fixed missing Serviio console icon in DSM 6.2 main menu, added support for DS119j
  • 0035 14/May/18 – Updated to Serviio 1.9.2
  • 0034 01/Mar/18 – Updated to Serviio 1.9.1, added ARMv8 support
  • 0033 02/Aug/17 – Updated to Serviio 1.9
  • 0032 21/Jan/17 – Fixed Evansport FFmpeg wrapper script to allow transcoding to aac since it’s an older FFmpeg version with slightly different command syntax
  • 0031 07/Jan/17 – Updated to Serviio 1.8
    Updated FFmpeg to 3.2.2
    Updated Intel Evansport hardware transcoding build of FFmpeg from 2.0.2 to 2.7.1 – now detects H.265 codec correctly
    Fixed Intel Evansport FFmpeg support for transcoding DTS audio
    FFmpeg now uses hard float ABI on systems with Armada 370/XP SoC (DSM 6.0 change)
    FFmpeg now uses NEON on systems with Armada 375 SoC (DSM 6.0 change)
    Disabled FFmpeg wrapper script to enable libshine for ARMv5 systems now that Serviio handles this automatically
    Added Ogg Vorbis audio support to FFmpeg
    Updated Deja-Vu fonts to 2.37
    DSM 6.0 is now required due to greatly simplify FFmpeg compilation
  • 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 MediaBrowser 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,499 thoughts on “Serviio 2.0 package for Synology NAS

    1. wdouter's avatarwdouter

      23424 port that is configured for this package is used by another service or is reserved for system use. Disable the service that is causing the conflict, or contact the developer to change the configuration of the package.
      how do i kill the serviio service?

      Reply
  1. Benji's avatarBenji

    Just installed DSM 5.0 on my DS212j and Serviio stopped running. Just uninstalled Java 6 and re-installed then went to Serviio and hit Run and it works again. Hope this helps!

    Reply
  2. Cedric's avatarCedric

    I Upgrade to DSM 5.0 since 2 day and Serviio didn’t want to work. I have reinstall It and Java and got this error when I try to log to the media browser “Returning error code 503 to the REST”

    Reply
  3. Mario's avatarMario

    Also i upgrade to dsm 5, and serviio doesn’t restart.. i have unistalled all: serviio and java 1.7 i restart my nas 213 and i have reistalled all.. first java 1.7. 0.51 and after i have installed serviio 1.4 but it doesnt restart..

    if i go to mediabrowser page i can see the page , but if i go on my tv or on my pc where is installed serviio console i can’t see the server..

    HELP ME PLEASE..

    Reply
  4. Robert's avatarRobert

    Hello,

    It happens exactly the same with my DSM213J .

    Upgrade to DSM 5.0 , and everything worked fine except Serviio . As much as it began, did not start . So uninstall it and install again . Without success.

    So I read , and I understood that the problem was in Java , so reinstall Java, Serviio now if initiated , but the console does not work , it opens but does not connect .

    I have made some tests. For example, if I run :

    http://192.168.xx.xx:23423/rest/service-status

    I returned:

    false

    If I run to see the license:

    http://192.168.xx.xx:23423/rest/application

    I returned:

    Even to rule out a problem with my Mac , I’ve had a macbook, where if the Serviio -Console starts, but does not show the console.

    To go further , I have even tried to install serviio console for PHP, and more attempting to activate the server does not start .

    So I’ve gotten into SSH, and after buying a PRO license , I tried to update it with the following result:

    curl- i- H “Content -Type : plain / text ; Accept: application / json” -X PUT ” http://192.168.xx.xx:23423/rest/license-upload ” -T Serviio_xxxx.lic
    HTTP/1.1 500 Internal Server Error
    Connection : close
    Transfer -Encoding : chunked
    Date: Thu, 13 Mar 2014 16:34:59 GMT
    Server : Restlet -Framework / @ number @ @ major- minor- release number @ @ @ @ release -type – number @ .
    Vary : Accept- Charset , Accept- Encoding, Accept- Language , Accept
    Content- Type: application / xml; charset = UTF -8

    To do more tests , I went to the root of Serviio on my Synology , until you find the serviio-console.sh . When I run :

    Estacion> sh serviio-console.sh
    Exception in thread ” Thread- 1″ java.lang.NullPointerException
    at org.serviio.console.ServiioConsole $ ShutdownHook.run ( ServiioConsole.java : 324 )

    And rather than reinstall Serviio , java, or Restart the DSM does not work. Any tips ?

    Reply
  5. apornstar's avatarapornstar

    Same Problem Here … Synology DSM 5 Update … Serviio doesn’t start anymore … please advise!!!!

    Reply
  6. foreskinzola's avatarforeskinzola

    Unfortunately I have to add myself to the list of users that are having problems. I have a 212j with a fresh install of DSM 5, latest java, latest serviio. It does not startup correctly. The process still seems to be running. I switched on debug logging and the last few lines from the log file were :
    2014-03-13 20:09:09,124 DEBUG [TechnicalMetadataCacheDecorator] Cleared cache (online_technical_metadata)
    2014-03-13 20:09:09,124 DEBUG [DBSchemaUpdateExecutor] Setting a new database update ID
    2014-03-13 20:09:09,126 DEBUG [ConfigEntryDAOImpl] Reading a ConfigEntry (name = db_update_id)
    2014-03-13 20:09:09,165 DEBUG [ConfigEntryDAOImpl] Creating a new ConfigEntry (name = db_update_id, value = a2a0488e42504e57a0f02ee5e3d4af11)

    Let me know if i can provide and more info or help.

    Reply
  7. Sebastian's avatarSebastian

    It seems that lib/padlock.jar is corrupted in the current download package. I was not able to run the Serviio 1.4 on DSM 4.3 or 5.0 without replacing that file with the one from 1.4.1 linux tarball.

    Regards,
    Sebastian

    Reply
    1. patters's avatarpatters Post author

      That’s odd. If you expand the script sources of my package in this page, you can see that I don’t actually distribute Serviio at all. The package script fetches the standard Linux Serviio archive from http://www.serviio.org.

      I’m afraid I haven’t had any time available to investigate this DSM5.0 issue, and I am also busy all weekend.

      Reply
  8. Robert's avatarRobert

    It’s true! To all who have the problem with DSM 5.0, is solved by changing the padlock.jar file.

    Madre mia! with the hours I’ve spent trying to fix this!

    Thank you Sebastian!

    Reply
    1. Matt's avatarMatt

      That would explain why my recent upgrade from DSM 5.0 beta to DSM 5.0 didn’t break my Serviio set up as I only had to reinstall Java 7. I wonder if something has gotten messed up on Serviio.org during the recent 1.4.1 update?

      Reply
      1. dfragar's avatardfragar

        Reinstalling Java 7 didn’t fix it for me. Changing back to Java 6 did. If that hadn’t worked next step was to try copying over padlock.jar.

    1. Robert's avatarRobert

      Login via SSH to your Synology. Normally, in:

      cd /volume1/@appstore/Serviio/lib/

      find the package: padlock.jar

      This package should replace it with the version 1.4.1, for example. It downloads to your computer’s version of Linux, and upload it to the public folder. Move it to the folder you indicated above, and from that moment, and Serviio works.

      Reply
  9. marco792013's avatarmarco792013

    Ok i confirm that reinstalling Java 1.7.0 (first remove, then reinstall from community menu) will make your Serviio to work again. but the access to WEbUI is gone, so you cannot add toher folders or change the configs. ANy idea how to solve this?

    Reply
  10. Dan's avatarDan

    I think an update is necessary for Serviio and for Console WeBUI, we have to wait. It was a bad idea to upgrade to DSM 5.0.

    Reply
  11. patters's avatarpatters Post author

    I have now updated my Syno to the release version of DSM5.0. Serviio still works. Here’s what I did:

    I used vi to edit /var/packages/Serviio/INFO and lowered the package version number to 0023. This prompted a Serviio update to be shown in Package Center following a refresh. However if you try to update Serviio, without removing and reinstalling Java then the Serviio upgrade will fail because apparently $JAVA_HOME is not defined after the DSM5.0 upgrade. Despite this failure, your Serviio database will still be saved though. If that happens to you, cancel out of the Serviio install wizard after the failure. Remove and Reinstall my Java package. Now install Serviio but do not select Run After Install. Once Serviio is installed, you need to copy your backed up database from the failed upgrade:
    cd /volume1/@appstore/serviio_db_migration
    cp -R db /volume1/@appstore/Serviio/library
    chown -R serviio /volume1/@appstore/Serviio/library

    Now start Serviio and check the log. It will start up. The MediaBrowser works, and I can connect fine with a Serviio Console instance on another computer.

    I will be releasing a new Serviio package soon for 1.4.1.1, but for now anyone who upgrades to DSM5.0 should immediately reinstall Java before they try updating any of my packages.

    Reply
      1. patters's avatarpatters Post author

        There is no WebUI. You need to use a Serviio Console running on a computer – see the instructions on this page on how to configure it to connect to your NAS’s Serviio instance.

  12. patters's avatarpatters Post author

    I have released the new 1.4.1.1 version. FFmpeg is unchanged because that’s literally a week’s work to compile for all the different CPU types. Serviio’s ‘official’ recommended FFmpeg build is still older than mine.

    Reply
    1. marco792013's avatarmarco792013

      Thanks! will this solve also the WEB ui that was not working anymore after dsm5 and java reinstall ?

      Reply
    2. Nathan's avatarNathan

      Not working for me anymore. It worked last night after I upgraded to DSM and uninstalled/reinstalled Java 6 and then it worked again. Now after running the 1.4.1.1 update for serviio, it won’t run again. Thoughts?

      Reply
  13. EPIX's avatarEPIX

    i tried to upgrade to the newest version, but I get a fault, thtat I should stop the process “serviio console” before updating…
    How should I do this? – I just can’t find a way to do this…

    Greetings from austria
    Eric

    Reply
    1. patters's avatarpatters Post author

      As mentioned in the main blog post I don’t support the web console at all. This is something unofficial made by a third party (not Serviio’s developer) so I have no expectation that it will work following version upgrades etc. Use the real Serviio Console application from a computer. Perhaps later the Web UI will catch up, but you’ll have to experiment with that yourself.

      Reply
      1. marco792013's avatarmarco792013

        Thanks at the end i followed your advice and with console i can access the control panel so now its perfect… only one little thing: controlpanerl says my license will expire in 12 days. After that, will i still be able to access it? what will change?

  14. Wayne's avatarWayne

    What Happen if you have Serviio already running on that PC streaming on your network then what? And still doesn’t work on 2411+, it has never worked…

    Reply
  15. cwimar's avatarcwimar

    Hello,
    my problem sems a little different. I’ve installed serviio on my DS213j (several times now) with either java 6,0 or java 7,0 and it always seems to work all right (in the log) but when I try to access it on http://myserverIP:23424/mediabrowser – it alaways says that the address is wrong. The Console on the computer can’t find it as well. I thought it could be some port forwarding problem, but I try to use it on my lan. I searched different firewall options but I can’t find the cause.
    Any advice please?
    And where can I find the log to copy it, as the only place i can access it doesnt let me copy it.

    Reply
  16. Udo's avatarUdo

    Inside the photo folder there was an @eadir folder (thumbnails).
    But there is not need to see this folder, so why don’t hide it?

    Reply
    1. patters's avatarpatters Post author

      The @eaDir thing is specific to Synology DSM. Zip would need to alter Serviio to exclude it I think. Maybe you could ask on the Serviio forum suggestions subforum (request for library exclusion regex – much like with CrashPlan).

      Reply
  17. Chris's avatarChris

    Hi Patters,

    After updating my DSM to the latest version, every time I try to start Serviio, I get the following error message: “Haven’t found any suitable local IP address, will try again 1 time”.

    I’ve already tried to re-install JAVA, Serviio, Serviio-Console and tried multiple restarts. But since the update that I did a couple of hours ago, the same message keeps coming back… Can you please help me out?

    Thanks in advance!
    Chris

    Reply
    1. patters's avatarpatters Post author

      Is this a Web Console issue (which I do not distribute or support)? Verify first by using the proper Serviio Console client from a computer. If that works then Serviio is fine – the web console is the problem.

      Reply
      1. chrisinzweden's avatarchrisinzweden

        Thanks for your quick reply. What exactly do you mean with ‘a Web Console’?

        I’ve downloaded and used the Serviio-Console from this page: http://serviio.org/download
        That should be the correct one, right?

        I’m a little bit puzzled on how to continue…

        Anyhow, I really appreciate your help.
        Chris

      2. patters's avatarpatters Post author

        Ah, my mistake. Yes that is the correct console. A lot of people want to install a third party web-based one written in PHP, and that’s the one that causes issues.
        Did you definitely edit the Console application to point at your NAS’s IP address?

      3. chrisinzweden's avatarchrisinzweden

        Hi Patters,

        Thanks for your quick reply. Really appreciate your help here.

        I downloaded the serviio-console from serviio.com. This should be supported right? What else could be the problem? Could it maybe have to do with the latest upgrade from Synology DSM?

        Thanks,
        Chris

      4. patters's avatarpatters Post author

        It’s a side project maintained by some other guys on the forum there – not an official release, and it often breaks when new versions of Serviio come out. I stopped attempting to bundle it with the Synology package a long time ago because it cause most of the issues people were having.

  18. harrywerk's avatarharrywerk

    Hi Peter.
    Could you give me a download link for the Serviio package for my DS410 (running DSM 5.x) and I try and install it manually.
    The package install from the site always comes back with Downloading … Failed to download.
    All other packages have downloaded and installed without issue. Serviio was on there before (1.4.0.x) but I couldn’t update it because of the above error.

    Reply
  19. chrisinzweden's avatarchrisinzweden

    Hi Patters,

    After doing a full re-install of Serviio on my Synology and JAVA, it still gives me the error: “Haven’t found any suitable local IP address, will try again 1 time”.

    I’m sorry for getting this back to you… but do you have any other thoughts on how I could fix this problem?

    Thanks again,
    Chris

    Reply
    1. patters's avatarpatters Post author

      Try leaving the Synology idle for a few minutes before you reinstall the package perhaps. I’ve seen it complain about port conflicts when there are none, and then be fine a few moments later.

      Reply
  20. bornext's avatarbornext

    Hello patters,

    you’re talking about ffmpeg 2.1 but the version included with servio on my Intel NAS (1511+) say 2.0.2.
    Did I missed something somewhere ?

    Another question related to the compilation: does your page is up to date ?
    No new version of the DSM-Source archive ?

    Thanks for your work.
    MoBO

    Reply
    1. patters's avatarpatters Post author

      There’s already an ffmpeg included with DSM but it lacks some features that Serviio needs. Run /volume1/@appstore/Serviio/bin/ffmpeg to check the version, because the Serviio one is not added to the system path.

      Reply
      1. bornext's avatarbornext

        Argh! I’m “stupid” sometimes.
        Thanks for this friendly reminder.

        What about the DSM-Source archive from your ffmpeg compilation page?

        Does this entry now work-> Apple (HFS)?
        “ffmpeg -ss %o -t %d -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f mpegts -vcodec libx264 -preset superfast -acodec libmp3lame -threads 0 -”

      2. patters's avatarpatters Post author

        I believe my ffmpeg binary supports HLS since Serviio uses it for streaming to iOS devices when using the Media Browser. As for the DSM source stuff I hosted on my Dropbox, no I haven’t updated it. Updating my ffmpeg binary for four different CPU architectures with all the dependent libraries is a big task which I don’t do very often. You can obtain newer sources for those DSM-included packages here, but they’re all contained in one huge archive. I seem to remember that I used quite an old OpenSSL (1.0x – before Heartbleed) because the 1.0.1 versions would break something else at the time (librtmp perhaps).

  21. greggandjah's avatargreggandjah

    Hi,

    My syno is a 209+.
    I installed java via the alternate methode from chreggy.fr . It seems to work.
    But now Serviio doesn’t appear in the package center, in the third tab.
    Does it mean that my syno isn’t compatible with your serviio package?
    Thank you

    Reply
    1. patters's avatarpatters Post author

      Using that Debian chroot is problematic – chreggy would have to make a dedicated Serviio package really because I wouldn’t be able to test.

      Reply
      1. greggandjah's avatargreggandjah

        Hi, thank you for the reply.

        But actually, I can only see three of your packages: CraftBukkit, Minecraft, and OpenRemote.
        No Java or Serviio. And this was the same before installing the java package from chreggy with the Debian chroot. I didn’t go through the end to install CrashPlan. Only Debian and Java.

        That’s why I wonder if my syno is compatible with Serviio packages. My DSM is 4.0-2219.

        What could you suggest to me?

        Thanks again for your answer

      2. patters's avatarpatters Post author

        With that processor you can’t use my packages unfortunately. You would need DSM 5.0 which Synology only made available for 2010 Synology products or newer. Yours is a 2009 model. For your NAS, the repository is only displaying the pure Java packages that have no CPU requirement, even then I’m unsure if they would work with chreggy’s Java package.

      3. greggandjah's avatargreggandjah

        So sad… I’ll wait to win the lotery to buy a new syno…
        Whatever, thank you for your answers, really appreciate this.
        Have a good day

  22. Nick's avatarNick

    I just upgraded my DSM to 5.0-4458 Update 2 to close the Heartbleed issues and since then have found that when viewing Serviio on my Sony Bravia TV that the server drops out frequently, even when scrolling through file lists. When playing video it stops after a few minutes with an error that the server could not be contacted.

    I thought the update should be okay as I moved from the second latest DSM to latest and wouldn’t need to uninstall/reinstall Java or Serviio. Any ideas?

    Reply
    1. Matt's avatarMatt

      From the synology Java package page (https://pcloadletter.co.uk/2011/08/23/java-package-for-synology/):

      “If you update DSM later, you will need to re-install this package or else UTF-8 and locale support will be broken by the update.”

      As a result of the above, I ALWAYS reinstall Java after a DSM update (no matter how minor) and have no issues with Serviio. It only takes about 30 seconds to stop Serviio, uninstall Java, reinstall Java and then start Serviio again, which is a lot less time than you’ll spend messing around if you find something doesn’t work later.

      Reply
      1. Nick's avatarNick

        I uninstalled/reinstalled, and it actually seems a bit improved, but still not 100%. I also realised that when I upgraded to the latest DSM about a week ago (prior to Heartbleed) and reinstalled Serviio that it was set to downmix to stereo. Turning that setting off made a bigger improvement. I’m perplexed.

  23. Juan's avatarJuan

    Looks like last DSM update (5.0-4482) or the latest Java 7 update just broke my Serviio package. It won’t start again. Tried everything I could in terms of uninstalling packages (Java, Serviio, etc.)… even tried installing the previous Java update but had zero luck. The log (available in the Synology Package center) is empty. Anthing else I could look into in order to troubleshoot?

    Reply
    1. patters's avatarpatters Post author

      Try stopping your Java applications (Serviio, CrashPlan). Reboot the NAS, remove Java, reboot, then reinstall Java. Should fix it.

      I think after the DSM upgrade the Java applications sort of hang when they start, and can become orphaned. So even though they can show as stopped in Package Center there’s actually a running Java process. If you uninstall Java at that point, rather than terminating the orphaned process it seems to hang around, and probably interferes with reinstalling Java.

      Reply
      1. Juan's avatarJuan

        Got it. The java update I downloaded never finished so the VM update just left me with an unusable one. Checking the log for the Java package showed me the .zip file was never properly unzipped.

        Thanks for the tip on Crashplan, btw. I only thought about Java when I remembered I had another dependency over there.

  24. patrick's avatarpatrick

    hi, on windows, changing the remote host in vmoptions won’t let me change the password via the console on synology Nas .. any hints on what’s going wrong? can i change the passwd via ssh?

    Reply
  25. nagrabus's avatarnagrabus

    Hi. I have instaled Serviio on my DS214play and I am testing it for two days. I streem mkv movies to PS3 system and I am happy that Serviio can transcode DST sound track to AC3 and suport for polish subtitles. Thats features are not available on official DLNA server from Synology NAS even if you have DS214play. But I have a question abaut hardware transcoding that DS214 play is suporting. Is it possible to use its hardware acceleration in Serviio for this model of NAS?

    Reply
    1. patters's avatarpatters Post author

      Using Synology’s published sources, a lot of detective work, and a truckload of patience, I have just finished building what I believe may be a working FFmpeg with hardware transcoding for DS214Play. I will need to log onto a NAS of that model via SSH in order to test it though, since I only have a DS111. If you can help please leave me a message on here.

      Reply
      1. nagrabus's avatarnagrabus

        Yes, I will help you, I will give you an account to my server and SSH access.

  26. Grant's avatarGrant

    I’m trying to figure out what I broke on my Synology DS1513+ when I upgraded to DSM 5.0-4493 (from 4.something.)

    Servio 1.4.0-0024 stopped and won’t start.

    I upgraded the Java Manager (to 7.0.51-0026) and Java 1.6.0_39-0021 claims to be up to date. I tried to update it to V7 but the package center acts like it can’t find it and I can’t get it to install manually despite downloading it via firefox and moving it to the public folder of the NAS.

    What am I missing?

    Thanks,
    Grant

    Reply
  27. john's avatarjohn

    Hi !
    I have a DS414J and I follow you guide to update Java. This part seems fine.
    I dont see servvio in your apps .. any idea ?

    Thx!

    Reply
      1. john's avatarjohn

        Thank you for your very fast answer :)
        The installation works and i was able to add libraries and play divx/musics.
        It appear that my NAS cpu is too “light” to handle HD video (720p and 1080p) or 3D videos for obvious reasons. Some images appear but it’s too laggy to watch a movie in proper condition.

        I will add an Intel Nuke to do that part and will hide it behind the NAS :p

        Thank you very much again !

      2. patters's avatarpatters Post author

        The alternative may be to buy a renderer device with better format support. For instance I use an ARMv5 powered DS111 (a CPU worse than an original iPhone from 2007!) with a Sony Bluray player.

  28. curu's avatarcuru

    Hi, first thanks for this awesome program. I’m starting to use the Serviio Synology package with Xpenology on a HP Proliant N54L machine (on an ESXi VM). Its CPU is AMD Turion II Neo 2,2 ghz. Is there some changes I can made to improve transcoding abilities since maybe the package was not designed for this kind of CPU ?

    Reply
  29. DeadManWalkn's avatarDeadManWalkn

    Device Synology NAS DS112
    DSM 5.0
    Installed Community Repository,
    installed Java 7.0
    installed Serviio version 1.4.1.2.0026
    Serviio is running but cannot connect via mediabrowser link
    cannot connect computer console installation.
    I also tried to install serviidroid with no luck.

    How do I trouble ??

    Reply
    1. sofazilia's avatarsofazilia

      Were you able to connect to serviio?
      I’ve got the same config & same issue: serviio is running but i can’t connect the console neither the mediabrowser.

      Reply
  30. robert's avatarrobert

    I have a DS214play… funny name… as it doesn’t play anything (expect music). I have been working with their tech support and was also just told that the unit also doesn’t support AC3. When I use the desktop version of Serviio, the blu-ray can play all my files. My question… do I install this on my DS214play and will have the capabilities of the desktop version? I am trying to understand this whole DLNA thing. Before I purchased the unit, I assumed from their sales support conversation that it would do what I wanted (.mkv files on my blu ray). Many Thanks for any guidance you can offer!

    Reply
      1. Robert's avatarRobert

        Thanks! Detailed post of which most I do not understand. So.. the current Serviio package doesn’t take advantage of the hardware and that is what you are trying to figure out? I am not happy with Synology at the moment since I was very specific with them before I purchased this unit and many things seemed to be left out. My ASUS router works better for DLNA than their expensive NAS. I digress… I just wrote to B&H for an RMA but since it has been so long, I am guessing it will be denied. I am glad they are working with you as many others seem unhappy with this unit. I would offer to help but all this is way beyond my scope :)

    1. Matt's avatarMatt

      Hang in there Robert, when Patters gets this working it will be well worth the wait. I’ve tried all the other DLNA streaming solutions on my DS412+ (Plex, Synology, etc) and found them all severely wanting in one way or another. Serviio on the other hand does everything I need it to and is very reliable.

      If you do manage to get a refund on your box then I’d highly recommend getting the DS412+ that I have and then you can install Patters’ existing Serviio package which works brilliantly. If you can’t get a refund I’d carry on with the desktop version of Serviio for now (not ideal having to power up the PC I know) and wait for the current issues Patters is having to get sorted, I’m sure they will eventually and I expect you will be very happy with the outcome.

      Reply
    1. Ton's avatarTon

      I stopped using the OSX console. Now it refreshed my library again. Maybe it’s me, or maybe it’s the latest version of the OSX serviio-console.

      Reply
  31. nagrabus's avatarnagrabus

    I have installed DSM 5.1 Beta and my Serviio stoped working. I deinstaled it and try to instal again but instalator say to me that I have port 23424 locked by another service and I must to unlock this port. I dont know how to do that and why it says that port is locked…….
    Java is up to date.

    Reply
      1. nagrabus's avatarnagrabus

        Today Is not better. Restart was done. If you could spend for me 5 minutes and connect via ssh to see what the problem so I will be grateful.

  32. Taurec's avatarTaurec

    Hello, i have a DS415+
    Is there a Serviio-install-package available?
    The DLNA Server from Synology doesn’t work on my Panasonic
    I know at the DS415+ is a different CPU.
    It hope a package is in work :-)

    Reply
  33. Castelli's avatarCastelli

    Hi,

    I’m trying to install Serviio on a DS214Play but when I tryu to install Java SE Embedded 6, 7 or 8 the following message appears :

    “Java binary not found. EULA could potentially cover legal aspects, because file hosted on Oracle’s server are protected by a session cookie requiring a Java script enabled browser”

    I’m using Windows vista and Goggle Chrome.

    Thank you for your help.

    Reply
    1. paulhenshaw's avatarpaulhenshaw

      I see similar error messages when I try to install any of the Java SE packages on my DS 213j running DSM 5.0-4528

      Reply
  34. Raphael's avatarRaphael

    Please can you tell me exactly the path to point on shared media. Consider I have 3 folders. One is music, photo and video.
    Volume1.
    How can write it?

    Reply
  35. Raphael's avatarRaphael

    Thanks for quick reply. I got installed and synced. But one thing missed. All the folder in the dlna device are empty. I can’t load anything. Can you kind suggest solution. Thanks in advance

    Reply
    1. Scott's avatarScott

      Hi Patters,
      I found Serviio can’t start the service today.
      DS214 with DSM 5.0
      Java embeded 7
      Serviio 1.4.1.2
      I tried to uninstall/install JAVA, Serviio and update DSM to the most recent 4528 update1.
      But Serviio still can’t start the service. It was good yesterday.

      I checked log and found that below:
      [profilesdefinitionparser]Cannot get the name of local computer: NAS:NAS
      ………….
      java.lang.nullpointerexception:replacement

      I named NAS for DS214 and I never changed its name. Why would this happen?

      Reply
      1. patters's avatarpatters Post author

        I have never seen this. Do you get the same issue with Java 6 or Java 8?
        By the way, you don’t need to uninstall packages to update DSM. They won’t be affected. Java used to be problematic with locale support but I fixed that in recent versions.

      2. Juan R.'s avatarJuan R.

        Serviio for me is working fine… Crashplan, on the other hand, is unwilling. I’ll keep on playing with this.

  36. M-A-X's avatarM-A-X

    Hey.
    According to a Forum Entry at serviio.org i have to use a modded ffmpeg to get the twitch plugin to work:
    http://forum.serviio.org/viewtopic.php?p=94157#p94157

    “i’ve had to recompile ffmpeg to make sure we stay gpl compliant and i can actually redistribute this fix without zip getting DMCA’d or something. but i think it’ll still work fine in most situations as this only removes some optimizations and the fraunhofer aac decoder.
    LINUX/UNIX:
    you’ll have to recompile ffmpeg yourself according to this guide, then before doing the ./configure line for ffmpeg, download this patch for ffmpeg into the ffmpeg folder, apply it and carry on afterwards.
    usage:

    Code:
    cd ffmpeg-source-dir
    patch -p1 < mpegtsenc.patch

    Is it possible to add this "fix" in any way to your package? I really dont know what to do to fix ist. Do i need to compile ffmpeg myself and put it in a special folder?

    Reply
  37. jacobacci's avatarjacobacci

    Hi
    I am trying to install Serviio on my DS411+ii. Successfully installed Java SE 1.7.0-71 through DSM Package Center (Synology Java Manager).
    Added http://packages.pcloadletter.co.uk as package source.
    Rebooted the DS. Now I would need to install Serviio, but I cannot find it in Package Center.
    Where did I go wrong?

    Reply

Leave a reply to bornext Cancel reply