Synology SPK for DVR Record Engine

Downloads & Instructions
Post Reply
demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Synology SPK for DVR Record Engine

Post by demonrik »

Requirements
  • Your Synology NAS must be running DSM 6.0 or newer
  • You must have the WebStation app installed for the PHP UI to work
  • You must have PHP 7.2 installed
Note: This is an alternate installer than the official installer as part of the SiliconDust package. You should not install both as they will confuse each other

SPK Installation Instructions
  1. Download the latest .spk file from Google Drive, DropBox, OneDrive, or advanced users can build from source (see below). The .md5 file allows advanced users to verfiy that the file has not been modified in transit but is otherwise not needed.
  2. Open a browser to your Synology desktop and login as an admin user
  3. Open the 'Package Center'
  4. Click on 'Manual Install'
  5. Browse to the location of the SPK file and select it
    Image
  6. Click Next
  7. You will be presented with information about the package.. Ensure you have the 'Run after installation' box checked and hit 'Apply'
    Image
  8. After a few minutes the package will be installed and available in the 'Package Center'
    Image

--------------------------
Support
Support for my prebuilt packages will be done via this thread or via discord channel
https://discord.gg/0uzKaTiMjCwvanxM
Just ask and I will do my best to answer as quickly as I can :)


-------------------------
About
Similar to my QNAP QPKG (here) here is a project to build a custom Synology SPK package for installation on your Synology NAS.
Provides similar benefits
- integrated UI to manage the configuration file
- integrated into the Synology desktop package manager
- makes the log files viewable
- easy installation/update without requiring new shares or even a separate PC
- automatic restart when the NAS restarts (after update for example)

All sources are located in the silicondust DVR installer project on github
https://github.com/Silicondust/dvr_install

This project is simply the SPK sources to build the SPK. The project does not contain a copy of SiliconDust's HDHomeRun DVR Record Engine Binary. Builders must get this binary separately from the SiliconDust forums (script provided)

License of the SPK sources is public domain. License of the HDHomeRun DVR Record Engine remains the property of SiliconDust and use of this SPK sources does in no way permit the user the right to redistribute the binaries without SiliconDust's permission and/or permit any breaking of SiliconDust's license restrictions on the DVR record engine.
Last edited by demonrik on Tue Sep 21, 2021 1:03 am, edited 10 times in total.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

Known Issues/Workarounds

No UI -> open_basedir
By Default Synology installs PHP with the open_basedir directive set in the php.ini to restrict the directories. To workaround this you have 2 choices. Either
  • a) Remove the restriction
    b) add all directories to the open_basedir list
For both..
  1. Open a Browser to your Synology DSM
  2. Open the 'Webstation' App
  3. Under PHP Settings you will have a dialog showing the ability to 'Customize PHP open_basedir'
  4. First check which PHP version you have selected in the top drop down box.. Typically newer Synology uses PHP 7.2..
    For
    a) simply leave the check box for 'Customize PHP open_basedir' checked and remove everything in the text box below
    or
    b) add the following and adjust for any changes you may make to the list
    • /var/packages/HDHomeRunDVR - base package location to allow access to the binaries and config file
    • /volume1/HDHomeRunDVR - default recording directory
Error 500 when loading UI webpage
Error 500 is shown when the webserver on the NAS cannot show the webpage because something has thrown an error.
In many cases the fix is to ensure you select PHP 7.2 with the instructions below:
1. Open the WebStation app on your DSM desktop
2. Select the 'General Settings' tab
3. For PHP, ensure 'Default Profile ( PHP 7.2 )' is selected
4. Hit Apply

Error running the engine with a previously created shared folder
When setting the RecordPath to a shared folder you previously created you get an error, and the record engine fails to start
This has to do with the way Synology sets the share permissions versus folder permissions. Unfortunately at this time there is no automated fix, however you can get it working. Please follow these steps to add the 'http' group as permitted to write to the folder.
1. Go to the 'Shared Folder' tool in your Control Panel
2. Select the shared folder you wish to use for the DVR
3. Make sure 'Restrict access to administrators only' is not selected/ticked.
4. Hit 'Edit' to edit it's permissions
5. Select the 'Permissions' Tab
6. Where you see 'Local users' select the drop down to 'Local groups'
7. Select the Check Mark for 'Read/Write' access for the 'http' group
8. Select OK

How to expose the default RecordPath as a share (or even just see it in FileStation)
On Synology they lock down a lot. so we have to add the right permissions to get things started.
So first things first.. disable the DVR (via UI or app center) and ssh to the NAS and login as your admin user.
I'm going to assume that everything on your NAS is located on /volume1/ - adjust to volume[1-9] as needed.

Now we need to add the admin access control list (ACL) with

Code: Select all

sudo synoacltool -add /volume1/HDHomeRunDVR group:administrators:allow:rwxpdDaARWc--:fd—
This will now allow us to actually add it as a share
So back to the DSM web interface, log in, and
- open Control Panel
- open Shared Folder
- select 'Create'
- enter the name of the folder, e.g. HDHomeRunDVR
- uncheck 'Restrict Access to administrators only'
- uncheck 'Enable Recycle Bin'
- click 'Next', then click 'Apply'

Now you should have the share in filestation and be able to access it from other PCs in your network.

The final thing we need to do, is just quickly ensure that the http user still has access for the engine.
So back to ssh and enter

Code: Select all

sudo synoacltool -add /volume1/HDHomeRunDVR group:http:allow:rwxpdDaARWc--:fd--
All should be ok at this point - time to restart the DVR engine..
Last edited by demonrik on Sun Jun 09, 2019 4:32 pm, edited 7 times in total.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

Reserved for future

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

Howto transition from SiliconDust installer to the new SPK

Stop the Current Record Engine
  1. SSH as an administrator to the NAS
  2. When using the SD installer you had to create a 'HDHomeRun' share - this is typically located on the system as /volumeX/HDHomeRun where X is the number for the volume you installed it on.
  3. Change to that directory and stop the engine with

    Code: Select all

    #> cd /volumeX/HDHomeRun
    #> ./hdhomerun_record stop
Install the new Record Engine SPK
With the engine stopped lets switch to the DSM Web Page. Log in as an admin user and install the New engine through the Package Center -> Manual install
(remember to update the PHP open_basedir if needed - see here)

Stop the new Record Engine
  1. Select the HDHomeRun DVR Manager app in the Package Center
  2. Under the action drop down, select STOP
Move the Config File
Now back to SSH again..
Move the old CONF file to the new location
Note: You must do this as 'root'
  1. Locate the original CONF file - should be in /volumeX/HDHomeRun/hdhomerun.conf
  2. and move it to the new location

    Code: Select all

    #> sudo mv /volumeX/HDHomeRun/hdhomerun.conf /var/packages/HDHomeRunDVR/target/etc/HDHomeRunDVR.conf
Start the new Record Engine
You can now start the engine through the DSM Web Frontend
Stop the new Record Engine
  1. Log in as an admin user
  2. Select the HDHomeRun DVR Manager app in the Package Center
  3. Under the action drop down, select Run
If you click on the URL in the App's info for Package Center it should take you to the Manager UI.. And should state that the engine is running and you can go look at log files and recordings.

CleanUp tasks.....
  1. Stop the engine using instructions above for the new Record Engine
  2. ssh to the NAS as an admin user
  3. remove or backup the log files
  4. remove the record_linux binary
DO NOT REMOVE the Share through the 'Shared Folder Control Panel'
Doing so will remove your recordings!!!!
To remove the share - you MUST move the recordings to another folder.. so stop the engine, update the RecordPath and then start the engine again.
Last edited by demonrik on Wed Nov 29, 2017 2:15 pm, edited 3 times in total.

jjwatmyself
Posts: 79
Joined: Fri Jan 18, 2013 9:13 pm

Re: Synology SPK for DVR Record Engine

Post by jjwatmyself »

Loving the 3rd party innovation that this represents. Such a great contribution to the community. I will watch this space with great interest.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

Removed - see OP for correct version and link
Last edited by demonrik on Fri Oct 01, 2021 4:32 pm, edited 1 time in total.

poorman
Posts: 17
Joined: Sat Oct 10, 2015 11:29 am

Re: Synology SPK for DVR Record Engine

Post by poorman »

Awesome, this is great. I'm very happy someone is working on this.

Installed and running. Can't find the interface tho.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

poorman wrote: Mon Nov 27, 2017 4:03 pm Awesome, this is great. I'm very happy someone is working on this.

Installed and running. Can't find the interface tho.
If you look at the app in the application center you will see the admin URL.

I have recordings list working.. just a few things to clean up before I upload new package

jasonic8
Posts: 121
Joined: Wed Jul 01, 2015 3:03 am
Location: Somerset, UK

Re: Synology SPK for DVR Record Engine

Post by jasonic8 »

What's the SD status on this - should we wait or use this?

Beerman
Posts: 1642
Joined: Thu May 21, 2015 7:05 pm
x 5

Re: Synology SPK for DVR Record Engine

Post by Beerman »

Thanks for doing this, it sounds great!
If I'm already running HDHomerun on my Synology, do I have to do anything to it first?

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

New Version available - 0_3-20171118
Fixes
- Now same functionality as QNAP - recordings working.. same issues with stop/start.

Big issues still to resolve
- start/stop of the engine from the UI

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

Beerman wrote: Tue Nov 28, 2017 5:29 am Thanks for doing this, it sounds great!
If I'm already running HDHomerun on my Synology, do I have to do anything to it first?
TBH I never used the installer so I'm not 100% sure.
Here's what I think is the procedure - if someone wants to try and see if it works, please let me know.
You will need an SSH shell to the NAS

<instructions moved to here>
Last edited by demonrik on Wed Nov 29, 2017 2:03 pm, edited 2 times in total.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: Synology SPK for DVR Record Engine

Post by demonrik »

jasonic8 wrote: Tue Nov 28, 2017 4:35 am What's the SD status on this - should we wait or use this?
this is me helping SD out.
All the code is provided free to SD for their use. I just do the work and create the packages for you.
Support of the package at this time is with me.. Support of the DVR engine is with SD.

As to should you wait or use.
It depends on your needs. Personally I hate having exposed shares that aren't needed, and prefer to have updates that work independent of SMB share issues, as well as having the engine restart once I update the NAS.
If that's not a concern - then do not install.

jasonic8
Posts: 121
Joined: Wed Jul 01, 2015 3:03 am
Location: Somerset, UK

Re: Synology SPK for DVR Record Engine

Post by jasonic8 »

demonrik wrote: Tue Nov 28, 2017 3:23 pm this is me helping SD out.
All the code is provided free to SD for their use. I just do the work and create the packages for you.
Support of the package at this time is with me.. Support of the DVR engine is with SD.
Thanks for the clarification and for sharing this then. I agree the points you mention are a pain.

poorman
Posts: 17
Joined: Sat Oct 10, 2015 11:29 am

Re: Synology SPK for DVR Record Engine

Post by poorman »

demonrik wrote: Thu Nov 23, 2017 12:59 pm Howto transition from SiliconDust installer to the new SPK

Stop the Current Record Engine

<SNIP>

To remove the share - you MUST move the recordings to another folder.. so stop the engine, update the RecordPath and then start the engine again.[/i]
I have tried these steps and report that it works ... mostly. When on the HDHomerunDVD DSM page I select action run or stop, your software does stop or start the record engine (./hdhomerun_record status). However when I follow the URL, in my case is http://nas/HDHomeRunDVR/, i receive a 500 There is an error while processing this request.

Maybe I have the open_basedir incorrect. I'm unsure of the delimiter between the two entries. I have "/var/packages/HDHomeRunDVR:/volume1/HDHomeRunDVR". Should it be a colon : ? Both paths have been verified.

No worries here though, I know it is in development so I can patiently await the next version and try again.

Post Reply