How to start a program from satelite?

Arnaud de Bossoreille de Ribou bozo at via.ecp.fr
Wed Apr 3 13:27:31 CEST 2002


On Wed, Apr 03, 2002, Jean-Paul Saman wrote:
> ASSERT ERROR in src/server/buffer.cpp line 117 (code checked: pPacket)
> ASSERT ERROR in src/server/tsstreamer.cpp line 155 (code checked: pPacket)
> ASSERT ERROR in src/server/output.cpp line 114 (code checked: pPacket)
> ASSERT ERROR in src/core/stack.cpp line 89 (code checked: pData)
> Segmentation fault
> 
> The ASSERT ERROR are exactly the same problems we encountered with 
> streaming. The solution I found was getting SyncFifo thread safe and 
> alter the behaviour of putting packets on the SyncFifo. The convertor 
> first checks if there is room on the fifo before getting a packet. See 
> the patch I submitted earlier.
> 
> I also checked the patch against this CVS version to check if it solves 
> the above problem.
> 
> The conclusion is that it interferes with PAT and PMT discovery of the 
> DVB input module. How exactly I do not now yet. It needs some more 
> investigation to exactly pinpoint what goes wrong where. This week and 
> probably next week I do not have time to
> exactly do that.
> 
> What is your vision?

Ok, here we go... :-)

1/ A little bit of theory about the NetList.

It shouldn't be empty provided that

 sizeof(NetList) >= sizeof(internal bufferization) + sizeof(SyncFifo) +
                    sizeof(output buffer) + 1

Why ? Simply because before getting another packet from it the caller is
blocked by the SyncFifo.

The problem in the DVB input is that there may be a lot of SyncFifos for
only one NetList. So I put a big size for the NetList (500) and small
sizes for the SyncFifos (2 * sizeof output buffer) and we have to pray
about the fact that there are not enough programs to have a packet
shortage. _Yes_ this is a kludge.


2/ Now the SyncFifo.

I think one problem is that the both Push and Pop methods of C_Fifo
are modifying m_iSize at the same time. I never saw this problem in 3
years of use but I've made a little patch I suggest you to try (diff
attached).

The ASSERT above say that

  - either a NULL packet has been pushed but there should have some
    other assertions before so I don't think this possible;
  - or the Fifo has a bug which may be solved by my patch.


Just for me: could you remind me which architecture you use ?


3/ I don't know why you have to check the continuity of the TS stream
since the packets can't be lost in VLS (or it's a bug).


-- 
Arnaud de Bossoreille de Ribou - http://www.via.ecp.fr/~bozo/
-------------- next part --------------
Index: src/core/stack.cpp
===================================================================
RCS file: /var/cvs/videolan/vls/src/core/stack.cpp,v
retrieving revision 1.1
diff -r1.1 stack.cpp
49c49
<   m_apBuff = new T* [iCapacity];
---
>   m_apBuff = new T* [iCapacity + 1];
52d51
<   m_iSize = 0;
92c91,92
<   if (m_iSize < m_iCapacity)
---
>   if (   (m_iCapacity + 1 + (m_iWhereToPush - m_iWhereToPop))
>        % (m_iCapacity + 1) < m_iCapacity)
97c97
<     if (++m_iWhereToPush >= m_iCapacity)
---
>     if (++m_iWhereToPush >= m_iCapacity + 1)
102,104d101
< 
<     // The buffer has grown
<     m_iSize++;
147c144,146
<   
---
> 
>   ASSERT(m_iWhereToPush != m_iWhereToPop);
> 
161c160
<   if (m_iSize > 0)
---
>   if (m_iWhereToPush != m_iWhereToPop)
167c166
<     if (++m_iWhereToPop >= m_iCapacity)
---
>     if (++m_iWhereToPop >= m_iCapacity + 1)
172,174d170
< 
<     // The buffer has shorten
<     m_iSize--;
189c185
<   ASSERT(iIndex < m_iSize);
---
>   ASSERT(iIndex < Size());
194,195c190,191
<   if(iElemPos >= m_iCapacity)
<     iElemPos = iElemPos - m_iCapacity;
---
>   if(iElemPos >= m_iCapacity + 1)
>     iElemPos = iElemPos - m_iCapacity - 1;
Index: src/core/stack.h
===================================================================
RCS file: /var/cvs/videolan/vls/src/core/stack.h,v
retrieving revision 1.1
diff -r1.1 stack.h
48c48,49
<   { return m_iSize; };
---
>   { return   (m_iCapacity + 1 + (m_iWhereToPush - m_iWhereToPop))
> 	   % (m_iCapacity + 1); };
59,60d59
<   // Number of TS_Packet stored in the Fifo
<   unsigned int m_iSize;


More information about the vls-devel mailing list