1. 25 Jan, 2011 2 commits
    • Gerd Hoffmann's avatar
      pulseaudio: setup buffer attrs · e6d16fa4
      Gerd Hoffmann authored
      
      
      Request reasonable buffer sizes from pulseaudio.  Without this
      pa_simple_write() can block quite long and lead to dropouts,
      especially with guests which use small audio ring buffers.
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarmalc <av1474@comtv.ru>
      e6d16fa4
    • Gerd Hoffmann's avatar
      pulseaudio: process 1/4 buffer max at once · 6315633b
      Gerd Hoffmann authored
      
      
      Limit the size of data pieces processed by the pulseaudio worker
      threads.  Never ever process more than 1/4 of the buffer at once.
      
      Background: The buffer area currently processed by the pulseaudio thread
      is blocked, i.e. the main thread (or iothread) can't fill in more data
      there.  The buffer processing time is roughly real-time due to the
      pa_simple_write() call blocking when the output queue to the pulse
      server is full.  Thus processing big chunks at once means blocking
      a large part of the buffer for a long time.  This brings high latency
      and can lead to dropouts.
      
      When processing the buffer in smaller chunks the rpos handling becomes a
      problem though.  The thread reads hw->rpos without knowing whenever
      qpa_run_out has already seen the last (small) chunk processed and
      updated rpos accordingly.  There is no point in reading hw->rpos though,
      pa->rpos can be used instead.  We just need to take care to initialize
      pa->rpos before kicking the thread.
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarmalc <av1474@comtv.ru>
      6315633b
  2. 12 Jan, 2011 1 commit
  3. 28 Sep, 2010 1 commit
    • Wu Fengguang's avatar
      pulse-audio: fix bug on updating rpos · fd5723b3
      Wu Fengguang authored
      
      
      Fix a rpos coordination bug between qpa_run_out() and qpa_thread_out(),
      which shows up as playback noises.
      
      	qpa_run_out()
      			qpa_thread_out loop N critical section 1
      	qpa_run_out()   qpa_thread_out loop N doing pa_simple_write()
      	qpa_run_out()	qpa_thread_out loop N doing pa_simple_write()
      			qpa_thread_out loop N critical section 2
      			qpa_thread_out loop N+1 critical section 1
      	qpa_run_out()	qpa_thread_out loop N+1 doing pa_simple_write()
      
      In the above scheme, "qpa_thread_out loop N+1 critical section 1" will
      get the same rpos as the one used by "qpa_thread_out loop N critical
      section 1". So it will be reading dead samples from the old rpos.
      
      The rpos can only be updated back to qpa_thread_out when there is a
      qpa_run_out() run between two qpa_thread_out loops.
      
      normal sequence:
      	qpa_thread_out:
      			hw->rpos (X0) => local rpos => pa->rpos (X1)
      	qpa_run_out:
      			pa->rpos (X1) => hw->rpos (X1)
      	qpa_thread_out:
      			hw->rpos (X1) => local rpos => pa->rpos (X2)
      
      buggy sequence:
      	qpa_thread_out:
      			hw->rpos (X0) => local rpos => pa->rpos (X1)
      	qpa_thread_out:
      			hw->rpos (X0) => local rpos => pa->rpos (X1')
      
      Obviously qpa_run_out() shall be called at least once between any two
      qpa_thread_out loops (after pa->rpos is set), in order for the new
      qpa_thread_out loop to see the updated rpos.
      
      Setting pa->live to 0 does the trick. The next loop will have to wait
      for one qpa_run_out() invocation in order to get a non-zero pa->live
      and proceed.
      
      Signed-off-by: default avatarmalc <av1474@comtv.ru>
      Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
      fd5723b3
  4. 13 Oct, 2009 1 commit
  5. 18 Sep, 2009 1 commit
    • malc's avatar
      audio: internal API change · bdff253c
      malc authored
      
      
      pcm_ops.run_out now takes number of live samples (which will be always
      greater than zero) as a second argument, every driver was calling
      audio_pcm_hw_get_live_out anyway with exception of fmod which used
      audio_pcm_hw_get_live_out2 for no good reason.
      
      Signed-off-by: default avatarmalc <av1474@comtv.ru>
      bdff253c
  6. 11 Aug, 2009 5 commits
  7. 18 Jun, 2009 1 commit
  8. 03 Dec, 2008 1 commit
  9. 06 Oct, 2008 1 commit
  10. 05 Oct, 2008 1 commit
  11. 02 Jul, 2008 1 commit