[linux-dvb] How to extract several PID's from a TS

Ralph Metzler rjkm at metzlerbros.de
Fri Mar 31 01:37:20 CEST 2006


Trent Piepho writes:
 > True, you can do this when you want lots of PIDs.  It's easy and it will work.
 > 
 > But say you want to just want to get all the meta-data on a ATSC QAM-256
 > channel.  This could be 50 to 60 PIDs and a few hundred packets per second.
 > The kernel is filtering 25830 packets per second and selecting them all, then
 > every packet is copied from the DMA buffer to the dvr0 device buffer, then
 > from there to user space, and then in userspace you re-filter all 25830
 > pkts/sec and just pick the 200 or so you care about.
 > 
 > Instead, the kernel could efficiently software filter all the PIDs you wanted,
 > it's a trivial O(1) algorithm, and then copy just those to the dvr buffer and
 > user space, where you don't need to re-filter them.  This would be more
 > efficient and make better use of buffer space, by dropping packets you don't
 > care about as soon as possible.

What prevents you from setting filters for those 50 PIDs? 
Currently, one has to open 50 demux files for that but it should work.
Budget cards should support 256.

A single ioctl for setting all wanted PIDs would be nicer but, when it was
discussed before, there was disagreement, the (then also already) 
upcoming V4 API was supposed to handle it, etc.

The filter also used to be O(1) (I am still using it). I think it was
changed in the linuxtv tree because you would either not need more than 
a few PIDs (true most of the time) or just take the whole TS, or
something like that.
Should not be too hard to change that back and add other features.


Ralph



More information about the linux-dvb mailing list