mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pulse-server: increase buffer size
Because we keep everything in a ringbuffer and provide exactly the required amount of data, we can use 1/4 buffers. Also increase the buffer size. We don't want to limit the buffer size to the negotiated tlength because it can be increased later. Instead scale it to the max quantum size (8192) with a max resample rate of 32.
This commit is contained in:
parent
57dae3e2b3
commit
fd4ea442d9
2 changed files with 6 additions and 6 deletions
|
|
@ -49,8 +49,8 @@
|
|||
#define NATIVE_COOKIE_LENGTH 256
|
||||
#define MAX_TAG_SIZE (64*1024)
|
||||
|
||||
#define MIN_BUFFERS 8u
|
||||
#define MAX_BUFFERS 64u
|
||||
#define MIN_BUFFERS 1u
|
||||
#define MAX_BUFFERS 4u
|
||||
|
||||
#define MAXLENGTH (4*1024*1024) /* 4MB */
|
||||
|
||||
|
|
|
|||
|
|
@ -1005,12 +1005,11 @@ static const struct spa_pod *get_buffers_param(struct stream *s,
|
|||
blocks = 1;
|
||||
stride = s->frame_size;
|
||||
|
||||
maxsize = 8192 * 32 * s->frame_size;
|
||||
if (s->direction == PW_DIRECTION_OUTPUT) {
|
||||
maxsize = attr->tlength * s->frame_size;
|
||||
size = attr->minreq * s->frame_size;
|
||||
size = attr->minreq;
|
||||
} else {
|
||||
size = attr->fragsize;
|
||||
maxsize = attr->fragsize * MAX_BUFFERS;
|
||||
}
|
||||
buffers = SPA_CLAMP(maxsize / size, MIN_BUFFERS, MAX_BUFFERS);
|
||||
|
||||
|
|
@ -1019,7 +1018,8 @@ static const struct spa_pod *get_buffers_param(struct stream *s,
|
|||
|
||||
param = spa_pod_builder_add_object(b,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
|
||||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(buffers, MIN_BUFFERS, MAX_BUFFERS),
|
||||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(buffers,
|
||||
MIN_BUFFERS, MAX_BUFFERS),
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(blocks),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(
|
||||
size, size, maxsize),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue