From 2df9d3b00362dfdab0b475897060e4a2e7c0d836 Mon Sep 17 00:00:00 2001 From: Lars Kumbier Date: Mon, 17 May 2021 12:06:23 +0200 Subject: [PATCH] Adds intermediate message for unsupported pipewire This should be removed, when pipewire is supported - progress is currently tracked in the issue https://github.com/lawl/NoiseTorch/issues/63 --- main.go | 15 +++++++++++++++ ui.go | 3 +++ 2 files changed, 18 insertions(+) diff --git a/main.go b/main.go index 0ec62c6..66c0072 100644 --- a/main.go +++ b/main.go @@ -186,6 +186,21 @@ func paConnectionWatchdog(ctx *ntcontext) { fmt.Fprintf(os.Stderr, "Couldn't create pulseaudio client: %v\n", err) } + // This searches for the pipewire server, which is not supported yet. In order to reduce support requests + // due to missing modules, we inform the user in the UI. Remove when Pipewire is supported: + // cf. https://github.com/lawl/NoiseTorch/issues/63 + info, err := paClient.ServerInfo() + if err != nil { + log.Printf("Couldn't fetch pulse server info: %v\n", err) + fmt.Fprintf(os.Stderr, "Couldn't fetch pulse server info: %v\n", err) + } + ctx.isPipewire = strings.Contains(info.PackageName, "PipeWire") + if ctx.isPipewire { + msg := "Found Pipewire, which is not yet supported. Check the implementation issue for progress and help: https://github.com/lawl/NoiseTorch/issues/63\n" + log.Printf(msg, err) + fmt.Fprintf(os.Stderr, msg) + } + ctx.paClient = paClient go updateNoiseSupressorLoaded(ctx) diff --git a/ui.go b/ui.go index af4421a..192c791 100644 --- a/ui.go +++ b/ui.go @@ -33,6 +33,7 @@ type ntcontext struct { haveCapabilities bool capsMismatch bool views *ViewStack + isPipewire bool } var green = color.RGBA{34, 187, 69, 255} @@ -78,6 +79,8 @@ func mainView(ctx *ntcontext, w *nucular.Window) { if ctx.noiseSupressorState == loaded { w.LabelColored("NoiseTorch active", "RC", green) + } else if ctx.isPipewire { // intermediate warning - remove when resolved: https://github.com/lawl/NoiseTorch/issues/63 + w.LabelColored("Unfortunately, Pipewire is not supported yet :/", "RC", red) } else if ctx.noiseSupressorState == unloaded { w.LabelColored("NoiseTorch inactive", "RC", red) } else if ctx.noiseSupressorState == inconsistent {