You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spotify: PulseAudio: Unable to connect: Connection refused #2169
Before starting spotify I issue this in shell: exportxprop -root -notype PULSE_SERVER | tr -d ' '``
and then
flatpak run com.spotify.Client/x86_64/stable
which gives me this:
ALSA lib ../../pulse/pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
ALSA lib ../../src/dlmisc.c:170:(snd_dlsym_verify) unable to verify version for symbol _snd_pcm_plug_open
ALSA lib ../../src/dlmisc.c:296:(snd1_dlobj_cache_get) symbol _snd_pcm_plug_open is not defined inside [builtin]
No idea how to fix this. I have Spotify opened, but no sound.
Just finished a -current install and grabbed spotify with flatpak. I was able to get audio working by creating an executable script and running spotify from that. here is the code:
Thanks @CrashyBang and @KaMiila, your solutions worked wonderfully for my similar issue with Discord Flatpak. I'll detail my exact procedure for anyone else:
Step 1: Add the following lines to ~/.xinitrc (before the line that starts WM)
Step 3: Change the permission on the script to make it runnable chmod a+x ~/.local/bin/Discord
Step 4: Restart/reload your WM and run the script. If Discord still has no sound the first time you run it after this procedure, kill all Discord processes (check htop) and try again. Sometimes xdg_runtime_dir is not populated before discord launches so it can't connect to PulseAudio but after restarting Discord, it should work.
Activity
TingPing commentedon Oct 2, 2018
Does this happen with other Flatpaks?
xexpanderx commentedon Oct 2, 2018
This is the first time I try to use Flatpak, do you have any other package I may try that requires pulseaudio?
TingPing commentedon Oct 2, 2018
Maybe https://flathub.org/apps/details/org.gnome.Lollypop
alexlarsson commentedon Oct 3, 2018
flatpak is supposed to read the PULSE_SERVER env var, see the code at:
https://github.com/flatpak/flatpak/blob/master/common/flatpak-run.c#L344
Maybe its some form it can't accept though, it can only do unix: ones atm? What is the value of the env var for you?
xexpanderx commentedon Oct 3, 2018
Hi,
The value is:
chopfitzroy commentedon Dec 19, 2018
@xexpanderx did you find a solution? I am experiencing the same problem.
xexpanderx commentedon Dec 19, 2018
No, I gave up, too much of a hassle.
chopfitzroy commentedon Dec 19, 2018
Fair enough I will comment here if I find anything simple.
refi64 commentedon Dec 19, 2018
Based on #878, this seems to occur if
$XDG_RUNTIME_DIRis empty when PulseAudio was started. Try adding:chopfitzroy commentedon Dec 19, 2018
Hey @kirbyfan64,
I added that to my
.zshrcand now I get the following error:I also tried install
xdg-utilsin case this was required but it made no difference.chopfitzroy commentedon Dec 21, 2018
After reading a little more I tried adding:
To my
/etc/profilethis stopped the above error, but did not resolve the issues.refi64 commentedon Dec 21, 2018
Now, what's the value of
$PULSE_SERVER?chopfitzroy commentedon Dec 21, 2018
Hey Kirby so I actually got it by running:
However I did notice when I run it without:
Added to the
/etc/profileI get the following errors:
Any idea what that may be? And what it may effect?
refi64 commentedon Dec 22, 2018
(commenting on the new issue)
KaMiila commentedon Oct 26, 2019
Just finished a -current install and grabbed spotify with flatpak. I was able to get audio working by creating an executable script and running spotify from that. here is the code:
#!/bin/bash
export
xprop -root -notype PULSE_SERVER | tr -d ' 'PULSE_SERVER=unix:/tmp/pulse-PKdhtXMmr18n/native
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client @@U %U @@
IronOxidizer commentedon May 21, 2020
Thanks @CrashyBang and @KaMiila, your solutions worked wonderfully for my similar issue with Discord Flatpak. I'll detail my exact procedure for anyone else:
Step 1: Add the following lines to
~/.xinitrc(before the line that starts WM)Step 2: Create a script (mine is ~/.local/bin/Discord) with the following lines
Step 3: Change the permission on the script to make it runnable
chmod a+x ~/.local/bin/DiscordStep 4: Restart/reload your WM and run the script. If Discord still has no sound the first time you run it after this procedure, kill all Discord processes (check htop) and try again. Sometimes xdg_runtime_dir is not populated before discord launches so it can't connect to PulseAudio but after restarting Discord, it should work.
run: More accurately match PulseAudio's logic for finding its socket
run: More accurately match PulseAudio's logic for finding its socket
smcv commentedon Jan 7, 2021
#4059 should make most (all?) of the workarounds given here unnecessary.
run: More accurately match PulseAudio's logic for finding its socket
run: More accurately match PulseAudio's logic for finding its socket