Skip to content
Snippets Groups Projects
  1. Mar 18, 2019
  2. Mar 11, 2019
  3. Jan 24, 2019
    • Gerd Hoffmann's avatar
      audio: check for pulseaudio daemon pidfile · d175505b
      Gerd Hoffmann authored
      
      Check whenever the pulseaudio daemon pidfile is present before trying to
      initialize the pulseaudio backend.  Just return NULL if that is not the
      case, so qemu will check the next backend in line.
      
      In case the user explicitly configured a non-default pulseaudio server
      skip the check.
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20190124112055.547-5-kraxel@redhat.com
      d175505b
  4. Nov 12, 2018
  5. Mar 12, 2018
  6. Feb 06, 2018
  7. Jan 16, 2018
    • Eric Blake's avatar
      maint: Fix macros with broken 'do/while(0); ' usage · 2562755e
      Eric Blake authored
      
      The point of writing a macro embedded in a 'do { ... } while (0)'
      loop (particularly if the macro has multiple statements or would
      otherwise end with an 'if' statement) is so that the macro can be
      used as a drop-in statement with the caller supplying the
      trailing ';'.  Although our coding style frowns on brace-less 'if':
        if (cond)
          statement;
        else
          something else;
      that is the classic case where failure to use do/while(0) wrapping
      would cause the 'else' to pair with any embedded 'if' in the macro
      rather than the intended outer 'if'.  But conversely, if the macro
      includes an embedded ';', then the same brace-less coding style
      would now have two statements, making the 'else' a syntax error
      rather than pairing with the outer 'if'.  Thus, even though our
      coding style with required braces is not impacted, ending a macro
      with ';' makes our code harder to port to projects that use
      brace-less styles.
      
      The change should have no semantic impact.  I was not able to
      fully compile-test all of the changes (as some of them are
      examples of the ugly bit-rotting debug print statements that are
      completely elided by default, and I didn't want to recompile
      with the necessary -D witnesses - cleaning those up is left as a
      bite-sized task for another day); I did, however, audit that for
      all files touched, all callers of the changed macros DID supply
      a trailing ';' at the callsite, and did not appear to be used
      as part of a brace-less conditional.
      
      Found mechanically via: $ git grep -B1 'while (0);' | grep -A1 \\\\
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Acked-by: default avatarCornelia Huck <cohuck@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Acked-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20171201232433.25193-7-eblake@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2562755e
  8. Jun 03, 2016
  9. Feb 02, 2016
  10. Jun 15, 2015
  11. Dec 09, 2013
  12. May 03, 2012
  13. Apr 25, 2012
  14. Apr 17, 2012
  15. Aug 21, 2011
  16. Jan 25, 2011
    • Gerd Hoffmann's avatar
      pulseaudio: tweak config · bf1064b5
      Gerd Hoffmann authored
      
      Zap unused divisor field.
      Raise the buffer size default.
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarmalc <av1474@comtv.ru>
      bf1064b5
    • 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
  17. Jan 12, 2011
  18. Sep 29, 2010
    • 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
  19. Oct 13, 2009
  20. Sep 18, 2009
    • 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
  21. Aug 11, 2009
  22. Jun 18, 2009
  23. Dec 03, 2008
  24. Oct 06, 2008
  25. Oct 05, 2008
  26. Jul 02, 2008
Loading