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 »

NTC wrote: Thu Jul 30, 2020 1:59 pm drwxrwxrwx+ 37 http http 4096 Jul 29 14:50 .
drwxr-xr-x 13 root root 4096 Jul 29 14:48 ..
-rwxrwxrwx+ 1 hdhomerundvr users 49023 Jul 28 18:59 20200728.log
-rwxrwxrwx+ 1 hdhomerundvr users 42258 Jul 29 15:07 20200729.log
drwxrwxr-x 2 http http 4096 Jul 13 2019 Endeavour on Masterpiece
drwxrwxrwx+ 3 hdhomerundvr users 4096 Jul 29 14:39 Great Performances
-rwxr-x--- 1 hdhomerundvr http 1511164 Jul 2 02:00 hdhomerun_record
drwxrwxrwx+ 3 hdhomerundvr users 4096 Jul 24 13:34 Muscle Shoals to Music Row
drwxrwx--- 3 http http 4096 Jul 12 15:06 Saturday Night Live
drwxrwxrwx+ 2 http root 4096 Jul 4 10:29 Simply Ming
drwxrwx--- 3 http http 4096 Nov 14 2019 The 53rd Annual CMA Awards
drwxrwxrwx+ 3 http root 4096 Jul 18 21:59 The Johnny Cash Show
drwxrwxrwx+ 3 hdhomerundvr users 4096 Jul 18 17:30 This Old House
Actually - looking again...
Can you confirm if there is a difference between 'Simply Ming' and 'Saturday Night Live'
I notice one is owned as group root and the other http with different world permissions.
if you can see neither - then ignore this and follow the previous post ;)
But if you can see 'Simply Ming' epsiodes and NOT 'Saturday Night Live' then it could be that we need to simply either change the group via

Code: Select all

sudo chgrp -R users /volume/HDHomeRunDVR
and/or change the world permissions with

Code: Select all

sudo chmod -R a+wr /volume/HDHomeRunDVR
If you see 'Saturday Night Live' and not 'Simply Ming' then I'm confused :)

NTC
Posts: 71
Joined: Sat Apr 13, 2019 2:26 pm
Device ID: 10751B42, 108007F1

Re: Synology SPK for DVR Record Engine

Post by NTC »

demonrik wrote: Thu Jul 30, 2020 4:24 pm It's very odd that the new recordings don't show up but the old ones do.. I would have expected if anything the other way round.
To clarify, I can not see any recordings, old or new. Not with the app, or going to the Silicon Dust page (NAS-IP:59090). Going to "recording" on the TV app states ready to record, but when I record a new program, it does not show up. However the log file shows no errors, and when I SMB into the my NAS from my desktop, the recorded files are there.
demonrik wrote: Thu Jul 30, 2020 4:24 pm Might be worth seeing if doing a chown on the /volume1/HDHomeRunDVR to hdhomerundvr might fix it..

Code: Select all

sudo synopkgctl stop HDHomeRunDVR
sudo chown -R hdhomerundvr:http /volume1/HDHomeRunDVR
sudo synopkgctl start HDHomeRunDVR
Changing to hdhomerundvr:http to all files and folders fixed the problem. I can see new and old recordings on the TV app and via NAS-IP:59090. Not sure why the new install set new recordings with group users but can only be seen with group http.

Out of curiosity, with PuTTY there are some folders I can get into (i.e. Simply Ming) and some that gives me access denied. Not sure if that was the case even before I did the above chown command. Not that it matters as I can still control the folder and files within the app, through SMB, and Synology DMS file manager.

As always, thanks for you help.

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 »

NTC wrote: Fri Jul 31, 2020 9:33 am Out of curiosity, with PuTTY there are some folders I can get into (i.e. Simply Ming) and some that gives me access denied. Not sure if that was the case even before I did the above chown command. Not that it matters as I can still control the folder and files within the app, through SMB, and Synology DMS file manager.
Am guessing you log in as you and not root
Therefore if you are not the user, or group, and the rest of world permissions are not set you won't get access to the folder unless you become root (sudo -i)
e.g.

Code: Select all

drwxrwx--- 3 http http 4096 Jul 12 15:06 Saturday Night Live[/ode]
if you're not http, or part of the http program then the last --- indicates you cannot read, write, or CD to the directory
but
[code]drwxrwxrwx+ 2 http root 4096 Jul 4 10:29 Simply Ming
allows everyone to CD to the directory and can read and write to it's contents (i.e. add files, and/or delete files which are also marked as a+w)

NTC
Posts: 71
Joined: Sat Apr 13, 2019 2:26 pm
Device ID: 10751B42, 108007F1

Re: Synology SPK for DVR Record Engine

Post by NTC »

Got it. 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 »

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

NTC
Posts: 71
Joined: Sat Apr 13, 2019 2:26 pm
Device ID: 10751B42, 108007F1

Re: Synology SPK for DVR Record Engine

Post by NTC »

Hi Rik, I installed 1.0.1 and lost access to my recordings again.

If you recall last week, I chown in the HDHomeRunDVR directory to hdhomerundvr:http and was able to see my recordings through the app and via the SiliconDust web page. After installation of 1.0.1 the owner:group for all my recordings were changed to 1027:http and I no longer can view recordings

Not sure who, or what 1027 is but I assume it is a UID, however it is not hdhomerundvr, which is 1028 on my machine, and http is 1023. Running the id command gives me 1027 no such user.

Running the synoacltool, I got this (the strange symbols is what I got on PuTTY, and line [2] is what got added after the upgrade)
ACL version: 1
Archive: has_ACL,is_support_ACL
Owner: ▒▒▒▒▒▒▒▒vyP▒▒v▒▒v▒▒▒v▒▒▒v▒▒▒~▒▒v4m▒v▒\▒vT▒v(user) not found
---------------------
[0] user:http:allow:rwxp-DaARWc--:fd-- (level:0)
[1] user:hdhomerundvr:allow:rwxpdDaARWc--:fd-- (level:0)
[2] user::allow:rwxpdDaARWc--:fd-- (level:0)
[3] group:administrators:allow:rwxpdDaARWc--:fd-- (level:0)
[4] group:http:allow:rwxpdDaARWc--:fd-- (level:0)

So, how do I fix this and view my exsiting recordings? Do I do a chown again?

Norm

EDIT: I forgot to mention that in DVR Manager the RunAs is set to hdhomerundvr

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 »

NTC wrote: Sat Aug 08, 2020 9:32 am Hi Rik, I installed 1.0.1 and lost access to my recordings again.

If you recall last week, I chown in the HDHomeRunDVR directory to hdhomerundvr:http and was able to see my recordings through the app and via the SiliconDust web page. After installation of 1.0.1 the owner:group for all my recordings were changed to 1027:http and I no longer can view recordings

Not sure who, or what 1027 is but I assume it is a UID, however it is not hdhomerundvr, which is 1028 on my machine, and http is 1023. Running the id command gives me 1027 no such user.

Running the synoacltool, I got this (the strange symbols is what I got on PuTTY, and line [2] is what got added after the upgrade)
ACL version: 1
Archive: has_ACL,is_support_ACL
Owner: ▒▒▒▒▒▒▒▒vyP▒▒v▒▒v▒▒▒v▒▒▒v▒▒▒~▒▒v4m▒v▒\▒vT▒v(user) not found
---------------------
[0] user:http:allow:rwxp-DaARWc--:fd-- (level:0)
[1] user:hdhomerundvr:allow:rwxpdDaARWc--:fd-- (level:0)
[2] user::allow:rwxpdDaARWc--:fd-- (level:0)
[3] group:administrators:allow:rwxpdDaARWc--:fd-- (level:0)
[4] group:http:allow:rwxpdDaARWc--:fd-- (level:0)

So, how do I fix this and view my exsiting recordings? Do I do a chown again?

Norm

EDIT: I forgot to mention that in DVR Manager the RunAs is set to hdhomerundvr
hmmm... Odd
yeah - you need to re-chown the folders, e.g.

Code: Select all

sudo chown -R hdhomerundvr /volume1/HDHomeRunDVR
In the upgrade of the package it will remove the hdhomerundvr user and then re-add them.
I believe this is the root cause here - for some reason the UID on your system is incrementing which usually means the delete hasn't fully persisted before the add.. so the add sees the old UID is still there and thus increments to the next, while the user name was removed so it doesn't error that the user exists. This isn't the first time I've seen similar things happening on synology :(

I have an idea on how to fix for future. Should have new SPK later today to try, basically i'll prevent the remove/add of the user during upgrade.. also realize I should probably always chown the files in the RecordPath

NTC
Posts: 71
Joined: Sat Apr 13, 2019 2:26 pm
Device ID: 10751B42, 108007F1

Re: Synology SPK for DVR Record Engine

Post by NTC »

demonrik wrote: Sat Aug 08, 2020 11:41 am hmmm... Odd
yeah - you need to re-chown the folders, e.g.

Code: Select all

sudo chown -R hdhomerundvr /volume1/HDHomeRunDVR
In the upgrade of the package it will remove the hdhomerundvr user and then re-add them.
I believe this is the root cause here - for some reason the UID on your system is incrementing which usually means the delete hasn't fully persisted before the add.. so the add sees the old UID is still there and thus increments to the next, while the user name was removed so it doesn't error that the user exists. This isn't the first time I've seen similar things happening on synology :(

I have an idea on how to fix for future. Should have new SPK later today to try, basically i'll prevent the remove/add of the user during upgrade.. also realize I should probably always chown the files in the RecordPath
When the 1st time it didn't work, I remembered that I have to stop the record engine first. Once I did that and then chown, I got my recordings back.

As for your suggestions for future packages, they sound like logical precautions.

NTC
Posts: 71
Joined: Sat Apr 13, 2019 2:26 pm
Device ID: 10751B42, 108007F1

Re: Synology SPK for DVR Record Engine

Post by NTC »

I've thought about the UID 1027 that it created and was thinking that it could only have created it if all instances of user hdhomerundvr was removed. Otherwise, if it started adding hdhomerundvr before complete removal, wouldn't it have used the same UID? Just wondering.

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 »

NTC wrote: Sat Aug 08, 2020 1:18 pm I've thought about the UID 1027 that it created and was thinking that it could only have created it if all instances of user hdhomerundvr was removed. Otherwise, if it started adding hdhomerundvr before complete removal, wouldn't it have used the same UID? Just wondering.
1027 was the UID of the last successful install
When you upgraded this time it removed the hdhomerundvr user (1027) then created a new one (1028)
Anyway - please try 1.0.2 (should upload sometime in the next hour or so)
It will still do this delete/create this run, but will be fixed for next time.
It also will auto chown the record path folder to whoever is set as RunAs

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

Re: Synology SPK for DVR Record Engine

Post by Beerman »

Working great for me. Thanks again for your time and effort into this project!

ppasteur
Posts: 133
Joined: Thu Sep 05, 2019 3:54 pm
x 2

Re: Synology SPK for DVR Record Engine

Post by ppasteur »

@demonrik
I had a failure of my DS918+ and had to reinstall everything from scratch. I installed the most recent version of the SPK (engine 20200701).
EDIT:
I installed the 1.02 SPK. I now see the status of the record engine from the management screen. But I have lost the "recordings" tab. I also now do not have the icons to start and stop the engine. Actually there are no icons other that the one used to edit the CONF file.
I do see recordings in the recording path directory. When I stream the logs show that it is recording. Running the HDHR client on windows it shows the recordings and allows me to play them.
SO what am I doing wrong?
I left the below as history in case it is relevant.

________________________________________________________________________________________________________________________________________



Everything seemed to be working OK. DVR is discoverable using MyHDHomerun. Logs are being created. I can see new recordings. Logs show when I am streaming. But a strange this is that I show a message at the bottom of the manager window that says:
Unable to discover DVR status | 20200815-19:07:11 Status: Resource: nbk=0 dmk=286
Which is confusing as it is showing a status. But, it doesn't tell me whether the engine is running or stopped. Obviously I can't tell whether the dvr engine controls are working (start/stop)
I went through some of the steps for troubleshooting similar things but have not figured out what is wrong.
Another thing that may or not be of interest. I tried to run the wrapper and get this.

root@Pasengnas:/var/packages# /volume1/@appstore/HDHomeRunDVR/bin/hdhr_wrapper
-ash: /volume1/@appstore/HDHomeRunDVR/bin/hdhr_wrapper: No such file or directory

Do you have any ideas about what I can check to identify the problem? As mentioned, things appear to be working except for the unable to discover DVR engine error.

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 »

ppasteur wrote: Sat Aug 15, 2020 12:40 pm @demonrik
I had a failure of my DS918+ and had to reinstall everything from scratch. I installed the most recent version of the SPK (engine 20200701).
EDIT:
I installed the 1.02 SPK. I now see the status of the record engine from the management screen. But I have lost the "recordings" tab. I also now do not have the icons to start and stop the engine. Actually there are no icons other that the one used to edit the CONF file.
I do see recordings in the recording path directory. When I stream the logs show that it is recording. Running the HDHR client on windows it shows the recordings and allows me to play them.
SO what am I doing wrong?
I left the below as history in case it is relevant.

________________________________________________________________________________________________________________________________________



Everything seemed to be working OK. DVR is discoverable using MyHDHomerun. Logs are being created. I can see new recordings. Logs show when I am streaming. But a strange this is that I show a message at the bottom of the manager window that says:
Unable to discover DVR status | 20200815-19:07:11 Status: Resource: nbk=0 dmk=286
Which is confusing as it is showing a status. But, it doesn't tell me whether the engine is running or stopped. Obviously I can't tell whether the dvr engine controls are working (start/stop)
I went through some of the steps for troubleshooting similar things but have not figured out what is wrong.
Another thing that may or not be of interest. I tried to run the wrapper and get this.

root@Pasengnas:/var/packages# /volume1/@appstore/HDHomeRunDVR/bin/hdhr_wrapper
-ash: /volume1/@appstore/HDHomeRunDVR/bin/hdhr_wrapper: No such file or directory

Do you have any ideas about what I can check to identify the problem? As mentioned, things appear to be working except for the unable to discover DVR engine error.
Recordings Tab is gone.. You don't need it anymore since SD have UI now on the record engine
I've removed the start/stop of the engine from the UI.. Just use the mechanisms in the App Center.
The whole way I start the engine has changed - so no wrapper any more.. the start/stop script now downloads latest engine on start, and runs as hdhomerundvr user

The 'Unable to discover DVR status' is worrying - suggests the UI doesn't have permissions to the record engine binary.
With system running can you have a look at it

Code: Select all

ls -l /volume1/HDHomeRunDVR/ 
curious if the engine has group settings set wrong.

ppasteur
Posts: 133
Joined: Thu Sep 05, 2019 3:54 pm
x 2

Re: Synology SPK for DVR Record Engine

Post by ppasteur »

OK, I think that clarifies things considerably. It seems that the controls that I am missing are missing by design. Though I did like the ability to start and stop the engine from the DVR Manager.
I also liked the ability to view recordings there. Mostly as a one stop for verification.
After installing 1.0.2 the DVR status is reported properly.

"HDHomeRun RECORD running | 20200815-21:27:32 Recording: recording stated..."

One thing you might clarify for me. You say something to the effect that we don't need the recordings tab anymore because "SD has UI for record engine" (or something to that effect)
What UI is it that you refer to? Is it the client side UI for viewing recordings, perhaps?

Beside that, it seems that everything is working OK with 1.0.2. Other than the tings I miss about the previous UI.
If I wanted those tools back, could I install a previous version of the SPK? Or would that just lead to more problems?

Thanks for the help and quick reply!!

Phil

Online
signcarver
Expert
Posts: 11083
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 10A05954 10802091 131B34B7 13231F92 1070A18E 1073ED6F 15300C36
x 39

Re: Synology SPK for DVR Record Engine

Post by signcarver »

It used to be that the recording engine would give one big list of all the recordings when one would retrieve the recorded_files.json now it give the list of the various "series" (in a sense folders but it goes by the SeriesID or type such as Movies/Sports when those are recorded as such) then for each one you have to retrieve the list of "episodes" so it would require entirely new programming to sort through it all. It probably should have stated "API" or such rather than UI.

Post Reply