[pulseaudio-discuss] Accessing audio as root

Colin Guthrie gmane at colin.guthr.ie
Sun Jan 3 06:21:07 PST 2010


'Twas brillig, and Ng Oon-Ee at 03/01/10 13:26 did gyre and gimble:
> So, in my simplistic and user-centric point-of-view, I wonder if
> speechd-up accepts audio INPUTS? Perhaps it could act as a pulseaudio
> sink, with the appropriate modules, of course. It starts before the user
> logs in and only exits after the user has logged out, of course.
> 
> The reasoning behind my proposal is simply that root is system-wide by
> definition (in my understanding), hence why all Colin's proposals have
> involved speechd-up running as a particular user while all your replies
> have mentioned root access to pulse....


I guess a possibility is the following:

1. Make console-kit aware of the "idle" state as before.
2. Make the speechd-up or speech-dispatcher "headless". i.e. all they do
is open a pipe (fifo) and pump their synthesised speech to it - they do
not actually output audio itself.
3. Write a PA module that acts as a pulse client that opens that pipe
and outputs the sound (in actual fact, we could use a combination of
module-pipe-source and module-loopback for this without writing a single
line of code in PA).
4. Place a script in:
/usr/lib/ConsoleKit/run-session.d
 or
/etc/ConsoleKit/run-session.d
(I'm not sure which is best)
which basically does the following (see /usr/bin/start-pulseaudio-x11):

/usr/bin/pulseaudio --start --log-target=syslog "$@"
/usr/bin/pactl load-module module-pipe-source source_name="a11y"
file="/tmp/a11y.socket" > /dev/null
/usr/bin/pactl load-module module-loopback source="a11y" > /dev/null


(or something like the above - I could have gotten arguments wrong and
you may want some channels/rate etc. stuff going on). There may also
need to be something setup to stop PA from exiting after an idle timeout.


With all that in place things may just work. Obviously speechd-up would
have to support multiple clients opening the /tmp/a11y.socket file (and
it probably shouldn't actually be in /tmp!).

Does that fit better with your model of things?


As a side note, would it be wise to provide some kind of positional
information along with the raw PCM? I'd have thought that using stereo
to good effect may help with a11y? Event sounds are already positional -
those triggered at the left of the screen are much louder on the left
channel etc. This is just a random thought tho'.

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