From d4b06431ff565f4db5ce2810304ca0f496810103 Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Fri, 27 Aug 2021 08:49:12 -0400 Subject: [PATCH] pulse-server: calculate buffer size based on the frame size Audio with big frame sizes (especially audio with multiple channels) needs more buffer size than the one calculated with the current formula. This patch uses the frame size to calculate the buffer size, fixing playback issues for clients configured in passthrough mode. --- src/modules/module-protocol-pulse/pulse-server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index e07dc3290..f0e9fbfe7 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -963,8 +963,8 @@ static const struct spa_pod *get_buffers_param(struct stream *s, stride = s->frame_size; if (s->direction == PW_DIRECTION_OUTPUT) { - maxsize = attr->tlength * 4; - size = attr->minreq * 2; + maxsize = attr->tlength * s->frame_size; + size = attr->minreq * s->frame_size; } else { size = attr->fragsize; maxsize = attr->fragsize * MAX_BUFFERS;