[pulseaudio-discuss] Using "expect" to feed pacmd

Colin Guthrie gmane at colin.guthr.ie
Fri Sep 10 07:41:17 PDT 2010


Hiya

'Twas brillig, and Whit Blauvelt at 10/09/10 15:14 did gyre and gimble:
> On Fri, Sep 10, 2010 at 01:44:31PM +0100, Colin Guthrie wrote:
> 
>> The /etc/inid.d script should ONLY be used for system wide PA. We do not
>> even provide such a script in our upstream tarballs and generally
>> discourage using PA in system wide mode. 
> 
> That's good design from a traditional *nix perspective, assuming any system
> may have multiple users. I think where it collides with a distro like Ubuntu
> is that Ubuntu has two main use cases: servers where it may have many users
> but won't have a GUI and is unlikely to be involved with sound, and then
> desktops on notebooks where there's a polished GUI and generally only a
> single user. Canonical must figure that for single user systems system-wide
> mode isn't so bad.

I believe they just provide the script. They certainly do not use it by
default and in a typical setup it is not activated by default. 99% of
their users they will totally ignore this script and it will not be run.

> But then in the Ubuntu forums there are many, many reports of people going
> System > Preferences > Sound and then getting nothing but a message about
> waiting for the sound system to start. Obviously it works for many much of
> the time. But it also breaks for many too. It could be this fragility is
> just in running it system-wide. Maybe Canonical just shouldn't do that.

Like I said, they do not do that. They maybe did about 4 or 5 releases
ago, but certainly not in any recent release.

> Nonetheless, for now, your largest user base is probably on Ubuntu, and if
> it's not going to work so well in system-wide mode, either Canonical or
> Pulseaudio should work things out so it does, or else doesn't even try to
> work that way.

I really think you're reading too much into this. Like I say it's not
enabled in Ubuntu by default. Only if users take specific action to
enable this will it be used.

>> In the default, per-user setup that we ship, PA auto-spawns, so exiting
>> the daemon is generally not overly problematic (clients which support
>> reconnect will do so automatically).
> 
> I'm all for building stuff from source, but sound is such a complex stack
> I'd worry about how much other stuff would need to be from source rather
> than from the distro's packages in order to keep this stable as other system
> components go through their upgrade cycles.

I really wasn't advocating you build anything from source yourself. I'm
just stating the recommendations of the upstream project.
Ubuntu/Canonical/Debian provide the system wide init script for those
few users that want it, but like I say it's not enabled by default.


> Meanwhile is there a right way
> to restart the daemon on any level at all under Ubuntu without having to
> reboot? If the init.d script doesn't do it, and "pulseaudio&" at the command
> prompt doesn't do it, what's the invocation that would? Or does Ubuntu's
> having started it system-wide the first time around mean there's just no way
> to get there?

I've said it before, but Ubuntu does not have it system-wide. They
provide the init script but their default setup is to not run it system
wide.

"pulseaudio&" will just try to run PA and when it detects one is already
running it exits.

"pulseaudio -k" will kill the currently running daemon.

Generally speaking PA will then just automatically start again due to
it's auto-spawn capabilities.

That said, after killing PA, you should generally run
start-pulseaudio-x11 script again (it's done automatically at login for
you) to ensure the correct X11 related modules are loaded into PA.

>> I take your point re the "exit" command tho'. I am tempted to agree with
>> you. I just never, ever type exit on any terminal out of habit (ctrl+D
>> is much quicker) and thus I've never really noticed this.
> 
> Hmm. Stretch for control, hold it down, then press D - or just type "exit"
> from home position - same speed for me, and what with different keyboards
> moving ctrl around, often faster to type "exit." I only use ctrl-D in Python
> ; >


>From the home keys, it's a simple "pinkie down, slight rotation counter
clockwise, slight shift left" movement of the left hand. Touch typing
with keyboard short cuts is easy enough (we all know to hit ctrl+s all
the time right???) :p

Col

-- 

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

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list