[SOLVED] lots of ALSA troubles when snapping AGS with pulsifyied alsa

Hello,

I am trying to snap AGS. I feel I am so close, but I can’t figure out what’s the difference between building my snap on my machine and on the snapcraft cloud.

I have ubuntu 16.04 on my machine and when I snapcraft from here, it works: https://github.com/ericoporto/ags-snap/releases

The snap built on the cloud doesn’t - has no sound, like it’s missing allegro alsa modules. This is the one submitted to the snap listing.

Sound settings: digital driver ID: 'Auto' (0xffffffff), MIDI driver ID: 'Auto' (0xffffffff)
ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_pulse.so
ALSA lib rawmidi.c:286:(snd_rawmidi_open_noupdate) Unknown RawMidi default
Failed to init one of the drivers; Error: 'Insufficient digital voices available'.
Will try to start without MIDI
ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_pulse.so
Failed to init one of the drivers; Error: 'Insufficient digital voices available'.
Will try to start without DIGI
ALSA lib rawmidi.c:286:(snd_rawmidi_open_noupdate) Unknown RawMidi default
Failed to init sound drivers. Error: Insufficient digital voices available
ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_pulse.so
ALSA lib rawmidi.c:286:(snd_rawmidi_open_noupdate) Unknown RawMidi default

I looked both snaps through MELD and there are lot’s of differences that I can’t understand why they exist. One that caught my attention:

this one I fixed by adding cmake flags on my snapcraft.yaml when building allegro.

Also opengl related things in allegro are gone on the cloud built snap.

I think cmake just runs as it normally would instead of only having snap build environment access, which breaks a lot of things.

Also, organize really needs to be verbose on what it’s doing! One needs to look the logs and have enough information!

Also I know for environment variable for the running snap, these docs exist: https://docs.snapcraft.io/reference/env , but for the actual build time variable I had to read from the source here: https://github.com/snapcore/snapcraft/blob/master/snapcraft/internal/project_loader/_env.py (and actually I had to check the buid logs from the server to see which snapcraft is being used and then get the source from here https://github.com/snapcore/snapcraft/releases )

Current snapcraft.yaml: https://github.com/ericoporto/ags-snap/blob/master/snapcraft.yaml

Also, it would be good if snapcraft saved the used snapcraft.yaml inside of it so one can reproduce what he did that generated a working snap.

alsa-plugins is missing, ensure you’ve follow the instructions at https://github.com/diddledan/snapcraft-alsa 's README

When I follow the instructions I get some sed errors that you fixed already in a pull request some time ago.

Can you specify the pull request’s location?

I do not think that you did follow the instructions because the instructions don’t mention anything about the part called alsa-chain-test which you have copied into your part verbatim (along with the other parts verbatim). This indicates that you blindly copied the entire snapcraft.yaml from my repo. That is most definitely going to fail because there is no express ordering configuration. The readme details how to get the parts built in the correct order. Go back and re-read the instructions in the README.md file.

1 Like

@Lin-Buo-Ren yes here:

https://github.com/diddledan/snapcraft-alsa/pull/3

I followed instructions on friday and got the error sed lines on my build log reported in issue https://github.com/diddledan/snapcraft-alsa/issues/2

So it seems for some reason using the part as remote got me an old version of the part. This is why I’ve moved the code inside my own snapcraft.yaml . @lucyllewy I am sorry if this isn’t supposed to happen, if you look through my commits you will see I tried a ton of things already.

Also it would be great if build logs on snapcraft server were public.

Unless snapcraft keeps a outdated cache of remote parts this shouldn’t happen :-/

The remote parts registry is updated on the server every hour, so the part should be correct on snapcraft.io. You can try snapcraft update to fetch the latest definitions from the server but this shouldn’t be necessary, especially so on container builds (cleanbuild or the build service). Audacity-2.3.0 was built yesterday on the build service using exactly the same remote part, set up exactly as detailed in the README.md of my alsa repository, so I can say that it works in some (most?) cases.

1 Like

Tried to use remote part, is there a way to get it’s headers and link to it? Now allegro alsa plugins broke because of a missing header. :frowning_face:

The remote part’s source key should have a clue.

I decided to just follow the lxd and cleanbuild route, explained in buid.snapcraft.io . I don’t understand yet how in this case I should inspect the parts - without forcing a fail in the build. Also I get an annoying error when typing exit to exit the terminal.

Now I get back my original error:

    Sound settings: digital driver ID: 'Auto' (0xffffffff), MIDI driver ID: 'Auto' (0xffffffff)
    ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_pulse.so
    ALSA lib rawmidi.c:286:(snd_rawmidi_open_noupdate) Unknown RawMidi default
    Failed to init one of the drivers; Error: 'Insufficient digital voices available'.
    Will try to start without MIDI
    ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_pulse.so
    Failed to init one of the drivers; Error: 'Insufficient digital voices available'.
    Will try to start without DIGI
    ALSA lib rawmidi.c:286:(snd_rawmidi_open_noupdate) Unknown RawMidi default
    Failed to init sound drivers. Error: Insufficient digital voices available
    ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_pulse.so
    ALSA lib rawmidi.c:286:(snd_rawmidi_open_noupdate) Unknown RawMidi default

one thing though is that I removed the disable-rawmidi config flag from the remote alsa-lib part because I do need rawmidi.h to build allegro successfully. So maybe I reached LP#1766878

You’re not hitting LP#1766878.

Check that you don’t include libasound from any other sources. If you have accidentally included it via a dependency in stage-packages then you need to use stage: [-path/to/libasound.so] to remove it again before the snap is finalised (note that the leading dash [-] is important!). Any library you have installed which depends on the ALSA library shipped by Ubuntu is possibly going to require rebuilding against the ALSA library shipped by my remote part - if you get segfaults after you remove the Ubuntu libasound, without recompiling the depending libraries, then that is probably due to this issue.

1 Like

Ok, I apparently really have 2 libasound.so (one under /usr/lib/x86_64-linux-gnu/ and the other under /usr/lib/), but I don’t know which is the right one and how to build agains the remote part. :confused:

… erh… Scratch that… I think it worked ? :smiley:

(if someone who has an adventure game made in ags finds this topic, you can play it by installing ags from snap install --edge ags and then typing ags in the game folder!)

I am using the alsa-mixin part here: https://github.com/ericoporto/ags-snap/blob/ags-snap-new-version/snapcraft.yaml

Unfortunately I am again at the part where I have no sound.

My humble suggestion is to give a way in the API to pop a window for the user asking to connect the connectors, since I am only doing the alsa to pulseaudio thing because it doesn’t automatically connect the alsa interface. By pop a window, I mean everytime the application is run without having turned the connector on like on Android with permission. I think the way is done is to make “easier” to convert an existing application, but this could be done in the wrapper command line bash script without “intruding” the original application source code, if so desired.

you can use

as a workaround from inside your snap until something like this is integrated in snapd (or the userd) eventually …

2 Likes