No sound using Raspian on pi3 using built snap

Hello.

Using an Ionic/Angular app I’ve made.

I’ve built setup exe on Windows to target Windows, installed and sound plays fine.

I’ve built snap on Ubuntu target armv7l platform. Copied to Raspbian running on Pi3. Install the Snap. Open the new installed snap and everything seems to work great except when playing HTML audio.

I’ve opened a new window within the snap app to YouTube to test audio there and when playing video there, still no audio.

I’ve copied a video and audio file to the filesystem and played with VLC and have audio.

Are there any dependencies that I may be missing within my build that will make this audio work on Raspbian on Pi3?

FYI, I installed Ubuntu Server, added MATE desktop, installed snap, opened and audio works. So obviously something is not there that should be for audio on Raspbian.

Thanks.

Some more testing on my end I’ve found out some more information. The std output for the app when running Electron when I load a media file it’s trying to access the configuration file for alsa which it doesn’t have access to. See here:

ALSA lib conf.c:3916:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
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
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 plug:default

So I researched interfaces for Snap and included the “alsa” interface in the build configuration for electron-builder, doing ‘snap interfaces app-name’ gives this:

Slot                             Plug
gnome-3-28-1804:gnome-3-28-1804  my-app
gtk-common-themes:gtk-3-themes   my-app
gtk-common-themes:icon-themes    my-app
gtk-common-themes:sound-themes   my-app
-                                my-app:alsa
-                                my-app:browser-support
-                                my-app:desktop
-                                my-app:desktop-legacy
-                                my-app:gsettings
-                                my-app:home
-                                my-app:network
-                                my-app:opengl
-                                my-app:pulseaudio
-                                my-app:unity7
-                                my-app:wayland
-                                my-app:x11

So assuming the app now has access to ALSA configuration, I run the app but still get the above std error output results that it cannot access the alsa configuration file.

I’m not sure how to change which sound library that electron/chromium will use. You can see the app has access to ‘pulseaudio’ as well, which I might assume the default included Chromium browser for Raspbian uses since audio works for that app that is included.

My problem obviously is a sandbox issue and need something to configure to allow access to alsa configuration or potentially use ‘pulseaudio’?

Another update! So I have moved away from using Snap and created a Debian package for ARM architecture and installed that and executed my Electron app and sound now works. This works better because I’d rather work outside of a sandbox situation with the app since this will be a kiosk only application with audio.

End result is there is some definite configuration that needs to be done for the Snap version to allow access to that ALSA file I believe. Something out of my knowledge and maybe someone will run across this in the future and chime in to provide some good information.