Jump to content


Photo

Loading EPG for GStreamer (IPTV channels in general)


  • Please log in to reply
14 replies to this topic

#1 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 1 December 2013 - 15:08

Hello,

Is it possible to load EPG for channels handled by GStreamer without using offline method?


sources.xml contains the following:
<source type="gen_xmltv" channels="/tmp/test.xml">
        <description>Rytec Greece XMLTV</description>
        <url>http://rytec.sifteam.eu/rytecxmltvnova.gz</url>
        <url>http://xmltvepg.wanwizard.eu/rytecxmltvnova.gz</url>
        <url>http://enigma2.world-of-satellite.com/epg_data/rytecxmltvnova.gz</url>
        <url>http://www.vuplus-community.net/rytec/rytecxmltvnova.gz</url>
        <url>http://www.ebook-directory.net/rytecxmlepg/rytecxmltvnova.gz</url>
</source>
And test.xml contains the following:
<?xml version="1.0" encoding="latin-1"?>
<!-- service references can be found in /etc/enigma2/lamedb -->
<channels>
<channel id="mega.gr">4097:0:1:13f:157c:13e:820000:0:0:0:</channel> <!--MEGA -->
<channel id="ant1.gr">4097:0:1:1:2:3:4:0:0:0:</channel> <!--ANT1 -->
</channels>
When i am using offline method (python /usr/lib/enigma2/python/Plugins/Extensions/EPGImport/OfflineImport.py sources.xml) EPG works for both channels, mega and ant1.

When i am using online method EPG works only for mega, most probably because service reference 1:0:1:13f:157c:13e:820000:0:0:0: is valid.

So i would like to hear your ideas/opinions on the matter.

Thanks.
Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: Loading EPG for GStreamer (IPTV channels in general) #2 Taykun345

  • Senior Member
  • 1,297 posts

+41
Good

Posted 1 December 2013 - 16:45

Is there a solution how to append epg to iptv (mpeg2 streams) with basic channel reference (1:0:1:0:0:0:...)? Few months ago the only solution was to append epg using crossepg. I think that when replacing reference with the one from sat channel with working epg, stream stops working.<br />

Edited by Taykun345, 1 December 2013 - 16:48.

Army MoodBlue HD skin modification by me: https://github.com/T...-MoodBlueHD-mod
Matrix10 MH-HD2 skin modification by me: https://github.com/B...-MX-HD2-OpenPli
MetrixHD skin modification by me: https://github.com/T...xHD-WPstyle-mod
Slovenian translation for OpenPLi E2: https://github.com/T...ion-for-OpenPLi

Re: Loading EPG for GStreamer (IPTV channels in general) #3 doglover

  • Rytec EPG Team
  • 17,277 posts

+650
Excellent

Posted 2 December 2013 - 09:46

I ran into problems here as well.  Did not find a solution yet.

 

However when I stream channels from one box to another via the links:

 

 

#SERVICE 1:0:19:13A9:C85:3:EB0000:0:0:0:http%3A//192.168.1.19%3A8001/1%3A0%3A19%3A13A9%3AC85%3A3%3AEB0000%3A0%3A0%3A0:Eurosport HD
#SERVICE 1:0:19:1421:C85:3:EB0000:0:0:0:http%3A//192.168.1.19%3A8001/1%3A0%3A19%3A1421%3AC85%3A3%3AEB0000%3A0%3A0%3A0:Eurosport HD DUT
 

 

made by the remote channel stream convertor, The epg can be attached.

 

One guess is, there is a need of the service reference to be included in the lamedb.  So you can try using valid service references (which exist in lamedb).  I have not pursued this any further,.

 

Willy


Edited by doglover, 2 December 2013 - 11:07.
Typo corrected : not

~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: Loading EPG for GStreamer (IPTV channels in general) #4 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 2 December 2013 - 10:24

Probably @pieterg allready answered this long time ago...

 

the reason why it works like you reported:

EPGImport tries to start a (fake) recording on the channels it is trying to import for.
If e2 says it can't record, it doesn't import epg for the channel, because it figures e2 will not be able to tune to that particular channel.
Now in order to be able to record from http ts streams, I've made a few modifications which tell e2 that recording from any serviceref with a 'path' field which starts with 'http://' is fine.

As a result, if you put the full stream url in the channels.xml, the import goes fine.
If you omit the stream url part, the import would still work fine, IF you have the local equivalent serviceref in your lamedb (and the corresponding orbital position in your sat config)
Apparantly, that is not the case for you.

So if you don't have the local equivalent serviceref in your lamedb, and/or you cannot record from that channel, according to your satconfig, you will have to put some http://... path in the serviceref of your channels.xml.

The url does not have to be correct I guess, as long as the path field starts with http://


Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: Loading EPG for GStreamer (IPTV channels in general) #5 doglover

  • Rytec EPG Team
  • 17,277 posts

+650
Excellent

Posted 3 December 2013 - 09:43

Hello, I am also trying to receive epg from IPTV channels (OTETV) but I cant get it. I am using EPGimport, checking the sources I need including the Greek ones  - not the Greek in English) but i cannot receive epg. I have tried to to edit my rytec.channels.xml and edit the OTETV channels from: e.g. 

 

<channel id="OTECinema1.gr">1:0:1:3F0:5:AA:5A0000:0:0:0:</channel> and make it like 
<channel id="OTECinema1.gr">1:0:1:3F0:5:AA:5A0000:0:0:0:http%3a//stream site/otecinema1hd/username/password:</channel>
 

 

in order to receive an epg but still nothing. Also did a restart to the box and download again the sources from EPG Import. Still nothing. Any help?

 

ThanosDJ has asked this question in another thread.  I think it is the same problem as this.

 

Has anabody solved this problem?  With the answer from pieterg, it did not work.

 

So the general question is how to attached epg to streamed channels?  It is possible with channels created with the the remote channel stream convertor, but any other ref fails.

 

Help pls.

 

Willy


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: Loading EPG for GStreamer (IPTV channels in general) #6 Taykun345

  • Senior Member
  • 1,297 posts

+41
Good

Posted 3 December 2013 - 10:30

+1

 

Many true IPTV subscribers are without EPG because of this ...


Army MoodBlue HD skin modification by me: https://github.com/T...-MoodBlueHD-mod
Matrix10 MH-HD2 skin modification by me: https://github.com/B...-MX-HD2-OpenPli
MetrixHD skin modification by me: https://github.com/T...xHD-WPstyle-mod
Slovenian translation for OpenPLi E2: https://github.com/T...ion-for-OpenPLi

Re: Loading EPG for GStreamer (IPTV channels in general) #7 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 3 December 2013 - 12:59

The problem is on eHttpStream most probably.

 

I was able to insert EPG for 1 or 2 channels successfully, but when you try for 10 channels never completes...

 

[EPGImport] nextImport, source= TEST GR EPG
[EPGImport] Downloading: http://xxx.yyy.zzz/epg.xml.gz to local path: /tmp/epgimport.gz
[EPGImport] afterDownload /tmp/epgimport.gz
[EPGImport] unlink /tmp/epgimport.gz
[EPGImport] Downloading: http://xxx.yyy.zzz/files/test10.xml to local path: /tmp/epgimport
[EPGImport] afterChannelDownload /tmp/epgimport
[EPGImport] Using twisted thread
[EPGImport] Parsing channels from 'http://xxx.yyy.zzz/files/test10.xml'
eHttpStream::Start thread
send cancel to thread
thread joined 0
eHttpStream::Start thread
send cancel to thread
main thread is non-idle! display spinner!
<<<<< NO MORE >>>>>>

[EPGImport] afterDownload /tmp/epgimport.gz
[EPGImport] unlink /tmp/epgimport.gz
[EPGImport] Downloading: http://xxx.yyy.zzz/files/test10.xml to local path: /tmp/epgimport
[EPGImport] afterChannelDownload /tmp/epgimport
[EPGImport] Using twisted thread
[EPGImport] Parsing channels from 'http://xxx.yyy.zzz/files/test10.xml'
eHttpStream::Start thread
send cancel to thread
thread joined 0
eHttpStream::Start thread
send cancel to thread
thread joined 0
eHttpStream::Start thread
send cancel to thread
thread joined 0
eHttpStream::Start thread
send cancel to thread
thread joined 0
eHttpStream::Start thread
send cancel to thread
thread joined 0
eHttpStream::Start thread
send cancel to thread
thread joined 0
eHttpStream::Start thread
send cancel to thread
thread joined 0
eHttpStream::Start thread
send cancel to thread
<<<<< NO MORE >>>>>>

 

When this is happening you have to kill enigma (Ctrl-Z and kill -9).


Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: Loading EPG for GStreamer (IPTV channels in general) #8 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 3 December 2013 - 13:07

The code that seems to blocks is the following:

 

void eThread::kill(bool sendcancel)
{
        if (!the_thread) /* already joined */
                return;

        if (sync() && sendcancel)
        {
                eDebug("send cancel to thread");
                pthread_cancel(the_thread);
        }
        eDebug("thread joined %d", pthread_join(the_thread, 0));
        the_thread = 0;
}

 

 

Maybe this can help?

 

https://groups.google.com/d/msg/comp.programming.threads/vDHqTRbINEM/NSiMpt6dK94J
 
Recently i fixed a similar problem w.r.t. pthread_cancel, where
pthread_cancel was causing 100% CPU utilization when issued on a
thread doing recv/read on a socket. This problem looks similar to that
problem. The best way to fix this problem is to defer the cancellation
state of the thread either in the application or library(in this case
stdio stream).
something like..
void *thread(void* arg)
{
    int cs;
    pthread_setcancelstate(PTHREAD_CANCEL_DEFERRED, &cs);
    printf("hello thread");
    pthread_setcancelstate(cs, NULL);
    return NULL;
}
 
This way we can make sure that thread does not go away without
unlocking the stdio stream. :)

Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: Loading EPG for GStreamer (IPTV channels in general) #9 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 3 December 2013 - 19:54

Hello again,

 

 

I put some debugging messages on thread.cpp and it seems that thread_join is blocking...

 

void eThread::kill(bool sendcancel)
{
        if (!the_thread) /* already joined */
                return;

        if (sync() && sendcancel)
        {
                eDebug("send cancel to thread");
                int ret = pthread_cancel(the_thread);
                if (ret != 0)
                {
                        eDebug("Oppps failure %d", errno);
                        if (ret == ESRCH)
                                return;
                }
                eDebug("cancel received by thread");
        }
        eDebug("thread join");
        eDebug("thread joined %d", pthread_join(the_thread, 0));
        the_thread = 0;
}

 

Here is what i get:

 

[EPGImport] nextImport, source= TEST GR EPG
[EPGImport] Downloading: http://xxxx.yyyy.zzz/epg.xml.gz to local path: /media/hdd/epgimport.gz
[EPGImport] afterDownload /media/hdd/epgimport.gz
[EPGImport] unlink /media/hdd/epgimport.gz
[EPGImport] Downloading: http://xxxx.yyyy.zzz/test10.xml to local path: /media/hdd/epgimport
[EPGImport] afterChannelDownload /media/hdd/epgimport
[EPGImport] Using twisted thread
[EPGImport] Parsing channels from 'http://xxxx.yyyy.zzz/test10.xml'
eHttpStream::Start thread
send cancel to thread
cancel received by thread
thread join
thread joined 0
eHttpStream::Start thread
send cancel to thread
cancel received by thread
thread join

 

@pieterg, @MiLo are you watching this? Any idea why thread join is blocking?

 

Thanks,


Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: Loading EPG for GStreamer (IPTV channels in general) #10 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 4 December 2013 - 10:07

Hello,

 

 

I have found where the deadlock is happening.

 

See here:

 

eHttpStream::Start thread
~eHttpStream: calling kill
~eHttpStream: calling close
send cancel to thread
thread: before openUrl
openUrl: before Connect
cancel received by thread
thread join
thread joined 0
eHttpStream::Start thread
thread: before openUrl
openUrl: before Connect
~eHttpStream: calling kill
~eHttpStream: calling close
send cancel to thread
cancel received by thread
thread join

 

When the connection is calling Connect function inside eHttpStream::openUrl is blocking!

 

Changing ~eHttpStream to check if connectioStatus is BUSY (BUSY == blocking...) and wait until connectionStatus changed, solves the blocking problem.

 

eHttpStream::~eHttpStream()
{
        free(tmpBuf);
        while (connectionStatus == BUSY)
        {
                eDebug("%s: connection is busy wait 10ms", __FUNCTION__);
                usleep(10000);  // wait 10 msec
        }
        eDebug("%s: calling kill", __FUNCTION__);
        kill(true);
        eDebug("%s: calling close", __FUNCTION__);
        close();
}

 

The above while probably will never cause endless loop because Connect has timeout 10 seconds.

 

Do you think above solution is good?

Should i leave eDebug inside while?

 

+#include <unistd.h> // for usleep
 
eHttpStream::~eHttpStream()
{
        free(tmpBuf);
+        while (connectionStatus == BUSY)
+        {
+                eDebug("%s: connection is busy wait 10ms", __FUNCTION__);
+                usleep(10000);  // wait 10 msec
+        }
+        kill(true);
        close();
}

 

Thanks.


Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: Loading EPG for GStreamer (IPTV channels in general) #11 koukou

  • Member
  • 1 posts

0
Neutral

Posted 10 December 2013 - 13:22

I  have the same problem. Any solution yet?



Re: Loading EPG for GStreamer (IPTV channels in general) #12 doglover

  • Rytec EPG Team
  • 17,277 posts

+650
Excellent

Posted 10 December 2013 - 14:19

I suppose so.

 

http://openpli.org/f...mer-servicemp3/

 

You have to update your image.

 

Willy

 

PS: I have not tested this myself


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: Loading EPG for GStreamer (IPTV channels in general) #13 ThanosDJ

  • Senior Member
  • 30 posts

0
Neutral

Posted 15 December 2013 - 16:12

I suppose so.

 

http://openpli.org/f...mer-servicemp3/

 

You have to update your image.

 

Willy

 

PS: I have not tested this myself

 

I have updated the image but still no EPG for some IPTV stream channels (OTE TV ones).



Re: Loading EPG for GStreamer (IPTV channels in general) #14 doglover

  • Rytec EPG Team
  • 17,277 posts

+650
Excellent

Posted 16 December 2013 - 09:29

Have you made the custom source and channels file?

 

Willy


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: Loading EPG for GStreamer (IPTV channels in general) #15 ThanosDJ

  • Senior Member
  • 30 posts

0
Neutral

Posted 16 December 2013 - 11:04

Have you made the custom source and channels file?

 

Willy

I will give it a second check and tell you.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users