Jump to content


Photo

merge requests for PLi's git


  • Please log in to reply
1748 replies to this topic

Re: merge requests for PLi's git #361 zakalibit

  • Senior Member
  • 51 posts

+5
Neutral

Posted 20 November 2013 - 17:39

thanks, filtering part will follow, I think you going to like the solution I came up with :)



Re: merge requests for PLi's git #362 Erik Slagter

  • PLi® Core member
  • 46,969 posts

+541
Excellent

Posted 20 November 2013 - 19:12

I have one remark on the code, the string "Transfer-Encoding: chunked" is compared case-dependent. AFAIK http doesn't require this specific capitalisation, so IMHO it's better to do a case-independent compare, changing strncmp into strncasecmp should suffice.

 

Also I see a few one-liners :huh:


Edited by Erik Slagter, 20 November 2013 - 19:14.

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: merge requests for PLi's git #363 zakalibit

  • Senior Member
  • 51 posts

+5
Neutral

Posted 20 November 2013 - 20:30

I have one remark on the code, the string "Transfer-Encoding: chunked" is compared case-dependent. AFAIK http doesn't require this specific capitalisation, so IMHO it's better to do a case-independent compare, changing strncmp into strncasecmp should suffice.

 

Also I see a few one-liners :huh:

Have not seen yet a problem with that, but agree with your point. 



Re: merge requests for PLi's git #364 zakalibit

  • Senior Member
  • 51 posts

+5
Neutral

Posted 20 November 2013 - 20:33

You could say the same about other string comparisons.

Those one liners makes at least for me the code more readable and what about the existing one liners? I think is pointless talking about one liners, they look just fine.


Edited by zakalibit, 20 November 2013 - 20:34.


Re: merge requests for PLi's git #365 zakalibit

  • Senior Member
  • 51 posts

+5
Neutral

Posted 20 November 2013 - 23:23

Here you go, packet boundary aligned reads

https://sourceforge....ge-requests/28/



Re: merge requests for PLi's git #366 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 20 November 2013 - 23:43

applied, but changed it to use iTsSource::packetSize, instead of fixed 188

Re: merge requests for PLi's git #367 zakalibit

  • Senior Member
  • 51 posts

+5
Neutral

Posted 20 November 2013 - 23:55

applied, but changed it to use iTsSource::packetSize, instead of fixed 188

cool, that is  good idea, did not know about that variable



Re: merge requests for PLi's git #368 zakalibit

  • Senior Member
  • 51 posts

+5
Neutral

Posted 21 November 2013 - 00:04

line 253  needs to change:

 

- if (partialPktSz > 0 && partialPktSz < sizeof(partialPkt))

+ if (partialPktSz > 0 && partialPktSz < packetSize)

 

because you have increased the buffer size to 192 and we need to save only incomplete packets.

I do not understand that value, the size can be 188 or 204 if correction bytes are added to the packet


Edited by zakalibit, 21 November 2013 - 00:04.


Re: merge requests for PLi's git #369 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 21 November 2013 - 00:14

yes, you're right I missed that.

192 = 188 + external timestamp (for timekeeping in scrambled data, used by m2ts)

Re: merge requests for PLi's git #370 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 23 November 2013 - 20:48

Hello,


When we are using TS streams (1:0:1) the service.streamed() is always null. So Converter IsStream on ServiceInfo returns also false.

The following patch fixes streamed function to return correct information when we are using TS stream, based on m_is_stream flag.
--- a/lib/service/servicedvb.cpp
+++ b/lib/service/servicedvb.cpp
@@ -1755,6 +1755,29 @@ RESULT eDVBServicePlay::rdsDecoder(ePtr<iRdsDecoder> &ptr)
 	return 0;
 }
 
+RESULT eDVBServicePlay::streamed(ePtr<iStreamedService> &ptr)
+{
+	if (m_is_stream)
+	{
+		ptr = this;
+		return 0;
+	}
+	ptr = 0;
+	return -1;
+}
+
+ePtr<iStreamBufferInfo> eDVBServicePlay::getBufferCharge()
+{
+	/** FIXME **/
+	return 0;
+}
+
+int eDVBServicePlay::setBufferSize(int size)
+{
+	/** FIXME **/
+        return 0;
+}
+
 RESULT eDVBServicePlay::getName(std::string &name)
 {
 	if (m_is_pvr)
diff --git a/lib/service/servicedvb.h b/lib/service/servicedvb.h
index 038c978..1c2f113 100644
--- a/lib/service/servicedvb.h
+++ b/lib/service/servicedvb.h
@@ -86,7 +86,8 @@ class eDVBServicePlay: public eDVBServiceBase,
 		public iAudioTrackSelection, public iAudioChannelSelection,
 		public iSubserviceList, public iTimeshiftService,
 		public iCueSheet, public iSubtitleOutput, public iAudioDelay,
-		public iRdsDecoder, public iStreamableService
+		public iRdsDecoder, public iStreamableService, 
+		public iStreamedService
 {
 	DECLARE_REF(eDVBServicePlay);
 public:
@@ -111,7 +112,12 @@ public:
 	RESULT audioDelay(ePtr<iAudioDelay> &ptr);
 	RESULT rdsDecoder(ePtr<iRdsDecoder> &ptr);
 	RESULT keys(ePtr<iServiceKeys> &ptr) { ptr = 0; return -1; }
-	RESULT streamed(ePtr<iStreamedService> &ptr) { ptr = 0; return -1; }
+
+		// iStreamedService
+	RESULT streamed(ePtr<iStreamedService> &ptr);
+	ePtr<iStreamBufferInfo> getBufferCharge();
+	int setBufferSize(int size);
+
 
 		// iPauseableService
 	RESULT pause();
Attached File  0001-Implement-streamed-call-must-return-not-null-value-i.patch.txt   2.27KB   1 downloads

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: merge requests for PLi's git #371 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 23 November 2013 - 22:00

thx, applied (minus the whitespace error)

Re: merge requests for PLi's git #372 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 1 December 2013 - 12:45

Hello,

The following patch will enable a867 and af9035 for vu 3.1 kernel.
--- a/meta-openpli/recipes-linux/linux/linux-vuplus-3.1.1.inc
+++ b/meta-openpli/recipes-linux/linux/linux-vuplus-3.1.1.inc
@@ -3,7 +3,7 @@ LICENSE = "GPL"
 SECTION = "kernel"
 KV = "3.1.1"
 
-PR_INC = ".8"
+PR_INC = ".9"
 
 SRCREV = "r2"
 
@@ -22,6 +22,8 @@ SRC_URI += "http://archive.vuplus.com/download/kernel/linux-${KV}_${SRCREV}.tar.
         file://em28xx_fix_terratec_entries.patch \
         file://em28xx_add_terratec_h5_rev3.patch \
 	file://fix-dvb-siano-sms-order.patch \
+	file://dvb-usb-af9035.patch \
+	file://dvb-usb-a867.patch \
         file://${MACHINE}_defconfig \
         "
Patches where available but they didn't apply nicely on 3.1 kernel (Makefile patching was failing).

I don't have such a usb stick in order to test it. Compiled kernel modules are available here : http://openpli.org/f...not-on-vu-solo/ , altough the reporter never downloaded modules (probably black hole suck him :P)

Attached Files


Edited by athoik, 1 December 2013 - 12:46.

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: merge requests for PLi's git #373 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 2 December 2013 - 18:11

Hello,

Can you please commit above?

(because i am preparing new patch for siano dvb-t sticks and PR_INC will change from 9 to 10, actually every kernel will increase PR_INC see here http://openpli.org/f...er/#entry389987)
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: merge requests for PLi's git #374 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 4 December 2013 - 19:29

Hello,
 
Here is a patch to handle deadlock when inserting EPG for IPTV. More information here: http://openpli.org/f...els-in-general/
 
 
When we are destroying eHttpStream object and connectionStatus is
busy, we have deadlock at thread kill. We need to call thread kill
when connectionStatus changes to non busy state.

diff --git a/lib/base/httpstream.cpp b/lib/base/httpstream.cpp
index 1aeaf3f..b18025b 100644
--- a/lib/base/httpstream.cpp
+++ b/lib/base/httpstream.cpp
@@ -1,5 +1,6 @@
 #include <cstdio>
 #include <openssl/evp.h>
+#include <unistd.h> // for usleep

 #include <lib/base/httpstream.h>
 #include <lib/base/eerror.h>
@@ -21,6 +22,11 @@ eHttpStream::eHttpStream()
 eHttpStream::~eHttpStream()
 {
        free(tmpBuf);
+       while (connectionStatus == BUSY)
+       {
+               eDebug("~eHttpStream:: Connection is busy, wait 200 msec...");
+               usleep(200000);  // wait 200 msec
+       }
        kill(true);
        close();
 }
 
Attached File  0001-httpstream-Avoid-deadlock-on-eHttpStream-destructor.patch.txt   1004bytes   3 downloads
 
Thanks.

Edited by athoik, 4 December 2013 - 19:30.

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: merge requests for PLi's git #375 littlesat

  • PLi® Core member
  • 56,612 posts

+694
Excellent

Posted 4 December 2013 - 19:31

In fact this is not the way how deadlocks should be avoided.... ;)


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #376 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 4 December 2013 - 19:43

But when Connect is in progress (BUSY) and we are (kill and then) calling pthread_cancel and then pthread_join the thread deadlocks in join.

The destructor must inform Connect to "disconnect" before pthread_join.

But how this is possible?
Send a signal (eg SIGUSR1, but i cannot see any signal handler inside Connect in wrappers.cpp)?

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: merge requests for PLi's git #377 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 4 December 2013 - 22:45

Doesn't this race? (can the connection change it's state to BUSY again?)

Re: merge requests for PLi's git #378 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 4 December 2013 - 22:50

It can be FAILED or CONNECTED after BUSY.

http://sourceforge.n...stream.cpp#l190

BUSY is only when thread starts.
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: merge requests for PLi's git #379 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 4 December 2013 - 22:55

so where does it hang? Doesn't the thread eventually return, even though the connect might not be aborted right away?

Re: merge requests for PLi's git #380 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 4 December 2013 - 23:01

See:

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

Thread join blocks if we call kill after OpenUrl.
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


2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users