On Thu, 2016-09-08 at 14:34 +0800, ChenQi wrote:
> On 09/07/2016 06:29 PM, Pau Espin Pedrol wrote:
> > 
> > 
> > 
> > Pau Espin Pedrol
> > 
> > 2016-09-07 11:22 GMT+02:00 Chen Qi <qi.c...@windriver.com 
> > <mailto:qi.c...@windriver.com>>:
> > 
> >     Make use of the new SYSTEMD_USER_SERVICE variable added in
> >     systemd.bbclass
> >     to manage user services in pulseaudio-server package.
> > 
> >     Signed-off-by: Chen Qi <qi.c...@windriver.com
> >     <mailto:qi.c...@windriver.com>>
> >     ---
> >      meta/recipes-multimedia/pulseaudio/pulseaudio.inc | 4 ++--
> >      1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> >     diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
> >     b/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
> >     index 6ed79ef..f3754d7 100644
> >     --- a/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
> >     +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
> >     @@ -124,8 +124,8 @@ FILES_${PN}-conf = "${sysconfdir}"
> >      FILES_${PN}-bin +=
> >     "${sysconfdir}/default/volatiles/volatiles.04_pulse"
> >      FILES_${PN}-server = "${bindir}/pulseaudio ${bindir}/start-*
> >     ${sysconfdir} ${bindir}/pactl */udev/rules.d/*.rules
> >     */*/udev/rules.d/*.rules ${systemd_user_unitdir}/*"
> > 
> >     -#SYSTEMD_PACKAGES = "${PN}-server"
> >     -SYSTEMD_SERVICE_${PN}-server = "pulseaudio.service"
> >     +SYSTEMD_PACKAGES = "${PN}-server"
> >     +SYSTEMD_USER_SERVICE_${PN}-server = "pulseaudio.service
> >     pulseaudio.socket"
> > 
> > I think specifying "pulseaudio.socket" for 
> > SYSTEMD_USER_SERVICE_${PN}-server should be enough, systemd.bbclass is 
> > going to add the .service file afair.
> 
> Add both:
> chenqi@pek-hostel-deb01:~/poky/build-systemd [1] $ ls 
> tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/systemd/user
> default.target.wants  sockets.target.wants
> 
> Add pulseaudio.socket:
> chenqi@pek-hostel-deb01:~/poky/build-systemd [1] $ ls 
> tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/systemd/user
> sockets.target.wants
> 
> They have different results.
> I don't know a lot about pulseaudio. Can you confirm that 
> pulseaudio.socket is enough?

If I understood correctly, Pau's argument was that there would be no
difference, which doesn't seem to be the case. However, if
pulseaudio.service isn't included in default.target.wants, that
shouldn't be a big problem, because socket activation will anyway start
the service when needed. On the other hand, I don't
think SYSTEMD_USER_SERVICE is intended to be used for controlling which
units to enable - it looks more like a variable that should contain all
units contained in the package. If my understanding is correct, you
should list both units in the variable.

The distributions that I've seen to use systemd to manage pulseaudio
only enable pulseaudio.socket, so that socket activation is used rather
than starting pulseaudio automatically as part of the user session. I
don't know if OE supports that - it looks like there's only a toggle to
enable all units or none. Other distributions also patch client.conf to
disable pulseaudio's own autospawning mechanism, since it's redundant
when using socket activation. Leaving autospawning enabled shouldn't
break anything in normal use, but it can cause some confusing behaviour
if the user tries to manually disable automatic pulseaudio starting by
disabling the systemd units.

-- 
Tanu
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to