[LAU] Service/user not using PulseAudio

Iain Mott mott at escuta.org
Wed Apr 8 17:17:12 CEST 2020


Thanks Chris. I've tried running:

sudo -H -u asterisk bash -c 'unset DISPLAY ; /usr/bin/pulseaudio -vvvvv 
--daemonize=no --start'

and after killing off the pulseaudio process:

sudo -H -u asterisk bash -c 'unset DISPLAY ; /usr/bin/pulseaudio -vvvvv 
--daemonize=yes --start'

But neither get the audio working correctly. The verbose output of the 
instances are as follows:

D: [pulseaudio] conf-parser.c: Parsing configuration file 
'/etc/pulse/client.conf'
D: [pulseaudio] conf-parser.c: /etc/pulse/client.conf.d does not exist, 
ignoring.
I: [pulseaudio] main.c: Daemon startup successful.

If i kill off pulseaudio with 'pulseaudio -k" as user iain and start 
pulsaudio in the same way (rather than having it start automatically 
when using aplay), the output is the same and the audio continues to 
work correctly.

I'm still not sure if /var/lib/asterisk/.config/pulse is being used

Iain




Em 08/04/2020 10:56, Chris Caudle escreveu:
> On Wed, April 8, 2020 8:14 am, Iain Mott wrote:
>> no, a pulse config directory is created in /var/lib/asterisk/.config/
>>
>> the entry for asterisk in /etc/passwd is:
>>
>> asterisk:x:124:130:Asterisk PBX
>> daemon,,,:/var/lib/asterisk:/usr/sbin/nologin
> Perhaps there is no pulse instance running for user asterisk.  When you
> used aplay from your user account it would have played through a pulse
> instance running as your user, the asterisk user account would not have
> access to that instance.  You need to start pulse as user asterisk.
> Watch out for details on how to start, for example the man page has a note
> about starting from systemd services:
>
>        --start
>              Start PulseAudio if it is not running yet. This is different from
>              starting PulseAudio without --start which would fail if PA is
> already
>              running. PulseAudio is guaranteed to be fully initialized when
> this
>              call returns. Implies --daemonize.
>
>         -D | --daemonize[=BOOL]
>              Daemonize after startup, i.e. detach from the terminal. Note that
>              when running as a  systemd  service you should use
>              --daemonize=no for systemd notification to work.
>


More information about the Linux-audio-user mailing list