Re: Recently sound does not play as root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/20/23 07:22, Eyal Lebedinsky wrote:
Fedora 36 up-to-date.

$ uname -a
Linux e4.eyal.emu.id.au 6.1.15-100.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Mar  3 17:22:46 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

I have a script running as root (using sudo) and in it I play a sound
     paplay /audio/ogg/beginning.ogg
and it always worked.

Then a few days ago it stopped and I now get an error. Something changed.

$ sudo paplay /audio/ogg/beginning.ogg
Connection failure: Connection refused
pa_context_connect() failed: Connection refused


Playing sounds from a userid not "logged in" has always been very problematic
and took me a lot of experimentations in the past.
My current solution is something like:
(this is run with the user logged in and "owning" the audio)

pactl load-module module-native-protocol-tcp listen=127.0.0.1
export PULSE_SERVER='tcp:127.0.0.1:4713'
pax11publish -e
xhost si:localuser:mysecondaryuser

where "mysecondaryuser" should be root in your case.

This is basically
- enabling TCP connections to pulseaudio (or pipewire emulation)
- making the path available to users able to interact with the X11 session
- enabling a user to access the X11 session

No warranty that it will work in your case.
No idea how this would be adapted when using Wayland instead of X11.

Regards.
--
   Roberto Ragusa    mail at robertoragusa.it
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux