summary refs log tree commit diff stats
path: root/scripts/qemu-gdb.py
diff options
context:
space:
mode:
authorVolker RĂ¼melin <vr_qemu@t-online.de>2021-01-10 11:02:29 +0100
committerGerd Hoffmann <kraxel@redhat.com>2021-01-15 11:25:22 +0100
commitbea29e9f2ea6061abc212809090548cba6d64081 (patch)
treede588e2da2bbaa8e573a8b5377aa954f183f0fe7 /scripts/qemu-gdb.py
parent6fb0cd50541465114d8dd868bef8463e4edf7522 (diff)
downloadfocaccia-qemu-bea29e9f2ea6061abc212809090548cba6d64081.tar.gz
focaccia-qemu-bea29e9f2ea6061abc212809090548cba6d64081.zip
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>
Diffstat (limited to 'scripts/qemu-gdb.py')
0 files changed, 0 insertions, 0 deletions