From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id 3816E1EF985; Mon, 15 Feb 2016 14:25:44 -0500 (EST) Received: from hurricane.the-brannons.com (hurricane.the-brannons.com [64.62.188.119]) by befuddled.reisers.ca (Postfix) with ESMTP id 47C921EF8A7 for ; Mon, 15 Feb 2016 14:25:42 -0500 (EST) Received: from localhost (unknown [IPv6:2602:43:5b6:8a00::1]) by hurricane.the-brannons.com (Postfix) with ESMTPSA id 1943E77C9F for ; Mon, 15 Feb 2016 11:19:54 -0800 (PST) From: Chris Brannon To: speakup@linux-speakup.org Subject: more about PA Date: Mon, 15 Feb 2016 11:20:37 -0800 Message-ID: <871t8dixve.fsf@mushroom.localdomain> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2016 19:25:44 -0000 A quick Googling reveals: http://billauer.co.il/blog/2014/01/pa-multiple-users/ So I'll just quote from his post: -----START QUOTE----- This is a simple and quick solution for those of us who want to run certain programs as a different user on the same desktop, for example running several user profiles of a browser at the same time. The main problem is usually that Pulseaudio doesn=E2=80=99t accept connecti= ons from a user other than the one logged in on the desktop. It=E2=80=99s often suggested to go for a {system mode} Pulseaudio daemon, but judging from the developer=E2=80=99s {own comments} on this, and the friendly messages left in the system=E2=80=99s log when doing this,= like Jan 18 16:35:33 ocho pulseaudio[11158]: main.c: OK, so you are running PA i= n system mode. Please note that you most likely shouldn't be doing that. Jan 18 16:35:33 ocho pulseaudio[11158]: main.c: If you do it nonetheless th= en it's your own fault if things don't work as expected. Jan 18 16:35:33 ocho pulseaudio[11158]: main.c: Please read http://pulseaud= io.org/wiki/WhatIsWrongWithSystemMode for an explanation why system mode is= usually a bad idea. Jan 18 16:35:33 ocho pulseaudio[11158]: module.c: module-hal-detect is depr= ecated: Please use module-udev-detect instead of module-hal-detect! Jan 18 16:35:33 ocho pulseaudio[11158]: module-hal-detect-compat.c: We will= now load module-udev-detect. Please make sure to remove module-hal-detect = from your configuration it=E2=80=99s probably not such a good idea. Plus that in my case, the sound card wasn=E2=80=99t detected in system wide= mode, probably because some configuration issue, which I didn=E2=80=99t care much about working on. The bottom line is that the software=E2=80=99s authors don=E2=80=99t really= want this to work. Opening a TCP socket instead The simple solution is given on {this forum thread}. This works well when there=E2=80=99s a specific user always logged on, and programs belonging to other dummy users are always run for specific pur= poses. The idea behind this trick is to open a TCP port for native Pulseaudio communication, only it doesn=E2=80=99t require authentication, as long as the connection comes from 127.0.0.1, i.e. from the host itself. This opens the audio interface to any program running on the computer, including recording from the microphone. This makes no significant difference security-wise if the computer is acces= sed by a single user anyhow (possible spyware is likely to run with the logged = in user ID anyhow, which has full access to audio either way). This solution works on Fedora Core 12, but it=E2=80=99s probably the way to do it on any distribution released sin= ce 2009 or so. Edit: It has been suggested in the comments below to use a UNIX socket inst= ead of TCP. Haven=E2=80=99t tried it, but it seems like a better solution. To do as the desktop=E2=80=99s user So let=E2=80=99s get to the hands-on: First, copy /etc/pulse/default.pa into a file with the same name in the .pulse directory, that is cp /etc/pulse/default.pa ~/.pulse/ And then edit the file, adding the following line at the end: load-module module-native-protocol-tcp auth-ip-acl=3D127.0.0.1 At this point, restart the pulseaudio deamon, $ pulseaudio -k $ pulseaudio -D To do as the =E2=80=9Cfake=E2=80=9D user Now switch to the second user, and create a file named client.conf under th= at user=E2=80=99s .pulse subdirectory $ echo "default-server =3D 127.0.0.1" > ~/.pulse/client.conf Note that default.pa and client.conf are in completely different directorie= s, each belonging to a different user! Surprisingly enough, that=E2=80=99s it. Any program running as the second u= ser now has sound access. ----- END QUOTE ----- Clever hack. Don't think it will be widely applicable to distros, but putting it out there for interested parties. -- Chris