[pulseaudio-tickets] [PulseAudio] #144: rtp sink latency increments

PulseAudio trac-noreply at tango.0pointer.de
Fri May 2 16:27:44 PDT 2008


#144: rtp sink latency increments
---------------------------+------------------------------------------------
  Reporter:  Rudd-O        |       Owner:  lennart
      Type:  defect        |      Status:  new    
  Priority:  normal        |   Milestone:         
 Component:  module-rtp-*  |    Severity:  normal 
Resolution:                |    Keywords:         
---------------------------+------------------------------------------------
Comment (by bcavagnolo):

 Hello,

 My company has been using pulseaudio in mesh networking demos.  Recently,
 we had the same problem described here.  We observed both gradual and
 abrupt increases in latency.  Here's what was going on:

 Suppose the recv module's memblockq can hold 5 seconds of audio for a
 given stream.  The rtp recv module is set up to prebuffer 100ms of audio.
 If the module fails to receive 2 seconds worth of packets starting at t=0,
 the 100ms will be consumed, the length of the recv module's memblockq will
 go to 0, and the sink will output silence until t=2 seconds.  When the
 next packet successfully arrives at t=2 seconds, the recv module will seek
 forward 2 seconds in the queue and insert the new packet.  This leaves 2
 seconds of silence at the beginning of the queue.  The sink will play this
 silence before getting to the new packet.  So, the sink will play 2
 seconds of silence while the memblockq is empty, and another 2 seconds of
 silence after the t=2 packet arrives, and it will finally play the t=2
 packet at t=4s.

 On the other hand, if the memblockq can only hold 500ms of audio, when it
 attempts to seek forward the 2 seconds, it will fail and purge the queue.
 In this case, the t=2 packet will be played as soon as possible, which
 will be approximately correct.

 The fix for this problem is to specify the size of the memblockq in time
 instead of bytes.  When the rtp session is created, the size of the
 memblockq is calculated based on the sample spec.  I've attached a patch
 against today's svn HEAD.

-- 
Ticket URL: <http://www.pulseaudio.org/ticket/144#comment:2>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server


More information about the pulseaudio-bugs mailing list