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 - allen00se - 2012-10-01

Thanks for the help guys, Ill try the deinterlace setting tonigh. It is really good to see all of this work happening.


RE: New MythTV add-on using libcmyth - Translucent - 2012-10-01

XBMC is currently hanging for me (not at home, so I don't have access to the log atm).

Current specs:
XBMC build from source last tuesday
REPO: git://github.com/xbmc/xbmc.git

CMYTH_ADDON build from source last tuesday
https://github.com/janbar/xbmc-pvr-addons.git

Running Ubuntu 12.04 64bit

Build xbmc with --enable-pulse otherwise both xbmc and the addons were build clean without any changes or configure params

The log shows (again sorry I dont have it on front of me) that the pvr addon is loading and thats it. XBMC seems to hang and I get nothing more in the log file. The log entry appears to come from xbmc/cores/DllLoader/SoLoader.cpp::Load() method right before the dlopen() method is called. I'm not sure what to add, I'm expecting to see the log lines for 1/7, 2/7, etc as it loads all its pieces. Can anyone suggest what might be causing it to hang? I haven't looked through what 1/7 is yet, is it possible it's trying to connect to mysql and failing and that is causing the hang?


RE: New MythTV add-on using libcmyth - rsennewald - 2012-10-02

Ok just built off of janpar's xbmc and xbmc-pvr-addons master branch on ubuntu 12.04. All looks good.. I think I had some environment issues I worked through, which was why I was getting errors when running the addon that I built previously from cfetzer's fork. If I recall the most current merged code from janpar, tsp and yourself is living at your fork right cfetzer? If that's the case would you mind doing a pull request to opdenkamp so we can get it merged there? Like you mentioned, I also think it'd make things a lot easier for anyone who wants to test or develop against this addon so we can all be testing and working against the same base.


RE: New MythTV add-on using libcmyth - allen00se - 2012-10-02

(2012-10-01, 16:56)Aubrien Wrote: You need to set up the SW deinterlacing in XBMC. Get playback started and open the video settings. Look for interlacing and set it to auto detect VDPAU if applicable, or just auto detect if you dont have VDPAU support. There should be a way to tell it to use that setting for every video. Note that you can only set this from the menu when the video is playing. That would look great on a CRT, but you need to deinterlace it before using a digital display.

OK help.. I started liveTV and went to video settings, but there is nothing there about interlacing!!!



RE: New MythTV add-on using libcmyth - Aubrien - 2012-10-02

@allen00se

1) Using default skin start live tv in full screen
2) Press "m" on keyboard
3) Press right arrow 5x and select the video looking icon
4) Top option is deinterlace. Select auto.
5) Next line is deinterlace method. I selected "Auto - ION optimized" since I have an ION. Select whatever is appropriate for you.

@cfetzer
@janbar

I think I got a good solution for the live tv stopping as well as the channel change delay we made an option for. For both cases the underlying issue is that we are trying to read from the stream before it has an data and we get a "Read 0 bytes!" error and playback stops. What I did was I deleted the channel change delay I had manually inserted into cfetzers code, reverting it to unchanged and changed the ReadLiveTV function to retry reading from the stream if it fails. Additionally, when it does read data it forces the buffer to fill with 5s of data. Notice i had to re-add the locks to get it to work. This is not the cleanest and is certainly unpolished but perhaps it will be useful to someone who wants to clean it up.

addons/pvr.mythtv.cmyth/src/cppmyth/MythRecorder.cpp
Code:
int MythRecorder::ReadLiveTV(void* buffer,unsigned long length)
{
  m_recorder_t->Lock();
  int bytesRead=0;
  CMYTH_REC_CALL( bytesRead, bytesRead < 0, cmyth_livetv_read( *m_recorder_t, static_cast<char*>( buffer ), length ) );
  while(bytesRead==0)
  {
    usleep(100000);
    CMYTH_REC_CALL( bytesRead, bytesRead < 0, cmyth_livetv_read( *m_recorder_t, static_cast<char*>( buffer ), length ) );
    XBMC->Log(LOG_DEBUG,"%s: DELAY FOR FILE",__FUNCTION__);
    if(bytesRead>0)
    {
      XBMC->Log(LOG_DEBUG,"%s: DELAY FOR BUFFER",__FUNCTION__);
      usleep(5000000);
    }
  }
  m_recorder_t->Unlock();
  return bytesRead;
}

I think it would be nice if we defined a buffer size in ms to replace my 5s and a max wait until timeout in ms that were configurable for the addon. Right now the above code will try forever and is set at a fixed 5s re-buffer period when the player chokes and finally regains data. Or maybe there is a better way to do it all together. The above works for me though.

Edit:
OK I spoke too soon. It left me with a filled enough buffer to where it went for a few shows before stopping. What a let down. The good news is that it gave me the fastest channel changing I have had yet and I didn't have to configure a delay manually.


RE: New MythTV add-on using libcmyth - allen00se - 2012-10-02

thanks that did it... I was going into the main video settings looking for interlace options instead of using the overlay

My problem is, now that I set the channel to auto deinterlace playback stutters every few seconds. I checked and cpu utilization is under 20%, not sure whats going on here.
Any ideas?


RE: New MythTV add-on using libcmyth - markcs - 2012-10-02

HI!

I need some help please! I installed the latest nightly and the Myth addon from https://github.com/janbar/xbmc-pvr-addons.git

When I try to enable the addon, XBMC just crashes. In the crash log, I see:
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/xbmc/xbmc.bin'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f0ed0a28e84 in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0

I haven't included all the crash log. Is there something that I can paste here that would indicate the issue?



RE: New MythTV add-on using libcmyth - allen00se - 2012-10-02

Anyone know if this plugin will work with a 0.26 mythtv backend? I tried it myself but got an error in the logs that said something along the lines of "Expecting protocol 8 got 75"

I was hoping that 0.26 would work because it has a patch i need.
Thanks,
Krys


RE: New MythTV add-on using libcmyth - Aubrien - 2012-10-02

@markcs

I would use cfetzer right now as janbar is 4 days old. cfetzer has merged with upstream and is working with the latest xbmc nightlies. Last time I looked you needed to roll back the xbmc master to an earlier version to get it to work with janbar. I'm pretty sure cfetzer will be the location that everyone will be working from anyway, though janbar has been working on some additional features. Someone please correct me if I'm wrong.

@allen00se
What is the patch? Maybe you can compile 0.25 from source and just apply the patch by hand...assuming it isn't something that fundamentally changes the way myth works or something like that. As for your original question, I don't think it works with the 0.26 builds. dtierny added 0.25 support for libcmyth earlier in the year if my memory is correct. This is evident by the protocol version checks in libcmyth and branching logic. I'm very curious what this patch is though.

https://github.com/cmyth/cmyth


RE: New MythTV add-on using libcmyth - allen00se - 2012-10-02

(2012-10-02, 16:37)Aubrien Wrote: @markcs

I would use cfetzer right now as janbar is 4 days old. cfetzer has merged with upstream and is working with the latest xbmc nightlies. Last time I looked you needed to roll back the xbmc master to an earlier version to get it to work with janbar. I'm pretty sure cfetzer will be the location that everyone will be working from anyway, though janbar has been working on some additional features. Someone please correct me if I'm wrong.

@allen00se
What is the patch? Maybe you can compile 0.25 from source and just apply the patch by hand...assuming it isn't something that fundamentally changes the way myth works or something like that. As for your original question, I don't think it works with the 0.26 builds. dtierny added 0.25 support for libcmyth earlier in the year if my memory is correct. This is evident by the protocol version checks in libcmyth and branching logic. I'm very curious what this patch is though.

https://github.com/cmyth/cmyth

The patch is for my Ceton USB tuner, I have been manually applying it, but anytime there is an update or a rebuild I have to manually apply it all over again, however it is included by default in 0.26. Not a major deal, just hoping that this addon would work with 0.26

Did you see my post about the stuttering in livetv when I set deinterlace to auto?




RE: New MythTV add-on using libcmyth - Aubrien - 2012-10-02

I would try messing with the different deinterlace methods and use a platform specific method if available. For my case it is ION. Also, I found that the best video drivers for me at least are the Nvidia 304 that I got from Nvidia the other day. I have never had the deinterlace studder but maybe graphics drivers would help if its doing some sort of HW assisted deinterlace.


RE: New MythTV add-on using libcmyth - fetzerch - 2012-10-02

(2012-10-02, 02:08)rsennewald Wrote: Ok just built off of janpar's xbmc and xbmc-pvr-addons master branch on ubuntu 12.04. All looks good.. I think I had some environment issues I worked through, which was why I was getting errors when running the addon that I built previously from cfetzer's fork. If I recall the most current merged code from janpar, tsp and yourself is living at your fork right cfetzer? If that's the case would you mind doing a pull request to opdenkamp so we can get it merged there? Like you mentioned, I also think it'd make things a lot easier for anyone who wants to test or develop against this addon so we can all be testing and working against the same base.

You're right. Janbar and I agreed that he will finish the 'livetv stops at show end' bug. and afterwards he'll continue his development on my branch.
In the meantime I'm still working on cleanups that are required before this can go upstream.
The only thing that is currently missing in my branch is janbar's + aubrien's work for the delayed start.
So if you start new development / bugfixing on it, please use mine. If you want to help/work on stabilising janbar's fixes, you'll need his branch at the moment.

(2012-10-02, 16:22)allen00se Wrote: Anyone know if this plugin will work with a 0.26 mythtv backend? I tried it myself but got an error in the logs that said something along the lines of "Expecting protocol 8 got 75"

I was hoping that 0.26 would work because it has a patch i need.
Thanks,
Krys

Doubt that anyone has tested 0.26 yet. According to the protocol changes here (http://www.mythtv.org/wiki/Category:Myth_Protocol) the db time is the 'only' change right now.
If you want to give it a try (please create a BACKUP of your database!), add this line to protomap in libcmyth's connection.c: {74, "SingingPotato"}, {75, "SweetRock"}.



RE: New MythTV add-on using libcmyth - markcs - 2012-10-03

(2012-10-02, 16:37)Aubrien Wrote: @markcs

I would use cfetzer right now as janbar is 4 days old. cfetzer has merged with upstream and is working with the latest xbmc nightlies. Last time I looked you needed to roll back the xbmc master to an earlier version to get it to work with janbar. I'm pretty sure cfetzer will be the location that everyone will be working from anyway, though janbar has been working on some additional features. Someone please correct me if I'm wrong.

Thanks Aubrien. I've searched the forums but can't find the github link to cfetzer's repository. Can someone direct me to the right place? Thanks!


RE: New MythTV add-on using libcmyth - Shotgun Ted - 2012-10-03

This is his GIT page: https://github.com/fetzerch




RE: New MythTV add-on using libcmyth - markcs - 2012-10-03

(2012-10-03, 08:38)Shotgun Ted Wrote: This is his GIT page: https://github.com/fetzerch

Thanks! (there really should be thank's buttons on this forum)