Core24 issue with audio

I did rewrote old snapcraft file to not use some of the dependencies previously used by snap and updated base to use core24.

Here is my snapcraft.yaml file

name: etlegacy
summary: FPS Game
description: |
  Welcome to ET: Legacy, an open source project that aims to create a fully compatible client
  and server for the popular online FPS game Wolfenstein: Enemy Territory - whose gameplay
  is still considered unmatched by many, despite its great age.
base: core24
adopt-info: etl
compression: lzo
confinement: strict
source-code: https://github.com/etlegacy/etlegacy-snap
website: https://www.etlegacy.com
contact: https://discord.gg/UBAZFys
issues: https://github.com/etlegacy/etlegacy/issues/

license: GPL-3.0

parts:
  etl:
    plugin: cmake
    cmake-parameters:
      - -DCROSS_COMPILE32=OFF
      - -DRENDERER_DYNAMIC=OFF
      - -DINSTALL_OMNIBOT=OFF
      - -DBUILD_MOD_PK3=OFF
      - -DBUNDLED_OPENSSL=OFF
      - -DBUNDLED_WOLFSSL=OFF
    source-type: git
    source-branch: master
    source: https://github.com/etlegacy/etlegacy
    parse-info: [usr/local/share/metainfo/com.etlegacy.ETLegacy.metainfo.xml]
    build-packages:
      - g++
      - gcc
      - make
      - autoconf
      - automake
      - autotools-dev
      - m4
      - libtool
      - libglew-dev
      - libopengl-dev
      - libgl1-mesa-dev
      - libglx-dev
      - freeglut3-dev
      - zlib1g-dev
      - libminizip-dev
      - libx11-dev
      - libc-devtools
      - libc6-dev
      - libssl-dev
      - libsoundio-dev
      - nasm
      - zip

    stage-packages:
      - libgl1
      - libglvnd0
      - libglu1-mesa
      - libgl1-mesa-dri
      - libglx-mesa0
      - libstdc++6
      - libsoundio2
      - wget
      - curl
      - unzip

  wrappers:
    plugin: dump
    after: [etl]
    source: ./wrappers
    organize:
      etl: bin/etl
      etlded: bin/etlded
    prime:
      - bin/etl
      - bin/etlded

apps:
  etl:
    command: bin/etl
    plugs:
      - opengl
      - x11
      - wayland
      - audio-playback
      - pulseaudio
      - joystick
      - network
      - alsa
      - hardware-observe

  etlded:
    command: bin/etlded
    plugs:
      - network
      - network-bind
      - hardware-observe

# The `layout` ensures that files can be found by applications where they are expected by the toolkit or application.
layout:
  # Other, generally useful paths
  /usr/share/fonts:
    bind: $SNAP/usr/share/fonts
  /usr/share/icons:
    bind: $SNAP/usr/share/icons
  /usr/share/sounds:
    bind: $SNAP/usr/share/sounds
  /etc/fonts:
    bind: $SNAP/etc/fonts
  /usr/share/alsa:
    bind: $SNAP/usr/share/alsa

I have launched snap package and it gives me errors about audio

0 --------------------------------
       0 ----- Initializing Sound (1) ---
       0 SDL_Init( SDL_INIT_AUDIO )... OK
       0 SDL audio driver is "alsa".
tty]ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
       0 SDL_OpenAudioDevice() failed: ALSA: Couldn't open audio device: No such file or directory
       0 Sound initialization failed
       0 --------------------------------

I have tried with pulseaudio but I do not have any logs from that attempt

I found the only fix for it was changing confintment to classic but in order to publish the app to the store I need create a request

The chance you get classic confinement granted for a game is close to zero …

You seem to not be shipping any alsa libs but create layouts for them, which will just result in empty dirs inside your snap, you need to actually ship the pieces you want to use …

Yeah just checked supported categories and there is no game cattegory

I tried alsa and pulseaudio installed bunch of requied libs and did setup correct paths and both resulted in failure

SDL gave me error that it could not connect to Pulseaudio

I’d start with adding libasound2-data and perhaps also libasound2-plugins to your stage-packages: they ship the data for /usr/share/alsa normally…

Alternatively, simply try to use the gnome extension in your apps: entry, that should set up audio output for you if you do not want to bother with shipping the alsa bits yourself …

Yeah I used thos libs and it gave me this

SDL_Init( SDL_INIT_AUDIO )... OK
       0 SDL audio driver is "alsa".
tty]ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
       0 SDL_OpenAudioDevice() failed: ALSA: Couldn't open audio device: No such file or directory
       0 Sound initialization failed

And yeah adding:

extensions: [gnome]

Made it work

1 Like