qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] df016a: hda-codec: fix playback rate control


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] df016a: hda-codec: fix playback rate control
Date: Mon, 06 Jan 2020 09:45:14 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: df016a1998147ec328d7e800a7f7582e053720d1
      
https://github.com/qemu/qemu/commit/df016a1998147ec328d7e800a7f7582e053720d1
  Author: Volker Rümelin <address@hidden>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M hw/audio/hda-codec.c

  Log Message:
  -----------
  hda-codec: fix playback rate control

Since commit 1930616b98 "audio: make mixeng optional" the
function hda_audio_output_cb can no longer assume the function
parameter avail contains the free buffer size. With the playback
mixing-engine turned off this leads to a broken playback rate
control and playback buffer drops in regular intervals.

This patch moves down the rate calculation, so the correct
buffer fill level is used for the calculation.

Signed-off-by: Volker Rümelin <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: c435fea72bbae2c37e4ae375cbecfee0d4a5470c
      
https://github.com/qemu/qemu/commit/c435fea72bbae2c37e4ae375cbecfee0d4a5470c
  Author: Volker Rümelin <address@hidden>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M hw/audio/hda-codec.c

  Log Message:
  -----------
  hda-codec: fix recording rate control

Apply previous commit to hda_audio_input_cb for the same
reasons.

Signed-off-by: Volker Rümelin <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 4db3e634c77a671fadbba6d4d39e0d21232e5609
      
https://github.com/qemu/qemu/commit/4db3e634c77a671fadbba6d4d39e0d21232e5609
  Author: Volker Rümelin <address@hidden>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M audio/paaudio.c

  Log Message:
  -----------
  paaudio: drop recording stream in qpa_fini_in

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: Volker Rümelin <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: acc3b63e1bdf806de1a520522dd43e494461d3bb
      
https://github.com/qemu/qemu/commit/acc3b63e1bdf806de1a520522dd43e494461d3bb
  Author: Volker Rümelin <address@hidden>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M audio/paaudio.c

  Log Message:
  -----------
  paaudio: try to drain the recording stream

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: Volker Rümelin <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 7c9eb86e679b3b6992f97bd60440dbd1a9a75929
      
https://github.com/qemu/qemu/commit/7c9eb86e679b3b6992f97bd60440dbd1a9a75929
  Author: Volker Rümelin <address@hidden>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M audio/paaudio.c

  Log Message:
  -----------
  paaudio: wait until the recording stream is ready

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: Volker Rümelin <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 40ad46d3cc463fab5a23db466f77e37aff23f927
      
https://github.com/qemu/qemu/commit/40ad46d3cc463fab5a23db466f77e37aff23f927
  Author: Volker Rümelin <address@hidden>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M audio/audio.c

  Log Message:
  -----------
  audio: fix integer overflow

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: be1092afa0 "audio: fix audio timer rate conversion bug"

Signed-off-by: Volker Rümelin <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 5d112176457c070baa954fb6860df5ed1e55ad5c
      
https://github.com/qemu/qemu/commit/5d112176457c070baa954fb6860df5ed1e55ad5c
  Author: Peter Maydell <address@hidden>
  Date:   2020-01-06 (Mon, 06 Jan 2020)

  Changed paths:
    M audio/audio.c
    M audio/paaudio.c
    M hw/audio/hda-codec.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/kraxel/tags/audio-20200106-pull-request' into staging

audio: bugfixes.

# gpg: Signature made Mon 06 Jan 2020 12:51:15 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <address@hidden>" [full]
# gpg:                 aka "Gerd Hoffmann <address@hidden>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <address@hidden>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/audio-20200106-pull-request:
  audio: fix integer overflow
  paaudio: wait until the recording stream is ready
  paaudio: try to drain the recording stream
  paaudio: drop recording stream in qpa_fini_in
  hda-codec: fix recording rate control
  hda-codec: fix playback rate control

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/81e6a7345a12...5d112176457c



reply via email to

[Prev in Thread] Current Thread [Next in Thread]