[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/6] hda-codec: fix playback rate control
From: |
Gerd Hoffmann |
Subject: |
[PULL 1/6] hda-codec: fix playback rate control |
Date: |
Mon, 6 Jan 2020 13:52:31 +0100 |
From: Volker RĂ¼melin <address@hidden>
Since commit 1930616b98 "audio: make mixeng optional" the
function hda_audio_output_cb can no longer assume the function
parameter avail contains the free buffer size. With the playback
mixing-engine turned off this leads to a broken playback rate
control and playback buffer drops in regular intervals.
This patch moves down the rate calculation, so the correct
buffer fill level is used for the calculation.
Signed-off-by: Volker RĂ¼melin <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/audio/hda-codec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
index f17e8d8dcea2..768ba31e7926 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -338,8 +338,6 @@ static void hda_audio_output_cb(void *opaque, int avail)
return;
}
- hda_timer_sync_adjust(st, (wpos - rpos) - to_transfer - (B_SIZE >> 1));
-
while (to_transfer) {
uint32_t start = (uint32_t) (rpos & B_MASK);
uint32_t chunk = (uint32_t) MIN(B_SIZE - start, to_transfer);
@@ -351,6 +349,8 @@ static void hda_audio_output_cb(void *opaque, int avail)
break;
}
}
+
+ hda_timer_sync_adjust(st, (wpos - rpos) - (B_SIZE >> 1));
}
static void hda_audio_compat_input_cb(void *opaque, int avail)
--
2.18.1
- [PULL 0/6] Audio 20200106 patches, Gerd Hoffmann, 2020/01/06
- [PULL 2/6] hda-codec: fix recording rate control, Gerd Hoffmann, 2020/01/06
- [PULL 4/6] paaudio: try to drain the recording stream, Gerd Hoffmann, 2020/01/06
- [PULL 1/6] hda-codec: fix playback rate control,
Gerd Hoffmann <=
- [PULL 5/6] paaudio: wait until the recording stream is ready, Gerd Hoffmann, 2020/01/06
- [PULL 6/6] audio: fix integer overflow, Gerd Hoffmann, 2020/01/06
- [PULL 3/6] paaudio: drop recording stream in qpa_fini_in, Gerd Hoffmann, 2020/01/06
- Re: [PULL 0/6] Audio 20200106 patches, Peter Maydell, 2020/01/06