aboutsummaryrefslogtreecommitdiff
path: root/audio/audio_int.h
diff options
context:
space:
mode:
authorVolker RĂ¼melin <vr_qemu@t-online.de>2022-03-01 20:13:06 +0100
committerGerd Hoffmann <kraxel@redhat.com>2022-03-04 11:05:13 +0100
commit9833438ef624155de879d4ed57ecfcd3464a0bbe (patch)
tree2774d4652e970f5ff9fb2d5caa96204882d5765a /audio/audio_int.h
parent669b95229d13e3c521c2f50bcc9ca0503efb3c5f (diff)
audio: restore mixing-engine playback buffer size
Commit ff095e5231 "audio: api for mixeng code free backends" introduced another FIFO for the audio subsystem with exactly the same size as the mixing-engine FIFO. Most audio backends use this generic FIFO. The generic FIFO used together with the mixing-engine FIFO doubles the audio FIFO size, because that's just two independent FIFOs connected together in series. For audio playback this nearly doubles the playback latency. This patch restores the effective mixing-engine playback buffer size to a pre v4.2.0 size by only accepting the amount of samples for the mixing-engine queue which the downstream queue accepts. Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de> Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20220301191311.26695-10-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio/audio_int.h')
-rw-r--r--audio/audio_int.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/audio/audio_int.h b/audio/audio_int.h
index 71be162271..2a6914d2aa 100644
--- a/audio/audio_int.h
+++ b/audio/audio_int.h
@@ -162,9 +162,13 @@ struct audio_pcm_ops {
size_t (*write) (HWVoiceOut *hw, void *buf, size_t size);
void (*run_buffer_out)(HWVoiceOut *hw);
/*
+ * Get the free output buffer size. This is an upper limit. The size
+ * returned by function get_buffer_out may be smaller.
+ */
+ size_t (*buffer_get_free)(HWVoiceOut *hw);
+ /*
* get a buffer that after later can be passed to put_buffer_out; optional
* returns the buffer, and writes it's size to size (in bytes)
- * this is unrelated to the above buffer_size_out function
*/
void *(*get_buffer_out)(HWVoiceOut *hw, size_t *size);
/*
@@ -190,6 +194,7 @@ void audio_generic_run_buffer_in(HWVoiceIn *hw);
void *audio_generic_get_buffer_in(HWVoiceIn *hw, size_t *size);
void audio_generic_put_buffer_in(HWVoiceIn *hw, void *buf, size_t size);
void audio_generic_run_buffer_out(HWVoiceOut *hw);
+size_t audio_generic_buffer_get_free(HWVoiceOut *hw);
void *audio_generic_get_buffer_out(HWVoiceOut *hw, size_t *size);
size_t audio_generic_put_buffer_out(HWVoiceOut *hw, void *buf, size_t size);
size_t audio_generic_write(HWVoiceOut *hw, void *buf, size_t size);