Spotify snap not working on windows managers

I was trying to play a song with spotify installed via snap and got the following errors:

ALSA lib conf.c:3750:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default

No sound plays, I’ve tested snap’s spotify on GNOME and Deepin DE and it works flawlessly but when I start it in a tiling window manager such as bspwm or i3wm the errors occur (I think the problem is something related to notifications). I’ve already tried the following fixes:

I’m currently using arch linux, snap version:

snap    2.30
snapd   2.30
series  16
arch   
kernel  4.14.15-1-ARCH

This is probably related to snap because installing spotify through the Arch Linux’s AUR package fixes the issues.

Thanks for reporting the problem. This may be related to what has been addressed in Spotify does not play audio

I understand that you do not use wayland. Do you use pulseaudio? Can you do:

$ ls -l /run/user/$(id -u)/pulse
total 4
srw-rw-rw- 1 maciek maciek 0 02-05 07:04 native
-rw------- 1 maciek maciek 6 02-05 07:04 pid

There should be a socket there. Another way for pulseaudio to find the socket is to look at properties of X root window, can you try:

$ xprop -root | grep PULSE
PULSE_SERVER(STRING) = "{9152da7600c94619af668cc8f273730c}unix:/run/user/1000/pulse/native"
PULSE_SESSION_ID(STRING) = "c2"
PULSE_ID(STRING) = "1000@9152da7600c94619af668cc8f273730c/19383"

Lastly, can you try to run spotify like this and post the log?

PULSE_LOG=4 SNAPD_DEBUG=1 SNAP_CONFINE_DEBUG=1 /snap/bin/spotify

Sorry for the late reply, I do use Pulseaudio and Xorg, the output of $ls -l /run/user/$(id -u)/pulse is:

total 4
srw-rw-rw- 1 chromze wheel 0 Feb  5 08:49 native
-rw------- 1 chromze wheel 4 Feb  5 08:49 pid

$xprop -root | grep PULSE produces no output.

Here’s the log: gist.

2018/02/05 09:15:48.995579 cmd.go:70: DEBUG: re-exec not supported on distro "arch" yet
DEBUG: security tag: snap.spotify.spotify
DEBUG: executable:   /usr/lib/snapd/snap-exec
DEBUG: confinement:  non-classic
DEBUG: base snap:    core
DEBUG: ruid: 1000, euid: 0, suid: 0
DEBUG: rgid: 998, egid: 0, sgid: 0
DEBUG: checking if the current process shares mount namespace with the init process
DEBUG: re-associating is not required
DEBUG: creating lock directory /run/snapd/lock (if missing)
DEBUG: opening lock directory /run/snapd/lock
DEBUG: opening lock file: /run/snapd/lock/.lock
DEBUG: sanity timeout initialized and set for three seconds
DEBUG: acquiring exclusive lock (scope (global))
DEBUG: sanity timeout reset and disabled
DEBUG: ensuring that snap mount directory is shared
DEBUG: unsharing snap namespace directory
DEBUG: creating namespace group directory /run/snapd/ns
DEBUG: namespace group directory does not require intialization
DEBUG: releasing lock (scope: (global))
DEBUG: creating lock directory /run/snapd/lock (if missing)
DEBUG: opening lock directory /run/snapd/lock
DEBUG: opening lock file: /run/snapd/lock/spotify.lock
DEBUG: sanity timeout initialized and set for three seconds
DEBUG: acquiring exclusive lock (scope spotify)
DEBUG: sanity timeout reset and disabled
DEBUG: initializing mount namespace: spotify
DEBUG: opening namespace group directory /run/snapd/ns
DEBUG: found base snap filesystem device 7:0
DEBUG: attempting to re-associate the mount namespace with the namespace group spotify
DEBUG: successfully re-associated the mount namespace with the namespace group spotify
DEBUG: found root filesystem inside the mount namespace 7:0
DEBUG: releasing resources associated with namespace group spotify
DEBUG: moved process 4153 to freezer cgroup hierarchy for snap spotify
DEBUG: releasing lock (scope: spotify)
DEBUG: resetting PATH to values in sync with core snap
DEBUG: snappy_udev_init
DEBUG: setup_devices_cgroup
DEBUG: write_string_to_file /sys/fs/cgroup/devices/snap.spotify.spotify/tasks 4153
DEBUG: write_string_to_file /sys/fs/cgroup/devices/snap.spotify.spotify/devices.deny a
DEBUG: run_snappy_app_dev_add: /sys/class/mem/null snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/class/mem/null 1:3
DEBUG: run_snappy_app_dev_add: /sys/class/mem/full snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/class/mem/full 1:7
DEBUG: run_snappy_app_dev_add: /sys/class/mem/zero snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/class/mem/zero 1:5
DEBUG: run_snappy_app_dev_add: /sys/class/mem/random snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/class/mem/random 1:8
DEBUG: run_snappy_app_dev_add: /sys/class/mem/urandom snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/class/mem/urandom 1:9
DEBUG: run_snappy_app_dev_add: /sys/class/tty/tty snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/class/tty/tty 5:0
DEBUG: run_snappy_app_dev_add: /sys/class/tty/console snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/class/tty/console 5:1
DEBUG: run_snappy_app_dev_add: /sys/class/tty/ptmx snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/class/tty/ptmx 5:2
DEBUG: running snappy-app-dev add snap_spotify_spotify /dev/pts/slaves 136:*
DEBUG: running snappy-app-dev add snap_spotify_spotify /dev/pts/slaves 137:*
DEBUG: running snappy-app-dev add snap_spotify_spotify /dev/pts/slaves 138:*
DEBUG: running snappy-app-dev add snap_spotify_spotify /dev/pts/slaves 139:*
DEBUG: running snappy-app-dev add snap_spotify_spotify /dev/pts/slaves 140:*
DEBUG: running snappy-app-dev add snap_spotify_spotify /dev/pts/slaves 141:*
DEBUG: running snappy-app-dev add snap_spotify_spotify /dev/pts/slaves 142:*
DEBUG: running snappy-app-dev add snap_spotify_spotify /dev/pts/slaves 143:*
DEBUG: running snappy-app-dev add snap_spotify_spotify /dev/uhid 10:239
DEBUG: run_snappy_app_dev_add: /sys/devices/pci0000:00/0000:00:02.0/drm/card0 snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/devices/pci0000:00/0000:00:02.0/drm/card0 226:0
DEBUG: run_snappy_app_dev_add: /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1 snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1 0:0
DEBUG: run_snappy_app_dev_add: /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1 snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1 0:0
DEBUG: run_snappy_app_dev_add: /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-2 snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-2 0:0
DEBUG: run_snappy_app_dev_add: /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1 snap_spotify_spotify
DEBUG: running snappy-app-dev add snap_spotify_spotify /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1 0:0
DEBUG: creating user data directory: /home/chromze/snap/spotify/5
DEBUG: loading bpf program for security tag snap.spotify.spotify
DEBUG: read 5960 bytes from /var/lib/snapd/seccomp/bpf//snap.spotify.spotify.bin
DEBUG: raising privileges to load seccomp profile
DEBUG: dropping privileges after loading seccomp profile
DEBUG: execv(/usr/lib/snapd/snap-exec, /usr/lib/snapd/snap-exec...)
DEBUG:  argv[1] = spotify
Parsing configuration file '/etc/pulse/client.conf'
/etc/pulse/client.conf.d does not exist, ignoring.
Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472
Trying to connect to /run/user/1000/snap.spotify/pulse/native...
connect(): No such file or directory (2)
Trying to connect to /var/run/pulse/native...
connect(): No such file or directory (2)
Parsing configuration file '/etc/pulse/client.conf'
/etc/pulse/client.conf.d does not exist, ignoring.
Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472
Trying to connect to /run/user/1000/snap.spotify/pulse/native...
connect(): No such file or directory (2)
Trying to connect to /var/run/pulse/native...
connect(): No such file or directory (2)
ALSA lib conf.c:3750:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default

Can you try the candidate channel? The command is:

snap refresh --candidate spotify

By the looks of if, the candidate snap already has the fix that we came up with in the other forum topic.

2 Likes

Yep, it fixed the issue.

I saw that you have fixed the issue of Spotify snap not working on Windows manager. Could I confirm what’s your way to fix it? I have tried to use DRmare Spotify Music Converter to convert Spotify songs and transfer them to my device. It seems I don’t need to use the Spotify app anymore.
Is this way right solution?