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

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: PVR Development (/forumdisplay.php?fid=136)
+--- Thread: New MythTV add-on using libcmyth (/showthread.php?tid=110694)



- Robotica - 2012-02-28 02:32

KeithLM Wrote:OK, thanks. I've commented out the two pieces of code that add in the ": subtitle" and have rebuilt it. I will try in a few hours and see what happens.

I'll look into phpMyAdmin. I've been looking for some way to snoop around in mysql ever since I moved my XBMC data into there.

Navicat is also a very good option to use. Better GUI and easier doing more stuff.


- KeithLM - 2012-02-28 03:11

Well I just tried a few shows, and it still has problems. Now there is no subtitle, which is expected. I set up two recordings on Cartoon network, from XBMC it shows in the Scheduled Recordings as being on "257 Cartoon Network" whereas when scheduled in Myth it's "257 TOON". Similarly another show I tried had a different channel name, but the ID is fine.

Code:
| recordid | type | chanid | starttime | startdate  | endtime  | enddate    | title                                          | subtitle     | description | category        | profile      | recpriority | autoexpire | maxepisodes | maxnewest | startoffset | endoffset | recgroup | dupmethod | dupin | station        | seriesid   | programid      | search | autotranscode | autocommflag | autouserjob1 | autouserjob2 | autouserjob3 | autouserjob4   | findday  | findtime | findid | inactive | parentid   | transcoder | playgroup | prefinput | next_record         | last_record         | last_delete         | storagegroup | avg_delay |
|       50 |    1 |   1257 | 20:00:00  | 2012-02-27 | 20:30:00 | 2012-02-27 | King of the Hill                               |                          | |                 | Default      |          46 |          0 |           0 |      0 |           2 |         2 | Default  |         6 |    15 | Cartoon Network   |            |                |      0 |             0 |    0 |            0 |            0 |            0 |            0 |       0 | 20:00:00 | 734925 |        0 |        0 |          0 | Default   |    0 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | Default      |       100 |
|       51 |    1 |   1257 | 20:30:00  | 2012-02-27 | 21:00:00 | 2012-02-27 | King of the Hill                               | Maid in Arlen            | | Sitcom          | Default      |           0 |          1 |           0 |      0 |           0 |         0 | Default  |         6 |    15 | TOON              | EP00207002 | EP002070020152 |      0 |             1 |    1 |            1 |            0 |            0 |            0 |       2 | 20:30:00 | 734925 |        0 |        0 |         27 | Default   |    0 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | Default      |       100 |

|       49 |    1 |   1511 | 19:00:00  | 2012-02-27 | 19:30:00 | 2012-02-27 | How I Met Your Mother                          |                           | |                 | Default      |          46 |          0 |           0 |      0 |           2 |         2 | Default  |         6 |    15 | KTVTDT (KTVT-DT)  |            |                |      0 |             1 |    1 |            1 |            0 |            0 |            0 |       0 | 19:00:00 | 734925 |        0 |        0 |         27 | Default   |    0 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | Default      |       100 ||
|       52 |    1 |   1511 | 19:30:00  | 2012-02-27 | 20:00:00 | 2012-02-27 | 2 Broke Girls                                  | And the One-Night Stands | | Sitcom          | Default      |           0 |          1 |           0 |      0 |           0 |         0 | Default  |         6 |    15 | KTVTDT            | EP01419872 | EP014198720018 |      0 |             1 |    1 |            1 |            0 |            0 |            0 |       2 | 19:30:00 | 734925 |        0 |        0 |         27 | Default   |    0 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | Default      |       100 |

49 and 50 were made from XBMC, the other two from mythfrontend. seriesid and programid are missing, and all the post processing jobs are set to 0. I'll poke around in the code some after dinner to see if there's something else that I can figure out.


- KeithLM - 2012-02-28 08:35

I tried working with the code some and have gotten myself into a weird state. In order to determine which function affected the data sent to MythTV, I altered the strings for plot to identify which function set them. After testing that and determining which function was which, I went and changed them back, but XBMC keeps showing me my test strings. I've recompiled multiple times, and can't get them to switch back. Is there some buffer that epg data is stored in?

Nevermind, found it. I located Epg7.db and have deleted it.


- Jimmer - 2012-02-28 10:33

KeithLM Wrote:I tried working with the code some and have gotten myself into a weird state. In order to determine which function affected the data sent to MythTV, I altered the strings for plot to identify which function set them. After testing that and determining which function was which, I went and changed them back, but XBMC keeps showing me my test strings. I've recompiled multiple times, and can't get them to switch back. Is there some buffer that epg data is stored in?

Nevermind, found it. I located Epg7.db and have deleted it.

Just a thought, but did you consider a corrupted epg7.db might have caused your problem in the first place? I wonder now that you have deleted it and forced xbmc to re-build it, that your problem might actually be solved.

Just for disclosure, I have built every commit that tsp has made and I have never had this specific problem (even in the earlier days when things were ropier). So I wondered what was specific to your install/enviroment?


- KeithLM - 2012-02-28 16:44

Jimmer Wrote:Just a thought, but did you consider a corrupted epg7.db might have caused your problem in the first place? I wonder now that you have deleted it and forced xbmc to re-build it, that your problem might actually be solved.

Just for disclosure, I have built every commit that tsp has made and I have never had this specific problem (even in the earlier days when things were ropier). So I wondered what was specific to your install/enviroment?

Well I'm still having the problem. And my initial test yesterday was with a fresh epg7.db since the title/subtitle data changed. I'm curious to see what a valid recording from xbmc looks like in Myth's database. If you wouldn't mind dumping some data that would be helpful. I'm using version 0.24 of Myth pulled from whatever ppa's were provided in my Ubuntu 11.10 install. So I don't know if that makes a difference as to what data is required. And perhaps there's an option in Myth that sets it to be extra picky about program data. After all, channel, plus start time, plus end time should really do it.

As far as the code, I can now tell that PVRClientMythTV::GetEPGForChannel is being used to populate epg7.db, and while that was adding the subtitle to the name, I can't be certain that was a problem. I have found that the seriesid variable in that function corresponds with that field in the database, I don't know what makes programid, but I'm going to try to track that down. Then if I can locate how that data is passed to Myth, if the api handles it, I'll put it in there. It's the best guess I have at the moment.


- fiveisalive - 2012-02-28 22:31

KeithLM Wrote:Well I'm still having the problem. And my initial test yesterday was with a fresh epg7.db since the title/subtitle data changed. I'm curious to see what a valid recording from xbmc looks like in Myth's database. If you wouldn't mind dumping some data that would be helpful. I'm using version 0.24 of Myth pulled from whatever ppa's were provided in my Ubuntu 11.10 install. So I don't know if that makes a difference as to what data is required. And perhaps there's an option in Myth that sets it to be extra picky about program data. After all, channel, plus start time, plus end time should really do it.

As far as the code, I can now tell that PVRClientMythTV::GetEPGForChannel is being used to populate epg7.db, and while that was adding the subtitle to the name, I can't be certain that was a problem. I have found that the seriesid variable in that function corresponds with that field in the database, I don't know what makes programid, but I'm going to try to track that down. Then if I can locate how that data is passed to Myth, if the api handles it, I'll put it in there. It's the best guess I have at the moment.

I've had success scheduling recordings with non-trivial rules via the Mythbox add-on, perhaps it might have some useful code for guiding you in terms of how to access the mythbackend from an external program. It basically uses Python to access the functionality:

https://github.com/analogue/mythbox


- tsp42 - 2012-02-28 23:13

KeithLM: I think the problem could be the wrong channel name. Try checking the channel table. It might reveal why the name is wrong. The problem with the subtitle is that there is no valid field for it in the XBMC EPG data. Try looking at the definition of the EPG_TAG in xbmc_pvr_types.h. So the mythtv addon has to translate the mythtv EPG data to xbmc epg data and the other way when xbmc schedules a recording. Most of the time it is enough if the start time title channel and date is correct for mythtv to schedule a recording.


- KeithLM - 2012-02-28 23:38

tsp42 Wrote:KeithLM: I think the problem could be the wrong channel name. Try checking the channel table. It might reveal why the name is wrong. The problem with the subtitle is that there is no valid field for it in the XBMC EPG data. Try looking at the definition of the EPG_TAG in xbmc_pvr_types.h. So the mythtv addon has to translate the mythtv EPG data to xbmc epg data and the other way when xbmc schedules a recording. Most of the time it is enough if the start time title channel and date is correct for mythtv to schedule a recording.

OK, I'll look at that, and I'll also see if I can edit the channel name in the record table and see if that changes anything.

fiveisalive, I'll see about trying that also. If I can figure out other valid examples of scheduling requests I might be able to deduce the minimal number of required fields.


- KeithLM - 2012-02-29 03:15

I entered a new recording on Cartoon Network from XBMC, then checked in MythTV and it had the error message. So I stopped the backend, edited the database directly and put in TOON, started the backend, and now it shows up in MythTV as looking good.

I'm going to look around in the database as well as MythTV and XBMC options to see if there's something that can be done about these channel names. Perhaps it's some combination of HDHomeRun Prime and Verizon FiOS that gives me two names for each channel whereas other people don't have that, and in XBMC the wrong channel name is being pulled for use in the recordings. In MythFrontend I only see the short name.

*Update* A quick look at the channel table and I see callsign and name, callsign is what should be used, name is what is being used by XBMC.


- KeithLM - 2012-02-29 07:49

This is really confusing me now. I've been doing some searching and according to what I find in the docs, recordings are done based on callsign. But libcmyth.h does not have any functions to retrieve callsigns. AddTimer() is putting in the channel name, not the callsign.

So I really don't understand how this is working for anyone, unless you have all your channel names== callsigns. I'd appreciate it if others who have this capability could look at their myth db and see what channel names and callsigns look like for them, just look in the record and channel tables to see what's there. Also, what is being displayed on xbmc in the program guide? Do you see the callsign or the channel name?

In the function PVRClientMythTV::GetEPGForChannel we do have access to the callsign. It's in MythProgram and is accessible as the variable "callsign" in the iterator. If that were stored in the EPG_TAG I think it might be accessible further down the chain of events that leads to the timer being added. I'm not sure, ultimately it needs to get to a MythTimer.