kodi-pvr / pvr.dvbviewer

Kodi's DVBViewer client addon
GNU General Public License v2.0
11 stars 26 forks source link

Timeshift buffering only when needed (after pausing video playback) #21

Closed jakubklos77 closed 7 years ago

jakubklos77 commented 9 years ago

Hello after struggling a lot with TVHeadend and VDR bugs and issues I have decided to stay with DVBViewer recording service (although running as a VM on my Linux machine). Everything is smooth and works great. Including your pvr plugin. Good job btw.

  1. Timeshift I wanted to ask you. Would it be possible to change the timeshift behavior so the actual file buffering would start only after user has paused the live tv playback? The dvbviewer does it this way and it makes sense. We could save some HDD life-time cycle with this.

It may not be possible due to the Kodi PVR plugin API though. Only asking :)

  1. xmltv icon Btw. I have written movie/tv show scrapper and xmltv grabber long time ago. The good thing is that it combines these 2 and the xmltv contains extra information (such as icon and other stuff). Now I know that the DVBViewer EPG storage cannot be basically extended with extra attributes as it is a static size file of records (what a shame) but still I am thinking about integrating these extras into it.

There are 2 optons coming to my mind

I am just asking your opinion what you think would be the best approach. Kodi supports EPG programme icons and it's a shame we cannot display them even though we have them in the xmltv file :)

Thank you very much and sorry for this long post

manuelm commented 9 years ago

On demand timeshift might be possible. I'm kind of busy with work right now but I will try this out.

Regarding EPG: I don't want to further complicate the EPG handling. Especially adding support for external EPG data seems wrong for a specific PVR. The better solution is to expand the dvbviewer EPG backend so other addons can benefit as well or a general solution for Kodi (doubt that will happen anytime soon).

jakubklos77 commented 9 years ago

Thank you for your response, Manuel.

The on domenad timeshift would be great.

I agree about the EPG. The DVBViewer team will hardly do any work there. It is just not worth the time and work

Thank you again

manuelm commented 7 years ago

@CiNcH83 I've a version ready. Want to give it a try? I can backport it to Krypton for you but I won't merge it until Krypton has been released. So this is 17.1 or 18.0 stuff

Also which text is clearer to enable the old behavior: Enable timeshift: Always, Immediately or On playback

jakubklos77 commented 7 years ago

That is great news, Manuel. Thank you. I am still on Jarvis running on Ubuntu 16.04. I don't have the Kodi build environment but if you want me I can try to set it up on some VM. Just let me know (or I can test on Windows VM)

"On playback" works for me the best :)

CiNcH83 commented 7 years ago

I would love to. But unfortunately I won't be home until Monday evening... Europa-Park winter wonderland time... yaaay ^^ .

You don't necessarily have to backport it to Krypton. Why don't you just push it to master? I can also take a master nightly...

My suggestion concerning naming:

Timeshifting: Disabled | Permanent | On Pause

For the permanent one, we could steal the RingBuffer from NextPVR add-on ^^ .

jakubklos77 commented 7 years ago

Ok, I will try it on monday too.

I think the labelling is ok

Thank you

manuelm commented 7 years ago

@jakubklos77 and @CiNcH83

Krypton win32 build: https://ci.appveyor.com/project/manuelm/pvr-dvbviewer/build/Krypton-b2b2feb/artifacts master win32 build: https://ci.appveyor.com/project/manuelm/pvr-dvbviewer/build/master-2b8ab24/artifacts

Automatic builds are not tested. At least not yet.

jakubklos77 commented 7 years ago

I had a little time today so I cloned the repo and installed all required build packages. Now that you have sent me the windows binaries I will test it tomorrow on a Win WM. Thanks

manuelm commented 7 years ago

I can build you a linux build in less than minutes. I've a working build environment for that.

jakubklos77 commented 7 years ago

That would be nice. I mean I want to get it set up too but this would save me time... Ubuntu 16.04 (official Jarvis but I can get the beta too) Thank you

manuelm commented 7 years ago

https://manuel.mausz.at/coding/kodi/2.4.6/ Those are for Krypton. No Jarvis anymore.

CiNcH83 commented 7 years ago

Too bad, the add-on does not load on current official Kodi L 18 nightly (2016-12-20) on Android TV.

Will give it a shot with your build on Windows...

CiNcH83 commented 7 years ago

Your addon 3.0.0 build even crashes on Krypton Beta 7 under Windows.

Here is the log for the Kodi L 18 nightly build, which fails to initialize the addon.

jakubklos77 commented 7 years ago

Was able to got it working. Unfortunately not on a Win VM because because of the video acceleration. I have tested it on unstable 17.0 latest beta with the 2.4.6 that Manel has provided. Works great. Maybe just delete the timeshift buffer after stopping or changing the channel. Good work!

CiNcH83 commented 7 years ago

2.4.6 is permanent timeshifting only, no?

jakubklos77 commented 7 years ago

Nope, it has the On pause mode too

CiNcH83 commented 7 years ago

OK, working beautifully. Switching between live and file when hitting 'Pause' is completely seamless. How is that possible?

Also skipping seems to be working properly.

tsbuffer file still does not get deleted on a stop/channel change though which is not a big deal though.

CiNcH83 commented 7 years ago

Some more good news. The 2.4.6 ARM build also works on my Android TV. My mistake always was that I tried to manually install the package which is not possible due to missing root privileges. Installing it from ZIP inside Kodi works. Sorry for that. I am not yet a Kodi pro...

Now going to try triggered timeshifting on Android TV.

I also need to take a look again at Kodi 18 L which did not load the addon with version 3.0.1 on Android TV, see above log. I probably need to do a clean install of the APK!?

CiNcH83 commented 7 years ago

I set 'Enable Timeshift' to 'On pause' and buffer path to '/storage/sda1/ts/'. I then restarted Kodi. Unfortunately I am not getting the 'Pause' button on the Android platform.

Here is a log.

manuelm commented 7 years ago

Your addon 3.0.0 build even crashes on Krypton Beta 7 under Windows.

Please look at the link. You've used the master build on Krypton. This will crash due to ABI changes. Also just tested the automatic Krypton build for windows. Loads and works fine.

I set 'Enable Timeshift' to 'On pause' and buffer path to '/storage/sda1/ts/'. I then restarted Kodi. Unfortunately I am not getting the 'Pause' button on the Android platform.

From your log:

14:17:02.347 T:18446744072031837072 DEBUG: CAddonCallbacksAddon - GetAddonSetting - add-on 'DVBViewer Client' requests setting 'usetimeshift' 14:17:02.355 T:18446744072031837072 DEBUG: AddOnLog: DVBViewer Client: Timeshift: disabled

Both the name of the setting + the log line has changed. So I guess you're still loading the old PVR version.

Maybe just delete the timeshift buffer after stopping or changing the channel.

I'll truncate the file. See no reason for removal.

CiNcH83 commented 7 years ago

Weird. I just did a clean install of Kodi Krypton Beta 7 and then installed your 2.4.6 ARM build from here. It is giving me the new options in the GUI at least.

manuelm commented 7 years ago

Maybe it's because I haven't bumped the version number yet

CiNcH83 commented 7 years ago

Tried to uninstall the package and re-install it from ZIP. Still the same.

Package Update was successful on Windows though.

manuelm commented 7 years ago

If you've access to the sdcard you can overwrite/md5sum-check the PVR yourself. Kodi loads from:

Loading: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/pvr.dvbviewer/libpvr.dvbviewer.so

md5sum should be 259f917d9e06699d75a947ed4d6d9da6

CiNcH83 commented 7 years ago

Haven't yet found an easy way to do so.

manuelm commented 7 years ago

@CiNcH83 you can easily bump the PVR version yourself. Just edit the addon.xml (ignore the addon.xml.in) inside the zip package. Increasing the patch number (the last digit) should be enough.

CiNcH83 commented 7 years ago

Didn't help. DVBViewer Client add-on is now shown as 2.4.7 in menu. Timeshift still not available on Android TV. Same issue as before according to the log, trying to find the 'usetimeshift' setting.

I even re-downloaded the ZIP from here to be sure...

CiNcH83 commented 7 years ago

I assume that compilation currently fails for Android. If you look inside the master nightly APK, you will recognize that the libpvr.dvbviewer.so is missing, hence the error I posted above with Kodi 18 L.

libpvr.dvbviewer.so in your ZIP package is probably from the last successful compilation before the timeshift changes.

manuelm commented 7 years ago

libpvr.dvbviewer.so in your ZIP package is probably from the last successful compilation before the timeshift changes.

Definitely not. Use strings if you don't believe me. Compilation works fine.

I assume that compilation currently fails for Android. If you look inside the master nightly APK, you will recognize that the libpvr.dvbviewer.so is missing, hence the error I posted above with Kodi 18 L.

Looks like a build system issue. Shared objects are missing in all PVRs

CiNcH83 commented 7 years ago

OK, new plan...

I take the kodi-17.0-Krypton_beta7-armeabi-v7a.apk and replace libpvr.dvbviewer.so in lib/armeabi-v7a and resource files in assets/addons/pvr.dvbviewer. If the APK still installs after the modification, I assume that the replaced version will be used.

Will report back...

CiNcH83 commented 7 years ago

Modified APK didn't install.

I then did a clean install of Krypton Beta 7 and tried to update the add-on from ZIP again with logging enabled. Log of the update process can be found here. DVBViewer Client add-on was still shown as 2.4.6 afterwards. Only after a Kodi restart would it display as 2.4.7. Timeshift is still not available (log still shows same error).

No clue how to get the thing updated on Android TV anymore.

manuelm commented 7 years ago

You need to sign the APK after modification.

Also don't you have remote adb? Or an application that provides a remote browsing service?

If I find some time during the holidays I can take a look at a FireTV device. However no promises.

CiNcH83 commented 7 years ago

I can access my Sony TV via adb, but it is not rooted, so no access to /data.

manuelm commented 7 years ago

Kodi userdata (which includes updated PVRs) is located in /storage/emulated/0/Android/data/org.xbmc.kodi which equals to /sdcard/Android/data/org.xbmc.kodi. No need to access /data unless you want to modify the files installed by the APK.

CiNcH83 commented 7 years ago

The log says:

DEBUG: SECTION:LoadDLL(/data/app/org.xbmc.kodi-1/lib/arm/libpvr.dvbviewer.so)

I haven't really figured out yet, how the whole stuff really works. But fumbling around with the addon in /storage/emulated/0/Android/data/org.xbmc.kodi didn't do the trick so far.

manuelm commented 7 years ago

You're looking at a log from before the PVR update…

You could at least check if the md5sum is correct and the log is lying :-)

CiNcH83 commented 7 years ago

Ah right. After the update, it is taken from emulated according to the log. Will check when I get back home.

manuelm commented 7 years ago

...which I've told you 2 days ago: https://github.com/kodi-pvr/pvr.dvbviewer/issues/21#issuecomment-268245609 :smiling_imp:

CiNcH83 commented 7 years ago

This is my first Android device and I am not yet really familiar with it. Still learning...

CiNcH83 commented 7 years ago
shell@SVP-DTV15:/ $ md5 /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/pvr.dvbviewer/libpvr.dvbviewer.so
259f917d9e06699d75a947ed4d6d9da6

Looks like the new version...

manuelm commented 7 years ago

Did a quick google search. Androids /storage/emulated is mounted noexec which of course prohibits loading shared objects via dlopen. So I guess Kodi is silently changing the path.

So either wait until the master is fixed or try signing the APK yourself. e.g. https://shatter-box.com/knowledgebase/android-apk-signing-tool-apk-signer/ seems to provide a UI.

CiNcH83 commented 7 years ago

Guess I have to wait then. Tried to sign it but the Sony shows me a parse error on the APK. My workflow doesn't seem valid.

So updating the PVR add-on independently is not possible at all on Android?

manuelm commented 7 years ago

So updating the PVR add-on is not possible at all on Android?

So it seems.

manuelm commented 7 years ago

Looks like it's fixed: https://github.com/xbmc/xbmc/pull/11250

manuelm commented 7 years ago

Judging from the file size of todays master build the binary addons are now included again.

CiNcH83 commented 7 years ago

Yes. I already checked the content of the APK. libpvr.dvbiewer.so is inside. I will give it a shot as soon as I get back home.

CiNcH83 commented 7 years ago

Timeshifting works beautifully on Android TV with master nightly and included DVBViewer Client add-on 3.0.1.

CiNcH83 commented 7 years ago

Some error handling in case timeshift buffer path is not available anymore (removable storage) would probably be good.

manuelm commented 7 years ago

Some error handling in case timeshift buffer path is not available anymore (removable storage) would probably be good.

Yeah I know. PauseStream is a void. So all I can do is show a popup. Edit: Have a better idea. Will fix this.