qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] d4b70f: audio: handle buf == NULL in put_buff


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] d4b70f: audio: handle buf == NULL in put_buffer_out()
Date: Thu, 24 Sep 2020 11:00:33 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: d4b70fa4ede25734d2ff76503c735e6fcee6cfda
      
https://github.com/qemu/qemu/commit/d4b70fa4ede25734d2ff76503c735e6fcee6cfda
  Author: Volker Rümelin <vr_qemu@t-online.de>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M audio/spiceaudio.c

  Log Message:
  -----------
  audio: handle buf == NULL in put_buffer_out()

With the next patch all audio backends put_buffer_out() functions
have to handle the buf == NULL case, provided the get_buffer_out()
function may return buf = NULL and size > 0.

It turns out that all audio backends get_buffer_out() functions
either can't return buf = NULL or return buf = NULL and size = 0
at the same time. The only exception is the spiceaudio backend
where size may be uninitialized.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20200920171729.15861-1-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: 4c3356f96557e848f0323772f9502d60817682dc
      
https://github.com/qemu/qemu/commit/4c3356f96557e848f0323772f9502d60817682dc
  Author: Volker Rümelin <vr_qemu@t-online.de>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M audio/audio.c

  Log Message:
  -----------
  audio/audio: fix video playback slowdown with spiceaudio

This patch allows the audio backends get_buffer_out() functions
to drop audio data and mitigates a bug reported on the qemu-devel
mailing list.

https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03832.html

The new rules for the variables buf and size returned by
get_buffer_out() are:
size == 0: Downstream playback buffer is full. Retry later.
size > 0, buf != NULL: Copy size bytes to buf for playback.
size > 0, buf == NULL: Drop size bytes.

The audio playback rate with spiceaudio for the no audio case is
too fast, but that's what we had before commit fb35c2cec5
"audio/dsound: fix invalid parameters error". The complete fix
comes with the next patch.

Reported-by: Qi Zhou <atmgnd@outlook.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20200920171729.15861-2-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: aec6d0dc4ef243b957115b3c3aef39c348fefb25
      
https://github.com/qemu/qemu/commit/aec6d0dc4ef243b957115b3c3aef39c348fefb25
  Author: Volker Rümelin <vr_qemu@t-online.de>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M audio/audio.c
    M audio/spiceaudio.c

  Log Message:
  -----------
  audio/spiceaudio: always rate limit playback stream

The playback rate with the spiceaudio backend is currently too
fast if there's no spice client connected or the spice client
can't play audio. Rate limit the audio playback stream in all
cases. To calculate the rate correctly the limiter has to know
the maximum buffer size.

Fixes: 8c198ff065 ("spiceaudio: port to the new audio backend api")
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20200920171729.15861-3-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: b9896dc5becca1c6c2824d1ef8bcf00f5c74a6a9
      
https://github.com/qemu/qemu/commit/b9896dc5becca1c6c2824d1ef8bcf00f5c74a6a9
  Author: Volker Rümelin <vr_qemu@t-online.de>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M audio/audio.c

  Log Message:
  -----------
  audio: align audio_generic_read with audio_pcm_hw_run_in

The function audio_generic_read should work exactly like
audio_pcm_hw_run_in. It's a very similar function working
on a different buffer.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20200920171729.15861-4-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: ac221f45e3c4fc7823a8e913a6926ca8509c2526
      
https://github.com/qemu/qemu/commit/ac221f45e3c4fc7823a8e913a6926ca8509c2526
  Author: Volker Rümelin <vr_qemu@t-online.de>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M audio/audio.c

  Log Message:
  -----------
  audio: remove unnecessary calls to put_buffer_in

This patch removes unnecessary calls to the pcm_ops function
put_buffer_in(). No audio backend needs this call if the
returned length of pcm_ops function get_buffer_in() is zero.

For the DirectSound backend this prevents a call to
dsound_unlock_in() without a preceding call to dsound_lock_in().
While Windows doesn't complain it seems wrong anyway.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20200920171729.15861-5-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: 2d8823077e56598da1ad6adf7e5760f84057bad1
      
https://github.com/qemu/qemu/commit/2d8823077e56598da1ad6adf7e5760f84057bad1
  Author: Volker Rümelin <vr_qemu@t-online.de>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M audio/audio.c

  Log Message:
  -----------
  audio: align audio_generic_write with audio_pcm_hw_run_out

The function audio_generic_write should work exactly like
audio_pcm_hw_run_out. It's a very similar function working on a
different buffer.

This patch significantly reduces the number of drop-outs with
the DirectSound backend. To hear the difference start qemu with
-audiodev dsound,id=audio0,out.mixing-engine=off and play a
song in the guest with and without this patch.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20200920171729.15861-6-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: a8a98cfd42f70ac1b725ee25e23154291228b330
      
https://github.com/qemu/qemu/commit/a8a98cfd42f70ac1b725ee25e23154291228b330
  Author: Volker Rümelin <vr_qemu@t-online.de>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M audio/audio.c

  Log Message:
  -----------
  audio: run downstream playback queue unconditionally

Run the downstream playback queue even if there are no samples
in the mixing engine buffer. The downstream queue may still have
queued samples.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20200920171729.15861-7-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: f0c4555edfdd2088aab04b5779912d52b6b90454
      
https://github.com/qemu/qemu/commit/f0c4555edfdd2088aab04b5779912d52b6b90454
  Author: Gerd Hoffmann <kraxel@redhat.com>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M audio/audio.c
    M audio/spiceaudio.c
    M include/ui/qemu-spice.h
    M ui/spice-core.c

  Log Message:
  -----------
  audio: remove qemu_spice_audio_init()

Handle the spice special case in audio_init instead.

With the qemu_spice_audio_init() symbol dependency being
gone we can build spiceaudio as module.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20200916084117.21828-2-kraxel@redhat.com


  Commit: 5e626fa7364bc2d7db5f6c8e59150dee1689b98a
      
https://github.com/qemu/qemu/commit/5e626fa7364bc2d7db5f6c8e59150dee1689b98a
  Author: Gerd Hoffmann <kraxel@redhat.com>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M audio/meson.build

  Log Message:
  -----------
  audio: build spiceaudio as module

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20200916084117.21828-3-kraxel@redhat.com


  Commit: 1bd5556f6686365e76f7ff67fe67260c449e8345
      
https://github.com/qemu/qemu/commit/1bd5556f6686365e76f7ff67fe67260c449e8345
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-09-24 (Thu, 24 Sep 2020)

  Changed paths:
    M audio/audio.c
    M audio/meson.build
    M audio/spiceaudio.c
    M include/ui/qemu-spice.h
    M ui/spice-core.c

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

audio: various buffering fixes.
audio: build spiceaudio as module.

# gpg: Signature made Wed 23 Sep 2020 10:09:46 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/audio-20200923-pull-request:
  audio: build spiceaudio as module
  audio: remove qemu_spice_audio_init()
  audio: run downstream playback queue unconditionally
  audio: align audio_generic_write with audio_pcm_hw_run_out
  audio: remove unnecessary calls to put_buffer_in
  audio: align audio_generic_read with audio_pcm_hw_run_in
  audio/spiceaudio: always rate limit playback stream
  audio/audio: fix video playback slowdown with spiceaudio
  audio: handle buf == NULL in put_buffer_out()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/f7f1d916b223...1bd5556f6686



reply via email to

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