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

Colin Guthrie gmane at colin.guthr.ie
Wed Dec 29 02:29:01 PST 2010


'Twas brillig, and Peter Hercek at 28/12/10 21:36 did gyre and gimble:
> On 12/28/2010 09:28 PM, Colin Guthrie wrote:
>> 'Twas brillig, and Peter Hercek at 28/12/10 19:58 did gyre and gimble:
>>> Yes, it is quite usable for me. But the main reason is that I almost
>>> always run an image in virtual box which keeps one connection always
>>> active when it runs.
>>>
>>> I can run it without x11-publish and if I do not mess with it will work
>>> fine ... till I do not start some other application using the pulseaudio
>>> server. I did more tests and looks like any application (excepet the
>>> line-in loopback itlsef) using the server will make it exit 20 seconds
>>> after it is finished. This is even when I do not have suspend-on-idle
>>> loaded.
>>>
>>> I thought the only expection is pacmd which would cause the server to
>>> exit immediately. I was wrong. I used command exit as a way to quit
>>> pacmd but that tells the server to exit too. When I finished pacmd with
>>> ^D it behaved as all the rest of the pulseaudo server clients.
>>>
>>> My hypothesis would be that x11-publish somehow uses the server which
>>> starts the 20 sec countdown. The rest of the modules I have loaded do
>>> not do this. Any apllication connecting the server starts 20 sec
>>> countdown too (when it finishes). Loopback cannot keep the server used
>>> (so I think it should keep it used if it is not muted).
>>>
>>> As for as the module-x11-xsmp. I do not use it. I also to not use any
>>> desktop environment. I have only the bare xserver, fluxbox, and a few of
>>> x11 apps installed. Minimalistic environment, nothing fancy.
>>
>> Ahhh, right, then this last bit is the telling thing. This is
>> technically expected behaviour. PA only stays alive when it's needed. It
>> considers itself "needed" when an external client connects. e.g. some
>> application that uses PA in some capacity.
>>
>> When no application has expressed and interest in using PA for 20s, then
>> it exits. This is intended behaviour and is what the setting
>> exit-idle-time in daemon.conf (see "man pulse-daemon.conf" for details)
>> controls.
>>
>> Normally, PA will be kept alive for the duration of the user's X11
>> session by loading a special PA module (module-x11-xsmp) to connect to
>> the X11 Session Manager. It allows PA to stay alive and not exit for the
>> duration of the X11 session. If you do not run a session manager,
>> obviously this module in PA cannot be loaded and PA will exit after 20s.
> 
> Should it exit even when suspend-on-idle is not loaded?
> Well it is named suspend-on-idle and not exit-on-idle ... so maybe it
> should...
> 
> 
>> Now you could argue that module-loopback should actually prevent idle
>> timeout. I'd be tempted to agree with this, but there are probably other
>> folk that would say that's a bad idea as it's often a "hidden" feature
>> and we'd have people asking why their PA server is not exiting after the
>> timeout!
> 
> I do not mind if it by default does exit even when loopback is loaded
> and active. But there should be a way to prevent the exit (because it
> results in loss of sound when the loopback is used). Maybe I can achieve
> it by somehow manually loading module-x11-xsmp ... so that I can pretend
> I'm like gnome/kde folks?
> 
> 
>> 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).

> I'm cool with any way which allows me to prevent the server exit when it
> is used by module-loopback only. It may be done by module-loopback
> actually telling the server it is being used or it can be done by some
> switch/option/argument to module-loopback (looks like it is possible to
> have them so I do not know how to specify it now) or a switch to server
> or loading some module do-not-exit-on-idle or whatever :-) I do not
> really care, it just sucks big time when I need to have some other
> (visible) app using pulseaudio server to keep it running when I need
> only module-loopback active.

Well the server wide solution (i.e. your do-not-exit-on-idle option) is
as I previously documented: setting exit-idle-timeout in daemon.conf to
a negative number. This will totally prevent PA from killing itself
after a timeout.

But a more granular option in the module itself makes sense I think.
Whether it is always on or just on when a certain switch is present on
the module command line is open for debate. I'll ask others before
deciding how to do that.

Cheers

Col



-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list