Kodi Community Forum
New MythTV add-on using libcmyth - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+---- Forum: PVR (https://forum.kodi.tv/forumdisplay.php?fid=136)
+---- Thread: New MythTV add-on using libcmyth (/showthread.php?tid=110694)



RE: New MythTV add-on using libcmyth - zarac - 2012-11-13

Hello, I'm a long time reader but first time posting in this thread.

About a month ago I setup my htpc on ubuntu 12.04 32-bit.
As tvheadend (which I prefer) doesn't want to scan channels with my usb dvb-t card (avermedia h830) I decided to use MythTV as backend (2:0.25.2+fixes.20120802.46cab93-0ubuntu1).
I installed xbmc from ppa:nathan-renniewaldock/xbmc-nightly and compiled pvr.mythtv.cmyth as per instructions on the wiki.

I have been updating xbmc daily and everything worked great until today (2:11.9.7~git201211122010~a6f70e2-1~ppa1~precise).
When I click on LiveTV i get "No PVR clients have been started yet" error.
First I tried starting mythfrontend and it worked just fine, then I checked my mythtv settings in xbmc and after realising everything should work I fetched and compiled plugin sources again hoping some changes in the repository will magically "make it work."

It didn't help, so I went through the xbmc log and noticed some PVR errors:
Code:
15:27:34 T:2891967296  NOTICE: PVRManager - starting up
15:27:34 T:2883574592  NOTICE: Thread PVR manager start, auto delete: false
15:27:34 T:2875181888  NOTICE: Thread PVR add-on updater start, auto delete: false
15:27:34 T:3036555008  NOTICE: initialize done
15:27:34 T:3036555008  NOTICE: Running the application...
15:27:34 T:2857712448  NOTICE: Thread XBPyThread start, auto delete: false
15:27:34 T:2980485952  NOTICE: -->Python Interpreter Initialized<--
15:27:34 T:2866105152  NOTICE: Thread CVideoInfoScanner start, auto delete: false
15:27:34 T:2875181888   ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_conn_connect: asked for version 8, got version 72
15:27:34 T:2875181888   ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_conn_connect: asked for version 72, got version 72
15:27:34 T:2875181888   ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_conn_connect: asked for version 8, got version 72
15:27:34 T:2875181888   ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_conn_connect: asked for version 72, got version 72
15:27:34 T:2857712448  NOTICE: -->Python Interpreter Initialized<--
15:27:34 T:2875181888   ERROR: PVR - Add-on 'unknown' is using an incompatible API version. Please contact the developer of this add-on: Christian Fetzer, Jean-Luc Barrière, Tonny Petersen

Tried deleting Addons15.db, Epg7.db and TV22.db but it didn't help.

Is there anything else I can do?

Thanks for your time,
Zarac

p.s.
I'll attach my xbmc log just in case it helps - http://xbmclogs.com/show.php?id=14419
I haven't posted debug log as it is quite big (around 40mb) but if it helps I can post that as well.


EDIT:
Sorry, I just read the past few pages and realised xbmc was not updating mythtv pvr plugin to 0.5.
I simply deleted the plugin from .xbmc/addons, its package from .xbmc/addons/packages and plugin userdata from .xbmc/userdata/addon_data. Reinstalled it from the newly compiled zip and now everything works again.
Was xbmc supposed to auto-update the plugin to 0.5 since it is now added to official repository?
After deleting the 0.4 version I tried to install 0.5 via official repository, but could not find the plugin there.


RE: New MythTV add-on using libcmyth - tdavis - 2012-11-13

(2012-11-13, 07:53)fiveisalive Wrote:
(2012-11-13, 07:30)tdavis Wrote: I've built a version for Fedora 17, using modified version of the Frodo alpha rpm for F18, that simply does two git clones (one on xbmc git, the other on pvr git).. If there is interest, I can try to find a place to drop for use.. I am 100% sure I'm not doing this right, but it makes it easy to remove/re-install on my frontends this way.

I also had to disable Pulseaudio in it to get it work on one of my systems.

If you make changes to the XBMC spec file, would be great if you could post a link to the diffs against the Fedora/RPM Fusion git repo for the XBMC package that I co-maintain:

http://fedorapeople.org/cgit/alexlan/public_git/xbmc-rpm.git/

We ultimately plan to package the PVR add-ons + XBMC core from one SRPM that contains the 2 tarballs.

I'll work on that.. Most of the changes where really quite minor, and changes to the script to create a single tarball, I had to create a minor patch to get pulse to compile in (which they have now fixed), and then to find out pulse couldn't find the proper audio out..





RE: New MythTV add-on using libcmyth - dubstar_04 - 2012-11-13


Search function bug:
When i try to search tv listings using the built-in function the ui jumps to the channels page.

is this a known bug?

Log:

http://paste.ubuntu.com/1356126/



RE: New MythTV add-on using libcmyth - fetzerch - 2012-11-13

For me the search doesn't find anything. But actually I didn't even know that this existed :-)
Anyway jumping to the channel list shound like this issue here: https://github.com/xbmc/xbmc/pull/1702

After fixing the search ( https://github.com/xbmc/xbmc/pull/1778 ) I can confirm that https://github.com/xbmc/xbmc/pull/1702 fixes the issue with jumping to the channel page.

Cheers,
Christian


RE: New MythTV add-on using libcmyth - fiveisalive - 2012-11-14

(2012-11-13, 20:35)tdavis Wrote:
(2012-11-13, 07:53)fiveisalive Wrote:
(2012-11-13, 07:30)tdavis Wrote: I've built a version for Fedora 17, using modified version of the Frodo alpha rpm for F18, that simply does two git clones (one on xbmc git, the other on pvr git).. If there is interest, I can try to find a place to drop for use.. I am 100% sure I'm not doing this right, but it makes it easy to remove/re-install on my frontends this way.

I also had to disable Pulseaudio in it to get it work on one of my systems.

If you make changes to the XBMC spec file, would be great if you could post a link to the diffs against the Fedora/RPM Fusion git repo for the XBMC package that I co-maintain:

http://fedorapeople.org/cgit/alexlan/public_git/xbmc-rpm.git/

We ultimately plan to package the PVR add-ons + XBMC core from one SRPM that contains the 2 tarballs.

I'll work on that.. Most of the changes where really quite minor, and changes to the script to create a single tarball, I had to create a minor patch to get pulse to compile in (which they have now fixed), and then to find out pulse couldn't find the proper audio out..

Thanks! Ken (the other maintainer working on packaging for Fedora/RPM Fusion) just updated that git repo to alpha7, so you might want to check what he changed. There were a few patches we could drop and one that we had to add.



RE: New MythTV add-on using libcmyth - schmoko - 2012-11-14

(2012-11-13, 05:14)janbar Wrote: @all

Release 0.5.0 and the new adjustment of buffer size: Since 0.5.0 the buffer size has no fixed size to avoid stop show from backend.

When the tune of channel is bad sometime mythtv skip lot of frames. Because we requested to much before the backend stopped all (it is a rule in mythtv), we have limited the buffer size in these critical situations. But when situation become normal the buffer size is enlarged.like before.
The algorythm could be reviewed if you have to many problems with that. Let me know.

I done lot of test using a network over power line (4~5 Mbytes max (model 200Mb) ) and HD stream run well (1080i) but if you have other network traffic that would break the stream because HD stream need 4.5MBytes.

So prefer gigabyte network for HD stream.

br

Thanks for the explanation janbar, and for all your hard work.

1080i playback has never been an issue on my network, and still is not with tvheadend or earlier myth revisions. Requiring a gigabit connection for what should be a fairly low bandwidth stream seems excessive. Is it possible the new algorithm is too aggressive in reducing the buffer size, or is starving the buffer unnecessarily?

Are there a specific set of commits I can look at? I'm assuming the fixes marked "Protocol Improvements" would be a good place to start.


RE: New MythTV add-on using libcmyth - janbar - 2012-11-15

(2012-11-14, 19:17)schmoko Wrote:
(2012-11-13, 05:14)janbar Wrote: @all

Release 0.5.0 and the new adjustment of buffer size: Since 0.5.0 the buffer size has no fixed size to avoid stop show from backend.

When the tune of channel is bad sometime mythtv skip lot of frames. Because we requested to much before the backend stopped all (it is a rule in mythtv), we have limited the buffer size in these critical situations. But when situation become normal the buffer size is enlarged.like before.
The algorythm could be reviewed if you have to many problems with that. Let me know.

I done lot of test using a network over power line (4~5 Mbytes max (model 200Mb) ) and HD stream run well (1080i) but if you have other network traffic that would break the stream because HD stream need 4.5MBytes.

So prefer gigabyte network for HD stream.

br

Thanks for the explanation janbar, and for all your hard work.

1080i playback has never been an issue on my network, and still is not with tvheadend or earlier myth revisions. Requiring a gigabit connection for what should be a fairly low bandwidth stream seems excessive. Is it possible the new algorithm is too aggressive in reducing the buffer size, or is starving the buffer unnecessarily?

Are there a specific set of commits I can look at? I'm assuming the fixes marked "Protocol Improvements" would be a good place to start.
Hi,
Yes you are right, today algorythm is very aggressive to avoid any stop show. We must to find the good average but without too many calculation (cpu is not cheap). Smile



RE: New MythTV add-on using libcmyth - richardambridge - 2012-11-15

Thanks for all the excellent work on getting mythtv as a backend to work with XBMC. I currently use it with OpenElec and it is getting better every day..

Some points:- (I'm using the default confluence skin, git addon and openelec) I expect some of these are not cMyth addon bugs, please let me know where I should log the issues..

* In LiveTv->Recordings
** is there anyway to sort by date? So the latest recordings are at the top?
** Any plans to integrate the Recordings screen with the media scrapers that are used in TV Shows?
** How do I delete a recording in the Recordings list?
** When I go into recordings, and then select a show subdirectory, there is no ".." entry to go back a level

* LiveTV -> EPG
** When I go into the EPG, if I select a show I get the window with program info, "Switch", "Record" "Ok", Please can there by an option to change this so that Switch is the default button
** When I switch and watch a program, when I stop and it returns to the EPG, but it goes back to the top of the list (channel 1)

* LiveTV -> Watching
** While watching live tv, if I get the menu up and move to the 'Rec' button and click Record, MythTV shows in Upcoming Recordings "ShowName: 1970-01-01 02:00:00" and the recording isn't in the Recordings list and it isn't recorded. I have to restart mythtv to get it cleared.


Please don't take these comments as any flame, the work is really good and appreciated, I just thought it would be good to document some of my findings.




RE: New MythTV add-on using libcmyth - raptorjr - 2012-11-15

I've enabled the PVR add-on two times, and both times i've seen a lot of messages in XBMC from the add-on that made me quit XBMC instantly. Why? Because all the messages was about "show deleted", "show cancelled" and so on. Got totally scared that the add-on had started to delete scheduled recordings and recorded programs. Don't know if i have a log saved, but has someone else noticed this? Don't think, as far as i could see, that anything actually got deleted. But it scared the sh*t out of me.


RE: New MythTV add-on using libcmyth - NewJerseyNinja - 2012-11-15

My testing of 0.5 and the xbmc nightly from your respository as of 11/14:

[1] Changing channels is noticeably faster when going from HDHR Prime to HDHR prime. It takes maybe 5 seconds now? It was taking well over 10 on 0.4

[2] No video skipping at all -- I think you were right --my low powered backend (Atom 330) may have been commercial flagging when I experienced the skipping video on version 0.4 of the cmyth addon.

[3] When I change from an HDHR Prime channel to an HDHR channel, XBMC will not change channels and will time out giving me an "unable to tune channel" error or something similar. This works pretty well in mythfrontend so I don't know what the difference is?

The HDHR Prime has it's own set of channels (and its own "input" source in mythbackend), and the HDHR has a different set of channels (and its own "input" source.)

Does anyone else have difficulty changing channels from one tuner to another tuner with CMYTH 0.5 addon?

Is there a way so I can group all the HDHR Prime and HDHR Channels separately?

[4] To update from 0.4 to 0.5 I had to delete it, it would not update on its own. While it's not a problem for me, it would be nice if it can eventually be made to auto-update like other xbmc addons.

[5] Although I have not yet tested this in 0.5, in 0.4 when I am watching a previously recorded show, and a new recording starts, then the previously recorded show ends, XBMC shows an empty recordings list. XBMC will show all of the recordings again after the new recording finishes.

I also want to thank you for your dedicated and daily work on this project, thank you very much, my entire family uses your addon and XBMC. You should setup a page to accept donations.




RE: New MythTV add-on using libcmyth - richardk - 2012-11-15

I was showing this to my wife this morning. She likes it!

But she noticed that in the context menu for recorded episodes, there's a "Delete" option but no "Delete and Re-record" option. We sometimes use that option when a program did nto record properly the first time.

Is that going to be added?


RE: New MythTV add-on using libcmyth - fetzerch - 2012-11-15

(2012-11-15, 11:07)richardambridge Wrote: * In LiveTv->Recordings
** is there anyway to sort by date? So the latest recordings are at the top?
Can be set up in the context menu of the recordings view

(2012-11-15, 11:07)richardambridge Wrote: ** Any plans to integrate the Recordings screen with the media scrapers that are used in TV Shows?
That should be doable already. You can add a source in the video menu for recordings and setup a scraper on it.
Though, I haven't tried it myself yet.

(2012-11-15, 11:07)richardambridge Wrote: ** How do I delete a recording in the Recordings list?
Also in the context menu of the recordings view

(2012-11-15, 11:07)richardambridge Wrote: ** When I go into recordings, and then select a show subdirectory, there is no ".." entry to go back a level
Use the back button on the remote. It's a global setting somewhere in xbmc to show ".." or not.

(2012-11-15, 11:07)richardambridge Wrote: * LiveTV -> EPG
** When I go into the EPG, if I select a show I get the window with program info, "Switch", "Record" "Ok", Please can there by an option to change this so that Switch is the default button
I think that's not possible at the moment

(2012-11-15, 11:07)richardambridge Wrote: ** When I switch and watch a program, when I stop and it returns to the EPG, but it goes back to the top of the list (channel 1)
known issue in xbmc: https://github.com/xbmc/xbmc/pull/1702

(2012-11-15, 11:07)richardambridge Wrote: * LiveTV -> Watching
** While watching live tv, if I get the menu up and move to the 'Rec' button and click Record, MythTV shows in Upcoming Recordings "ShowName: 1970-01-01 02:00:00" and the recording isn't in the Recordings list and it isn't recorded. I have to restart mythtv to get it cleared.
That sounds like an issue in our addon. Can you create a ticket here: https://github.com/fetzerch/xbmc-pvr-addons/issues so that it doesn't get lost.
We track only addon related issues there. Please upload a debug log on pastebin and post the link.
(2012-11-15, 14:52)raptorjr Wrote: I've enabled the PVR add-on two times, and both times i've seen a lot of messages in XBMC from the add-on that made me quit XBMC instantly. Why? Because all the messages was about "show deleted", "show cancelled" and so on. Got totally scared that the add-on had started to delete scheduled recordings and recorded programs. Don't know if i have a log saved, but has someone else noticed this? Don't think, as far as i could see, that anything actually got deleted. But it scared the sh*t out of me.

Do you see this in the log or as on screen notification? If the latter than it's harmless.
Our code only deletes recordings if you delete a recording from the context menu. And even then there's a confirmation dialog.
(2012-11-15, 15:31)NewJerseyNinja Wrote: [4] To update from 0.4 to 0.5 I had to delete it, it would not update on its own. While it's not a problem for me, it would be nice if it can eventually be made to auto-update like other xbmc addons.

It does on Windows and MacOS. For Linux we can't have it updated due to a dependency to libmyqslclient. But after Frodo is released you probably get updates via your linux distribution's package management.
Not nice, but not much we can do about this at the moment.

(2012-11-15, 15:31)NewJerseyNinja Wrote: [5] Although I have not yet tested this in 0.5, in 0.4 when I am watching a previously recorded show, and a new recording starts, then the previously recorded show ends, XBMC shows an empty recordings list. XBMC will show all of the recordings again after the new recording finishes.

This should work again in 0.5.

Don't have an answer to your other questions but I think janbar might help Smile


RE: New MythTV add-on using libcmyth - fetzerch - 2012-11-15

(2012-11-15, 17:12)richardk Wrote: But she noticed that in the context menu for recorded episodes, there's a "Delete" option but no "Delete and Re-record" option. We sometimes use that option when a program did nto record properly the first time.
Is that going to be added?

I fear this is currently not possible. It has to be implemented in xbmc's pvr code so that we have it for all addons. (but that's possible only after frodo is out).
Maybe you can create a feature request for xbmc. In the forum in either PVR or feature request category.
Thus currently everyone is busy with frodo and it might get lost easily...


RE: New MythTV add-on using libcmyth - richardk - 2012-11-15

(2012-11-15, 20:50)cfetzer Wrote:
(2012-11-15, 17:12)richardk Wrote: But she noticed that in the context menu for recorded episodes, there's a "Delete" option but no "Delete and Re-record" option. We sometimes use that option when a program did nto record properly the first time.
Is that going to be added?

I fear this is currently not possible. It has to be implemented in xbmc's pvr code so that we have it for all addons. (but that's possible only after frodo is out).
Maybe you can create a feature request for xbmc. In the forum in either PVR or feature request category.
Thus currently everyone is busy with frodo and it might get lost easily...

Just did.

http://forum.xbmc.org/showthread.php?tid=145284

Thanks!




RE: New MythTV add-on using libcmyth - richardambridge - 2012-11-15

(2012-11-15, 20:28)cfetzer Wrote: [quote='richardambridge' pid='1238642' dateline='1352970465']
* In LiveTv->Recordings
** is there anyway to sort by date? So the latest recordings are at the top?
Can be set up in the context menu of the recordings view



Ahha, this is my issue. I'm using CEC and Samsung remote, and I can't get the context Menu up. It works on normal xbmc on my desktop.

I do have a keymap:
<keymap>
<global>
<remote>
<red>Delete</red>
<green>XBMC.CleanLibrary(video)</green>
<yellow>ContextMenu</yellow>
<blue>ToggleWatched</blue>
</remote>
</global>
</keymap>

and Yellow should be mapped to ContextMenu..

If I go into TV Shows, and select a video and press yellow I get the context Menu...

18:15:17 T:140276853110528 DEBUG: PushCecKeypress - received key a7 duration 347
18:15:18 T:140276853110528 DEBUG: CecLogMessage - >> 01:44:74
18:15:18 T:140276853110528 DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): user control pressed (44)
18:15:18 T:140276853110528 DEBUG: CecLogMessage - key pressed: F4 (yellow) (74)
18:15:18 T:140276853110528 DEBUG: PushCecKeypress - received key fd duration 0
18:15:18 T:140277124302656 DEBUG: OnKey: 253 (fd) pressed, action is ContextMenu


but in recordings, if i press yellow:

18:11:13 T:140277124302656 DEBUG: CGUIMediaWindow::GetDirectory (pvr://recordings/Default/The Simpsons/)
18:11:13 T:140277124302656 DEBUG: ParentPath = [pvr://recordings/]
18:11:13 T:140275861100288 DEBUG: CPVRDirectory::GetDirectory(pvr://recordings/Default/The Simpsons)
18:11:13 T:140276853110528 DEBUG: CecLogMessage - >> 01:45
18:11:13 T:140276853110528 DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): user control release (45)
18:11:13 T:140276853110528 DEBUG: CecLogMessage - key released: select (0)
18:11:13 T:140276853110528 DEBUG: PushCecKeypress - received key b duration 237
18:11:14 T:140276853110528 DEBUG: CecLogMessage - >> 01:44:02
18:11:14 T:140276853110528 DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): user control pressed (44)
18:11:14 T:140276853110528 DEBUG: CecLogMessage - key pressed: down (2)
18:11:14 T:140276853110528 DEBUG: PushCecKeypress - received key a7 duration 0
18:11:14 T:140277124302656 DEBUG: OnKey: 167 (a7) pressed, action is Down
18:11:14 T:140276853110528 DEBUG: CecLogMessage - >> 01:45
18:11:14 T:140276853110528 DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): user control release (45)
18:11:14 T:140276853110528 DEBUG: CecLogMessage - key released: down (2)
18:11:14 T:140276853110528 DEBUG: PushCecKeypress - received key a7 duration 234
18:11:16 T:140276853110528 DEBUG: CecLogMessage - >> 01:44:74
18:11:16 T:140276853110528 DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): user control pressed (44)
18:11:16 T:140276853110528 DEBUG: CecLogMessage - key pressed: F4 (yellow) (74)
18:11:16 T:140276853110528 DEBUG: PushCecKeypress - received key fd duration 0
18:11:16 T:140277124302656 DEBUG: OnKey: 253 (fd) pressed, action is Yellow
18:11:16 T:140276853110528 DEBUG: CecLogMessage - >> 01:45
18:11:16 T:140276853110528 DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): user control release (45)
18:11:16 T:140276853110528 DEBUG: CecLogMessage - key released: F4 (yellow) (74)
18:11:16 T:140276853110528 DEBUG: PushCecKeypress - received key fd duration 445

seems that the remote keybindings aren't working here. I'll log an issue.. This addon, or Frodo?