mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pulse-server: tweak the fragsize/minreq handling
Only send 2/3 of the fragsize
This commit is contained in:
parent
e10305851d
commit
ad214dde2e
1 changed files with 5 additions and 8 deletions
|
|
@ -671,18 +671,15 @@ 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
|
/* pulseaudio configures the source to half of the fragsize. It also
|
||||||
* immediately sends chunks to clients. We use the minreq field to
|
* immediately sends chunks to clients. We use the minreq field to
|
||||||
* keep this info and use it to configure half the fragsize latency */
|
* keep this info and use it to configure half the fragsize latency */
|
||||||
attr->minreq = attr->fragsize / 2;
|
attr->minreq = attr->fragsize * 2 / 3;
|
||||||
attr->minreq = SPA_ROUND_UP(attr->minreq, frame_size);
|
attr->minreq = SPA_ROUND_UP(attr->minreq, frame_size);
|
||||||
|
latency = attr->minreq;
|
||||||
|
|
||||||
|
if (s->adjust_latency)
|
||||||
|
attr->fragsize = latency;
|
||||||
|
|
||||||
attr->tlength = attr->prebuf = 0;
|
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 */
|
/* make sure can queue at least to fragsize without overruns */
|
||||||
if (attr->maxlength < attr->fragsize * 4)
|
if (attr->maxlength < attr->fragsize * 4)
|
||||||
attr->maxlength = attr->fragsize * 4;
|
attr->maxlength = attr->fragsize * 4;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue