[Verse-dev] Audio streaming and verse_callback_update()

Samuel Siltanen saasilta at cc.hut.fi
Fri Dec 2 10:12:49 CET 2005


On Thu, 1 Dec 2005, Emil Brink wrote:

> Personally I tend towards larger values, but I've not written anything
> really performance-critical. 10000 is my default.

That is my default value also, but for streaming audio it was too large a 
value.

> A single Verse a_stream command will carry a maximum of 256 samples in
> that format, i.e. 1024 bytes of sample data. Assuming each of these
> commands gets its own Ethernet packet, we're looking at 2 * 176400 / 1024
> or 344 packets per second. This is one packet every 2.9 ms in the
> receiving end. I'm not sure if this means that your application needs
> to pass a value smaller than this to verse_callback_update(). Eskil?

I did the math too, and my conclusions were similar. But doesn't 
verse_callback_update() receive several packets in one call?

> Are you running this inside a single machine, or do the data actually
> have to traverse a network? Since you're seeing data loss, I wonder if
> it's "just" Verse choking, or perhaps really data loss due to packets
> being dropped somewhere en route.

I actually do it over a network. The command "ping" gives an average delay 
of about 100 ms. Apparently there are no packets lost initially. I have 
used the timestamps in verse_send_a_stream()-commands in debugging. And 
apparently the receiver gets all the packets, and the receiver and the 
sender are synchronized - until a certain amount of data (this seems to 
be a fixed number, because I experimented with diffrent sample rates) has 
been trasmitted. Then the sender gets ahead of the receiver. I interpret 
that this behavior is due to some buffer getting full, after which the 
packets send by the sender are dropped (is this what Verse does?). 
Because the sample rate at both ends is the same (even if it were not the 
same we could use interpolation), the sender and the receiver should 
handle the same amount of data per time unit. Thus the buffer would not 
get full as long as the network through-put is relatively constant and 
high enough. Becuase the network is fine, I assume that either Verse 
cannot handle the large amount of data or the receiver cannot get the 
packets out of Verse's buffer fast enough.

> Sorry for not having anything more concrete to offer you, I simply don't
> have too much experience with streaming audio over Verse. You guys are
> the first to try it for real, and pioneer it. Hopefully, we can get to
> the bottom of this together.

Yes, it takes awful lot of time, but I hope our experiences can be useful 
to others working with this system later.


Samuel Siltanen
saasilta at cc.hut.fi


More information about the Verse-dev mailing list