Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
fix(linux): composite on the GPU again (#2496)
voidbc79b4f82038
diff --git a/CLAUDE.md b/CLAUDE.mdindex 6c3050367..26c5767da 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -954,7 +954,8 @@ UI icons come from `src/components/icons/` (vendored Nucleo core outline compone- No standardized URL scheme for system settings (user must open manually)- Privacy settings button hidden in UI (not applicable on Linux)- Recommend `pavucontrol` for audio device management-- **Dialog overlays**: the full-window dialog overlays (shared `Dialog`, Settings, Ctrl+K, referral) skip their default backdrop blur on Linux (`ui/overlayBlur.ts`). Linux composites on the CPU (`--disable-gpu-compositing` in `main.js`), where a full-window blur is redrawn on every repaint inside the dialog (#2298); a blur passed through `overlayClassName` still applies+- **GPU compositing**: on, as on Windows, except whenever an NVIDIA kernel module (proprietary or open, any version) is loaded (`linuxGpuCompositing.js`, `/proc/driver/nvidia/version`): it flickered transparent windows in #203, Chromium's blocklist doesn't catch it, and explicit sync (driver 555+, Xwayland 24.1+, compositor support) can't be checked before app ready. Anyone else can turn it off with `--disable-gpu-compositing` in `open-whispr-flags.conf`, read by the packaged launcher (`scripts/lib/linux-launcher.js`). The mode is logged at startup, which only reaches the log file at `--log-level=debug`+- **Dialog overlays**: the full-window dialog overlays (shared `Dialog`, Settings, Ctrl+K, referral) skip their default backdrop blur on Linux (`ui/overlayBlur.ts`), since Linux can still composite on the CPU, where a full-window blur is redrawn on every repaint inside the dialog (#2298); a blur passed through `overlayClassName` still applies- **Launch at login**: XDG autostart entry at `~/.config/autostart/open-whispr.desktop` (see `linuxAutostart.js`), since Electron's `setLoginItemSettings()` does nothing on Linux- Disabling it from GNOME Tweaks or KDE's autostart editor is reflected in the Settings toggle- "Start minimized" is handled app-side by the `startMinimized` setting, not by the desktop entrydiff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.mdindex b056577e9..3ca4fbf60 100644--- a/TROUBLESHOOTING.md+++ b/TROUBLESHOOTING.md@@ -127,6 +127,26 @@ OpenWhispr tries clipboard methods in order: `wl-copy` (most reliable) → rendeOn GNOME and KDE, the first automatic paste can show a remote-interaction permission dialog. Approval is remembered in `~/.cache/openwhispr/portal-paste-token`; revoking permission or invalidating that token makes the prompt return. If automatic paste fails, the transcription remains in the clipboard for manual paste.+### Linux Window Flicker++**Symptoms:** The dictation pill or other transparent windows flicker++**Cause:** OpenWhispr composites on the GPU, except whenever an NVIDIA driver is loaded, where it already composites on the CPU. Some other drivers can flicker transparent windows too.++**Fix:**++1. With the official AppImage, deb, rpm or tar.gz build, add this line to `~/.config/open-whispr-flags.conf` (`$XDG_CONFIG_HOME/open-whispr-flags.conf` if you set `XDG_CONFIG_HOME`; create the file if it doesn't exist, and save it with Unix (LF) line endings):++ ```text+ --disable-gpu-compositing+ ```++2. Quit OpenWhispr and start it again. Closing the window only hides it, so quit from the tray icon, or, if your desktop shows no tray icon (GNOME without the AppIndicator extension), run `pkill -x open-whispr-app`.++The interface then composites on the CPU, so hover effects and scrolling can feel slower. Delete the line to undo it.++When you report the flicker, add `--log-level=debug` on its own line in the same file, restart, and attach the newest `~/.config/OpenWhispr/logs/debug-*.log`. Its "Linux GPU compositing" line shows which mode OpenWhispr started in.+### Linux System Audio PipeWire Issues**Symptoms:** Meeting transcription captures the microphone but not other participants, browser audio, or other system audio.diff --git a/main.js b/main.jsindex bbde5cb64..60b473ed5 100644--- a/main.js+++ b/main.js@@ -2,6 +2,7 @@// late — the flag has to come from a relaunch.const { XWAYLAND_FLAG, shouldForceXWayland } = require("./src/helpers/xwayland");const { createHotkeyRepeatGate } = require("./src/helpers/hotkeyRepeatGate");+const { shouldDisableGpuCompositing } = require("./src/helpers/linuxGpuCompositing");if (shouldForceXWayland(process.argv)) {const { spawn } = require("child_process");@@ -108,10 +109,16 @@ if (process.platform === "win32") {// Fix transparent window flickering on Linux: --enable-transparent-visuals requires// the compositor to set up an ARGB visual before any windows are created.-// --disable-gpu-compositing prevents GPU compositing conflicts with the compositor.if (process.platform === "linux") {app.commandLine.appendSwitch("gtk-version", "3");app.commandLine.appendSwitch("enable-transparent-visuals");+}++// Linux composites on the GPU except while an NVIDIA driver is loaded (#203). Anyone else whose+// transparent windows flicker can add --disable-gpu-compositing to the launcher's flags file+// (scripts/lib/linux-launcher.js).+const gpuCompositingDisabledForNvidia = shouldDisableGpuCompositing();+if (gpuCompositingDisabledForNvidia) {app.commandLine.appendSwitch("disable-gpu-compositing");}@@ -446,6 +453,23 @@ function initializeCoreManagers() {debugLogger = require("./src/helpers/debugLogger");debugLogger.ensureFileLogging();+ if (process.platform === "linux") {+ // The compositing mode is settled once the GPU process has reported its info; a GPU+ // process crash can still drop it to software later, logged below.+ app+ .getGPUInfo("basic")+ .catch(() => {})+ .then(() => {+ debugLogger.info("Linux GPU compositing", {+ status: app.getGPUFeatureStatus().gpu_compositing,+ disabledForNvidia: gpuCompositingDisabledForNvidia,+ });+ });+ }+ app.on("child-process-gone", (_event, details) => {+ if (details.type !== "GPU") return;+ debugLogger.warn("GPU process gone", { reason: details.reason, exitCode: details.exitCode });+ });// Registration runs before app ready, when the logger cannot write its file yet.if (linuxSchemeHandler?.reason) {debugLogger.warn("Could not register the Linux URL scheme handler entry", {diff --git a/src/components/ui/overlayBlur.ts b/src/components/ui/overlayBlur.tsindex b28d19faa..ca5157630 100644--- a/src/components/ui/overlayBlur.ts+++ b/src/components/ui/overlayBlur.ts@@ -1,6 +1,7 @@import { getCachedPlatform } from "../../utils/platform";-// Linux composites on the CPU (main.js passes --disable-gpu-compositing), where a blur-// behind a full-window overlay is redrawn on every repaint inside the dialog: hover lags-// and the GPU process pins a core (#2298). The scrim alone dims the page there.+// Linux can still composite on the CPU (any NVIDIA driver, blocklisted drivers, or+// --disable-gpu-compositing in the launcher's flags file), where a blur behind a full-window+// overlay is redrawn on every repaint inside the dialog: hover lags and the GPU process pins+// a core (#2298). The scrim alone dims the page there.export const blurBehindOverlays = getCachedPlatform() !== "linux";diff --git a/src/helpers/linuxGpuCompositing.js b/src/helpers/linuxGpuCompositing.jsnew file mode 100644index 000000000..83420841f--- /dev/null+++ b/src/helpers/linuxGpuCompositing.js@@ -0,0 +1,14 @@+const fs = require("fs");++// Linux composites on the GPU, as Windows does, except whenever an NVIDIA kernel module+// (proprietary or open) is loaded, on any driver version. #203's flicker was driver 550 on+// GNOME Wayland; Chromium's GPU blocklist doesn't cover it. Explicit sync fixes it only with+// driver 555+, Xwayland 24.1+ and a compositor that supports it, none of which can be checked+// before app ready, so every NVIDIA setup, Optimus laptops included, keeps CPU compositing.+const NVIDIA_DRIVER_VERSION_PATH = "/proc/driver/nvidia/version";++function shouldDisableGpuCompositing(fileExists = fs.existsSync) {+ return process.platform === "linux" && fileExists(NVIDIA_DRIVER_VERSION_PATH);+}++module.exports = { NVIDIA_DRIVER_VERSION_PATH, shouldDisableGpuCompositing };diff --git a/test/helpers/linuxGpuCompositing.test.js b/test/helpers/linuxGpuCompositing.test.jsnew file mode 100644index 000000000..daf2ae5d5--- /dev/null+++ b/test/helpers/linuxGpuCompositing.test.js@@ -0,0 +1,40 @@+const test = require("node:test");+const assert = require("node:assert/strict");++const {+ NVIDIA_DRIVER_VERSION_PATH,+ shouldDisableGpuCompositing,+} = require("../../src/helpers/linuxGpuCompositing.js");++function withPlatform(platform, run) {+ const originalPlatform = Object.getOwnPropertyDescriptor(process, "platform");+ Object.defineProperty(process, "platform", { value: platform, configurable: true });+ try {+ run();+ } finally {+ Object.defineProperty(process, "platform", originalPlatform);+ }+}++const nvidiaLoaded = (filePath) => filePath === NVIDIA_DRIVER_VERSION_PATH;+const noNvidia = () => false;++test("keeps CPU compositing on Linux while an NVIDIA driver is loaded", () => {+ withPlatform("linux", () => {+ assert.equal(shouldDisableGpuCompositing(nvidiaLoaded), true);+ });+});++test("composites on the GPU on Linux without an NVIDIA driver", () => {+ withPlatform("linux", () => {+ assert.equal(shouldDisableGpuCompositing(noNvidia), false);+ });+});++test("never disables GPU compositing on macOS or Windows", () => {+ for (const platform of ["darwin", "win32"]) {+ withPlatform(platform, () => {+ assert.equal(shouldDisableGpuCompositing(nvidiaLoaded), false, platform);+ });+ }+});