Skip to content
Snippets Groups Projects
  1. May 26, 2020
    • Volker Rümelin's avatar
      audio/mixeng: fix clang 10+ warning · 9c61fcc8
      Volker Rümelin authored
      The code in CONV_NATURAL_FLOAT() and CLIP_NATURAL_FLOAT()
      seems to use the constant 2^31-0.5 to convert float to integer
      and back. But the float type lacks the required precision and
      the constant used for the conversion is 2^31. This is equiva-
      lent to a [-1.f, 1.f] <-> [INT32_MIN, INT32_MAX + 1] mapping.
      
      This patch explicitly writes down the used constant. The
      compiler generated code doesn't change.
      
      The constant 2^31 has an exact float representation and the
      clang 10 compiler stops complaining about an implicit int to
      float conversion with a changed value.
      
      A few notes:
      - The conversion of 1.f to INT32_MAX + 1 doesn't overflow. The
        type of the destination variable is int64_t.
      - At a later stage one of the clip_* functions in
        audio/mixeng_template.h limits INT32_MAX + 1 to the integer
        range.
      - The clip_natural_float_* functions in audio/mixeng.c convert
        INT32_MAX and INT32_MAX + 1 to 1.f.
      
      Buglink: https://bugs.launchpad.net/bugs/1878627
      
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Message-id: 20200523201712.23908-1-vr_qemu@t-online.de
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      9c61fcc8
  2. May 25, 2020
  3. Apr 06, 2020
  4. Mar 16, 2020
  5. Feb 18, 2020
  6. Feb 06, 2020
  7. Jan 31, 2020
  8. Jan 24, 2020
  9. Jan 06, 2020
    • Volker Rümelin's avatar
      audio: fix integer overflow · 40ad46d3
      Volker Rümelin authored
      
      Tell the compiler to do a 32bit * 32bit -> 64bit multiplication
      because period_ticks is a 64bit variable. The overflow occurs
      for audio timer periods larger than 4294967us.
      
      Fixes: be1092af "audio: fix audio timer rate conversion bug"
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Message-id: 8893a235-66a8-8fbe-7d95-862e29da90b1@t-online.de
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      40ad46d3
    • Volker Rümelin's avatar
      paaudio: wait until the recording stream is ready · 7c9eb86e
      Volker Rümelin authored
      
      Don't call pa_stream_peek before the recording stream is ready.
      
      Information to reproduce the problem.
      
      Start and stop Audacity in the guest several times because the
      problem is racy.
      
      libvirt log file:
      -audiodev pa,id=audio0,server=localhost,out.latency=30000,
       out.mixing-engine=off,in.mixing-engine=off \
      -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,
       resourcecontrol=deny \
      -msg timestamp=on
      : Domain id=4 is tainted: custom-argv
      char device redirected to /dev/pts/1 (label charserial0)
      audio: Device pcspk: audiodev default parameter is deprecated,
       please specify audiodev=audio0
      audio: Device hda: audiodev default parameter is deprecated,
       please specify audiodev=audio0
      pulseaudio: pa_stream_peek failed
      pulseaudio: Reason: Bad state
      pulseaudio: pa_stream_peek failed
      pulseaudio: Reason: Bad state
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Message-id: 20200104091122.13971-5-vr_qemu@t-online.de
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      7c9eb86e
    • Volker Rümelin's avatar
      paaudio: try to drain the recording stream · acc3b63e
      Volker Rümelin authored
      
      There is no guarantee a single call to pa_stream_peek every
      timer_period microseconds can read a recording stream faster
      than the data gets produced at the source. Let qpa_read try to
      drain the recording stream.
      
      To reproduce the problem:
      
      Start qemu with -audiodev pa,id=audio0,in.mixing-engine=off
      
      On the host connect the qemu recording stream to the monitor of
      a hardware output device. While the problem can also be seen
      with a hardware input device, it's obvious with the monitor of
      a hardware output device.
      
      In the guest start audio recording with audacity and notice the
      slow recording data rate.
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Message-id: 20200104091122.13971-4-vr_qemu@t-online.de
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      acc3b63e
    • Volker Rümelin's avatar
      paaudio: drop recording stream in qpa_fini_in · 4db3e634
      Volker Rümelin authored
      
      Every call to pa_stream_peek which returns a data length > 0
      should have a corresponding pa_stream_drop. A call to qpa_read
      does not necessarily call pa_stream_drop immediately after a
      call to pa_stream_peek. Test in qpa_fini_in if a last
      pa_stream_drop is needed.
      
      This prevents following messages in the libvirt log file after
      a recording stream gets closed and a new one opened.
      
      pulseaudio: pa_stream_drop failed
      pulseaudio: Reason: Bad state
      pulseaudio: pa_stream_drop failed
      pulseaudio: Reason: Bad state
      
      To reproduce start qemu with
      -audiodev pa,id=audio0,in.mixing-engine=off
      and in the guest start and stop Audacity several times.
      
      Signed-off-by: default avatarVolker Rümelin <vr_qemu@t-online.de>
      Message-id: 20200104091122.13971-3-vr_qemu@t-online.de
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      4db3e634
  10. Nov 20, 2019
  11. Oct 26, 2019
  12. Oct 18, 2019
  13. Sep 23, 2019
Loading