Mailing List archive

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

[linux-dvb] Re: refactoring



Gerd Knorr wrote:

How do you check whether new data is available? Are you doing
busy-polling on the write position? I wanted to wake up a
poll()-waitqueue in the data-available irq, but maybe there are better
ways...

Well the thing is that there is almost always new data waiting (at least
on full-TS devices) so it's not really busy waiting. The user program just
gets a chunk of new packets, then does whatever it wants to them: writes
them to disk, sends them over the network, demultiplexes the PES for
decoding, etc.

I doubt that this is true. For example an application which does a
channel scan wants to read just a few tables. For 99% of the TS packets
the "processing" is looking at the PID, noticing "oh, that one is not
for me" and throw it away. That will be fast enougth that the app has
to wait for data.

Even when decoding video that will be true, it takes around 10% CPU only
on a modern desktop machine, so the app _has_ to wait at some point. If
it's not waiting for TS data then just because it's waiting somewhere
else (before blitting the video frame to the screen to get the timing
and a/v sync correct for example), not because the TS data is coming in
fast enougth.

You can wait between frames and decode then all data that is available, it makes no difference whether the yet-to-be decoded MPEG data is buffered in PES buffers inside the decoder or in the DMA ringbuffers.

Holger





Home | Main Index | Thread Index