* Re: Gstreamer e DCCP: issues related to ccid-3
2007-10-25 3:47 Gstreamer e DCCP: issues related to ccid-3 Łeandro Sales
@ 2007-10-25 10:17 ` Gerrit Renker
2007-10-25 10:29 ` Gerrit Renker
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Gerrit Renker @ 2007-10-25 10:17 UTC (permalink / raw)
To: dccp
| I'm implementing the dccp plugin for gstreamer and everything goes
| very well, I can transmit an mp3 sound using ccid-2, but when I try to
| use ccid-3, I can just send very little via send function and after
| the function returns 11 (EAGAIN). Is there any different parameter
| that I should set? I think that the problem that you had in VLC should
| be the same
This problem (or "feature") is well-known, Ian has also repeatedly pointed out
to this. Basically, what your code needs to be able to do is cope with EAGAIN,
i.e. when the TX buffer is full and CCID3 decides to throttle the sending speed,
the write call needs to be repeated.
I haven't checked the VLC code lately (it will have such a test), but I know that
Andre Noll developed a very clever way of handling this, by using a "generic chunk queue"
for audio chunks which could currently not be sent. He implemented this in paraslash
(file dccp_send.c), the sources are on http://www.systemlinux.org/~maan/paraslash/
For this most recent feature, it is best to use his git tarball:
http://www.systemlinux.org/~maan/paraslash/versions/paraslash-git.tar.bz2
I also
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Gstreamer e DCCP: issues related to ccid-3
2007-10-25 3:47 Gstreamer e DCCP: issues related to ccid-3 Łeandro Sales
2007-10-25 10:17 ` Gerrit Renker
@ 2007-10-25 10:29 ` Gerrit Renker
2007-10-25 17:14 ` Ian McDonald
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Gerrit Renker @ 2007-10-25 10:29 UTC (permalink / raw)
To: dccp
| Basically the functions that I'm using to send are the following:
|
| PS: the second function, gst_dccp_send_buffer, is a call back function
| called by gstreamer when it has data to be sent. Thank you.
| /* write buffer to given socket incrementally.
| * Returns number of bytes written.
| */
| gint
| gst_dccp_socket_write (int socket, const void *buf, size_t count)
| {
| size_t bytes_written = 0;
| ssize_t wrote;
|
| while (bytes_written < count) {
| wrote = send (socket, (const char *) buf + bytes_written,
| count - bytes_written, MSG_NOSIGNAL);
| if (wrote <= 0) {
| return bytes_written;
| }
| bytes_written += wrote;
| }
/* something like (but do have a look at the paraslash sources)
do {
wrote = send (socket, (const char *) buf + bytes_written,
count - bytes_written, MSG_NOSIGNAL);
} while (wrote < 0 && errno = EAGAIN);
*/
If the function below is a callback, then this may be tricky, since
the solution is to poll (the above do..while loop), until there is
room in the sender's TX queue.
In principle, you could use the same do..while loop, or decide to
store the chunk back into a list and reschedule the callback to
"call later", as it is done in the paraslash sources.
|
| /* write a GDP header to the socket. Return false if fails. */
| GstFlowReturn
| gst_dccp_send_buffer (GstElement * this, GstBuffer * buffer, int socket)
| {
| size_t wrote;
|
| gint size = 0;
| guint8 *data;
|
| size = GST_BUFFER_SIZE (buffer);
| data = GST_BUFFER_DATA (buffer);
|
| GST_LOG_OBJECT (this, "writing %d bytes for GDP buffer header\n", size);
| printf("writing %d bytes for GDP buffer header\n\n", size);
| wrote = gst_dccp_socket_write (socket, data, size);
| //g_free (data);
|
| if (wrote != size) {
| GST_ELEMENT_ERROR (this, CORE, TOO_LAZY, (NULL),
| ("Error while sending data"));
| printf("Error while sending data\n");
| return GST_FLOW_ERROR;
| }
|
| return GST_FLOW_OK;
| }
|
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Gstreamer e DCCP: issues related to ccid-3
2007-10-25 3:47 Gstreamer e DCCP: issues related to ccid-3 Łeandro Sales
2007-10-25 10:17 ` Gerrit Renker
2007-10-25 10:29 ` Gerrit Renker
@ 2007-10-25 17:14 ` Ian McDonald
2007-11-01 4:13 ` Łeandro Sales
2007-11-01 9:48 ` Gerrit Renker
4 siblings, 0 replies; 6+ messages in thread
From: Ian McDonald @ 2007-10-25 17:14 UTC (permalink / raw)
To: dccp
On 10/25/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> /* something like (but do have a look at the paraslash sources)
> do {
> wrote = send (socket, (const char *) buf + bytes_written,
> count - bytes_written, MSG_NOSIGNAL);
> } while (wrote < 0 && errno = EAGAIN);
> */
>
>
You can also look at iperf code, ttcp code etc.
--
Web1: http://wand.net.nz/~iam4/
Web2: http://www.jandi.co.nz
Blog: http://iansblog.jandi.co.nz
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Gstreamer e DCCP: issues related to ccid-3
2007-10-25 3:47 Gstreamer e DCCP: issues related to ccid-3 Łeandro Sales
` (2 preceding siblings ...)
2007-10-25 17:14 ` Ian McDonald
@ 2007-11-01 4:13 ` Łeandro Sales
2007-11-01 9:48 ` Gerrit Renker
4 siblings, 0 replies; 6+ messages in thread
From: Łeandro Sales @ 2007-11-01 4:13 UTC (permalink / raw)
To: dccp
2007/10/25, Ian McDonald <ian.mcdonald@jandi.co.nz>:
> On 10/25/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> > /* something like (but do have a look at the paraslash sources)
> > do {
> > wrote = send (socket, (const char *) buf + bytes_written,
> > count - bytes_written, MSG_NOSIGNAL);
> > } while (wrote < 0 && errno = EAGAIN);
> > */
> >
> >
> You can also look at iperf code, ttcp code etc.
> --
> Web1: http://wand.net.nz/~iam4/
> Web2: http://www.jandi.co.nz
> Blog: http://iansblog.jandi.co.nz
>
Did you implemented a similar solution in the code that you sent to
me? I didn't have enough time to check your code because I was busy on
the ccid-4 patches.
Leandro.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Gstreamer e DCCP: issues related to ccid-3
2007-10-25 3:47 Gstreamer e DCCP: issues related to ccid-3 Łeandro Sales
` (3 preceding siblings ...)
2007-11-01 4:13 ` Łeandro Sales
@ 2007-11-01 9:48 ` Gerrit Renker
4 siblings, 0 replies; 6+ messages in thread
From: Gerrit Renker @ 2007-11-01 9:48 UTC (permalink / raw)
To: dccp
Quoting Łeandro Sales:
| 2007/10/25, Ian McDonald <ian.mcdonald@jandi.co.nz>:
| > On 10/25/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
| > > /* something like (but do have a look at the paraslash sources)
| > > do {
| > > wrote = send (socket, (const char *) buf + bytes_written,
| > > count - bytes_written, MSG_NOSIGNAL);
| > > } while (wrote < 0 && errno = EAGAIN);
| > > */
| > >
| > >
| > You can also look at iperf code, ttcp code etc.
| > --
| > Web1: http://wand.net.nz/~iam4/
| > Web2: http://www.jandi.co.nz
| > Blog: http://iansblog.jandi.co.nz
| >
|
| Did you implemented a similar solution in the code that you sent to
| me? I didn't have enough time to check your code because I was busy on
| the ccid-4 patches.
|
Check
* ttcp (all versions, Arnaldo's, Ian's, or mine)
* iperf http://www.erg.abdn.ac.uk/users/gerrit/dccp/apps/#iperf
* but most of all: paraslash
- http://www.systemlinux.org/~maan/paraslash/
- get http://www.systemlinux.org/~maan/paraslash/versions/paraslash-git.tar.bz2
-
To unsubscribe from this list: send the line "unsubscribe dccp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread