[vlc] Re: Using vlc to show video through another app

Michael S. Zick mszick at goquest.com
Thu Jul 15 17:40:26 CEST 2004


On Thu July 15 2004 08:32, Chhaya, Harshal wrote:
> Michael, Felix,
>
> Your suggestion about named pipes to interface to vlc
> helped considerably.
>
> I now have two applications - one reads from the USB
> driver and puts the data in the named pipe and the
> other reads from the pipe and writes it to vlc
> using 'fwrite()'. This works - for about 20 seconds.
>
Named Pipes -
The OS buffers data in kernel memory, either 'real'
or 'virtual' (OS dependand).
Some OS allow (or have built in) the ability to extend
that buffer to a disk file.
?? Does your 'CreateNamedPipe' have an option to
enable extension to a disk file ??

>
> After a few seconds, the CPU utilization reaches 100%
> which slows down my driver and I am back to the original
> problem. 
>
Sounds like your OS is buffering to 'virtual memory' only.
When the OS exhausts all 'real' memory, it has to start
swapping pages to/from the swap file/drive.
So -
1) If your virtual memory setup allows the choice of using
either a 'file' or a 'disk partition' - choose 'disk partition'
(after partitioning your hard drive for a separate 'swap'
space).
Win-95 had this option (default: 'file') - I don't know if
your OS does.
2) Install more RAM in your machine.

> It seems that the fwrite() still blocks 
> because the data is given faster to vlc than it wants.
>
Sort of -
Most likely fwrite() isn't blocked - the OS thread is
blocked waiting on a memory 'page request' from
the page swapper.
Meanwhile, your OS's page swapper is thrashing
itself to death.

> Is there any other way to feed data to vlc?
Open a socket.
(Probably will have same OS buffering problems)

>
Follow the course of a 'print spooler' - 
Write your own 'ring buffer' that uses only a fixed 
amount of memory and extends itself as necessary 
onto a disk file. Stick this logic into the program at
the point of your fwrite() - you do the buffering prior
to the fwrite() rather than the OS on its side of the
fwrite.

Summary:
1) Check your virtual memory configuration, use in
decreasing order of desirability:
  a) dedicated disk drive for swap file
  b) dedicated disk partition
  c) disk file
2) Check your real memory - install more if possible
3) Do your own buffering with a 'ring buffer' that uses
a fixed amount of memory (and extends to a disk file)
on your side of the fwrite() rather than leave it upto
the OS to do the buffering with its page swapper.
4) Install Linux.

Mike
> Thanks,
> Harshal

-- 
This is the vlc mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/support/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc mailing list