[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/15] ossaudio: reduce effective playback buffer size
|
From: |
Volker Rümelin |
|
Subject: |
[PATCH 13/15] ossaudio: reduce effective playback buffer size |
|
Date: |
Thu, 6 Jan 2022 10:23:30 +0100 |
From: Volker Rümelin <vr_qemu@t-online.de>
Add the buffer_get_free pcm_ops function for the mmapped case
to reduce the effective playback buffer size. All intermediate
audio playback buffers become temporary buffers.
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
---
audio/ossaudio.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 1bd6800840..da9c232222 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -394,7 +394,7 @@ static size_t oss_buffer_get_free(HWVoiceOut *hw)
OSSVoiceOut *oss = (OSSVoiceOut *)hw;
if (oss->mmapped) {
- return INT_MAX;
+ return oss_get_available_bytes(oss);
} else {
return audio_generic_buffer_get_free(hw);
}
@@ -402,9 +402,10 @@ static size_t oss_buffer_get_free(HWVoiceOut *hw)
static void *oss_get_buffer_out(HWVoiceOut *hw, size_t *size)
{
- OSSVoiceOut *oss = (OSSVoiceOut *) hw;
+ OSSVoiceOut *oss = (OSSVoiceOut *)hw;
+
if (oss->mmapped) {
- *size = MIN(oss_get_available_bytes(oss), hw->size_emul -
hw->pos_emul);
+ *size = hw->size_emul - hw->pos_emul;
return hw->buf_emul + hw->pos_emul;
} else {
return audio_generic_get_buffer_out(hw, size);
--
2.31.1
- [PATCH 00/15] reduce audio playback latency, Volker Rümelin, 2022/01/06
- Re: [PATCH 00/15] reduce audio playback latency, Volker Rümelin, 2022/01/06
- [PATCH 08/15] audio: add pcm_ops function table for capture backend, Volker Rümelin, 2022/01/06
- [PATCH 09/15] audio: revert tests for pcm_ops table, Volker Rümelin, 2022/01/06
- [PATCH 13/15] ossaudio: reduce effective playback buffer size,
Volker Rümelin <=
- [PATCH 01/15] audio: replace open-coded buffer arithmetic, Volker Rümelin, 2022/01/06
- [PATCH 04/15] audio: inline function audio_pcm_sw_get_rpos_in(), Volker Rümelin, 2022/01/06
- [PATCH 12/15] dsoundaudio: reduce effective playback buffer size, Volker Rümelin, 2022/01/06
- [PATCH 07/15] audio: copy playback stream in sequential order, Volker Rümelin, 2022/01/06
- [PATCH 02/15] audio: move function audio_pcm_hw_clip_out(), Volker Rümelin, 2022/01/06
- [PATCH 06/15] jackaudio: use more jack audio buffers, Volker Rümelin, 2022/01/06