From 83e83608c8eb37a19a9ca3d8577a26a4d8e0b872 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 5 Sep 2022 16:18:54 +0200 Subject: [PATCH] Revert "pulse-server: tweak the fragsize/minreq handling" This reverts commit ad214dde2e094d3aab0eceaf92ae5a523850fb76. --- src/modules/module-protocol-pulse/pulse-server.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 0e8c8f90b..e93f5829f 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -671,15 +671,18 @@ static uint32_t fix_record_buffer_attr(struct stream *s, struct buffer_attr *att /* pulseaudio configures the source to half of the fragsize. It also * immediately sends chunks to clients. We use the minreq field to * keep this info and use it to configure half the fragsize latency */ - attr->minreq = attr->fragsize * 2 / 3; + attr->minreq = attr->fragsize / 2; attr->minreq = SPA_ROUND_UP(attr->minreq, frame_size); - latency = attr->minreq; - - if (s->adjust_latency) - attr->fragsize = latency; attr->tlength = attr->prebuf = 0; + if (s->early_requests) { + latency = attr->minreq; + } else if (s->adjust_latency) { + latency = attr->minreq; + } else { + latency = attr->minreq; + } /* make sure can queue at least to fragsize without overruns */ if (attr->maxlength < attr->fragsize * 4) attr->maxlength = attr->fragsize * 4;