Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] TS Continuity problem reason found for budget-cards



Hello,

after still having these ugly artefacts cause of lost ts-packets i've build debug code around the involved functions.

i've build a ts-continuity check for one pid (hardcoded) in
dvb_demux.c:dvb_dmx_swfilter_packets and find out that there are the place where packets lost.
this happens cause the ts-sync byte sometimes don't find at position 0 in buffer but at position 1 or (possible) other.
I've checked this with searching for ts-sync byte at all other positions and if found check pid and ts-continuity again.
here is some syslog output of a czap for a while.

*****************************
Sync Byte found for pid 255 and cont-counter 1 at pos = 1
Missing packet. Continuity Error. get=2 wanted=1
Sync Byte found for pid 255 and cont-counter 15 at pos = 1
Missing packet. Continuity Error. get=0 wanted=15
Sync Byte found for pid 255 and cont-counter 1 at pos = 1
Missing packet. Continuity Error. get=2 wanted=1
Sync Byte found for pid 255 and cont-counter 6 at pos = 1
Missing packet. Continuity Error. get=7 wanted=6
Sync Byte found for pid 255 and cont-counter 12 at pos = 1
Missing packet. Continuity Error. get=13 wanted=12
Sync Byte found for pid 255 and cont-counter 4 at pos = 1
Missing packet. Continuity Error. get=5 wanted=4
Sync Byte found for pid 255 and cont-counter 9 at pos = 1
Missing packet. Continuity Error. get=10 wanted=9
Sync Byte found for pid 255 and cont-counter 8 at pos = 1
Missing packet. Continuity Error. get=9 wanted=8
*****************************

there we can see, that every supposedly lost packet is found in the buffer at start position 1 instead of zero.

but i don't know how this can be possible in vpeirq function (budget-core.c) which reads the data from dma and calls the dvb_dmx_swfilter_packets().
are there some ts-packets larger then 188 bytes? or how can a single byte be between two ts-pakets?

any ideas?


here is the (reformated) debug code of dvb_dmx_swfilter_packets.


static u8 g_lastContCnt = 0xff;
void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf, size_t count)
{
spin_lock(&demux->lock);
int l_nCntOrig,l_nCnt = 0;
l_nCntOrig = count;
while (count--)
{
if(buf[0] == 0x47)
{
u8 l_nStat = buf[3];
l_nStat = l_nStat & 0xf;
u16 l_nPid = ((buf[1] & 0x1f) << 8) + buf[2];
if(l_nPid == 255)
{
if(g_lastContCnt == 0xff)
{
g_lastContCnt = l_nStat;
}
else
{
if(g_lastContCnt == l_nStat)
printk("duplicate packet %d\n", l_nStat);
else
{
g_lastContCnt = (g_lastContCnt + 1) % 16;
if(l_nStat != g_lastContCnt)
{
printk("Missing packet. TS-Continuity Error. get=%d wanted=%d\n", l_nStat, g_lastContCnt);
g_lastContCnt = l_nStat;
}
}
}
} //pid=255
dvb_dmx_swfilter_packet(demux, buf);
}
else //no Sync Byte found at pos==0, search for it
{
int i;
for(i=1; i < 188;i++)
{
if(buf[i] == 0x47)
{
u8 l_nStat = buf[i+3];
l_nStat = l_nStat & 0xf;
u16 l_nPid = ((buf[i+1] & 0x1f) << 8) + buf[i+2];
if(l_nPid == 255)
printk("Sync Byte found for pid 255 and cont-counter %d at pos = %d\n", l_nStat, i);
}
}
}
buf += 188;
}
spin_unlock(&demux->lock);
}



Markus Schulz




Home | Main Index | Thread Index