[pulseaudio-discuss] cannot control input devices from pavucontrol + crashes in recording tab

Peter Hercek phercek at gmail.com
Wed Dec 29 06:46:31 PST 2010


On 12/29/2010 11:29 AM, Colin Guthrie wrote:
> 'Twas brillig, and Peter Hercek at 28/12/10 21:36 did gyre and gimble:
>>> As for an immediate exit when used in combination of module-x11-publish,
>>> can you confirm that this immediate exit was just due to you manually
>>> telling the server to exit by typing "exit" into pacmd?
>> The immediate exit was there just because I used "exit" command in
>> pacmd. This is regardless of x11-publish ussage. My fault. I should have
>> read the help first and not expect it behaves like other applications
>> (e.g. mathomatic, calc). Maybe you can rename it to exit-server so that
>> it is clear what is being exited ... I do not expect you do this :-)
>>
>> For a while I thought that x11-publish still makes a difference:
>> * when x11-publish is loaded then the server exitst after 20 seconds if
>> it is used by module-loopback only
>> * when x11-publish is not loaded then the servr does not exit after 20
>> ... or any number of seconds regardless whether it is used by
>> module-loopback or not, but it exits after 20 secondf after the server
>> is used by something else than module-loopback
>>
>> Now I know I was wrong. I achieved loading of x11-publish by using
>> start-pulseaudio-x11 which (as I see now) is script starting the server
>> and then calling pactl load-module module-x11-publish "display=$DISPLAY".
>> This pactl call must be the ussage which starts the 20 seconds countdown
>> when I used x11-publish.
>>
>> I can see why the 20 seconds (or other number of seconds defined in the
>> settings) countdown should not start immediately after server is up -
>> regardles of whether it was already used or not. It is probably there to
>> prevent races and I guess it is part of the protocol. But it confused me
>> quite a bit.
> Generally speaking the server will exit after it's idle timeout
> regardless of whether any client has ever connected (at least that's my
> understanding - I've not actually tested so perhaps this is not the case).
>
> i.e. if the PA daemon is not running at all (pa aux | grep pulseaudio),
> running just "pulseaudio --start" and not using any PA clients should
> make the server startup, wait for 20 seconds and then exit.
>
> I would not rule out the possibility that this countdown only starts
> after the first client connects (kinda like the X server option to exit
> after the last client disconnects - it requires a client to connect
> first before this shutdown is initiated).
With my version of pulseaudio this is definitely the case. The countdown 
starts only after the first connection. It may be confusing (it 
(together with the fact that start-pulseaudio-x11 is a script calling 
pactl) confused me quite a bit), but I believe the reason for this 
behavior is to avoid this race condition:
1 server is not running
2 client starts the server
3 after client started the server it can try to connect it
4 since there is no guarantee how quickly the client runs compared to 
the server it may happen that the server exits on idle timeout before 
the client actually connects the server
5 since server is not running when client wants to connect then goto 1

With timeout in the range 20 seconds or more the above scenario is 
extremely unlikely but nevertheless it is a race. With the timeout 
countdown starting only after the first connection the above race cannot 
happen.

So my guess is that the countdown starting only after the first 
connection is by design.

Thanks for helping out with this,
   Peter.




More information about the pulseaudio-discuss mailing list