Skip to contentSkip to conversation

pulseaudio: Run as system-wide instance instead of per-user

PATCH In review Joel A Fernandes 3 participants 13 messages Jul 7, 2011 – Jul 9, 2011 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 pulseaudio: Run as system-wide instance instead of per-user

* Pulseaudio running as per-user is opening audio devices and blocking everyone else from getting access to the device. The problem is it doesn't even seem to be allowing applications to connect to it, this patch starts it up in system mode instead which is tested and known to work

---
Changes since earlier version:
Sorry I didn't bump the PR! Resending it again

 .../pulseaudio-system-mode-startup.sh              |    4 ++++
 recipes/pulseaudio/pulseaudio_0.9.22.bb            |   17 ++++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletions(-)
 create mode 100755 recipes/pulseaudio/pulseaudio-0.9.21/pulseaudio-system-mode-startup.sh
recipes/pulseaudio/pulseaudio-0.9.21/pulseaudio-system-mode-startup.sh new file +4 -0
new file mode 100755
index 0000000..528ceb9
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+echo "Starting Pulseaudio in system mode.."
+pulseaudio --log-target=syslog --system
recipes/pulseaudio/pulseaudio_0.9.22.bb +16 -1
index 2368829..1bc6816 100644
@@ -1,6 +1,6 @@
 require pulseaudio.inc
 
-PR = ${INC_PR}.2
+PR = ${INC_PR}.3
 
 DEPENDS += "gdbm speex"
 
@@ -12,6 +12,10 @@ FILESPATHPKG =. "pulseaudio-0.9.21:"
 
 inherit gettext
 
+inherit update-rc.d
+INITSCRIPT_NAME = "pulseaudio.sh"
+INITSCRIPT_PARAMS = "start 99 2 3 4 5 ."
+
 #SRC_URI += "\
 #  file://buildfix.patch \
 #  file://autoconf_version.patch \
@@ -27,6 +31,7 @@ SRC_URI += "\
   file://armv4+v5asm.patch \
   file://fixbluezbuild.patch \
   file://ubacktrace.patch \
+  file://pulseaudio-system-mode-startup.sh \
 "
 
 #do_compile_prepend() {
@@ -37,3 +42,13 @@ SRC_URI += "\
 
 SRC_URI[md5sum] = "ca85ab470669b05e100861654cf5eb3c"
 SRC_URI[sha256sum] = "c6019324395117a258c048a6db5e9734551cc2c61dc35b46403ff00d64be55f0"
+
+do_install_append() {
+  # init script to start pulseaudio system-wide
+  install -d ${D}/${sysconfdir}/init.d/
+  install -m 0755 ${WORKDIR}/pulseaudio-system-mode-startup.sh ${D}/${sysconfdir}/init.d/pulseaudio.sh
+
+  # Disable startup of pulseaudio as a per-user instance
+  chmod -x ${D}/${bindir}/start-pulseaudio-x11
+}
+
Signature · 1 line
1.7.0.4
#1 lore raw

Dear Joel,

Am Donnerstag, den 07.07.2011, 00:38 -0500 schrieb Joel A Fernandes:

Quoted 3 lines

* Pulseaudio running as per-user is opening audio devices and blocking everyone else from getting access to the device. The problem is it doesn't even seem to be allowing applications to connect to it, this patch starts it up in system mode instead which is tested and known to work

thank you for the patch. Could you post your error and check with the PulseAudio guys what the cause is? There are very responsive on their mailing list, which moved to freedesktop.org recently.

As far as I understood system mode can sometimes be the right thing to do but most of the time it is just a configuration error. Running PA and printing out the debug messages should give you a clue.

Quoted 52 lines

---
Changes since earlier version:
Sorry I didn't bump the PR! Resending it again

 .../pulseaudio-system-mode-startup.sh              |    4 ++++
 recipes/pulseaudio/pulseaudio_0.9.22.bb            |   17 ++++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletions(-)
 create mode 100755 recipes/pulseaudio/pulseaudio-0.9.21/pulseaudio-system-mode-startup.sh
recipes/pulseaudio/pulseaudio-0.9.21/pulseaudio-system-mode-startup.sh new file +4 -0
new file mode 100755
index 0000000..528ceb9
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+echo "Starting Pulseaudio in system mode.."
+pulseaudio --log-target=syslog --system
recipes/pulseaudio/pulseaudio_0.9.22.bb +6 -1
index 2368829..1bc6816 100644
@@ -1,6 +1,6 @@
 require pulseaudio.inc
 
-PR = ${INC_PR}.2
+PR = ${INC_PR}.3
 
 DEPENDS += "gdbm speex"
 
@@ -12,6 +12,10 @@ FILESPATHPKG =. "pulseaudio-0.9.21:"
 
 inherit gettext
 
+inherit update-rc.d
+INITSCRIPT_NAME = "pulseaudio.sh"
+INITSCRIPT_PARAMS = "start 99 2 3 4 5 ."
+
 #SRC_URI += "\
 #  file://buildfix.patch \
 #  file://autoconf_version.patch \
@@ -27,6 +31,7 @@ SRC_URI += "\
   file://armv4+v5asm.patch \
   file://fixbluezbuild.patch \
   file://ubacktrace.patch \
+  file://pulseaudio-system-mode-startup.sh \
 "
 
 #do_compile_prepend() {

recipes/pulseaudio/pulseaudio_0.9.22.bb SRC_URI += "\ · line 49

Quoted 8 lines
recipes/pulseaudio/pulseaudio_0.9.22.bb +5 -0
@@ -37,3 +42,13 @@ SRC_URI += "\
 
 SRC_URI[md5sum] = "ca85ab470669b05e100861654cf5eb3c"
 SRC_URI[sha256sum] = "c6019324395117a258c048a6db5e9734551cc2c61dc35b46403ff00d64be55f0"
+
+do_install_append() {
+  # init script to start pulseaudio system-wide
+  install -d ${D}/${sysconfdir}/init.d/
+  install -m 0755 ${WORKDIR}/pulseaudio-system-mode-startup.sh ${D}/${sysconfdir}/init.d/pulseaudio.sh

If I remember correctly that is configurable in the config files for PA under /etc/pulse/.

recipes/pulseaudio/pulseaudio_0.9.22.bb SRC_URI += "\ · line 52

Quoted 2 lines
recipes/pulseaudio/pulseaudio_0.9.22.bb +2 -0
+  # Disable startup of pulseaudio as a per-user instance
+  chmod -x ${D}/${bindir}/start-pulseaudio-x11

Is that needed? It is an unexpected change for the user having to find out that s/he has to make a program under /usr/bin/ executable to run it.

recipes/pulseaudio/pulseaudio_0.9.22.bb SRC_URI += "\ · line 54

Quoted 2 lines
recipes/pulseaudio/pulseaudio_0.9.22.bb +2 -0
+}
+

Please do not add empty lines.

Thanks,

Paul

#2 lore raw

Hi Paul,

Thanks for your email.

Quoted 11 lines · Paul Menzel

Dear Joel,

Am Donnerstag, den 07.07.2011, 00:38 -0500 schrieb Joel A Fernandes:

Quoted 3 lines

* Pulseaudio running as per-user is opening audio devices and blocking everyone else from getting access to the device. The problem is it doesn't even seem to be allowing applications to connect to it, this patch starts it up in system mode instead which is tested and known to work

thank you for the patch. Could you post your error and check with the PulseAudio guys what the cause is? There are very responsive on their mailing list, which moved to freedesktop.org recently.

Sure, I will follow up with the pulseaudio folks.

Quoted 4 lines

As far as I understood system mode can sometimes be the right thing to do but most of the time it is just a configuration error. Running PA and printing out the debug messages should give you a clue.

Pulseaudio isn't printing any debug messages to syslog or stdout ( -vv -log-level pulseaudio options )

Here was the thread on BeagleBoard mailing list that discusses this issue:
http://groups.google.com/group/beagleboard/browse_thread/thread/4dc82483a8d000fb/ccbd0e21fa5e89a0

I will post the details of the problem on the pulseaudio mailing list and try to get some other alternatives.

For now, can we temporarily merge this patch while I followup with them?

Quoted 3 lines

Is that needed? It is an unexpected change for the user having to find out that s/he has to make a program under /usr/bin/ executable to run it.

Do you have any suggestions on else we could do it? A patch that rm's the script?

thanks
Joel

#3 lore raw
Quoted 7 lines
Quoted 3 lines

As far as I understood system mode can sometimes be the right thing to do but most of the time it is just a configuration error. Running PA and printing out the debug messages should give you a clue.

Pulseaudio isn't printing any debug messages to syslog or stdout ( -vv -log-level pulseaudio options )

Quoted 7 lines

Here was the thread on BeagleBoard mailing list that discusses this issue:
http://groups.google.com/group/beagleboard/browse_thread/thread/4dc82483a8d000fb/ccbd0e21fa5e89a0

I will post the details of the problem on the pulseaudio mailing list and try to get some other alternatives.

For now, can we temporarily merge this patch while I followup with them?

Here is a discussion I started on the pulseaudio list:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2011-July/010565.html

thanks,
Joel

#4 lore raw

Am Donnerstag, den 07.07.2011, 21:55 -0500 schrieb Joel A Fernandes:

Quoted 10 lines
Quoted 10 lines
Quoted 3 lines

As far as I understood system mode can sometimes be the right thing to do but most of the time it is just a configuration error. Running PA and printing out the debug messages should give you a clue.

Pulseaudio isn't printing any debug messages to syslog or stdout ( -vv -log-level pulseaudio options )

Here was the thread on BeagleBoard mailing list that discusses this issue:
http://groups.google.com/group/beagleboard/browse_thread/thread/4dc82483a8d000fb/ccbd0e21fa5e89a0

Quoted 7 lines
Quoted 4 lines

I will post the details of the problem on the pulseaudio mailing list and try to get some other alternatives.

For now, can we temporarily merge this patch while I followup with them?

Here is a discussion I started on the pulseaudio list:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2011-July/010565.html

Thank you very much for bringing this issue to upstreams attention.

Regarding to pushing this patch, I am still a little confused since you wrote to the PA list you are using PA 0.9.15 and your patch is against 0.9.22.

Thanks,

Paul

#5 lore raw

[Just adding back everyone to CC list.]

Am Freitag, den 08.07.2011, 17:55 +0200 schrieb Paul Menzel:

Quoted 29 lines

Am Donnerstag, den 07.07.2011, 21:55 -0500 schrieb Joel A Fernandes:

Quoted 10 lines
Quoted 10 lines
Quoted 3 lines

As far as I understood system mode can sometimes be the right thing to do but most of the time it is just a configuration error. Running PA and printing out the debug messages should give you a clue.

Pulseaudio isn't printing any debug messages to syslog or stdout ( -vv -log-level pulseaudio options )

Here was the thread on BeagleBoard mailing list that discusses this issue:
http://groups.google.com/group/beagleboard/browse_thread/thread/4dc82483a8d000fb/ccbd0e21fa5e89a0

Quoted 7 lines
Quoted 4 lines

I will post the details of the problem on the pulseaudio mailing list and try to get some other alternatives.

For now, can we temporarily merge this patch while I followup with them?

Here is a discussion I started on the pulseaudio list:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2011-July/010565.html

Thank you very much for bringing this issue to upstreams attention.

Regarding to pushing this patch, I am still a little confused since you wrote to the PA list you are using PA 0.9.15 and your patch is against 0.9.22.

Thanks,

Paul

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 5 lines · Koen

(posting from the airport)

If I understood correctly Joel is going to try out 0.9.22 to see if that fixes session mode, and it not, try to make systemmode a separate recipe that both .15 and .22 could optionally use.

Joel, please correct me if I'm wrong :)

Hi Koen,

That's right :)

While I'm doing a build, I am also posting detailed logs to pulseaudio ML about the failure of an older version, just incase.

Just mentioning that I'm setting PREFERRED_VERSION_pulseaudio to 0.9.22 in conf/.../angstrom-2008-preferred-versions.inc

I do recall from the phone that you mentioned something about an "armv7" specific variable but I couldn't find it. Let me know if setting the above mentioned variable is ok.

Thanks and Have a safe flight.

Regards,
Joel

#8 lore raw
Quoted 9 lines · Joel A Fernandes
Quoted 5 lines · Koen

(posting from the airport)

If I understood correctly Joel is going to try out 0.9.22 to see if that fixes session mode, and it not, try to make systemmode a separate recipe that both .15 and .22 could optionally use.

Joel, please correct me if I'm wrong :)

Hi Koen,

Quoted 7 lines

That's right :)

While I'm doing a build, I am also posting detailed logs to pulseaudio ML about the failure of an older version, just incase.

Just mentioning that I'm setting PREFERRED_VERSION_pulseaudio to 0.9.22 in conf/.../angstrom-2008-preferred-versions.inc

Is it 2008 or 2010 that gets used?

Quoted 4 lines

I do recall from the phone that you mentioned something about an "armv7" specific variable but I couldn't find it. Let me know if setting the above mentioned variable is ok.

I believe I've found an example at
http://cgit.openembedded.net/cgit.cgi/openembedded/tree/conf/distro/angstrom-2008.1.conf?h=2011.03-maintenance#n107:

ANGSTROM_BINUTILS_VERSION                ?= "2.18"
ANGSTROM_BINUTILS_VERSION_armv4          ?= "2.20"
ANGSTROM_BINUTILS_VERSION_armv7a         ?= "2.18.50.0.7"

PREFERRED_VERSION_binutils ?= "${ANGSTROM_BINUTILS_VERSION}"

Looking at http://cgit.openembedded.net/cgit.cgi/openembedded/tree/conf/distro/include/angstrom-2010-preferred-versions.inc,
it seems to have "0.9.22" already!
http://cgit.openembedded.net/cgit.cgi/openembedded/tree/conf/distro/include/angstrom-2010-preferred-versions.inc?h=2011.03-maintenance
seems to be at "0.9.21".

I'd guess that you'd want to submit a patch for maintenance that did something similar:

ANGSTROM_PULSEAUDIO_VERSION = "0.9.21" (or whatever the old version was)
ANGSTROM_PULSEAUDIO_VERSION_armv7a = "0.9.22"

PREFERRED_VERSION_pulseaudio = "${ANGSTROM_PULSEAUDIO_VERSION}"

Quoted 2 lines

Thanks and Have a safe flight.

Hopefully I've saved Koen some typing from the phone! (probably not :-) )

Quoted 9 lines

Regards,
Joel

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
Quoted 22 lines · Jason
Quoted 22 lines

-----Original Message-----
From: Joel A Fernandes [mailto:[email protected]]
Sent: Friday, July 08, 2011 3:11 PM
To: Kooi, Koen
Cc: Paul Menzel; [email protected]; Kridner, Jason; Fernandes, Joel A
Subject: Re: [oe] [PATCH v2] pulseaudio: Run as system-wide instance instead of per-user

Quoted 3 lines · Koen

(posting from the airport)

If I understood correctly Joel is going to try out 0.9.22 to see if

that fixes session mode, and it not, try to make systemmode a separate recipe that both .15 and .22 could optionally use.

Quoted 2 lines

Joel, please correct me if I'm wrong :)

Hi Koen,

That's right :)

Quoted 7 lines
Quoted 5 lines

While I'm doing a build, I am also posting detailed logs to pulseaudio ML about the failure of an older version, just incase.

Just mentioning that I'm setting PREFERRED_VERSION_pulseaudio to 0.9.22 in conf/.../angstrom-2008-preferred-versions.inc

Is it 2008 or 2010 that gets used?

Oh! I use the angstrom setup scripts so my DISTRO is set to angstrom-2008.1 . Is this a problem?

The various 'year' version are confusing,

Do you know which DISTRO= would Narcissus assembled images be using?

Pulseaudio on the Narcissus assembled C5 image is on 0.9.15 , this is set only in 2008:
http://cgit.openembedded.net/cgit.cgi/openembedded/tree/conf/distro/include/angstrom-2008-preferred-versions.inc?h=2011.03-maintenance#n47

Also, if I'm right that the C5 image packages were built with DISTRO set to 2008, then shouldn't we be rebuilding pulseaudio with DISTRO = 2008?

Thanks
Joel

#11 lore raw
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

While I'm doing a build, I am also posting detailed logs to pulseaudio ML about the failure of an older version, just incase.

Just mentioning that I'm setting PREFERRED_VERSION_pulseaudio to 0.9.22 in conf/.../angstrom-2008-preferred-versions.inc

Is it 2008 or 2010 that gets used?

Just noticed that angstrom-2008.conf is present in the 2011.03-maintenance branch but not in the .dev

So I guess that we're supposed to use for all "maintenance" builds

Regards,
Joel

#12 lore raw
In reply to Joel A Fernandes
Quoted 26 lines · Joel A Fernandes
Quoted 25 lines · Jason
Quoted 25 lines

-----Original Message-----
From: Joel A Fernandes [mailto:[email protected]]
Sent: Friday, July 08, 2011 3:11 PM
To: Kooi, Koen
Cc: Paul Menzel; [email protected]; Kridner, Jason; Fernandes, Joel A
Subject: Re: [oe] [PATCH v2] pulseaudio: Run as system-wide instance instead of per-user

Quoted 3 lines · Koen

(posting from the airport)

If I understood correctly Joel is going to try out 0.9.22 to see if

that fixes session mode, and it not, try to make systemmode a separate recipe that both .15 and .22 could optionally use.

Quoted 2 lines

Joel, please correct me if I'm wrong :)

Hi Koen,

That's right :)

While I'm doing a build, I am also posting detailed logs to pulseaudio ML about the failure of an older version, just incase.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Just mentioning that I'm setting PREFERRED_VERSION_pulseaudio to 0.9.22 in conf/.../angstrom-2008-preferred-versions.inc

Is it 2008 or 2010 that gets used?

Oh! I use the angstrom setup scripts so my DISTRO is set to angstrom-2008.1 . Is this a problem?

Whatever is setup by the setup scripts is right, I just didn't know which file was getting used.

Quoted 2 lines

The various 'year' version are confusing,

Agreed.

Quoted 2 lines

Do you know which DISTRO= would Narcissus assembled images be using?

I got as far as figuring out that the images are served up using the configuration at
https://gitorious.org/angstrom/narcissus/trees/master/conf/beagleboard/configs/2011.03
which contains angstrom-feed-configs_1.0-r14.6_beagleboard.ipk. I don't know the easy way to unpack that IPK to see what URLs it points to.

I believe that file comes from
http://www.angstrom-distribution.org/feeds/unstable/ipk/glibc/armv7a/machine/beagleboard/angstrom-feed-configs_1.0-r14.6_beagleboard.ipk.

Trying to track backwards gets a bit difficult for me from there as I don't know where to find a copy of the autobuilder. I also think stuff on gitorious isn't the latest.

Quoted 4 lines

Pulseaudio on the Narcissus assembled C5 image is on 0.9.15 , this is set only in 2008:
http://cgit.openembedded.net/cgit.cgi/openembedded/tree/conf/distro/include/angstrom-2008-preferred-versions.inc?h=2011.03-maintenance#n47

Well, that makes it pretty clear, eh?

Quoted 4 lines

Also, if I'm right that the C5 image packages were built with DISTRO set to 2008, then shouldn't we be rebuilding pulseaudio with DISTRO = 2008?

Do what the script says!

Quoted 9 lines

Thanks
Joel

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#13 lore raw
In reply to Paul Menzel

Hi Paul,

Can we ignore this patch and use one I just submitted titled "pulseaudio: Switch to version version 0.9.22 for Angstrom 2011.03"?

Thanks for reviewing my patch,

Regards,
Joel

Quoted 34 lines · Paul Menzel

[Just adding back everyone to CC list.]

Am Freitag, den 08.07.2011, 17:55 +0200 schrieb Paul Menzel:

Quoted 29 lines

Am Donnerstag, den 07.07.2011, 21:55 -0500 schrieb Joel A Fernandes:

Quoted 10 lines
Quoted 10 lines
Quoted 3 lines

As far as I understood system mode can sometimes be the right thing to do but most of the time it is just a configuration error. Running PA and printing out the debug messages should give you a clue.

Pulseaudio isn't printing any debug messages to syslog or stdout ( -vv -log-level pulseaudio options )

Here was the thread on BeagleBoard mailing list that discusses this issue:
http://groups.google.com/group/beagleboard/browse_thread/thread/4dc82483a8d000fb/ccbd0e21fa5e89a0

Quoted 7 lines
Quoted 4 lines

I will post the details of the problem on the pulseaudio mailing list and try to get some other alternatives.

For now, can we temporarily merge this patch while I followup with them?

Here is a discussion I started on the pulseaudio list:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2011-July/010565.html

Thank you very much for bringing this issue to upstreams attention.

Regarding to pushing this patch, I am still a little confused since you wrote to the PA list you are using PA 0.9.15 and your patch is against 0.9.22.

Thanks,

Paul

#14 lore raw

Dear Joel,

Am Freitag, den 08.07.2011, 19:29 -0500 schrieb Joel A Fernandes:

Quoted 2 lines

Can we ignore this patch and use one I just submitted titled "pulseaudio: Switch to version version 0.9.22 for Angstrom 2011.03"?

yes of course. Could you please update the state of your patches in OE’s patch queue [1]? You have to register and for example use the following command [2].

	$ pwclient update -s Superseded 7115

If a patch has been committed you can also pass the commit ID with -c.

Quoted 1 line

Thanks for reviewing my patch,

No problem.

Thanks,

Paul

PS: Please never top post to lists. If interleaved style is not useful, since you do not need to take reference to anything, just delete the quote all together.

[1] http://patches.openembedded.org/project/oe/list/
[2] http://www.openembedded.org/index.php/Patchwork