Kodi Community Forum

Full Version: pvr.mythtv add-on
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2015-05-28, 08:20)glubbish Wrote: [ -> ]
(2015-05-25, 14:48)metu71 Wrote: [ -> ]I'm sure here is plenty of people who knows better, please correct if my finding is not relevant/correct.

To me it seems that your MythTV backend isn't holding preview images for your recordings. If you browse you media library using MythTV frontend (for example locally in MythTV server machine) can you see preview images for your recordings? The first line on the response is saying the status for the request and that is checked in GetResponse function. That is the only place in that function that can change the default return value (false) to true.

This is the first line in the response: (CPPMyth)GetResponse: HTTP/1.1 301 Unknown


The files in ~/.kodi/userdata/addon_data/pvr.mythtv/cache/thumbnail have many with zero length
I deleted one and copied another to its name and the error for that one ceased.

However just deleting them all, brings them back zero length as well.
I cannot find where they are coming from.
I did a search of the whole system (all disks), but the names (and partial names) only appear in the thumbnail directory

I wonder if there is anything in mythtv backend log about those trial to read it from the backend. I can see preview images via mythweb, but those are usually created with some delay after the recording has finished. There is a separate log file for this process in your backend.
Maybe Kodi is trying to read it too quickly after recording has stopped. If preview image is not yet available, it might create an empty file. This doesn't explain why it still doesn't work if zero size file is deleted.
I checked from my system that preview images are stored in same directory as recorded files.
(2015-05-25, 09:26)glubbish Wrote: [ -> ]Hi Janbar,

Do you have any idea what is causing these errors?

http://paste.ubuntu.com/11119586/

07:20:51 T:140712725182208 DEBUG: AddOnLog: MythTV PVR Client: GetPreviewIconPath: determined localFilename: /home/derek/.kodi/userdata/addon_data/pvr.mythtv/cache/thumbnail/2585_1427677200_000
07:20:51 T:140712725182208 DEBUG: AddOnLog: MythTV PVR Client: GetPreviewIconPath: preview: 2585_1427763600_000
and
07:20:51 T:140713362700032 ERROR: AddOnLog: MythTV PVR Client: (CPPMyth)GetPreviewImage1_32: invalid response
07:20:51 T:140712725182208 DEBUG: AddOnLog: MythTV PVR Client: GetPreviewIconPath: preview: 2589_1411044000_000
07:20:51 T:140712725182208 DEBUG: AddOnLog: MythTV PVR Client: GetPreviewIconPath: determined localFilename: /home/derek/.kodi/userdata/addon_data/pvr.mythtv/cache/thumbnail/2589_1411044000_000
07:20:51 T:140713362700032 ERROR: AddOnLog: MythTV PVR Client: Process: Failed to read file: type: 1, local: /home/derek/.kodi/userdata/addon_data/pvr.mythtv/cache/thumbnail/1072_1389870000_000

As said metu71, one of your backend didn't generate the preview. Here some of your recordings are handled by a slave backend because you have "301" response. The HTTP 301 response is a redirection:
Code:
CPPMyth)GetResponse: HTTP/1.1 301 Unknown
followed by the new location where addon could find preview:
Code:
Location: http://xbmc:6544/Content/GetPreviewImage?ChanId=%31%35%36%31&StartT...
But the preview is not available at the slave location too. Probably those recordings are not readable: in this case you should delete them.
(2015-05-28, 11:23)metu71 Wrote: [ -> ]
(2015-05-28, 08:20)glubbish Wrote: [ -> ]
(2015-05-25, 14:48)metu71 Wrote: [ -> ]I'm sure here is plenty of people who knows better, please correct if my finding is not relevant/correct.

To me it seems that your MythTV backend isn't holding preview images for your recordings. If you browse you media library using MythTV frontend (for example locally in MythTV server machine) can you see preview images for your recordings? The first line on the response is saying the status for the request and that is checked in GetResponse function. That is the only place in that function that can change the default return value (false) to true.

This is the first line in the response: (CPPMyth)GetResponse: HTTP/1.1 301 Unknown


The files in ~/.kodi/userdata/addon_data/pvr.mythtv/cache/thumbnail have many with zero length
I deleted one and copied another to its name and the error for that one ceased.

However just deleting them all, brings them back zero length as well.
I cannot find where they are coming from.
I did a search of the whole system (all disks), but the names (and partial names) only appear in the thumbnail directory

I wonder if there is anything in mythtv backend log about those trial to read it from the backend. I can see preview images via mythweb, but those are usually created with some delay after the recording has finished. There is a separate log file for this process in your backend.
Maybe Kodi is trying to read it too quickly after recording has stopped. If preview image is not yet available, it might create an empty file. This doesn't explain why it still doesn't work if zero size file is deleted.
I checked from my system that preview images are stored in same directory as recorded files.

below part of code handling that: fileOps.cpp line 303
Code:
// Failed to open file for reading. Unfortunately it cannot be determined if this is a permanent or a temporary problem (new recording's preview hasn't been generated yet).
        // Increase the error count and retry to cache the file a few times
        if (!fileStream)
        {
          XBMC->Log(LOG_ERROR, "%s: Failed to read file: type: %d, local: %s", __FUNCTION__, job.m_fileType, job.m_localFilename.c_str());
          job.m_errorCount += 1;
        }

        // File was empty (this happens usually for new recordings where the preview image hasn't been generated yet)
        // This is not an error, always try to recache the file
        else if (fileStream->GetSize() <= 0)
        {
          XBMC->Log(LOG_DEBUG, "%s: File is empty: type: %d, local: %s", __FUNCTION__, job.m_fileType, job.m_localFilename.c_str());
        }

        // Recache the file if it hasn't exceeded the maximum number of allowed attempts
        if (job.m_errorCount <= c_maximumAttemptsOnReadError)
        {
          XBMC->Log(LOG_DEBUG, "%s: Delayed recache file: type: %d, local: %s", __FUNCTION__, job.m_fileType, job.m_localFilename.c_str());
          jobQueueDelayed.push_back(job);
        }
In all of these 2 cases: no filestream (means cannot download file from backend) and fileStream.GetSize <= 0 (means downloaded file is empty) , the addon create an empty file in its cache. So the file size is zero. It will retry later by delaying the download job for 3 times max (c_maximumAttemptsOnReadError = 3).

Maybe the ERROR status could be renamed to WARNING or NOTICE.
Finally the cache, for artworks and previews, is cleaned after 30 days. the stamp file is stored at the root of folder "cache".
To clean channel icons cache you can launch addon action "Refresh cache for channel icons" in System/LiveTV/Client specific settings.
(2015-05-27, 04:13)smitopher Wrote: [ -> ]
(2015-05-27, 03:47)nickr Wrote: [ -> ]What version did you end up with installing from OE's repo?
2.1.1, so you can imagine my confusion.

I confirm: it is the right version for Isengard.
Does anyone have a compiled add-on for android they can share? I have 1.11.19 and it won't work.
Thanks!
(2015-05-30, 14:37)toddlmr Wrote: [ -> ]Does anyone have a compiled add-on for android they can share? I have 1.11.19 and it won't work.
Thanks!

As far as I know there is no way to just compile pvr.mythtv addon for android (arm) on its own and install it on an android device.

What is your version of mythtv backend ?
What is your version of Kodi/xbmc and the android version you are running ?

For kodi 15 Isengard, android minimum API is now 17 (was 14) which means android version 4.2 or greater
The current pvr.mythtv addon built from https://github.com/kodi-pvr/pvr.mythtv supports mythtv protocols up to and including 85

The version in https://github.com/janbar/pvr.mythtv branch doityourself adds protocol 86 support (latest 0.28pre mythtv backend).

Mike
(2015-05-24, 09:21)janbar Wrote: [ -> ]
(2015-05-22, 17:44)mattlach Wrote: [ -> ]
(2015-04-30, 19:30)mattlach Wrote: [ -> ]Has this been merged into the version in the PPA? Been running on this version I compiled from git, would be nice to switch back to the PPA version.

Thanks,
Matt

Any word on this?

Thank you,
Matt

Has been merged in ppa version.

Thank you very much Smile

Updating all the frontends to the PPA version now!
(2015-05-30, 11:06)janbar Wrote: [ -> ]
(2015-05-27, 04:13)smitopher Wrote: [ -> ]
(2015-05-27, 03:47)nickr Wrote: [ -> ]What version did you end up with installing from OE's repo?
2.1.1, so you can imagine my confusion.
I confirm: it is the right version for Isengard.

So the plugin in the OpenElec repository is your plugin? That would make things easy.
(2015-05-31, 16:27)smitopher Wrote: [ -> ]
(2015-05-30, 11:06)janbar Wrote: [ -> ]
(2015-05-27, 04:13)smitopher Wrote: [ -> ]2.1.1, so you can imagine my confusion.
I confirm: it is the right version for Isengard.

So the plugin in the OpenElec repository is your plugin? That would make things easy.

Yes of course it is janbar's addon (not plugin). There is currently no other mythtv addon.
@janbar

Can you do a PR or whatever is needed to get kodi-pvr/pvr.mythtv master updated to your latest version which includes protocol 86 support (needed for current 0.28pre mythbackend) on Kodi 15 Isengard.

I have been using your doityourself branch for Windows, Linux and OE (Rpi1/2), which is working great - thank you for all the hard work.

Android is another matter, as it is necessary to do a complete build from kodi source to create the apk.

I did a quick change to the kodi-android build to use your doityourself branch instead of kodi-pvr/pvr.mythtv master branch, the resulting apk works fine on my Hisense tablet (KitKat 4.4.2)

Mike
(2015-06-02, 09:48)MikeB2013 Wrote: [ -> ]@janbar

Can you do a PR or whatever is needed to get kodi-pvr/pvr.mythtv master updated to your latest version which includes protocol 86 support (needed for current 0.28pre mythbackend) on Kodi 15 Isengard.

I have been using your doityourself branch for Windows, Linux and OE (Rpi1/2), which is working great - thank you for all the hard work.

Android is another matter, as it is necessary to do a complete build from kodi source to create the apk.

I did a quick change to the kodi-android build to use your doityourself branch instead of kodi-pvr/pvr.mythtv master branch, the resulting apk works fine on my Hisense tablet (KitKat 4.4.2)

Mike
Thanks Mike. I will make the PR for kodi-pvr this evening.
I'm using MythBack 27.4 (i think this is the most stable release), on Ubuntu 14.04 LTS also using Kodi Helix (14.2). I have a Quad PCIe tuner (TBS6905). I’m currently using the "default" Myth Add-on that’s available in the main Kodi Repo I think the version is 1.12.6 (?? off the top of my head) .

I seem to be having numerous issue (various issue that have already been mentioned through out this post), some i have fixed e.g. by Enable demuxing MPEG-TS (beforehand I had playback issues & time shift wasn't that smooth).

However my number one issue appears to be when either a recording has taken place or is taking place. I either get really long channel changes (~ 20 sec) or the "channel not available" message, also when I’ve been watching a channel, and a recording starts (using the same channel that I’m watching). Live TV stops and i full back to the channel guide/selector... and then it's pretty much impossible to watch Live TV with out a reboot (my backend & client are on the same box).

I've been reading through the ~60 pages of this post (over several days! and apologies if i have missed the answer anywhere!) …
My understanding is that this Add-on is now on version 2.1.1 (looking at the couple of post above). Before I start posting logs etc., I’m keen to understand that I’m using the most approiate add-on.

What's the most appropriate version add-on i should be using for Kodi 14.2? Can/Should i upgrade (build/configure) the latest add-on version and still use Helix? Are the above issues common? Should i just wait for Isengard stable to be released? sorry for the questions, any assistance gratefully received!
@AshG

1.12.6 is very old, latest version is 1.12.20 for Helix (Kodi 14.2)

As you are on Ubuntu, you can get the latest version from http://janbar.github.io/pvr.mythtv/ see Ubuntu section of the latest downloads section.

Mike
@MikeB2013 - thanks, that's reassuring (that there's a newer version that i can try), will give it a bash tonight...
Hi Janbar,

Thanks for looking at this.

I have a single machine, contains mythfrontend/mythbackend/kodi

At some point I moved to this machine, so there may be some recordings from the previous machine.
However the mythweb recordings without a thumbnail go from jan to apr 7 2015, so could all have been on this machine.
These recordings can be played successfully so are readable.

Questions:
Is there any way to relate the listed preview eg: 2585_1427763600_000 back to the actual recording?
Is the issue related to http://xbmc:6544 rather than http://kodi:6544 ? It should not redirect, as there is only one backend.

Thanks