aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pipewire
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-17 17:02:36 +0900
committerOphestra <cat@gensokyo.uk>2026-03-17 17:04:06 +0900
commit420c721c7da46ab1c633b019441b7b623215fd12 (patch)
tree8443996fcee8a5df3427708ecdd353fba54f941b /internal/pipewire
parentbac583f89edd1360150143ff51f7264c01aa69ec (diff)
all: raise timeout defaults
This avoids timing out on systems running very slowly. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire')
-rw-r--r--internal/pipewire/core.go2
-rw-r--r--internal/pipewire/pipewire.go8
-rw-r--r--internal/pipewire/pipewire_test.go2
3 files changed, 6 insertions, 6 deletions
diff --git a/internal/pipewire/core.go b/internal/pipewire/core.go
index 2161acf7..026f75bb 100644
--- a/internal/pipewire/core.go
+++ b/internal/pipewire/core.go
@@ -514,7 +514,7 @@ var ErrNotDone = errors.New("did not receive a Core::Done event targeting previo
const (
// syncTimeout is the maximum duration [Core.Sync] is allowed to take before
// receiving [CoreDone] or failing.
- syncTimeout = 10 * time.Second
+ syncTimeout = RoundtripTimeout + 15*time.Second
)
// Sync queues a [CoreSync] message for the PipeWire server and initiates a Roundtrip.
diff --git a/internal/pipewire/pipewire.go b/internal/pipewire/pipewire.go
index bd1d4e8e..0538863a 100644
--- a/internal/pipewire/pipewire.go
+++ b/internal/pipewire/pipewire.go
@@ -701,14 +701,14 @@ func (ctx *Context) Roundtrip() (err error) {
}
const (
- // roundtripTimeout is the maximum duration socket operations during
+ // RoundtripTimeout is the maximum duration socket operations during
// Context.roundtrip is allowed to block for.
- roundtripTimeout = 5 * time.Second
+ RoundtripTimeout = 30 * time.Second
)
// roundtrip implements the Roundtrip method without checking proxyErrors.
func (ctx *Context) roundtrip() (err error) {
- ctx.conn.MightBlock(roundtripTimeout)
+ ctx.conn.MightBlock(RoundtripTimeout)
if err = ctx.sendmsg(ctx.buf, ctx.pendingFiles...); err != nil {
return
}
@@ -742,7 +742,7 @@ func (ctx *Context) roundtrip() (err error) {
}()
var remaining []byte
- ctx.conn.MightBlock(roundtripTimeout)
+ ctx.conn.MightBlock(RoundtripTimeout)
for {
remaining, err = ctx.consume(remaining)
if err == nil {
diff --git a/internal/pipewire/pipewire_test.go b/internal/pipewire/pipewire_test.go
index 0187391c..1671601c 100644
--- a/internal/pipewire/pipewire_test.go
+++ b/internal/pipewire/pipewire_test.go
@@ -717,7 +717,7 @@ type stubUnixConn struct {
}
func (conn *stubUnixConn) MightBlock(timeout time.Duration) {
- if timeout != 5*time.Second {
+ if timeout != pipewire.RoundtripTimeout {
panic("unexpected timeout " + timeout.String())
}
if conn.current == 0 ||