I finally understood the previous problem, but am now facing another one. Using the following code (which corrects my first problem) :<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">

int fd = sp_get_fd(pipe);<br>
  <br>
    fd_set rfds;<br>
    FD_ZERO(&rfds);<br>
    FD_SET(fd, &rfds);<br>
    select(fd+1, &rfds, NULL, NULL, NULL);<br>
  <br>
    int k = recv_to_buffer (pipe, buffer);<br>
    sp_client_recv_finish(pipe, buf);<br>
</blockquote>
<br>I get the following error :<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">shmTest: shmpipe.c:729: sp_client_recv_finish: Assertion `shm_area' failed.<br>

Abandon<br></blockquote><br>Looks like my pipe get no ShmArea, right ? Where could this error come from ?<br><br>Thanks.<br><br><div class="gmail_quote">2012/7/6 Hamza Chouh <span dir="ltr"><<a href="mailto:hchouh@gmail.com" target="_blank">hchouh@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Thank you for your answers. <br><br></div><div class="im"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">

The easiest route is to use the "shmsrc" element in your external
<br>application, otherwise you will have to write your own shmsrc-like
<br>client for your application.
<br>If it's of any help, a while ago I made a minimal python example using
<br>the shmsrc and shmsink elements that might be of some use:
<br><br><a href="https://github.com/tmatth/gst-prototypes/tree/master/shm" rel="nofollow" target="_blank">https://github.com/tmatth/gst-prototypes/tree/master/shm</a><br><br>Best,
<br>Tristan
<br></blockquote></div><div>I think I'll be forced to write my own shmsrc-like (actually, if I found a way to directly send my audio stream to the application without shm, I would). Anyway, I'll try to understand your python example which seems interesting.<div class="im">

<br>
<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Copy shmpipe.[ch] and shmalloc.[ch] into your application and use the<br>
read API described in shmpipe.h (sp_client_* sp_close, sp_get_fd) to get<br>
the buffers.</blockquote></div><div> <br>I already started to try use this API. So, if I understood well, I have to :<br><ol><li>Open a client connection with the server : ShmPipe * pipe = sp_client_open(PATH);<br></li><li>

Wait for data to read : select(sp_get_fd(pipe), &rdfs, NULL, NULL, NULL);<br>
</li><li>Then receive the data to read : sp_client_recv(pipe, my_buffer);</li><li>And finally finish to read using : sp_client_recv_finish()</li></ol><p>Now it seems very clear to me, however I still can't get it work : even if I send a stream to the specified path (using gst-launch audiotestsrc ! shmsink socket-path=testpath), my little program waits eternally, not seeing any incoming data.</p>


<p>I think I missed something really simple but I can't get it.<br></p></div> </div><div class="gmail_quote">2012/7/5 Olivier Crête <span dir="ltr"><<a href="mailto:olivier.crete@collabora.com" target="_blank">olivier.crete@collabora.com</a>></span><br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Hi,<br>
<div><br>
On Thu, 2012-07-05 at 08:52 -0700, Takido wrote:<br>
> Hello,<br>
><br>
> I'm trying to feed an external application which deals sound to a special<br>
> hardware with shmsink. I read all the doc I could find about shm (including<br>
> the commented part of shmpipe.h) but I still don't understand they way I<br>
> could get the audio stream in my external application.<br>
><br>
> How can I do that ?<br>
<br>
</div>Copy shmpipe.[ch] and shmalloc.[ch] into your application and use the<br>
read API described in shmpipe.h (sp_client_* sp_close, sp_get_fd) to get<br>
the buffers.<br>
<span><font color="#888888"><br>
--<br>
Olivier Crête<br>
<a href="mailto:olivier.crete@collabora.com" target="_blank">olivier.crete@collabora.com</a><br>
</font></span><br></div></div><div class="im">_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></div></blockquote></div><br>
</blockquote></div><br>