Just created my first snap and now I’m working on trying to get it completely working. The game works, but trying to solve the no audio issue. Here’s my .yaml file:
fasteroids:
plugin: dump
stage-packages:
- libgl1
- libglu1-mesa
- libx11-6
- libxext6
- libxrandr2
- libxxf86vm1
- libcurl3-gnutls
- libopenal-dev
source: fasteroids-amd64-Ubuntu-1.8.2/
organize:
"*": bin/
apps:
fasteroids:
command: bin/fasteroids
plugs:
- x11
- opengl
- alsa
- audio-playback
- pulseaudio
After installing I ran snap connect fasteroids:alsa but I’m still getting the following errors:
ALSA lib conf.c:3916:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device ‘default’: No such file or directory
g_device is (nil)
Error generating sources + buffers
Finding creating a snap really fun, this really is pretty awesome, but still just learning. I did a bit more digging after this initial post and based on Reusable alsa-lib part I reworked my snapcraft.yaml so it looks like:
name: fasteroids
base: core18
version: '1.8.2'
summary: Asteroids remake with more ships and limited controller support
description: |
Fasteroids is an Asteroids remake with adjustable enemy difficulty,
updated pixelart graphics, and limited game controller support.
grade: devel
confinement: strict
parts:
fasteroids:
plugin: dump
source: fasteroids-amd64-Ubuntu-1.8.2/
stage-packages:
- libgl1
- libglu1-mesa
- libx11-6
- libxext6
- libxrandr2
- libxxf86vm1
- libcurl3-gnutls
- libopenal-dev
after:
- alsa-lib
organize:
"*": bin/
alsa-lib:
plugin: autotools
source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.2.2.tar.bz2
configflags:
- --prefix=/usr
- --sysconfdir=/etc
- --libexec=/usr/lib
- --libdir=/usr/lib
- --localstatedir=/var
- --with-configdir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa
- --with-plugindir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib/alsa-lib
- --disable-static
stage:
- usr/include
- usr/lib
prime:
- -usr/bin
- -usr/include
- -usr/lib/pkgconfig
- -usr/share/alsa/alsa.conf
- -usr/share/alsa/pcm
- -usr/share/alsa/topology/broadwell
apps:
fasteroids:
command: bin/fasteroids
environment:
ALSA_CONFIG_PATH: /snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa
plugs:
- x11
- opengl
- alsa
- audio-playback
- joystick
I then installed the snap and ran snap connect fasteroids:alsa but still getting:
ALSA lib conf.c:3916:(snd_config_update_r) Cannot access file /snap/fasteroids/current/usr/share/alsa
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device ‘default’: No such file or directory
g_device is (nil)