[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 14/15] paaudio: fix samples vs. frames mix-up
From: |
Volker Rümelin |
Subject: |
[PATCH v3 14/15] paaudio: fix samples vs. frames mix-up |
Date: |
Tue, 1 Mar 2022 20:13:10 +0100 |
Now that the mixing buffer size no longer adds to playback
latency, fix the samples vs. frames mix-up in the mixing buffer
size calculation. This change will go largely unnoticed as long
as the user doesn't use a buffer-size smaller than timer-period.
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
---
audio/paaudio.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/audio/paaudio.c b/audio/paaudio.c
index d94f858ec7..a53ed85e0b 100644
--- a/audio/paaudio.c
+++ b/audio/paaudio.c
@@ -549,11 +549,8 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsettings
*as,
}
audio_pcm_init_info (&hw->info, &obt_as);
- /*
- * This is wrong. hw->samples counts in frames. hw->samples will be
- * number of channels times larger than expected.
- */
- hw->samples = audio_buffer_samples(
+ /* hw->samples counts in frames */
+ hw->samples = audio_buffer_frames(
qapi_AudiodevPaPerDirectionOptions_base(ppdo), &obt_as, 46440);
return 0;
@@ -601,11 +598,8 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsettings
*as, void *drv_opaque)
}
audio_pcm_init_info (&hw->info, &obt_as);
- /*
- * This is wrong. hw->samples counts in frames. hw->samples will be
- * number of channels times larger than expected.
- */
- hw->samples = audio_buffer_samples(
+ /* hw->samples counts in frames */
+ hw->samples = audio_buffer_frames(
qapi_AudiodevPaPerDirectionOptions_base(ppdo), &obt_as, 46440);
return 0;
--
2.34.1
- [PATCH v3 02/15] audio: move function audio_pcm_hw_clip_out(), (continued)
- [PATCH v3 02/15] audio: move function audio_pcm_hw_clip_out(), Volker Rümelin, 2022/03/01
- [PATCH v3 03/15] audio: add function audio_pcm_hw_conv_in(), Volker Rümelin, 2022/03/01
- [PATCH v3 05/15] paaudio: increase default latency to 46ms, Volker Rümelin, 2022/03/01
- [PATCH v3 07/15] audio: copy playback stream in sequential order, Volker Rümelin, 2022/03/01
- [PATCH v3 06/15] jackaudio: use more jack audio buffers, Volker Rümelin, 2022/03/01
- [PATCH v3 04/15] audio: inline function audio_pcm_sw_get_rpos_in(), Volker Rümelin, 2022/03/01
- [PATCH v3 08/15] audio: add pcm_ops function table for capture backend, Volker Rümelin, 2022/03/01
- [PATCH v3 09/15] Revert "audio: fix wavcapture segfault", Volker Rümelin, 2022/03/01
- [PATCH v3 14/15] paaudio: fix samples vs. frames mix-up,
Volker Rümelin <=
- [PATCH v3 13/15] ossaudio: reduce effective playback buffer size, Volker Rümelin, 2022/03/01
- [PATCH v3 10/15] audio: restore mixing-engine playback buffer size, Volker Rümelin, 2022/03/01
- [PATCH v3 11/15] paaudio: reduce effective playback buffer size, Volker Rümelin, 2022/03/01
- [PATCH v3 12/15] dsoundaudio: reduce effective playback buffer size, Volker Rümelin, 2022/03/01
- [PATCH v3 15/15] sdlaudio: fix samples vs. frames mix-up, Volker Rümelin, 2022/03/01