Table Of Contents 1 Installation of BubbleUPnPServer QPKG on QNAP NAS ...... 4 1.1 Introduction ...... 4 1.2 Requirements ...... 4 1.2.1 Java QPGK ...... 4 1.2.2 QNAP Firmware ...... 5 1.3 Install the BubbleUPnPServer QPKG ...... 6 1.4 Upgrade an existing BubbleUPnPServer QKPG ...... 7 1.5 Upgrade BubbleUPnPServer Server ...... 7 1.6 Start and Stop the BubbleUPnPServer ...... 8 1.6.1 Checks before starting BubbleUPnPServer ...... 8 1.6.2 Start ...... 8 1.6.3 Stop ...... 8 1.6.4 Autostart ...... 8 1.6.5 Configuration of BubbleUPnPServer ...... 9 1.7 Uninstalling BubbleUPnPServer QPKG ...... 10 1.8 Troubleshooting and known problems ...... 11 1.8.1 [BubbleUPnPServer] - JRE QPKG is installed but disabled. Please enable the JRE QPKG! ...... 11 1.8.2 [BubbleUPnPServer] - JRE QPKG is NOT installed. Please install JRE QKPG! ...... 11 1.8.3 Stopping and Starting BubbleUPnP Server QKPG from command line (ssh) ...... 11 1.8.4 Problems during installation...... 11 2 Additional Information ...... 12 2.1 Optional: install ffmpeg version that has libmp3lame support ...... 12 3 DISCLAIMER ...... 13

Version History: Version Date Changes v0.5.5 07.06.2012 • Initial Version • QKPG with BubbleUPnP Server 0.5.5 v0.6 15.08.2012 • Updated QPKG with BubbleUPnP Server 0.6 • Modified start script not to write any logs per default: otherwise this will prevent the HDDs of QNAP NAS to go into standby mode • Modified stop script to do a kill -9 after 10sec to make sure BubbleUPnP Server is really stopped • Updated documentation how to enable logs • Updated documentation with new link to BubbleUPnP Server website v0.6.1 19.08.2012 • Updated QPKG with BubbleUPnP Server 0.6.1 v0.6.1v2 25.08.2012 • No change in BubbleUPnP Server 0.6.1 • Changes to start & stop script: o added -Djava.io.tmpdir=... to startup command. Otherwise BubbleUPnP Server will use /tmp for image transcoding which is very limited in space on QNAP systems o Seems like one of the new firmwares of QNAP introduced a bug in QKPG handling: also uninstalled QPKGs will still receive a stop command. BubbleUPnP Server QKPG will write a system log entry in that case. To work around this bug and in addition a system log message when package is disabled and rebooted: All commands that create a QNAP system entry log have been removed from stop/start procedure except checks on JAVA QKPG status during startup. o No checks for Java QPKG status done anymore at shutdown o In case there are problems with PID file a 2nd approach to stop BubbleUPnP Server is used: via fuser command from QKPG. Process accessing BubbleUPnPServer.jar will be killed. For this Optware QKPG needs to be installed, for BubbleUPnP Serve QKPG Optware is optional since it usually works with PID file. • Update to documentation: o Optware QKPKG (optional) o Removed the error messages in troubleshooting part that were removed in stop / start script. o Added chapter how to start / stop the QPKG from command line

v0.6.2 12.09.2012 • Updated QPKG with BubbleUPnP Server 0.6.2 v0.6.3 15.11.2012 • Updated QPKG with BubbleUPnP Server 0.6.3 v0.6.4 18.02.201 3 • Updated QPKG with BubbleUPnP Server 0.6.4 v0.6.5 01.05.2013 • Updated QPKG with BubbleUPnP Server 0.6.5 ...... • v0.8.2 23.03.2014 • Updated QPKG with BubbleUPnP Server 0.8.2 v0.9 13.11.2014 • Updated QPKG with BubbleUPnP Server 0.9 • Big change in QPKG: since BubbleUPnP Server 0.9 the server itself (not the QPKG) has an auto update function. This is now supported with this QPKG Version. • Changes to startup script to support the new BubbleUPnP Layout • Changes to installation script to remove obsolete files and folders(<= v0.8.3) • Changes to installation script to download latest BubbleUPnP Server version at time of installation • Removed the 2 nd approach in stop procedure using the fuser/kill commands

1 Installation of BubbleUPnPServer QPKG on QNAP NAS 1.1 Introduction This documentation describes how you can install the BubbleUPnP Server (http://www.bubblesoftapps.com/bubbleupnpserver/ ) on a QNAP NAS. To make installation of the BubbleUPnPServer on QNAP NAS easier the BubbleUPnPServer QPKG was created. The QPKG is a framework around the BubbleUPnPServer that takes control of installation, uninstallation, start & stop of BubbleUPnPServer on a QNAP NAS.

The BubbleUPnPServer QPKG consists of: • The BubbleUPnPServer itsself ( http://www.bubblesoftapps.com/bubbleupnpserver/ ) • The QNAP special integration in the QNAP App Center for easy installation, uninstallation, start & stop.

Important: Until BubbleUPnP Server v0.9 the BubbleUPnP Server was part of the QPKG. This means: every time a new BubbleUPnP Server was released it was also needed to create a new QPKG containing the new BubbleUPnP Server binaries. Because of that the Version of the QPKG displayed in the App center also matched the Version of the BubbleUPnP Server (displayed on the BubbleUPnP Server webpage).

Starting with BubbleUPnP Server v0.9 the auto update function was added to BubbleUPnP Server. This means that the Server can be upgraded to a new version without touching the QPKG. Because of that, from now on, the BubbleUPnP Server Version will be different from the Version of the QPKG. E.g. BubbleUPnP Server v0.9 was released together with the QPKG v0.9. When a new BubbleUPnP Server is released the Version will change (e.g. to v0.91) but the Version of the QPKG will still stay on v0.9. The Version of the QPKG will only change in case there are changes made to the install or start / stop procedure of the QPKG.

1.2 Requirements

1.2.1 Java QPGK BubbleUPnPServer is written in JAVA. Therefore you need a Java Runtime Environment (JRE) installed on the QNAP NAS. Depending on which CPU Type (ARM or ) is installed in your QNAP you have to choose a different installation for the JRE. If you don’t know the CPU Type of your QNAP NAS please check on http://www.qnap.com .

1.2.1.1 ARM based NAS Install the JRE QPKG via your QNAPS Web Administration page. Choose: App Center –> All Apps Select the “JRE_ARM” Package and install it.

1.2.1.2 Intel x86 based NAS Install the JRE QPKG via your QNAPS Web Administration page. Choose: App Center –> All Apps Select the “JRE” Package and install it. 1.2.2 QNAP Firmware Please make sure you’re running the latest firmware for your QNAP NAS. Otherwise (in case you run older versions) some functionality in the QNAP QPKG Center might be missing.

1.3 Install the BubbleUPnPServer QPKG There are three different QPKG available for BubbleUPnP Server. Please download the version that meets the CPU Type of your NAS to your PC: BubbleUPnPServer__arm-x09 .qpkg BubbleUPnPServer__arm-x19 .qpkg BubbleUPnPServer__x86 .qpkg

Logon to the QNAP Web Administrator and choose: App Center –> All Apps -> Install Manually Here browse to the path to the BubbleUPNPServer QPKG on your PC. Then press the install button to install the QKPG.

Installation should only run for some seconds. The installer install the QPKG and download the latest available BubbleUPnP Server.

Afterwards BubbleUPnPServer will appear on the “My Apps” Tab:

After the installation BubbleUPnPServer might be stopped. Please see “1.6 Start and Stop the BubbleUPnPServer” for details on starting the BubbleUPnPServer.

For problems and troubleshooting please see “1.8 Troubleshooting and known problems”

1.4 Upgrade an existing BubbleUPnPServer QKPG

This chapter describes how you can update the BubbleUPnPServer QPKG -> this means only the framework for starting and stopping the BubbleUPnP Server (which is updated independently starting v0.9).

The upgrade is performed the same way as the installation. You don’t have to perform an uninstallation, just install the new version as described in “1.3 Install the BubbleUPnPServer QPKG” above.

The configuration file of BubbleUPnPServer (configuration.xml) is not touched by the new installation, so your configuration will be taken over to the new version of BubbleUPnPServer. Also saved playlists for OpenHome renderers will be available after the upgrade.

1.5 Upgrade BubbleUPnPServer Server

As of BubbleUPnP Server v0.9 an auto update function for the server was introduced. This means that the BubbleUPnP Server can be upgraded independently from the QPKG itsself.

To perform an update of the BubbleUPnP Server go to the webpage of BubbleUPnP Server. Under Settings-Update you can configure auto-update (then BubbleUPnP Server will be upgraded and restarted automatically when a new version is available). With the “Check for update” Button you can manually check for a new Version and perform an upgrade when a new Version was found.

1.6 Start and Stop the BubbleUPnPServer

1.6.1 Checks before starting BubbleUPnPServer Before starting the BubbleUPnP Server please make sure the JRE package is started. Otherwise BubbleUPnPServer will fail to start. In case you already have a manual BubbleUPnPServer installation running on your QNAP (non-QPKG Version), then please make sure it is stopped and BubbleUPnPServer is removed from the autostart script of your NAS. Otherwise there will be a port conflict.

1.6.2 Start To start the BubbleUPnpServer press the “OFF” Button in the App Center.

When BubbleUPnP is started the Icon will change from grey to colored:

For problems and troubleshooting please see “1.8 Troubleshooting and known problems”

1.6.3 Stop To stop the BubbleUPnPServer just press the “On” Button in App Center.

For problems and troubleshooting please see “1.8 Troubleshooting and known problems”

1.6.4 Autostart When starting your QNAP NAS BubbleUPnPServer QPKG will come up with the same state (Started / Stopped) it had during the shutdown. So if BubbleUPnPServer was running at the time the QNAP NAS was stopped it will automatically be started.

1.6.5 Configuration of BubbleUPnPServer To enter the BubbleUPnPServer configuration page you can press on the Open link in the App Center when the server is running:

For details on how to configure the BubbleUPnPServer please see this documentation: http://www.bubblesoftapps.com/bubbleupnpserver/#server_configuration

1.7 Uninstalling BubbleUPnPServer QPKG To uninstall BubbleUPnPServer just press the “More” link in the App Center when you move your mouse over the Server:

Press “Remove” to uninstall BubbleUPnP Server QPKG:

1.8 Troubleshooting and known problems

The BubbleUPnPServer QPKG is only responsible to take care of easy install/uninstall and start/stop of the BubbleUPnP Severs

For Problems not related to installation / uninstall, start and stop of the BubbleUPnPServer QKPG please refer to the BubbleUPnPServer documentation: http://www.bubblesoftapps.com/bubbleupnpserver/

Those errors can be logged to the QNAP eventlog during BubbleUPnPServer Startup & Shutdown:

1.8.1 [BubbleUPnPServer] - JRE QPKG is installed but disabled. Please enable the JRE QPKG! The Java JRE QPKG is installed on the QNAP but it is currently disabled in the QPKG Center. Please disable the BubbleUPnPServer QPKG again (you can ignore errors about not found PID file since BubbleUPnPServer was not started). Then start the JRE QPKG via the QPKG Center. Afterwards you should be able to start the BubbleUPnPServer QKPG.

1.8.2 [BubbleUPnPServer] - JRE QPKG is NOT installed. Please install JRE QKPG! Please install the JRE QPKG as described in chapter: “1.2.1 Java”

1.8.3 Stopping and Starting BubbleUPnP Server QKPG from command line (ssh) In case you want to stop / start BubbleUPnP Server QKPKG from command line (e.g. also in case there are problems via the web interface) you can use this:

Stop the Server: /share/MD0_DATA/.qpkg/BubbleUPnPServer/BubbleUPnPServer.sh stop Check that Server is stopped (make sure your ssh window is wide enough!) ps |grep java No java process should be running anymore with BubbleUPnPServer.jar file.

If it’s still running you can kill the BubbleUPnP Server process: First try to send a stop command to BubbleUPnP Server for clean shutdown kill -15

If process is still running you can force to kill the process: kill -9

START: Make sure the the JRE package is running

Start the Server: /share/MD0_DATA/.qpkg/BubbleUPnPServer/BubbleUPnPServer.sh start

1.8.4 Problems during installation The installer will write a logfile that can be used for troubleshouting: /share/MD0_DATA/.qpkg/BubbleUPnPServer/install.log

2 Additional Information 2.1 Optional: install ffmpeg version that has libmp3lame support This is only needed if you like to transcode music, e.g. to convert flac -> mp3 to reduce the bandwidth via mobile connections. But most likely the QNAP (at least ARM based NAS) will not be fast enough to do this transcoding in real time. You also can install ffmpeg at a later time, ffmpeg is not a requirement for BubbleUPnP Server.

Install the “Optware ()” QKPG (via QPKG Center)

Logon via ssh to your QNAP NAS and perform those steps: ipkg update

In case the “ipkg update” fails, try to adjust the following two config files: [/opt/etc/ipkg] # more tsx19-kmod.conf src/gz cs08q1armel http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable [/opt/etc/ipkg] # more tsx19.conf src/gz cs08q1armel http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable ipkg install optware-devel ipkg install git ipkg install yasm ipkg install lame mkdir /opt/compile cd /opt/compile git clone git://git.videolan.org/ffmpeg.git cd ffmpeg ./configure --enable-ssse3 --prefix=/opt --extra-cflags='-I/opt/include' --extra-ldflags='-L/opt/lib' -- enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-libmp3lame make make install

Execute those commands AND add to autostart script: make libraries in /opt/lib visible, otherwise libmp3lame.so library etc. is not detected echo "/opt/lib" >> /etc/ld.so.conf ldconfig replace built-in ffmpeg with link to new version: rm /usr/bin/ffmpeg ln -s /opt/bin/ffmpeg /usr/bin

3 DISCLAIMER BubbleUPnP Server End User Licence Agreement (c) 2011 - 2013 Michael Pujos. All rights reserved.

1. This End User Licence Agreement ("EULA") is a legal agreement between you (either an individual or an entity) (hereinafter "You") and copyright holder or other authorized party (collectively "Company") relating to Your installation and use of the BubbleUPnP Server software (including the QNAP QPKG framework) (the "Software").

By installing, copying, or otherwise using the Software, You agree to be bound by the terms of this EULA. If You do not agree to the terms of this EULA, do not install, copy or use the Software.

2. Permission is granted to You to use this Software, to copy it and redistribute it freely, subject to the following restrictions:

a. The origin of the Software must not be misrepresented; You must not claim that You wrote the Software. b. You may not sell, rent, loan or otherwise encumber the Software in whole or in part, standalone or as a part of integrated solutions, to any third party. c. You may not decompile, reverse engineer, disassemble or modify the Software, unless this is strictly for personal use or to debug such modifications. These modifications must not include removing licensing management module. d. This notice may not be removed or altered from redistributions.

3. The Software includes open source software not owned by the Company. The licence terms in this EULA do not apply to those parts. Instead, the licensing terms listed below apply:

a. The Software includes modified Cling library developed by 4thline licensed under LGPL 2.1. modified source is available at: https://github.com/bubbleguuum/cling b. The Software includes modified Seamless library developed by 4thline licensed under LGPL 2.1 modified source is available at: https://github.com/bubbleguuum/seamless c. The Software includes Jetty licensed under Apache License 2.0 d. The Software includes portions of GWT (Google Web Toolkit) developed by Google licensed under Apache Licence 2.0 e. The Software includes GWT-comet licensed under Apache Licence 2.0 f. The Software includes various Apache Commons libraries licensed under Apache Licence 2.0 g. The Software includes Apache HttpComponents licensed under Apache Licence 2.0 h. The Software includes Apache XML-RPC licensed under Apache Licence 2.0 i. The Software includes Simple Framework licensed under LGPL j. The Software includes RESTEasy licensed under LGPL k. The Software includes WinRun4J licensed under Eclipse Public Licence (EPL) l. The Software includes args4j licensed under MIT Licence m. The Software includes KXML2 licensed under BSD Licence n. The Software includes SLF4J licensed under MIT Licence o. The Software includes Fast MD5 licensed under LGPL 2.1 p. The Software includes imgsclr licensed under Apache Licence 2.0 q. The Software includes Bouncy Castle licensed under the MIT X11 License s. The Software includes FFmpeg binaries licensed under the LGPLv2.1

THE SOFTWARE IS PROVIDED BY THE COMPANY "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.