Sound for application running as root

I have an application that was written using Qt. This application needs to run as root in order for it to function properly. This is unfortunately a requirement for the application. I am attempting to use Thinlinc in single application mode to only display the application.

The issue that with it running as root. There is no sound. This is likely due to PulseAudio. To try and fix this, I have been trying to run it system wide either with the --system tag or -D. Either in the services configuration or manually starting the PulseAudio server. But nothing seems to be working as I cannot get the sound to work.

Does the ThinLinc server have its own built in PulseAudio? The reason that I ask is that any changes that I do the main PulseAudio app does not seem to make any difference.

Is it possible to get audio from and application running in sudo/root? Any guidance here will be greatly appreciated.

Hi @MatthewB,

The ThinLinc client will start it’s own PulseAudio process (“server”) on the client machine. Remote applications will then connect to this process via an SSH tunnel, so that audio can be output on the client.

I assume you’re not connecting via ThinLinc as root? The PulseAudio tunnel will be set up for whichever user you connect to ThinLinc as, which means an application run as root may not be able to find it. For example, running env | grep PULSE as the ThinLinc user should list a number of PulseAudio-related environment variables which are used by the application to find the tunnel endpoint. Ensuring that these variables are set for your Qt application as well would be a good place to start.

Hope that helps.