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

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.

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.

TBlankenheim
Posts: 101
Joined: Wed May 27, 2015 9:15 am
Device ID: 107BBE13, 10782AED
Location: Madison, WI
x 2

Re: Synology SPK for DVR Record Engine

Post by TBlankenheim »

I installed version 0.4.1-20171221 on my DS918+ and the RECORD engine does not seem to be functioning properly.

The DVR Manager indicates HDHomeRun RECORD running. The 'Recordings' tab does not indicate the presence of any recordings (there are several present). When I run the Windows 10 HDHomeRun client, I get a DVR Failure error message. Also, no entries are made to the log file. If I delete the log files before starting the RECORD engine, no new log file is being created.

When I look at the processes running on the DS918+, I can see hdhomerun_record_x64.

Version 0.3-20171118 works as expected with the exception of the DVR Manager not showing any log files. Not sure if this is a known problem or a configuration error on my part.

Any thoughts or suggestions? More than happy to collect any additional information you may require.

Thanks!

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 »

TBlankenheim wrote: Mon Feb 05, 2018 11:18 pm I installed version 0.4.1-20171221 on my DS918+ and the RECORD engine does not seem to be functioning properly.

The DVR Manager indicates HDHomeRun RECORD running. The 'Recordings' tab does not indicate the presence of any recordings (there are several present). When I run the Windows 10 HDHomeRun client, I get a DVR Failure error message. Also, no entries are made to the log file. If I delete the log files before starting the RECORD engine, no new log file is being created.

When I look at the processes running on the DS918+, I can see hdhomerun_record_x64.

Version 0.3-20171118 works as expected with the exception of the DVR Manager not showing any log files. Not sure if this is a known problem or a configuration error on my part.

Any thoughts or suggestions? More than happy to collect any additional information you may require.

Thanks!
No entries to the log file indicates a permissions issue.
Make sure your recordpath location is accessible by the http user.

The fact that 0.4.1 is having issues that 0.3 doesn't really does imply a permissions problem. For 0.4.1 the startup script attempts to run the record engine as the http user.. where as 0.3 runs it as root.

So short summary - check the permissions :)

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 http user? What's the name of the account that needs permissions? Is this something we can do through the DSM or do we need to SSH in and grant permissions to some system level user that we can't see like root?

UPDATE: Can be done in DSM - FileStation -> HDHomeRun folder permissions. Click create and select "http" and then add read and write permissions.
Last edited by jasonic8 on Tue Feb 06, 2018 10:32 am, edited 1 time 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 Feb 06, 2018 10:28 am What http user? What's the name of the account that needs permissions? Is this something we can do through the DSM or do we need to SSH in and grant permissions to some system level user that we can't see like root?
you will need to ssh.
This should only be a problem if you are migrating (or have migrated in previous versions) from the SD installer.

Once you ssh to the box.
simply run the following

Code: Select all

# sudo chown -R http:http <recordpath>

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

Re: Synology SPK for DVR Record Engine

Post by jasonic8 »

Thanks - I edited the post as you must have been answering - turns out you can do it in DSM.

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 Feb 06, 2018 10:33 am Thanks - I edited the post as you must have been answering - turns out you can do it in DSM.
cool :)

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

Re: Synology SPK for DVR Record Engine

Post by jasonic8 »

No Recordings can be found... any ideas?

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 Feb 06, 2018 10:58 am No Recordings can be found... any ideas?
Do you have log files in the recordpath?
Try shutting down the engine via the appcenter.. delete the logfiles if they exist.. then start up the engine
Do you get a new logfile?

If you have new logfile... then am not sure as engine is running.. would possibly be just waiting for my.hdhomerun.com to catch up (maybe wait 30mins or so).

If no new logfile.. then something is most likely wrong with permissions.. and changing through FileStation didn't resolve and we need to go to ssh login to resolve.

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

Re: Synology SPK for DVR Record Engine

Post by jasonic8 »

No that doesn't cure it and now (after SSH sudo) I have the "Unable to play channel. DVR failure" message again.

jasonl
Silicondust
Posts: 16801
Joined: Sun Oct 28, 2007 9:23 pm
x 56

Re: Synology SPK for DVR Record Engine

Post by jasonl »

What's the device ID for your HDHomeRun?

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

Re: Synology SPK for DVR Record Engine

Post by jasonic8 »

Hi - it's 12301DB4

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 Feb 06, 2018 1:09 pm No that doesn't cure it and now (after SSH sudo) I have the "Unable to play channel. DVR failure" message again.
when you re ssh'd to the box..
Can you do the following?

Code: Select all

ps -ef | grep hdh
you should see either this for x86 NAS

Code: Select all

http      9705     1  0 Feb05 ?        00:10:21 /tmp/hdhomerun_record_x64 start --conf /volume1/@appstore/HDHomeRunDVR/etc/HDHomeRunDVR.conf
or for arm

Code: Select all

http      9705     1  0 Feb05 ?        00:10:21 /tmp/hdhomerun_record_arm start --conf /volume1/@appstore/HDHomeRunDVR/etc/HDHomeRunDVR.conf

If you don't see anything.. then we have a problem that the record engine is not starting for some reason.
In the same ssh session - lets get some data
first - lets check the platform

Code: Select all

uname -a
If the output is arm then please try

Code: Select all

/var/packages/HDHomeRunDVR/target/bin/hdhr_wrapper_arm
otherwise if it's x86_64 please try

Code: Select all

/var/packages/HDHomeRunDVR/target/bin/hdhr_wrapper_x86_64
If it's neither - then I may have caused something with my mods for the wrapper.

You should see the following

Code: Select all

+===========================================================+
| Simple wrapper for HDHomeRun DVR Record Engine  v0.1      |
| changes effective user to same user as web engine for the |
| web UI to have sufficient privileges to stop/start the    |
| DVR engine backend without                                |
| Must be run as admin/root user                            |
| This script will not elevate privleges.                   |
+===========================================================+
+===========================================================+
|                                                           |
| hdhr_wrapper -u <username> -b <binary to execute>         |
|                                                           |
+===========================================================+
If you get something like

Code: Select all

cannot execute binary file: Exec format error
Then we have a performance mismatch I need to fix.

To remove the wrapper and resolve back to 0.3 like execution (but new engine and fixes) you can modify the following file
/var/packages/HDHomeRunDVR/scripts/common

Change from line 71 from:

Code: Select all

start_engine() {
    if [[ $EUID -ne 0 ]]; then
        $hdhr_bin_path/$hdhr_bin start --conf $hdhr_etc_path/$hdhr_conf
    else
        if [[ "$arch" =~ "arm"* ]]; then
            echo "Determined Platform is ARM from $arch"
            $hdhr_bin_path/$hdhr_wrap_arm -u $hdhr_user -b $hdhr_bin_path/$hdhr_bin -- start --conf $hdhr_etc_path/$hdhr_conf
        elif [[ "$arch" =~ "x86_64"* ]]; then
            echo "Determined Platform is x86_64 from $arch"
            $hdhr_bin_path/$hdhr_wrap_x86 -u $hdhr_user -b $hdhr_bin_path/$hdhr_bin -- start --conf $hdhr_etc_path/$hdhr_conf
        else
            echo "Unable to determine the platform - will default to no wrapper"
            $hdhr_bin_path/$hdhr_bin start --conf $hdhr_etc_path/$hdhr_conf
        fi
    fi
}
To

Code: Select all

start_engine() {
        $hdhr_bin_path/$hdhr_bin start --conf $hdhr_etc_path/$hdhr_conf
}

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

Re: Synology SPK for DVR Record Engine

Post by jasonic8 »

I'm on x86 and get the text describing the wrapper successfully.

It was allowing me to view live channels before so I'm not sure what's changed.

I'm rubbish at vi.

Post Reply