Bug 1234710 - pulseaudio does not start under root environment
Summary: pulseaudio does not start under root environment
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: pulseaudio
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-23 06:07 UTC by Israel
Modified: 2017-01-27 19:25 UTC (History)
7 users (show)

Fixed In Version: pulseaudio-6.0-8.fc22
Clone Of:
Environment:
Last Closed: 2017-01-06 15:09:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Enable autospawn as root (944 bytes, patch)
2016-01-06 15:01 UTC, Robby Workman
no flags Details | Diff

Description Israel 2015-06-23 06:07:24 UTC
Description of problem:
pulseaudio does not start under root environment.


Version-Release number of selected component (if applicable):
pulseaudio.x86_64-6.0-4.fc22

How reproducible:
Every time KDE plasma session started by root, pulseaudio server do not starts.

Steps to Reproduce:
1. Login to KDE plasma desktop graphical session 
2. Play some sound 

Actual results:
no sound

Expected results:
sound

Additional info:
Under a regular user session, peulseaudio starts without any problem.
The was no such issue under FC21. 
The problem began when I upgraded FC21 to FC22 using yum. Still no sound under the root session.

When pulseaudio started by typing pulseaudio -D in a terminal, the sound begins to work.
It's seems pulseuadio simply not spawned under the root in FC22 (at least for me)
I haven't ever changed any pulseaudio config files and have   
; autospawn = yes commented out in /etc/pulse/client.conf

Comment 1 Rex Dieter 2015-06-23 14:03:25 UTC
I think autospawn fails for root (not sure why).

Mind trying this build?

http://koji.fedoraproject.org/koji/buildinfo?buildID=664349

Comment 2 Israel 2015-06-23 14:56:38 UTC
I tried this build and now I have 6.0-6.fc22
But pulseaudio server is NOT spawned for root session still. 

For any regular user pulseaudio is spawned and sound is present.
So, the problem still persists.

Comment 3 Rex Dieter 2015-07-06 17:45:02 UTC
OK, what happens if you run (as root, and when pulseaudio is not running) by hand:

start-pulseaudio-x11

?

that's what is supposed to run automatically via
/etc/xdg/autostart/pulseaudio.desktop
on session start.

Comment 4 Israel 2015-07-06 18:43:09 UTC
My system doesn't have pulseaudio-module-x11 rpm installed but pulseaudio starts automatically on regular users sessions except a root session. Tell me how...

At my previous FC-21 pulseaudio-module-x11 wasn't installed too, but pulseaudio started in root session without a hitch.

Comment 5 Rex Dieter 2015-07-06 18:51:58 UTC
/usr/bin/start-pulseaudio-x11

is in the base pulseaudio rpm

$ rpm -q pulseaudio

?

Comment 6 Israel 2015-07-06 19:08:49 UTC
rpm -q pulseaudio
pulseaudio-6.0-6.fc22.x86_64

Comment 7 Fedora Update System 2015-07-06 20:32:19 UTC
pulseaudio-6.0-8.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/pulseaudio-6.0-8.fc22

Comment 8 Fedora Update System 2015-07-10 19:17:31 UTC
Package pulseaudio-6.0-8.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing pulseaudio-6.0-8.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-11330/pulseaudio-6.0-8.fc22
then log in and leave karma (feedback).

Comment 9 Israel 2015-07-11 06:41:34 UTC
Well, I 've just installed it and now I have:
rpm -q pulseaudio
pulseaudio-6.0-8.fc22.x86_64

but this package didn't fix this issue.
It isn't started in root session still (at least for me). 
Very sad.....

Comment 10 Rex Dieter 2015-07-11 14:41:16 UTC
OK, again, what happens exactly when you try running in root session terminal:

start-pulseaudio-x11

?

Comment 11 Israel 2015-07-11 14:52:11 UTC
start-pulseaudio-x11
bash: start-pulseaudio-x11: command not found

rpm -q pulseaudio-module-x11
package pulseaudio-module-x11 is not installed


But again - pulseaudio starts in regular user sessions without any problem.

Comment 12 Rex Dieter 2015-07-11 16:56:52 UTC
OK, 

/usr/bin/start-pulseaudio-x11

is provided by base 'pulseaudio' rpm, I suspect your root account's $PATH is messed up somehow, try this instead:

/usr/bin/start-pulseaudio-x11

Comment 13 Rex Dieter 2015-07-11 16:58:00 UTC
Oh nevermind, fix here is to :

dnf install pulseaudio-module-x11

then.

Comment 14 Israel 2015-07-12 05:14:33 UTC
Heck, It didn't fix it.
I've installed the pulseaudio-module-x11 but pulseaudio doesn't start automatically in a root session. (at least for me)

With manual start by running start-pulseaudio-x11 in terminal, I see the following output:

# start-pulseaudio-x11 
W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified)
and also some line in /var/log/messages:
rtkit-daemon[699]: Failed to make thread 2062 RT: Operation not permitted
rtkit-daemon[699]: Failed to make thread 2062 RT: Operation not permitted
......
after that procedure pulseaudio is up and running.

Comment 15 Rex Dieter 2015-07-12 06:08:38 UTC
What kind of session are you using?  gnome?  other?

I'm beginning to wonder if it supports xdg autostart, because all
/etc/xdg/autostart/pulseaudio.desktop
essentially does, is run:
start-pulseaudio-x11 (which you verified works)

Comment 16 Israel 2015-07-12 06:25:22 UTC
I am using KDE plasma desktop as I said at my first message.

Comment 17 Israel 2015-07-12 06:30:59 UTC
Why you are focusing at start-pulseaudio-x11???

In a regular user sessions pulseaudio does start!!! Completely without using start-pulseaudio-x11!! Except root sessions.

I strongly believe that start-pulseaudio-x11 has nothing to do with pulseaudio autostart procedure (at least in KDE Plasma desktop environment) 
Pulseadio is launched some other way, and this mechanism doesn't work in a root sessions.

Comment 18 Israel 2015-07-12 06:50:05 UTC
I am sure that pulseaudio is launched by some pulseaudio-libs code initiated upon starting a pulseaudio client software. 

Remember a default setting 'autospawn = yes' in a /etc/pulse/client.conf ?  Please think about it! And ask a question: How it works and why it doesn't work in a root session? 

And forget about about this heck start-pulseaudio-x11 - you are wasting the time.

Comment 19 Rex Dieter 2015-07-12 18:32:43 UTC
I've been focusing on start-pulseaudio-x11, because that is what actually does the starting (when autospawn doesn't work).

I cannot reproduce the problem, pulseaudio starts fine for me with root/plasma session. So far, I've been unable to determine how/why it doesn't do it for you.  Sorry.

Comment 20 Israel 2015-07-13 08:23:53 UTC
Well, may be the problem is caused by fact that I've updated FC 21 to FC 22 using yum, and after after the update something went wrong..

if I'll get a chance to do a clean install of FC-22 I check this issue with pulseaudio autospawn.

Thanks for you help.

Comment 21 Israel 2015-07-13 08:31:24 UTC
I have just checked again my 2-nd rig that I updated from FC-21 to FC-22 some time ago, and it also haven't got pulseaudio autospawn in root session.
So, may be the problem happens after FC-21-22 update.

Comment 22 Fedora Update System 2015-07-14 15:50:59 UTC
pulseaudio-6.0-8.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 23 Rex Dieter 2015-07-19 12:55:50 UTC
re-opening, problem not solved.

Comment 24 Robby Workman 2016-01-06 15:01:04 UTC
Created attachment 1112203 [details]
Enable autospawn as root

I think you'll find this handy :-)
It's from here: https://github.com/rworkman/pulseaudio/commit/2f84429f62c2c3089f1711ac1938a7c1e54b22f9

Comment 25 Rex Dieter 2016-01-06 17:44:43 UTC
upstream purposely disables root autospawn, and that patch/hack simply removes that intention.  We will not adopt that in fedora packaging.

Still waiting to hear if start-pulseaudio-x11 does not work for the reporter. (and if not, we need to find out why)

Comment 26 Robby Workman 2016-01-06 18:28:46 UTC
I'd be interested to know the reason that it's intentionally disabled. It first appeared in this commit, best I can tell:

commit 045c1d602dcba57868845ba3270510593c39480f
Author: Lennart Poettering <lennart>
Date:   Thu May 15 23:34:41 2008 +0000

    merge glitch-free branch back into trunk
    
    git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2445 fefdeb5f-60dc-0310-8127-8f9354f1896f


Either way, what we found is that pulseaudio simply will not autospawn as root whether in console or X without that patch. 

Perhaps there is a good reason other than handwaving about "it's not a good idea to use root for things like this" (I agree, and you agree, and most people agree, but...), and if so, we'd certainly like to know what it is. I humbly suggest that upstream be consulted on this to find out if it's a genuine problem, and if not, perhaps they'll consider at least making it configurable in client.conf.

Comment 27 Robby Workman 2016-01-06 22:44:13 UTC
Here's someone else's (much better) approach - someone pointed this out to me after I posted my ugly hack (which was, in my defense, knowingly ugly - this isn't shipping in the distro and is only being used for internal testing right now). Anyway, here:
http://lists.openembedded.org/pipermail/openembedded-core/2015-May/104989.html

Comment 28 Rex Dieter 2016-01-07 00:45:40 UTC
Mind sending that upstream?

Comment 29 Robby Workman 2016-01-07 01:01:30 UTC
Well, I'm not happy with the doc changes (I think they're a bit inconsistent), and besides, it's still not clear whether there's a nonhandwavy good reason for the existing behavior. 

Given that the original author of PA is CC'd on this bug, and that he's the person who made the change to not allow autospawn for root, and that he's a RH employee, I think one of the RH folks need to inquire of him about it before asking the current dev(s) to review and possibly include a patch that shouldn't be considered.

Comment 30 Wei-Lun Chao 2016-08-18 03:35:23 UTC
Only occurred with Workstation desktop, but OK with MATE desktop.

Comment 31 Wei-Lun Chao 2016-11-25 02:31:21 UTC
Test OK with Fedora 25.

Comment 32 Rex Dieter 2017-01-06 15:09:29 UTC
per comment #31 closing -> currentrelease


Note You need to log in before you can comment on or make changes to this bug.