Ubuntu ALSA lib error: No sound playing in simulator


I’m working with Ubuntu 20.04 LTS und started the Solar2D tutorial and made it to Chapter 7 — Sounds and Music.

I regognized that no sound or music was playing in the simulator while testing out my code changes. Everytime a sound or music should be playing, i got these error outputs in the console:

ALSA lib conf.c:4120:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory

Initially it looked to me like a file permission issue because the config file /usr/share/alsa/alsa.conf does exist. Unfortunately giving all permissions didn’t changed anything.

I never had sound issues except with Solar2D. All my youtube videos or system sounds playing perfectly fine as usual. Playing wav files using aplay works too. That’s also the first time i have something to do with the ALSA lib, never touched it before.

After hours searching through the internet, i tried a few things:

  • deinstall Solar2D and reinstall it with the flag --classic and in the second try with the flag --devmode
  • reboot
  • connect the plug with the slot with sudo snap connect solar2d:alsa
  • reinstall all alsa and pulseaudio related packages
  • explicitly setting the $ALSA_CONFIG_PATH
  • using a .asoundrc config file

No improvement so far!
I didn’t find an alsa sound issue directly related to Solar2D when searching online for a solution.

In the past, i had sometimes troubles with snap installed applications regarding permissions. Maybe it is a problem that i installed Solar2D using snap? I don’t know.

Does anyone of you maybe had a similar issue with alsa and Solar2D?

So far i really liked the experience using Solar2D but this could be a show stopper for me.

Any help would be appreciated! Thanks in advance!

I don’t use Solar2D on Linux, but I know it has some issues including the sound bug reported by some users before.
Below is a tutorial for Solar2D on Linux, hopefully, it can help you solve the problem.

1 Like

That was the step i wanted to avoid :smile: but what should i say… it worked!

I followed your mentioned tutorial and the sound in the simulator was instant playing.

Thanks a lot! You saved my day! :smiley:

1 Like