• 1
  • 86
  • 87
  • 88(current)
  • 89
  • 90
  • 148
New MythTV add-on using libcmyth
(2012-10-16, 18:30)kburkart Wrote: what nightly should I use for the xbmc build?

I assume grabbing cfetzers has most of the latest of what I need

Is there any opportunity to pull the current code upstream?
All Things PVR
Reply
(2012-10-17, 06:04)tdavis Wrote: so, what's the chance of getting this commited?

https://github.com/tsp/xbmc/commit/36d9d...34ae7d9702

It makes the EPG startup times much faster.. I've hidden many channels, instead of deleted them..

Thanks! We based everything on tsp's master repository. This commit was only present in his Eden-PVR branch.
There are a few more commits that might be interessting. I will have a closer look and let you know when I pushed the change to the repo.

(2012-10-17, 08:14)dubstar_04 Wrote:
(2012-10-16, 18:30)kburkart Wrote: what nightly should I use for the xbmc build?

I assume grabbing cfetzers has most of the latest of what I need

Is there any opportunity to pull the current code upstream?

If you mean by 'upstream' opdenkamp/xbmc-pvr-addons, yes I'm working on it. It's a quite big task since it requires plenty of changes but now we're hopefully in a pretty good shape.

If you mean to upstream the libcmyth code. That is still on the todo.

Ah and yes. fetzerch/xbmc-pvr-addons/master is the branch where everything gets integrated now.
Reply
(2012-10-16, 04:00)Aubrien Wrote: Thanks Janbar,
The 0.26 support is exciting though too!

@Aubrien

Log seems good, but there was contention on myth connection due to getting recorded program info.
Have you try a build from the last source of addon ? In the last code we stop traffic during livestream.
Reply
(2012-10-16, 16:00)Ayla Wrote: janbar:

The addon compiles, but when starting XBMC (latest Frodo nightly), the plugin won't load and there's an error regarding mysql in the log:

Code:
15:54:36 T:4540108800   ERROR: Unable to load /Users/martin/Library/Application Support/XBMC/addons/pvr.mythtv.cmyth/XBMC_MythTV_cmyth.pvr, reason: dlopen(/Users/martin/Library/Application Support/XBMC/addons/pvr.mythtv.cmyth/XBMC_MythTV_cmyth.pvr, 1): Library not loaded: libmysql.16.dylib
                                              Referenced from: /Users/martin/Library/Application Support/XBMC/addons/pvr.mythtv.cmyth/XBMC_MythTV_cmyth.pvr
                                              Reason: image not found

Any ideas?

I compiled following your new tutorial.
Can you check if you have the file libmysql.16.dylib in /usr/local/lib/ ?

(2012-10-17, 19:45)janbar Wrote:
(2012-10-16, 16:00)Ayla Wrote: janbar:

The addon compiles, but when starting XBMC (latest Frodo nightly), the plugin won't load and there's an error regarding mysql in the log:

Code:
15:54:36 T:4540108800   ERROR: Unable to load /Users/martin/Library/Application Support/XBMC/addons/pvr.mythtv.cmyth/XBMC_MythTV_cmyth.pvr, reason: dlopen(/Users/martin/Library/Application Support/XBMC/addons/pvr.mythtv.cmyth/XBMC_MythTV_cmyth.pvr, 1): Library not loaded: libmysql.16.dylib
                                              Referenced from: /Users/martin/Library/Application Support/XBMC/addons/pvr.mythtv.cmyth/XBMC_MythTV_cmyth.pvr
                                              Reason: image not found

Any ideas?

I compiled following your new tutorial.
Can you check if you have the file libmysql.16.dylib in /usr/local/lib/ ?

I will updating the tuto to build with static link instead and to avoid any frustation when files are deleted.
Reply
Someone to test pre addon for 0.26 ?

I merged my master with beta addon for 0.26: git://github.com/janbar/xbmc-pvr-addons.git

Let me know if it seems good. Thanks at all
Reply
(2012-10-17, 08:40)cfetzer Wrote:
(2012-10-17, 06:04)tdavis Wrote: so, what's the chance of getting this commited?

https://github.com/tsp/xbmc/commit/36d9d...34ae7d9702

It makes the EPG startup times much faster.. I've hidden many channels, instead of deleted them..

Thanks! We based everything on tsp's master repository. This commit was only present in his Eden-PVR branch.
There are a few more commits that might be interessting. I will have a closer look and let you know when I pushed the change to the repo.

I noticed that's not for the addon, but the PVR portion itself.. so I'm not sure if it will get incorporated into Frodo..
Reply
(2012-10-17, 12:01)janbar Wrote:
(2012-10-16, 04:00)Aubrien Wrote: Thanks Janbar,
The 0.26 support is exciting though too!

@Aubrien

Log seems good, but there was contention on myth connection due to getting recorded program info.
Have you try a build from the last source of addon ? In the last code we stop traffic during livestream.

Yes, i have tried the most recent. I actually just did another pull and compile to be sure though. Still no reliable performance. Does it also stop traffic during buffering or just during playback? It just seems like my tune times have gotten worse while everyone with a digital tuner has gotten better. I still cant usually get through program breaks either, but sometimes I can. Though we don't need to configure a tuning delay for me anymore and I like it better without it, it actually tuned faster when we were playing around with that idea. That is how I know we can get better performance from an analog tuner with this addon.

I guess I can play around with the code some more and if I get anything working I can post what I did and maybe you can figure out something cleaner to do with the idea. I am currently getting Read 0 Bytes errors (2 per second as expected) until the buffer is filled, but once it should start playback it stops posting Read 0 Bytes and hangs up for a long time (30s or so) before I actually get playback (if I get playback at all before it times out at 80s). From my experiments I have found that it works best if I prevent it from ever getting the the Read 0 Bytes part in the first place. I did this by waiting until the rec_livetv_file was not null and the rec_livetv_file.file_length was at least a certain size (had to use 15000 a anything smaller would sometimes not start playback). This was a few weeks ago though when I was doing these experiments.
Reply
(2012-10-08, 13:49)janbar Wrote:
(2012-10-08, 09:03)dteirney Wrote:
(2012-10-03, 21:11)Aubrien Wrote: OK, I have had live tv playing for hours now without it stopping so I think its time to post the solution. There are two delays needed as well as an object lock. I based this on cfetzer's code not janbar's since that is where we are moving to anyway. The changes are below...

addons/pvr.mythtv.cmyth/src/pvrclient-mythtv.cpp
Code:
bool PVRClientMythTV::OpenLiveStream(const PVR_CHANNEL &channel)
{
  if (g_bExtraDebug)
    XBMC->Log(LOG_DEBUG,"%s - chanID: %i, channumber: %i", __FUNCTION__, channel.iUniqueId, channel.iChannelNumber);

  SingleLock<PLATFORM::CMutex> lock(&m_lock);
  if (m_rec.IsNull())
  {
    MythChannel chan = m_channels.at(channel.iUniqueId);
    for (std::vector<int>::iterator it = m_sources.at(chan.SourceID()).begin(); it != m_sources.at(chan.SourceID()).end(); it++)
    {
      m_rec = m_con.GetRecorder(*it);
      if (!m_rec.IsRecording() && m_rec.IsTunable(chan))
      {
        if (g_bExtraDebug)
          XBMC->Log(LOG_DEBUG,"%s: Opening new recorder %i", __FUNCTION__, m_rec.ID());

        if (m_pEventHandler)
          m_pEventHandler->SetRecorder(m_rec);

        if (m_rec.SpawnLiveTV(chan))
        {
          usleep(10000000); //Channel change delay of 10s
          return true;
        }
      }
      m_rec = MythRecorder();
      if (m_pEventHandler)
      {
        m_pEventHandler->SetRecorder(m_rec); // Redundant
      }
    }

    if (g_bExtraDebug)
      XBMC->Log(LOG_DEBUG,"%s - Done", __FUNCTION__);
    return false;
  }
  else
  {
    if (g_bExtraDebug)
      XBMC->Log(LOG_DEBUG,"%s - Done", __FUNCTION__);

    return true;
  }
}
Add the delay for changing channels.

addons/pvr.mythtv.cmyth/src/cppmyth/MythRecorder.cpp
Code:
bool MythRecorder::LiveTVChainUpdate(CStdString chainID)
{
  char* buffer=strdup(chainID.c_str());
  m_recorder_t->Lock();
  int retval = 0;

  usleep(5000000); // Program switch delay of 5s

  CMYTH_REC_CALL( retval, retval < 0, cmyth_livetv_chain_update( *m_recorder_t, buffer, 16*1024 ) );
  if(retval != 0)
    XBMC->Log(LOG_ERROR,"LiveTVChainUpdate failed on chainID: %s",buffer);
  *livechainupdated=1;
  m_recorder_t->Unlock();
  free(buffer);
  return retval==0;
}
Uncomment the lock/unlock. Add the delay for between shows.

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 ) );
  m_recorder_t->Unlock();
  return bytesRead;
}
Uncomment the lock/unlock

The end result of this makes the channels change properly either from nothing being played or from already watching tv. The delay is especially useful for those of us with IR blasters and analog tuners. Additionally, when the chain is updated (program transition) it locks the recorder for 5s. During this time read operations delay and the user is prevented from underrunning the buffer on the backend. Both the channel change delay and the program switch delay should be made into addon settings to be user configured. Mine works with the static values I inserted for developing the fix. Between program transitions you will see a "Buffering %" dialog for a second or so. This buffering is essential as each program transition causes no data for a small period and eventually the buffer is depleted and this makes it refill.

Rather than a hard-coded 5 second delay could you look at doing something more like was done in one of my branches. Unfortunately still not cleaned up and ready for PR to upstream libcmyth. https://github.com/dteirney/xbmc/commit/...96ecac88b2

That commit also has the fix for the LiveTV locking problem as well.

@dteirney: I read your commit. It is a way. But i think we must to find a solution without use backend's database at least for liveTV. Would not be better to use only Mythtv protocol ?

Though I agree that we should use mythtv protocol, I also noticed that with this fix it does something else different. It prevents playback from starting too early vs starting it early and writing code to cope with the lack of data. Any chance of preventing playback from starting early like in dtierny's branch but doing it using mythtv protocol? And what about 0.26...would it provide any additional mythtv protocol features that may help with this since you are working on 0.26 support already?
Reply
Does this addon take advantage of comm skipping by chance?
HTPC(s): All running LibreELEC
  • AMD 2200G APU on Gigabyte AB350N-Gaming WIFI-CF
  • RPI3 x2 | RPI2 x2
NAS: FreeNAS (Latest Stable) | NFS/CIFS
Reply
One thing to note after playing with the latest PVR addon from last night I noticed that if I watch a show and stop the data it does record a bookmark in mythtv, however the PVR addon doesn't honor that bookmark and pickup where it left off.
HTPC(s): All running LibreELEC
  • AMD 2200G APU on Gigabyte AB350N-Gaming WIFI-CF
  • RPI3 x2 | RPI2 x2
NAS: FreeNAS (Latest Stable) | NFS/CIFS
Reply
Maybe I'm too lazy or incompetent, but does anyone have a page hosting precompiled binaries with TSP's addons? I have a mythbuntu mythtv backend upgraded to 0.26. I have a windows machine running xbmc and I'd love to test this.
Reply
(2012-10-18, 17:42)NewJerseyNinja Wrote: Maybe I'm too lazy or incompetent, but does anyone have a page hosting precompiled binaries with TSP's addons? I have a mythbuntu mythtv backend upgraded to 0.26. I have a windows machine running xbmc and I'd love to test this.

I also don't feel I have the knowledge to compile from scratch. But if binaries are made available, I can test on Windows, OpenELEC ION, and OpenElec Generic with a 0.24 backend.

Reply
(2012-10-18, 15:06)pyrodex Wrote: Does this addon take advantage of comm skipping by chance?

Nope not yet. But definitely one reason why I added the Get/SetBookmark functions.

(2012-10-18, 15:40)pyrodex Wrote: One thing to note after playing with the latest PVR addon from last night I noticed that if I watch a show and stop the data it does record a bookmark in mythtv, however the PVR addon doesn't honor that bookmark and pickup where it left off.

Hm I don't get it. It records the bookmark to resume where it left off...
You should be able to start watching with the addon and resume on that position (even in mythfrontend) vice verca.
Could you explain and pastebin a debug log?
Reply
I'm trying to test 0.26 support on your master branch Janbar, but I can't build from within a Windows environment. Here is the build output:

1>------ Build started: Project: libcmyth, Configuration: Release Win32 ------
2>------ Build started: Project: pvr.njoy, Configuration: Release Win32 ------
3>------ Build started: Project: pvr.mediaportal.tvserver, Configuration: Release Win32 ------
4>------ Build started: Project: pvr.demo, Configuration: Release Win32 ------
5>------ Build started: Project: pvr.hts, Configuration: Release Win32 ------
6>------ Build started: Project: pvr.vuplus, Configuration: Release Win32 ------
7>------ Build started: Project: pvr.vdr.vnsi, Configuration: Release Win32 ------
8>------ Build started: Project: pvr.nextpvr, Configuration: Release Win32 ------
5> HTSPConnection.cpp
4> PVRDemoData.cpp
3> utils.cpp
2> N7Xml.cpp
8> pvrclient-nextpvr.cpp
6> VuData.cpp
7> VNSIChannelScan.cpp
1> livetv.c
1> mythtv_mysql.c
1>..\libcmyth\mythtv_mysql.c(100): error C2143: syntax error : missing ';' before 'const'
1>..\libcmyth\mythtv_mysql.c(102): error C2065: 'query_str' : undeclared identifier
1>..\libcmyth\mythtv_mysql.c(102): warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
1>..\libcmyth\mythtv_mysql.c(102): warning C4024: 'cmyth_mysql_query_create' : different types for formal and actual parameter 2
1> proginfo.c
7> VNSIData.cpp
1> proglist.c
1> socket.c
2> client.cpp
4> client.cpp
5> HTSPData.cpp
1>..\libcmyth\socket.c(653): error C2143: syntax error : missing ';' before 'type'
1>..\libcmyth\socket.c(655): error C2065: 'tmp' : undeclared identifier
1>..\libcmyth\socket.c(655): warning C4047: 'function' : 'char *' differs in levels of indirection from 'int'
1>..\libcmyth\socket.c(655): warning C4024: '__cmyth_rcv_string' : different types for formal and actual parameter 3
1>..\libcmyth\socket.c(655): error C2065: 'tmp' : undeclared identifier
1>..\libcmyth\socket.c(657): error C2065: 'tmp' : undeclared identifier
1>..\libcmyth\socket.c(705): error C2143: syntax error : missing ';' before 'type'
1>..\libcmyth\socket.c(707): error C2065: 'tmp' : undeclared identifier
1>..\libcmyth\socket.c(707): warning C4047: 'function' : 'char *' differs in levels of indirection from 'int'
1>..\libcmyth\socket.c(707): warning C4024: '__cmyth_rcv_string' : different types for formal and actual parameter 3
1>..\libcmyth\socket.c(707): error C2065: 'tmp' : undeclared identifier
1>..\libcmyth\socket.c(709): error C2065: 'tmp' : undeclared identifier
1> Generating Code...
6> client.cpp
3> timers.cpp
8> Socket.cpp
7> VNSIDemux.cpp
9>------ Build started: Project: pvr.mythtv.cmyth, Configuration: Release Win32 ------
9> client.cpp
7> VNSIRecording.cpp
2> Creating library ..\..\addon\XBMC_njoy_win32.lib and object ..\..\addon\XBMC_njoy_win32.exp
2> Generating code
7> VNSISession.cpp
5> HTSPDemux.cpp
4> Creating library ..\..\addon\XBMC_Demo_win32.lib and object ..\..\addon\XBMC_Demo_win32.exp
4> Generating code
3> recordings.cpp
8> Compiling...
8> client.cpp
2> Finished generating code
2> pvrclient_njoy.vcxproj -> C:\Users\Ray\Projects\janbar-xbmc-pvr-addons\addons\pvr.njoy\project\VS2010Express\..\..\addon\XBMC_njoy_win32.pvr
9> MythConnection.cpp
4> Finished generating code
7> client.cpp
4> pvrclient_demo.vcxproj -> C:\Users\Ray\Projects\janbar-xbmc-pvr-addons\addons\pvr.demo\project\VS2010Express\..\..\addon\XBMC_Demo_win32.pvr
5> client.cpp
7> responsepacket.cpp
3> pvrclient-mediaportal.cpp
9>..\..\src\cppmyth\MythConnection.cpp(364): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
9>..\..\src\cppmyth\MythConnection.cpp(364): warning C4804: '<' : unsafe use of type 'bool' in operation
9>..\..\src\cppmyth\MythConnection.cpp(364): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
9>..\..\src\cppmyth\MythConnection.cpp(365): warning C4804: '>=' : unsafe use of type 'bool' in operation
9> MythDatabase.cpp
8> Creating library ..\..\addon\XBMC_NextPVR_win32.lib and object ..\..\addon\XBMC_NextPVR_win32.exp
8> Generating code
5> Creating library ..\..\addon\XBMC_Tvheadend_win32.lib and object ..\..\addon\XBMC_Tvheadend_win32.exp
5> Generating code
8> Finished generating code
7> Creating library ..\..\addon\XBMC_VDR_vnsi_win32.lib and object ..\..\addon\XBMC_VDR_vnsi_win32.exp
7> Generating code
8> XBMC_NextPVR.vcxproj -> C:\Users\Ray\Projects\janbar-xbmc-pvr-addons\addons\pvr.nextpvr\project\VS2010Express\..\..\addon\XBMC_NextPVR_win32.pvr
3> TSReader.cpp
9> MythEventHandler.cpp
5> Finished generating code
7> Finished generating code
5> pvrclient_tvheadend.vcxproj -> C:\Users\Ray\Projects\janbar-xbmc-pvr-addons\addons\pvr.hts\project\VS2010Express\..\..\addon\XBMC_Tvheadend_win32.pvr
7> pvrclient_vdr_vnsi.vcxproj -> C:\Users\Ray\Projects\janbar-xbmc-pvr-addons\addons\pvr.vdr.vnsi\project\VS2010Express\..\..\addon\XBMC_VDR_vnsi_win32.pvr
3> MultiFileReader.cpp
9> MythRecorder.cpp
3> FileReader.cpp
9> fileOps.cpp
3> epg.cpp
9> pvrclient-mythtv.cpp
3> Socket.cpp
6> Creating library ..\..\addon\XBMC_vuplus_win32.lib and object ..\..\addon\XBMC_vuplus_win32.exp
6> Generating code
3> Compiling...
3> client.cpp
6> Finished generating code
3> channels.cpp
6> pvr.vuplus.vcxproj -> C:\Users\Ray\Projects\janbar-xbmc-pvr-addons\addons\pvr.vuplus\project\VS2010Express\..\..\addon\XBMC_vuplus_win32.pvr
9>LINK : fatal error LNK1181: cannot open input file 'C:\Users\Ray\Projects\janbar-xbmc-pvr-addons\project\VS2010Express\libs\libcmyth\Release\libcmyth.lib'
3> GenreTable.cpp
3> Creating library ..\..\addon\XBMC_Mediaportal_win32.lib and object ..\..\addon\XBMC_Mediaportal_win32.exp
3> Generating code
3> Finished generating code
3> XBMC_MediaportalTVserver.vcxproj -> C:\Users\Ray\Projects\janbar-xbmc-pvr-addons\addons\pvr.mediaportal.tvserver\project\VS2010Express\..\..\addon\XBMC_Mediaportal_win32.pvr
========== Build: 7 succeeded, 2 failed, 4 up-to-date, 0 skipped ==========
Reply
(2012-10-18, 21:30)cfetzer Wrote: Hm I don't get it. It records the bookmark to resume where it left off...
You should be able to start watching with the addon and resume on that position (even in mythfrontend) vice verca.
Could you explain and pastebin a debug log?

Figured it out... I stopped it around the 4min mark and must have not been enough to trigger a resume/bookmark write the first time. I stopped it at 38 minutes of a 1 hour show and was able to resume it fine.
HTPC(s): All running LibreELEC
  • AMD 2200G APU on Gigabyte AB350N-Gaming WIFI-CF
  • RPI3 x2 | RPI2 x2
NAS: FreeNAS (Latest Stable) | NFS/CIFS
Reply
  • 1
  • 86
  • 87
  • 88(current)
  • 89
  • 90
  • 148

Logout Mark Read Team Forum Stats Members Help
New MythTV add-on using libcmyth8