qemu/audio
Akihiko Odaki 2bccabe6df audio: Reset rate control when adding bytes
Commit 90320051ea ("spiceaudio: add a pcm_ops buffer_get_free
function") caused to emit messages saying "Resetting rate control"
frequently when the guest generates no frames.

audio_rate_peek_bytes() resets the rate control when frames < 0 ||
frames > 65536 where frames is the rate-limited number of frames.
Resetting when frames < 0 is sensible as the number simply doesn't make
sense.

There is a problem when frames > 65536. It implies the guest stopped
generating frames for a while so it makes sense to reset the rate
control when the guest resumed generating frames. However, the
commit mentioned earlier broke this assumption by letting spiceaudio
call audio_rate_peek_bytes() whether the guest is generating frames or
not.

Reset the rate control in audio_rate_add_bytes(), which is called only
when actually adding frames, according to the previous call to
audio_rate_peek_bytes() to avoid frequent rate control resets even when
the guest generates no frame.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20250317-rate-v1-1-da9df062747c@daynix.com>
2025-05-25 15:25:21 +02:00
..
alsaaudio.c alsaaudio: Set try-poll to false by default 2025-05-25 15:24:43 +02:00
audio-hmp-cmds.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
audio.c audio: Reset rate control when adding bytes 2025-05-25 15:25:21 +02:00
audio.h audio: reintroduce default audio backend for VNC 2023-10-08 21:08:27 +02:00
audio_int.h audio: Reset rate control when adding bytes 2025-05-25 15:25:21 +02:00
audio_template.h audio: add float sample endianness converters 2025-05-25 11:28:28 +02:00
audio_win_int.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
audio_win_int.h Windows Waveform Audio driver (no ADC support yet) 2009-10-10 01:18:24 +04:00
coreaudio.m audio: Drop ifdef for macOS versions older than 12.0 2024-07-02 06:58:48 +02:00
dbusaudio.c dbus: add -audio dbus nsamples option 2025-02-03 21:16:07 +04:00
dsound_template.h dsoundaudio: replace GetForegroundWindow() 2021-01-15 11:25:22 +01:00
dsoundaudio.c audio: remove QEMU_AUDIO_* and -audio-help support 2023-10-03 10:29:39 +02:00
jackaudio.c audio: remove QEMU_AUDIO_* and -audio-help support 2023-10-03 10:29:39 +02:00
meson.build meson: remove unnecessary dependency 2024-05-25 13:28:02 +02:00
mixeng.c audio: add float sample endianness converters 2025-05-25 11:28:28 +02:00
mixeng.h audio: add float sample endianness converters 2025-05-25 11:28:28 +02:00
mixeng_template.h audio: fix saturation nonlinearity in clip_* functions 2020-03-16 10:18:07 +01:00
noaudio.c audio: remove QEMU_AUDIO_* and -audio-help support 2023-10-03 10:29:39 +02:00
ossaudio.c audio/ossaudio: Fix compiler warning with -Wshadow 2023-10-06 10:56:54 +02:00
paaudio.c audio: remove QEMU_AUDIO_* and -audio-help support 2023-10-03 10:29:39 +02:00
pwaudio.c audio/pw: Report more accurate error when connecting to PipeWire fails 2024-10-14 17:35:24 +04:00
rate_template.h audio: make the resampling code greedy 2023-03-06 10:30:23 +04:00
sdlaudio.c audio: remove QEMU_AUDIO_* and -audio-help support 2023-10-03 10:29:39 +02:00
sndioaudio.c audio: remove QEMU_AUDIO_* and -audio-help support 2023-10-03 10:29:39 +02:00
spiceaudio.c audio: allow returning an error from the driver init 2023-10-03 10:29:39 +02:00
trace-events ui: add more tracing for dbus 2024-07-22 12:47:28 +04:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
wavaudio.c audio: don't abort on f32 audio format in wav backend 2023-11-07 14:58:54 +00:00
wavcapture.c monitor: Use getter/setter functions for cur_mon 2020-10-09 07:08:19 +02:00