Sound not working after update

Hi,

I maintain this snap: https://github.com/mmartinortiz/retro-virtual-machine-snap , but I do not develop or maintain the original software.

Today the application was updated to a new version. I modified the snap to make use of the new deb package. The new version runs without problems, but there is no sound. I’ve checked that the deb version has sound (not only in my laptop, but in other user’s laptops).

All plugs (including sound) are enabled.

I’m not that expert packaging applications in Snaps, and any tip or guidance to debug this issue is appreciated.

Thanks!

I’ve gone a bit further in my investigation. Launching the snap from the command line, I saw that it is related to ALSA

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

I found that I need to enable the ALSA plug and install libasound2. I did both, but then:

Err libasound2-data_1.1.3-5ubuntu0.5_all.deb                                                                           
  404  Not Found [IP: 185.125.190.39 80]                                                                               
Fetched 0 B in 0s (0 B/s)                                                                                              
Package fetch error: The item '/root/.cache/snapcraft/download/libasound2-data_1.1.3-5ubuntu0.5_all.deb' could not be fetched: 404  Not Found [IP: 185.125.190.39 80]

Let’s continue the investigation…

After trying snapcraft clean I get a new error when I try to build.

↪ snapcraft build --debug
Launching a VM.
Build environment is in unknown state, cleaning first.
info failed: The following errors occurred:
instance "snapcraft-mmartinortiz-retro-virtual-machine" does not exist
launch failed: Remote "snapcraft" is unknown or unreachable.                    
An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.

This is not looking good :frowning:

You can use snapcraft --use-lxd to build on lxd containers instead of multipass VMs, it’s usually faster. About the sound issue, shouldn’t the application be using pulseaudio instead of alsa directly? Does adding libpulse-dev to build-packages and libpulse0 to stage-packages help?

Update: now I see that you’re using a binary deb instead of building the application from sources, so adding libpulse-dev doesn’t make any difference.

Thanks for your feedback.

With --use-lxd I got a link libraries error when using snapcraft try and later snap try. Upgrading to core20 or core22 did not help either. I’m getting different errors for them. I’m getting a bit discourage here with the use of snap :frowning:

@tigarmo recently worked on “try” so maybe he knows what could be happening here.

Regarding sound issues: since you’re staging a binary build, is it possible that the previous version had pulseaudio output enabled by default but this new version uses alsa directly, causing the sound issues? If this is the case maybe @diddledani has some trick to make it work (I used layouts to remap /usr/share/alsa and connected the alsa interface, but that was not enough to get sound from the ZX Spectrum emulator).

I created https://snapcraft-alsa.readthedocs.io/en/latest/ to get alsa running by piping it through pulse audio. Might be worth checking out the instructions there.

I finally got it working. I think that what made the trick was mapping or exposing the alsa.conf file, I followed the tip of this comment.

But I also updated the base to core22, removed some interfaces already provided by the gnome plugin and also all the libraries in the stage-packages, leaving only those for audio.

One last thing to mention: I could not debug the mapping of the alsa.conf file with --devmode, because I could not find where it become installed or get a shell into the snap to see if the mapping occurred. I had to release it, and install from the store, to be able to test it. I do not know if there is a better way to do this.

same problem facing on my intel arc pc, it says ; [snapcraft.yaml] is missing, how can fix this issue?