I’m trying to create my first snap for an electron app. The app works, but without sound. What am I missing? This is my snapcraft.yaml
name: tateti
base: core24
version: '1.0.0'
summary: Danielle's Ta-Te-Ti – a beautiful tic-tac-toe game
description: |
Danielle's Ta-Te-Ti is a modern take on the classic tic-tac-toe game.
It supports local play, AI opponents, WebRTC multiplayer, and a unique
3-piece variant.
grade: stable
confinement: strict
platforms:
amd64:
arm64:
apps:
tateti:
command: bin/tateti
desktop: meta/gui/tateti.desktop
environment:
DISABLE_WAYLAND: 1
ELECTRON_IS_SNAP: 1
GTK_MODULES: canberra-gtk3-module # loads libcanberra for sounds
plugs:
- home
- network
- network-bind
- audio-playback
- desktop
- desktop-legacy
- wayland
- x11
- unity7
- opengl
- browser-support
- gsettings
- pulseaudio
layout:
/usr/share/libdrm:
bind: $SNAP/usr/share/libdrm
/usr/lib/$CRAFT_ARCH_TRIPLET/dri:
bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/dri
parts:
tateti:
plugin: dump
source: ./dist-electron/linux-unpacked
stage-packages:
- libnss3
- libnspr4
- libatk1.0-0
- libatk-bridge2.0-0
- libcups2
- libgtk-3-0
- libpango-1.0-0
- libcairo2
- libatspi2.0-0
- libgdk-pixbuf2.0-0
- libdrm2
- libxss1
- libxcomposite1
- libxcursor1
- libxi6
- libxtst6
- libxrandr2
- libasound2
- libgbm1
- libxkbcommon0
- libxdamage1
- libxfixes3
- fonts-liberation
- libappindicator3-1
- libdbusmenu-glib4
- libdbusmenu-gtk3-4
- libindicator3-7
- libsecret-1-0
- libnotify4
- libvulkan1
- libcanberra-gtk3-module # ← sound plug-in, will prune OSS below
override-build: |
craftctl default
# 1. Remove the OSS backend that drags in libOSSlib.so
find $CRAFT_PART_INSTALL -name 'libcanberra-oss.so' -delete
# 2. Make Electron binary executable
chmod +x $CRAFT_PART_INSTALL/tateti-deluxe
# 3. Wrapper script
mkdir -p $CRAFT_PART_INSTALL/bin
cat > $CRAFT_PART_INSTALL/bin/tateti << 'EOF'
#!/bin/sh
exec "$SNAP/tateti-deluxe" --no-sandbox --disable-gpu-sandbox --use-gl=desktop "$@"
EOF
chmod +x $CRAFT_PART_INSTALL/bin/tateti
# 4. Desktop entry
mkdir -p $CRAFT_PART_INSTALL/meta/gui
cat > $CRAFT_PART_INSTALL/meta/gui/tateti.desktop << 'EOF'
[Desktop Entry]
Version=1.0
Type=Application
Name=Ta-Te-Ti
GenericName=Tic-Tac-Toe Game
Comment=Play Danielle's tic-tac-toe with friends
Exec=tateti %U
Icon=${SNAP}/meta/gui/icon.png
Terminal=false
StartupNotify=true
Categories=Game;BoardGame;
Keywords=tic-tac-toe;game;multiplayer;board;strategy;
StartupWMClass=tateti-deluxe
EOF
# 5. Icon
if [ -f "$CRAFT_PROJECT_DIR/icons/icon-512.png" ]; then
cp "$CRAFT_PROJECT_DIR/icons/icon-512.png" \
$CRAFT_PART_INSTALL/meta/gui/icon.png
fi
And this is what i see on the console when i launch the game:
tateti
Gtk-Message: 17:41:25.604: Failed to load module "canberra-gtk3-module"
Gtk-Message: 17:41:25.665: Failed to load module "canberra-gtk-module"
Gtk-Message: 17:41:25.666: Failed to load module "canberra-gtk-module"
(tateti-deluxe:1089961): GLib-GIO-CRITICAL **: 17:41:25.681: g_settings_schema_source_lookup: assertion 'source != NULL' failed
(tateti-deluxe:1089961): GLib-GIO-CRITICAL **: 17:41:25.727: g_settings_schema_source_lookup: assertion 'source != NULL' failed
[1090031:0615/174125.745391:ERROR:gl_factory.cc(113)] Requested GL implementation (gl=none,angle=none) not found in allowed implementations: [(gl=egl-angle,angle=default)].
[1090031:0615/174125.746458:ERROR:viz_main_impl.cc(166)] Exiting GPU process due to errors during initialization
[1090104:0615/174125.872214:ERROR:gl_factory.cc(113)] Requested GL implementation (gl=none,angle=none) not found in allowed implementations: [(gl=egl-angle,angle=default)].
[1090104:0615/174125.873285:ERROR:viz_main_impl.cc(166)] Exiting GPU process due to errors during initialization
[1089961:0615/174126.201523:ERROR:object_proxy.cc(576)] Failed to call method: org.gnome.SessionManager.Inhibit: object_path= /org/gnome/SessionManager: org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.10467" (uid=1000 pid=1089961 comm="/snap/tateti/x10/tateti-deluxe --no-sandbox --disa" label="snap.tateti.tateti (enforce)") interface="org.gnome.SessionManager" member="Inhibit" error name="(unset)" requested_reply="0" destination="org.gnome.SessionManager" (uid=1000 pid=6940 comm="/usr/libexec/gnome-session-binary --systemd-servic" label="unconfined")
[1089961:0615/174126.201539:ERROR:power_save_blocker_linux.cc(344)] No response to Inhibit() request!
Thanks for the help!