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)



- stevellion - 2011-10-12

This is really good.

My logic says if you can work with dtierney a bit to group the recordings differently, then can't we push it into the xbmc master?


- dubstar_04 - 2011-10-12

stevellion Wrote:This is really good.

My logic says if you can work with dtierney a bit to group the recordings differently, then can't we push it into the xbmc master?

There has been quite a bit of discussion over this in the past and as you say dtierney implemented a system where everything was grouped into folders.

I personally prefer having a list of recordings by date so i can watch things back in order.

This is probably something that will need to be addressed in the pvr code rather than individual plugins, however there was some work done towards taking the pvr recordings into xbmc library as recorded shows and movies.

This may be a better solution for people like yourself who like to browse the files in that way?

just a thought,

Dubstar_04


- fiveisalive - 2011-10-12

dubstar_04 Wrote:There has been quite a bit of discussion over this in the past and as you say dtierney implemented a system where everything was grouped into folders.

I personally prefer having a list of recordings by date so i can watch things back in order.

This is probably something that will need to be addressed in the pvr code rather than individual plugins, however there was some work done towards taking the pvr recordings into xbmc library as recorded shows and movies.

This may be a better solution for people like yourself who like to browse the files in that way?

just a thought,

Dubstar_04

One could maybe implement something (PVR-wide) like what Mythbox has done. It has a split screen, the top pane has "All recordings" and then a list of programs. The bottom pane is the episodes. So when you highlight All recordings", all episodes (in reverse date order) appear in the bottom pane, then if you highlight a show, it filters the bottom pane to only show episodes for that program. It's a bit clunky but it works.

I think having this feature should be in addition to having the ability to "import/view" the episodes in the TV/Movies library. I like to keep the recorded TV separate from my library, unless I explicitly want to import an episode to the Library (in which I'd also want to trim out the commercials and/or transcode them to save space). Anyway this is a bit off-topic now, so I'll stop.


- stevellion - 2011-10-12

OK - here's what I mean, which I think serves both of us.

This screenshot is just from the myth:// source, just under Video. It shows "All Recordings", which are in date order, and also "TV Shows" which groups into shows.

As I have about 115 episodes of Peppa Pig (recorded each morning..) I want to see only the shows I'm interested in sometimes!

First screen - the views available
Image

Second screen - All recordings, in order as specified (date)
Image

Third screen - All Shows, but no episodes.
Image


- fiveisalive - 2011-10-13

OK, pulled down git and built tsp's pvr client branch. Recordings seem to work well. The main issues for me are related to Live TV:

1. There appears to be some issues with the channel numbers. I noticed something similar with dteirney's plugin too. I have a cable connection from which I get local unencrypted (i.e. "clear") QAM channels. The myth backend, however, uses the subchannel notation when scanning and adding the channels (i.e. "2.1" for WGBH for example, see my posts on this thread, starting at page 42 or so: http://forum.xbmc.org/showthread.php?tid=82015&page=42 ).

The PVR plugin does not appear to like it, and it appears to wrongly assign the channels. (i.e. it rounds "2.1" to "2", but when I try to play that channel, it's the wrong channel). This might be a PVR-wide issue, not just mythtv.

2. Sometimes (because of the wrong channel assignments), it attempts to play a "hidden" channel (at least hidden by me in the mythtv backend, because it was probably encrypted). When it tries to play some of these channels, it simply hangs, but pressing "stop" doesn't return back to the interface, it gets stuck and I have to manually kill xbmc.

Some other issues I noticed:

The interface pops up with "Next recording start time" timer event for a program that ended in 2010, in the popup on the main screen. It doesn't appear to check whether the program is actually in the future. (Again could be a PVR-wide bug).


- stevellion - 2011-10-13

mronkko Wrote:How do I enable the extra debug information?

The record plays fine. Just seeking forward causes the player to exit.

BTW - I too had this problem using MythBox.. but since using the Mainline xbmc with the myth:// source, it's not a problem at all.

Just that the plain myth:// video source doesn't have all the cool things this does Smile - it's just very stable.

I tried last night switching to tsp's build, but there is at least 1 issue that's been since fixed in mainline. (I had a kind of picture tear on the thumbnails, on full screen, with VDPAU (My laptop doesn't run VDPAU, but HTPC does...)


- stevellion - 2011-10-13

One thing I particularly like - is the fact that this new plugin/module has split out the Radio Channels, from the TV Channels.

However, it's highlighted that I've got an issue on the backend somewhere, because it only picks up 6 radio channels, but there are 15 others still listed in the TV Channels.

I've been looking in my mythconverg database to try and figure out what it uses to identify correctly some of the channels, but I haven't found it yet.

Can someone help? : How does this module identify if a channel is TV or Radio?

Thanks!


- stevellion - 2011-10-13

I've got it - looked at the source ;-)

FYI - in the table channelscan_channel, it looks at 'is_audio_service' ...

Interesting as 'most' of my radio channels are not identified this way.
Time for some more SQL in my UK channel adjustments script Smile


- stevellion - 2011-10-13

fiveisalive Wrote:OK, pulled down git and built tsp's pvr client branch. Recordings seem to work well. The main issues for me are related to Live TV:

1. There appears to be some issues with the channel numbers. I noticed something similar with dteirney's plugin too. I have a cable connection from which I get local unencrypted (i.e. "clear") QAM channels. The myth backend, however, uses the subchannel notation when scanning and adding the channels (i.e. "2.1" for WGBH for example, see my posts on this thread, starting at page 42 or so: http://forum.xbmc.org/showthread.php?tid=82015&page=42 ).

The PVR plugin does not appear to like it, and it appears to wrongly assign the channels. (i.e. it rounds "2.1" to "2", but when I try to play that channel, it's the wrong channel). This might be a PVR-wide issue, not just mythtv.

fiveisalive : is this something that could be resolved/worked around, by renumbering the channel number is the myth database? I've just started doing that via a script now, to get the UK channels in the right order - so if your existing channel numbers are 'unusual' perhaps you can just normalise them? Here's a link to the UK channel wiki - which might be relevant as a kind of guide... http://www.mythtv.org/wiki/UK_Channel_Assignments


- tsp42 - 2011-10-14

I've updated the timer code. Now the old timers should no longer pop up as upcoming recordings. Manual added timers and repeating timers should also work now.

I've also uploaded a new windows build here:
http://www.megaupload.com/?d=FDBZPCGS

mronkko: The extra debug information can be enabled in the add-on configuration (It may require a restart of XBMC to take effect).
Image
The resulting log file should contain a lot of lines similar to this:

22:31:50 T:6072 DEBUG: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_conn_connect_ctrl: connecting control connection

stevellion: I will add the episode view to the Wishlist. It may take a while to implement however. Please let me know if you discover another way of distinguishing between tv and radio channels in the mythtv sql database so I can add it to the plugin (As I've only tested it with DVB-C).

fiveisalive: I didn't notice that MythTV saved the channel number as a string and not as a number . As other have mentioned XBMC PVR only support integers as channel numbers but I should be able to map the subchannel numbers to some unused channel numbers in XBMC PVR. It will however require some changes in the libcmyth code but it should be doable.


- fiveisalive - 2011-10-14

tsp42 Wrote:I've updated the timer code. Now the old timers should no longer pop up as upcoming recordings. Manual added timers and repeating timers should also work now.

fiveisalive: I didn't notice that MythTV saved the channel number as a string and not as a number . As other have mentioned XBMC PVR only support integers as channel numbers but I should be able to map the subchannel numbers to some unused channel numbers in XBMC PVR. It will however require some changes in the libcmyth code but it should be doable.

Great!

I have a few things I'm still a little confused about (and this probably also relevant for other PVR addons):

1.The relationship between the various options for getting the channel information from the PVR backend is not obvious to me. I don't have my machine in front of me, but from memory it has something like:

- use channel group from backend
- keep channel order from backend
- something else ...?

What is the optimal combination of options to use in order to have a view that corresponds as close as possible to that you would get in the mythfrontend?

2. Does the "reset PVR database" reset the MythTV database in the backend (i.e. clear all recordings, guide data etc.)? or does this just clear the cached information in XBMC. I'm a little unclear as to when you would want to use this.

3. Does the "scan for channels" do effectively the same things as the mythsetup? I didn't want to try in case it was going to step all over my myth configuration.

4. Relationship of EPG data to TV guide data in the backend: does the EPG data refer to the EIT encoded in the actual TV signal, or does it mean the MythTV TV guide data (e.g. from SchedulesDirect)?

Probably a lot of the confusion is that PVR infrastructure was developed using TVHead as the reference plugin and hence the terminology is a little different. (e.g. "timer" versus "schedule"). I tried to find some docs on the wiki that might outline the meaning of all the options in the PVR interface, but the closest I got was:

http://wiki.xbmc.org/index.php?title=HOW-TO:Watch_TV_in_XBMC

Which doesn't really have a description of the various options and how they are supposed to work and/or interact.


- robweber - 2011-10-14

fiveisalive Wrote:Great!

I have a few things I'm still a little confused about (and this probably also relevant for other PVR addons):

1.The relationship between the various options for getting the channel information from the PVR backend is not obvious to me. I don't have my machine in front of me, but from memory it has something like:

- use channel group from backend
- keep channel order from backend
- something else ...?

What is the optimal combination of options to use in order to have a view that corresponds as close as possible to that you would get in the mythfrontend?

2. Does the "reset PVR database" reset the MythTV database in the backend (i.e. clear all recordings, guide data etc.)? or does this just clear the cached information in XBMC. I'm a little unclear as to when you would want to use this.

3. Does the "scan for channels" do effectively the same things as the mythsetup? I didn't want to try in case it was going to step all over my myth configuration.

4. Relationship of EPG data to TV guide data in the backend: does the EPG data refer to the EIT encoded in the actual TV signal, or does it mean the MythTV TV guide data (e.g. from SchedulesDirect)?

I don't know for certain but I'll try to explain some of the options as I've understood them.

The channel options bascially allow you to either use the channels and groups as you'v set them up in the pvr backend (if the pvr addon implements this I'm guessing) or using the xbmc channel manager you can create your own channel orders and groups.

Resetting the PVR or EPG database only resets what XBMC has pulled from your backend.

Scanning for channels just prompts the XBMC addon to scan for channels from the backend database. It isn't like mythsetup where it looks for channels from the source.

EPG data in XBMC refers to the guide data it is pulling from the backend.

It helps if you think of XBMC as a client, you can view info from the backend but none of the settings should change things on the backend (except for scheduling of course!). The idea is to let the backend do all the work and only have XBMC display information.

If anyone has any better info on the exact nature of the settings feel free to correct me, I haven't taken the time to read through the pvr code and double check this but based on what I've read in other PVR threads in the past this seems right.


- fiveisalive - 2011-10-14

Master of tsp branch doesn't currently compile:

Code:
CPP     pvrclient-mythtv.o
pvrclient-mythtv.cpp: In member function ‘PVR_ERROR PVRClientMythTV::GetEPGForChannel(PVR_HANDLE_STRUCT*, const PVR_CHANNEL&, time_t, time_t)’:
pvrclient-mythtv.cpp:232: warning: comparison between signed and unsigned integer expressions
pvrclient-mythtv.cpp: In member function ‘PVR_ERROR PVRClientMythTV::GetTimers(PVR_HANDLE_STRUCT*)’:
pvrclient-mythtv.cpp:398: warning: comparison between ‘enum MythTimer::TimerType’ and ‘enum TimerType’
pvrclient-mythtv.cpp:406: warning: comparison between ‘enum MythTimer::TimerType’ and ‘enum TimerType’
pvrclient-mythtv.cpp:414: warning: comparison between ‘enum MythTimer::TimerType’ and ‘enum TimerType’
pvrclient-mythtv.cpp:420: warning: comparison between ‘enum MythTimer::TimerType’ and ‘enum TimerType’
pvrclient-mythtv.cpp:420: warning: comparison between ‘enum MythTimer::TimerType’ and ‘enum TimerType’
pvrclient-mythtv.cpp:420: warning: comparison between ‘enum MythTimer::TimerType’ and ‘enum TimerType’
pvrclient-mythtv.cpp:420: warning: comparison between ‘enum MythTimer::TimerType’ and ‘enum TimerType’
pvrclient-mythtv.cpp: In member function ‘PVR_ERROR PVRClientMythTV::AddTimer(const PVR_TIMER&)’:
pvrclient-mythtv.cpp:462: error: no matching function for call to ‘MythDatabase::FindProgram(const time_t&, const int&, CStdString, NULL)’
cppmyth.h:190: note: candidates are: bool MythDatabase::FindProgram(time_t, int, CStdString&, MythProgram*)
pvrclient-mythtv.cpp: In member function ‘PVR_ERROR PVRClientMythTV::UpdateTimer(const PVR_TIMER&)’:
pvrclient-mythtv.cpp:501: error: no matching function for call to ‘MythDatabase::FindProgram(const time_t&, const int&, CStdString, NULL)’
cppmyth.h:190: note: candidates are: bool MythDatabase::FindProgram(time_t, int, CStdString&, MythProgram*)
make: *** [pvrclient-mythtv.o] Error 1



- fiveisalive - 2011-10-14

robweber Wrote:....

It helps if you think of XBMC as a client, you can view info from the backend but none of the settings should change things on the backend (except for scheduling of course!). The idea is to let the backend do all the work and only have XBMC display information.

....

Great. That's more or less as I understood it would probably be, but I didn't want to go experimenting with the options until I had a decent idea of what they were going to do with the backend. Have you actually tried the "reset" option to double check?


- dubstar_04 - 2011-10-14

tsp42,

i'm getting a compile error using the latest fix:

http://paste.ubuntu.com/707741/

Thanks,

Dubstar_04