[PD] question about netclient and netserver

Roman Haefeli reduzierer at yahoo.de
Wed Mar 24 15:59:37 CET 2010


Hi Ivica

>From what I know, there is an internal buffer of ~4kB for the sending
sockets in both netclient and netserver (I can't recall whether this
buffer is built into the externals or is part of the network subsystem
of the OS). If that limit is hit, the Pd process is blocked until that
buffer is emptied again (which leads obviously to audio drop-outs).

IMHO, this is a design flaw, which all sending net-externals suffer
from. There is no way to check the state of this buffer, which would be
required in order to avoid a buffer overrun. It would be sufficient to
get notified only, when the buffer is completely emptied, so that you
could design your patch in a way that it would only send the next
message when the previous one is through. 

Currently, your best bet is not to send too big chunks in zero logical
time, but try to distribute the load over time (a.k.a [drip]ping the
messages every few ms), so that you don't hit the limit. However, this
only works, if you know beforehand what your network connection can
handle. If there are irregularities in the network, you still might
trigger a buffer overrun.   

In my experience, I never had x-runs in Jack because of that, though,
but only audio drop-outs in Pd. This might be due the fact that I'm
running both Pd and jackd with -rt while giving the jackd process an
even higher priority (drop-outs almost never trigger x-runs in jackd on
that system).

Roman 

On Tue, 2010-03-23 at 19:39 -0400, Ivica Ico Bukvic wrote:
> Hi all,
> 
> I've been trying to port my udp-based network communication to tcp-based
> and in a large ensemble netclient/netserver seemed like the best option.
> However, now that I've tested it in a couple sessions I am finding that
> every time I broadcast more than let's say dozen lines of text (coll
> data) which should be still less than a couple kb, I get nasty xruns
> (running through jack/linux). I am wondering what is causing this? Isn't
> netserver running in a separate thread?
> 
> Any ideas?
> 
> Any thoughts are most appreciated.
> 
> Best wishes,
> 
> Ico
> 
> 
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list



	
		
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de




More information about the Pd-list mailing list