Re: real-time process

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

 



On Thu, Oct 17, 2002 at 03:25:41PM +0530, Nagaraj wrote:
> From: "Jan Hudec" <bulb@ucw.cz>:
> > AFAIK, you just have to make them do blocking waiting for the data. When
> > it blocks, scheduler will run something else for a timer tick.
> 
> The blocking call affects the video streaming. Specially if u r talking of
> MPEG
> streams, the buffer overflow/underflow will lead to display going crazy.
> Best is to follow a non blocking call, and design ur application
> accordingly.

If you don't do a blocking call, you will never leave CPU and thus the
machine will not do anything else. Even kernel threads won't run - they
are high priority normal proceses, not realtime.

I don't talk about blocking output to the net. I mean to block until
any action is possible - in poll. You would like to wait until there are
at least n bytes to read from the camera, not just one, but that has to
be done in the kernel driver.

You need to do one frame (or rather one block) at a time and then wait
in poll until there is a next one ready from the camera or the net is
ready to accept more data. If there will be no time left to spend
sleeping in poll, then the machine is probably too slow.

> (Well,
> > you would probably like it to wake up when there are at least n bytes
> > available; now that would have to be done in kernel).
> > Displaying video does not have to be real-time. It can skip frames if
> > something else interferes and delays it too much.
> 
> AFAIK Skipping frames is decided by the encoder and decoder not in
> the transportation layer ( where data is actually xfered ).

Skiping frames can be two different things at two different points.
Either the encoder can skip frame when the network bandwith is too
small (if it has more than one frame ready to send, it only sends the
latest and forgets the rest). Or the decoder can skip displaying frames,
when the display is too slow (if it already has more than one frame in
recieve buffer when it is done with one frame, it only displays the
latest and forget about the rest).

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux