snap: bundle gstreamer plugins so audio bell works#12676
Open
aaron-ang wants to merge 2 commits into
Open
Conversation
3 tasks
Member
|
You need to disclose your use of AI. See https://github.com/ghostty-org/ghostty/blob/main/AI_POLICY.md |
Contributor
Author
added |
When `bell-features = audio` is enabled the GTK media stack uses libgtk-4-media-gstreamer, which in turn needs GStreamer playback and sink plugins to decode and route the audio. The current snap stages libgtk-4-media-gstreamer but ships none of the actual plugins, so the bell silently fails to play even when configured. Stage gstreamer1.0-plugins-base/-good/-pulseaudio for the decode + audio sink pipeline (typefind, decodebin, vorbis, audioconvert, autoaudiosink, pulsesink), and export GST_PLUGIN_SYSTEM_PATH, GST_PLUGIN_SCANNER and GST_REGISTRY in the launcher so child processes find the bundled plugins and write a per-user registry cache under SNAP_USER_COMMON.
26b7256 to
dd6d401
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With
bell-features = audioand a validbell-audio-pathconfigured, no sound plays in the snap build of Ghostty.The snap stages
libgtk-4-media-gstreamerand the core GStreamer libraries but ships onlylibgstcoreelements.soandlibgstcoretracers.so— none of the playback, decode, or audio-sink plugins that the GTK media backend needs to build a pipeline. The bell therefore silently fails.bell-features = system(compositor sound, routed viagdk_surface_beep()) already works and is unchanged.Fix
gstreamer1.0-plugins-base,gstreamer1.0-plugins-good, andgstreamer1.0-pulseaudioso the snap shipstypefind,decodebin,vorbis,audioconvert,autoaudiosink,pulsesink, etc.GST_PLUGIN_SYSTEM_PATH,GST_PLUGIN_SCANNER, andGST_REGISTRYinsnap/local/launcherso GStreamer finds the bundled plugins and writes a per-user registry cache underSNAP_USER_COMMON.Local build (how this PR was verified)
Official snap CI builds from a release tarball, so the committed
snapcraft.yamlassumes pre-generated.uiresources are present. Building from a git checkout requires two extra things that are not part of this PR (they would belong in a separate change to makesnap/snapcraft.yamlgit-source-buildable):A
VERSIONfile at the repo root (release tarballs include one):A
blueprint-compilerpart plus PyGObject build deps so the GTK UI resources can be generated at build time. Apply this diff on top of the PR before runningsnapcraft pack:The
cpis needed becauseblueprint-compiler.pyhard-codes the meson-configured module path (/usr/lib/python3/dist-packages) into the installed script; making the staged copy importable means putting it on that exact path inside the build container.With those in place:
snapcraft pack sudo snap install --dangerous --classic ./ghostty_1.3.2-dev_*.snapTest plan
Verified locally on Ubuntu 24.04 / arm64 using the build above.
printf '\a'rings both the compositor system bell and plays the audio file.AI Disclosure
Claude Code was used throughout: diagnosing why
bell-features = audioproduced silence in the snap (no playback/decode/sink plugins bundled despitelibgtk-4-media-gstreamerbeing staged), drafting thesnapcraft.yamlandsnap/local/launcherchanges, and driving thesnapcraft packbuild iteration that uncovered the temporary git-source build requirements documented above (which are not part of this PR).I reviewed every line of the diff and understand the role of each change: the three GStreamer plugin packages provide the pipeline elements GTK media needs (
typefind,decodebin,vorbis,audioconvert,autoaudiosink,pulsesink), and the three new env vars in the launcher point GStreamer at the bundled plugin directory and a user-writable registry cache. I rebuilt the snap, installed it, and confirmed both system and audio bell fire when configured.