On Tue, Mar 21, 2023 at 12:38 AM Eyal Lebedinsky <fed...@eyal.emu.id.au> wrote:
> [...]
> > There used to be an environment variable that pointed to the pulseaudio 
> > socket, but that seems to have changed (at least in F37).  Check that the 
> > XDG_RUNTIME_DIR variable is set.  It wasn't when I tested going through 
> > root.  It should point to /run/user/<pid> which is most likely 
> > /run/user/1000 unless you aren't the first user.
>
> Yet, it is present and set up. I expect that it is lost by sudo... yes it is.
> I set it up manually and got a similar error:
>
> [eyal@e7:~]$ sudo -i
> [root@e7 ~]# set|grep XDG_RUNTIME_DIR
> [root@e7 ~]# export XDG_RUNTIME_DIR=/run/user/500
> [root@e7 ~]# paplay /audio/ogg/beginning.ogg
> XDG_RUNTIME_DIR (/run/user/500) is not owned by us (uid 0), but by uid 500! 
> (This could e.g. happen if you try to connect to a non-root PulseAudio as a 
> root user, over the native protocol. Don't do that.)
> Connection failure: Connection refused
> pa_context_connect() failed: Connection refused

Give `sudo -E` a try.

Jeff
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to