Skip to content
Snippets Groups Projects
  1. Mar 06, 2023
    • Volker Rümelin's avatar
      alsaaudio: reintroduce default recording settings · 5140ad82
      Volker Rümelin authored
      
      Audio recording with ALSA default settings currently doesn't
      work. The debug log shows updates every 0.75s and 1.5s.
      
      audio: Elapsed since last alsa run (running): 0.743030
      audio: Elapsed since last alsa run (running): 1.486048
      audio: Elapsed since last alsa run (running): 0.743008
      audio: Elapsed since last alsa run (running): 1.485878
      audio: Elapsed since last alsa run (running): 1.486040
      audio: Elapsed since last alsa run (running): 1.485886
      
      The time between updates should be in the 10ms range. Audio
      recording with ALSA has the same timing contraints as playback.
      Reintroduce the default recording settings and use the same
      default settings for recording as for playback.
      
      The term "reintroduce" is correct because commit a93f3281
      ("alsaaudio: port to -audiodev config") removed the default
      settings for recording.
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20230121094735.11644-11-vr_qemu@t-online.de>
      5140ad82
    • Volker Rümelin's avatar
      alsaaudio: change default playback settings · 46744732
      Volker Rümelin authored
      
      The currently used default playback settings in the ALSA audio
      backend are a bit unfortunate. With a few emulated audio devices,
      audio playback does not work properly. Here is a short part of
      the debug log while audio is playing (elapsed time in seconds).
      
      audio: Elapsed since last alsa run (running): 0.046244
      audio: Elapsed since last alsa run (running): 0.023137
      audio: Elapsed since last alsa run (running): 0.023170
      audio: Elapsed since last alsa run (running): 0.023650
      audio: Elapsed since last alsa run (running): 0.060802
      audio: Elapsed since last alsa run (running): 0.031931
      
      For some audio devices the time of more than 23ms between updates
      is too long.
      
      Set the period time to 5.8ms so that the maximum time between
      two updates typically does not exceed 11ms. This roughly matches
      the 10ms period time when doing playback with the audio timer.
      After this patch the debug log looks like this.
      
      audio: Elapsed since last alsa run (running): 0.011919
      audio: Elapsed since last alsa run (running): 0.005788
      audio: Elapsed since last alsa run (running): 0.005995
      audio: Elapsed since last alsa run (running): 0.011069
      audio: Elapsed since last alsa run (running): 0.005901
      audio: Elapsed since last alsa run (running): 0.006084
      
      Acked-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20230121094735.11644-10-vr_qemu@t-online.de>
      46744732
    • Volker Rümelin's avatar
      audio/alsaaudio: use g_new0() instead of audio_calloc() · d1def19f
      Volker Rümelin authored
      
      Replace audio_calloc() with the equivalent g_new0().
      
      The value of the g_new0() argument count is >= 1, which means
      g_new0() will never return NULL. Also remove the unnecessary
      NULL check.
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20230121094735.11644-6-vr_qemu@t-online.de>
      d1def19f
  2. Dec 13, 2022
  3. Oct 11, 2022
  4. Mar 22, 2022
  5. Mar 04, 2022
    • Volker Rümelin's avatar
      audio: restore mixing-engine playback buffer size · 9833438e
      Volker Rümelin authored
      
      Commit ff095e52 "audio: api for mixeng code free backends"
      introduced another FIFO for the audio subsystem with exactly the
      same size as the mixing-engine FIFO. Most audio backends use
      this generic FIFO. The generic FIFO used together with the
      mixing-engine FIFO doubles the audio FIFO size, because that's
      just two independent FIFOs connected together in series.
      
      For audio playback this nearly doubles the playback latency.
      
      This patch restores the effective mixing-engine playback buffer
      size to a pre v4.2.0 size by only accepting the amount of
      samples for the mixing-engine queue which the downstream queue
      accepts.
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Reviewed-by: default avatarAkihiko Odaki <akihiko.odaki@gmail.com>
      Message-Id: <20220301191311.26695-10-vr_qemu@t-online.de>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      9833438e
  6. Jun 17, 2021
  7. Jan 15, 2021
  8. Feb 18, 2020
  9. Feb 06, 2020
  10. Jan 31, 2020
    • Volker Rümelin's avatar
      audio: fix bug 1858488 · fdc8c5f4
      Volker Rümelin authored
      The combined generic buffer management code and buffer run out
      code in function audio_generic_put_buffer_out has a problematic
      behaviour. A few hundred milliseconds after playback starts the
      mixing buffer and the generic buffer are nearly full and the
      following pattern can be seen.
      
      On first call of audio_pcm_hw_run_out the buffer run code in
      audio_generic_put_buffer_out writes some data to the audio
      hardware but the generic buffer will fill faster and is full
      when audio_pcm_hw_run_out returns. This is because emulated
      audio devices can produce playback data at a higher rate than
      the audio backend hardware consumes this data.
      
      On next call of audio_pcm_hw_run_out the buffer run code in
      audio_generic_put_buffer_out writes some data to the audio
      hardware but no audio data is transferred to the generic buffer
      because the buffer is already full.
      
      Then the pattern repeats. For the emulated audio device this
      looks like the audio timer period has doubled.
      
      This patch splits the combined generic buffer management code
      and buffer run out code and calls the buffer run out code after
      buffer management code to break this pattern.
      
      The bug report is for the wav audio backend. But the problem is
      not limited to this backend. All audio backends which use the
      audio_generic_put_buffer_out function show this problem.
      
      Buglink: https://bugs.launchpad.net/qemu/+bug/1858488
      
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Message-Id: <20200123074943.6699-5-vr_qemu@t-online.de>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      fdc8c5f4
  11. Oct 18, 2019
  12. Sep 23, 2019
  13. Aug 21, 2019
  14. Jun 12, 2019
  15. Mar 11, 2019
  16. Dec 12, 2018
  17. Mar 12, 2018
  18. Feb 06, 2018
  19. Feb 02, 2016
  20. Jun 15, 2015
  21. Jun 12, 2015
  22. Jun 13, 2014
  23. Dec 19, 2012
  24. Aug 21, 2011
  25. Jan 12, 2011
Loading