I am trying to run an application via systemd. This application tries to consume the audio system to emit some sounds.
When i run it from a terminal under my (current) user, everything works fine, although, when i configure it to run via systemd, it fails to connect to the pulse audio service and the sounds are not emitted.
This is my error message:
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused
The underlying library to enable sounds is https://github.com/faiface/beep
The unit is
$ groups mh-cbon
mh-cbon : mh-cbon lp docker
I tried to set the unit group as audio, that did not fix the problem. I would like not to have to add my user to audio group, if that would solve the issue.
Any idea what is going on ?
thank you for your help and inputs, it is appreciated.