POV-Ray : Newsgroups : povray.unix : Problems sending image to a fifo Server Time
13 Jun 2024 20:43:16 EDT (-0400)
  Problems sending image to a fifo (Message 1 to 3 of 3)  
From: Cesar
Subject: Problems sending image to a fifo
Date: 23 Jul 2005 09:15:00
Message: <web.42e241cc59a5a6a877b4f9a0@news.povray.org>
Hi,

I've asked this before, but for some reason my old solution does not work in
my new linux box, don know why.

I made a c++ program that changes the scene files several times and each
time, it renders an image using povray. The image must go to a buffer for
posterior processing.

So I create a fifo and in my render function i fork. The child process calls
povray sending the image to the fifo (+Omyfifo.ppm, myfifo.ppm being the
named fifo I create with mkfifo()). In the parent process, the function
reads from  the fifo to the buffer.

But I'm having serius synchronization issues. I've tried so many things I'm
lost. I'm sure someone have done
this before. Could you help me, maybe post some code? I would really
appreciate it.

Thanks,

Cesar


Post a reply to this message

From: Christoph Hormann
Subject: Re: Problems sending image to a fifo
Date: 23 Jul 2005 09:40:02
Message: <dbthah$gbt$1@chho.imagico.de>
Cesar wrote:
> Hi,
> 
> I've asked this before, but for some reason my old solution does not work in
> my new linux box, don know why.
> 
> I made a c++ program that changes the scene files several times and each
> time, it renders an image using povray. The image must go to a buffer for
> posterior processing.
> 
> So I create a fifo and in my render function i fork. The child process calls
> povray sending the image to the fifo (+Omyfifo.ppm, myfifo.ppm being the
> named fifo I create with mkfifo()). In the parent process, the function
> reads from  the fifo to the buffer.
> 
> But I'm having serius synchronization issues. I've tried so many things I'm
> lost. I'm sure someone have done
> this before. Could you help me, maybe post some code? I would really
> appreciate it.

To me this sounds like a problem not related to POV-Ray - still if you 
have the impression POV-Ray does not correctly output to the fifo you 
should try writing the image to stdout (using '-o-' like described in 
the docs) and pipe that to the fifo (you can also duplicate the output 
for debugging purposes using 'tee' this way).

In general using fifos is not so easy so you might start by testing your 
program operation with a different program before using it with POV-Ray. 
  A fairly nice example for a simple tool using a fifo can be found on:

http://www.deez.info/sengelha/projects/sigrandd/doc/

Also note you probably don't need to use a fifo to do what you are 
trying to do - for an example how you can process the output of POV-Ray 
directly in a program see KIO-POV:

http://www.tu-bs.de/%7Ey0013390/kiopov/index.html

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 01 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Cesar
Subject: Re: Problems sending image to a fifo
Date: 23 Jul 2005 16:40:01
Message: <web.42e2aa04d922281b877b4f9a0@news.povray.org>
The problem was certainly not with POVRay, I knew that. Anyway, thanks very
much for the info! I was trying to use a named pipe and I had no control of
how POVRay was opening it and all.

I checked kiopov source and, knowing what to do, changed everything to use
unnamed pipes, which gave me a lot more control. I checked several times
(because sometimes things sync at random. kekekek) and everything works
great.

Thanks again.



Christoph Hormann <chr### [at] gmxde> wrote:
> To me this sounds like a problem not related to POV-Ray - still if you
> have the impression POV-Ray does not correctly output to the fifo you
> should try writing the image to stdout (using '-o-' like described in
> the docs) and pipe that to the fifo (you can also duplicate the output
> for debugging purposes using 'tee' this way).
>
> In general using fifos is not so easy so you might start by testing your
> program operation with a different program before using it with POV-Ray.
>   A fairly nice example for a simple tool using a fifo can be found on:
>
> http://www.deez.info/sengelha/projects/sigrandd/doc/
>
> Also note you probably don't need to use a fifo to do what you are
> trying to do - for an example how you can process the output of POV-Ray
> directly in a program see KIO-POV:
>
> http://www.tu-bs.de/%7Ey0013390/kiopov/index.html
>
> Christoph
>
> --
> POV-Ray tutorials, include files, Landscape of the week:
> http://www.tu-bs.de/~y0013390/ (Last updated 01 Jul. 2005)
> MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.