Skip to content

regreet: fix static backgrounds falling back to GStreamer - #557063

Open
Daniil-Makarov wants to merge 1 commit into
NixOS:masterfrom
Daniil-Makarov:regreet-glycin-loaders
Open

regreet: fix static backgrounds falling back to GStreamer#557063
Daniil-Makarov wants to merge 1 commit into
NixOS:masterfrom
Daniil-Makarov:regreet-glycin-loaders

Conversation

@Daniil-Makarov

Copy link
Copy Markdown

Fixes #557002. See this comment for the corrected analysis — my first take on that issue was incomplete.

ReGreet 0.5.0 decodes static background images with glycin, which needs three things at runtime that the wrapper does not provide:

  1. the loader processes shipped by glycin-loaders, discovered through XDG_DATA_DIRS;
  2. the MIME database (shared-mime-info), also via XDG_DATA_DIRS — without it the content type of the file is never determined, so no loader is even spawned;
  3. bwrap, looked up in PATH, to sandbox the loader.

With any one of them missing, load_image() fails and ReGreet silently falls back to gtk::MediaFile with set_loop(true), decoding the still JPEG/PNG as a looping video through GStreamer. On a login screen that burns CPU continuously and, after 10–15 s, kills the greeter: Gdk-Message: Error 22 (Invalid argument) dispatching to Wayland display, after which greetd logs check_children: greeter exited without creating a session and restarts the greeter — the screen blanks and the login screen reappears.

The ReGreet 0.5.0 release notes list “Fix high resource usage of GStreamer on static images by using glycin instead”, so the packaging gap silently reverts an upstream fix. Earlier history: #532825 was the same GStreamer path in the 0.4.x era, fixed by #530302.

This is invisible when ReGreet is started from a desktop session, because XDG_DATA_DIRS and PATH there already carry all three pieces. A greeter session carries none.

Verification

Run in a nested headless sway with a deliberately bare environment (env -i, as in a greetd session), so that only the wrapper can supply anything. Indicators, both binary and reproducible:

  • grep -c libgst /proc/$PID/maps — 105 mappings once gtk::MediaFile is constructed, 45 when it is not;
  • number of glycin-* loader processes — non-zero only when glycin actually decodes.
loaders MIME database bwrap libgst mappings glycin loader processes
105 0
105 0
105 0
105 0
45 5

The last row is this PR, checked twice; the background image renders and the greeter idles quietly.

I originally quoted idle-CPU figures on the issue and have retracted them: the GStreamer spin does not always materialise inside a short measurement window, so CPU did not discriminate reliably. The two indicators above do.

The GStreamer inputs are deliberately kept — they are what plays animated and video backgrounds.

A question for maintainers

bwrap is not in PATH on a stock NixOS system, and the MIME database is not guaranteed either, so this is not really regreet-specific: any glycin consumer that runs outside a full desktop session hits it. Would you rather have both handled in libglycin's path-hook.sh, so every consumer gets a working setup? I kept this PR scoped to regreet because that is the reported bug, and I am happy to redo it in the hook instead.

Things done

  • Built on platform(s): x86_64-linux
  • Verified the resulting wrapper carries --prefix XDG_DATA_DIRS : …glycin-loaders…/share, --prefix XDG_DATA_DIRS : …shared-mime-info…/share and --prefix PATH : …bubblewrap…/bin
  • Tested on a live NixOS login screen with services.displayManager.regreet.settings.background, and on the bench described above
  • Fits CONTRIBUTING.md

/cc @fufexan

@nixpkgs-ci
nixpkgs-ci Bot requested a review from fufexan August 27, 2026 14:10
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle! labels Aug 27, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regreet: static background images still go through GStreamer video decoding (glycin loaders missing from the wrapper)

2 participants