qemu-e2k/audio
Volker Rümelin bea29e9f2e paaudio: avoid to clip samples multiple times
The pulseaudio backend currently converts, clips and copies audio
playback samples in the mixing-engine sample buffer multiple
times.

In qpa_get_buffer_out() the function pa_stream_begin_write()
returns a rather large buffer and this allows audio_pcm_hw_run_out()
in audio/audio.c to copy all samples in the mixing-engine buffer
to the pulse audio buffer. Immediately after copying, qpa_write()
notices with a call to pa_stream_writable_size() that pulse audio
only needs a smaller part of the copied samples and ignores the
rest. This copy and ignore process happens several times for each
audio sample.

To fix this behaviour, call pa_stream_writable_size() in
qpa_get_buffer_out() to limit the number of samples
audio_pcm_hw_run_out() will convert. With this change the
pulseaudio pcm_ops functions put_buffer_out and write are no
longer identical and a separate qpa_put_buffer_out is needed.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-13-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
..
alsaaudio.c audio: split pcm_ops function get_buffer_in 2021-01-15 11:25:22 +01:00
audio_int.h audio: split pcm_ops function get_buffer_in 2021-01-15 11:25:22 +01:00
audio_legacy.c sdlaudio: add -audiodev sdl,out.buffer-count option 2021-01-15 11:25:22 +01:00
audio_template.h sdlaudio: add -audiodev sdl,out.buffer-count option 2021-01-15 11:25:22 +01:00
audio_win_int.c audio: use qapi AudioFormat instead of audfmt_e 2019-03-11 10:29:26 +01:00
audio_win_int.h Windows Waveform Audio driver (no ADC support yet) 2009-10-10 01:18:24 +04:00
audio.c audio: remove remaining unused plive code 2021-01-15 11:25:22 +01:00
audio.h qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
coreaudio.c coreaudio: always stop audio playback on shut down 2020-12-15 09:14:17 +01:00
dsound_template.h audio/dsound: fix invalid parameters error 2020-02-06 14:31:20 +01:00
dsoundaudio.c dsoundaudio: dsound_get_buffer_in should honor *size 2020-04-06 13:29:53 +02:00
jackaudio.c audio: split pcm_ops function get_buffer_in 2021-01-15 11:25:22 +01:00
meson.build meson: add spice_headers dependency. 2020-10-15 11:14:40 +02:00
mixeng_template.h audio: fix saturation nonlinearity in clip_* functions 2020-03-16 10:18:07 +01:00
mixeng.c audio: Let audio_sample_to_uint64() use const samples argument 2020-05-26 08:29:30 +02:00
mixeng.h audio: proper support for float samples in mixeng 2020-02-06 14:35:57 +01:00
noaudio.c audio: split pcm_ops function get_buffer_in 2021-01-15 11:25:22 +01:00
ossaudio.c audio: split pcm_ops function get_buffer_in 2021-01-15 11:25:22 +01:00
paaudio.c paaudio: avoid to clip samples multiple times 2021-01-15 11:25:22 +01:00
rate_template.h audio: use size_t where makes sense 2019-08-21 09:13:37 +02:00
sdlaudio.c sdlaudio: enable (in|out).mixing-engine=off 2021-01-15 11:25:22 +01:00
spiceaudio.c audio: split pcm_ops function get_buffer_in 2021-01-15 11:25:22 +01:00
trace-events trace-events: Delete unused trace points 2020-09-09 17:17:02 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
wavaudio.c audio: fix bug 1858488 2020-01-31 08:48:03 +01:00
wavcapture.c monitor: Use getter/setter functions for cur_mon 2020-10-09 07:08:19 +02:00