Thank you for coming back to me. I have a few new data points.
First, I could not run spotify from snap until I first set ‘xhost +’.
gato@espejo:~> PULSE_LOG=4 snap run spotify
Gtk-Message: 10:09:35.683: Failed to load module "canberra-gtk-module"
No protocol specified
(spotify:25000): Gtk-WARNING **: 10:09:35.683: cannot open display: :0
gato@espejo:~> xclock
^X^C
gato@espejo:~> xhost +
This is interesting because I run pulseaudio as daemon under my own user, so if snap is a different user then it may have something to do with why it connect to pulseaudio. The problem with this theory is that when I examine processes, everything snap is running as my user, except snapd.
gato@espejo:~> ps auwwx|grep snap
root 1666 0.0 0.2 1763724 52044 ? Ssl Nov04 0:08 /usr/libexec/snapd/snapd
gato+ 25586 56.5 0.9 3299388 238240 pts/3 Sl+ 10:18 0:07 /snap/spotify/42/usr/share/spotify/spotify
gato+ 25685 0.1 0.2 569184 65868 pts/3 S+ 10:18 0:00 /snap/spotify/42/usr/share/spotify/spotify --type=zygote --no-zygote-sandbox --no-sandbox --log-file=/snap/spotify/42/usr/share/spotify/debug.log --log-severity=disable --product-version=Spotify/1.1.42.622 --lang=en
gato+ 25686 0.1 0.2 569184 65784 pts/3 S+ 10:18 0:00 /snap/spotify/42/usr/share/spotify/spotify --type=zygote --no-sandbox --log-file=/snap/spotify/42/usr/share/spotify/debug.log --log-severity=disable --product-version=Spotify/1.1.42.622 --lang=en
gato+ 25712 3.2 0.3 939284 93552 pts/3 Sl+ 10:18 0:00 /snap/spotify/42/usr/share/spotify/spotify --type=gpu-process --field-trial-handle=6340722393849877550,10750210885510684358,131072 --enable-features=CastMediaRouteProvider --disable-features=OutOfBlinkCors --no-sandbox --log-file=/snap/spotify/42/usr/share/spotify/debug.log --log-severity=disable --product-version=Spotify/1.1.42.622 --lang=en --gpu-preferences=MAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAQAAAAAAAAAAAAAAAAAAAACAAAAAAAAAA= --use-gl=swiftshader-webgl --log-file=/snap/spotify/42/usr/share/spotify/debug.log --shared-files
gato+ 25718 3.3 0.3 1314580 89536 pts/3 Sl+ 10:18 0:00 /snap/spotify/42/usr/share/spotify/spotify --type=utility --utility-sub-type=network.mojom.NetworkService --field-trial-handle=6340722393849877550,10750210885510684358,131072 --enable-features=CastMediaRouteProvider --disable-features=OutOfBlinkCors --lang=en-GB --service-sandbox-type=network --no-sandbox --log-file=/snap/spotify/42/usr/share/spotify/debug.log --log-severity=disable --product-version=Spotify/1.1.42.622 --lang=en --log-file=/snap/spotify/42/usr/share/spotify/debug.log --shared-files=v8_snapshot_data:100
gato+ 25734 48.5 1.0 6175260 266656 pts/3 Sl+ 10:18 0:04 /snap/spotify/42/usr/share/spotify/spotify --type=renderer --no-sandbox --log-file=/snap/spotify/42/usr/share/spotify/debug.log --field-trial-handle=6340722393849877550,10750210885510684358,131072 --enable-features=CastMediaRouteProvider --disable-features=OutOfBlinkCors --disable-gpu-compositing --lang=en-GB --log-file=/snap/spotify/42/usr/share/spotify/debug.log --log-severity=disable --product-version=Spotify/1.1.42.622 --disable-spell-checking --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=5 --shared-files=v8_snapshot_data:100
gato+ 25779 0.0 0.0 6120 684 pts/4 S+ 10:18 0:00 grep --color=auto snap
Then I start spotify as you suggest.
gato@espejo:~> PULSE_LOG=4 snap run spotify
Gtk-Message: 10:18:32.968: Failed to load module "canberra-gtk-module"
MESA-LOADER: failed to open i965 (search paths /snap/spotify/42/usr/lib/x86_64-linux-gnu/dri)
failed to load driver: i965
MESA-LOADER: failed to open kms_swrast (search paths /snap/spotify/42/usr/lib/x86_64-linux-gnu/dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast (search paths /snap/spotify/42/usr/lib/x86_64-linux-gnu/dri)
failed to load swrast driver
Parsing configuration file '/etc/pulse/client.conf'
Parsing configuration file '/etc/pulse/client.conf.d/50-system.conf'
Using shared memfd 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 unix:/run/user/1000/snap.spotify/../pulse/native...
connect(): Connection refused (111)
And when I play a track same messages as yesterday.
Pulseaudio is started as a daemon run by my user when windowmanager session is started.
gato@espejo:~> ps auwwx|grep pulse
gato+ 3191 0.1 0.0 1545016 12224 ? S<l Nov04 1:28 /usr/bin/pulseaudio --start
gato+ 3197 0.0 0.0 235724 7472 ? Sl Nov04 0:00 /usr/libexec/pulse/gsettings-helper
gato+ 25846 0.0 0.0 6120 748 pts/4 S+ 10:24 0:00 grep --color=auto pulse
Best,
Michael