Merge lp:~mterry/ubuntu-touch-session/pulse-in-snap into lp:ubuntu-touch-session

Proposed by Michael Terry
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: 295
Merged at revision: 296
Proposed branch: lp:~mterry/ubuntu-touch-session/pulse-in-snap
Merge into: lp:ubuntu-touch-session
Diff against target: 163 lines (+28/-19)
10 files modified
etc/profile.d/upstart-phablet.sh (+1/-1)
ubuntu-touch-lightdm-session (+1/-1)
ubuntu-touch-session (+9/-9)
upstart-session/bluez-mpris-proxy.conf (+1/-1)
upstart-session/cameraservice-trust-stored.conf (+1/-1)
upstart-session/obexd.conf (+1/-1)
upstart-session/ofono-setup.conf (+1/-1)
upstart-session/pulseaudio-trust-stored.conf (+1/-1)
upstart-session/pulseaudio.conf (+11/-2)
usc-wrapper (+1/-1)
To merge this branch: bzr merge lp:~mterry/ubuntu-touch-session/pulse-in-snap
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
Albert Astals Cid (community) Abstain
Ubuntu Phablet Team Pending
Review via email: mp+306662@code.launchpad.net

Commit message

Support running inside a snap (without breaking non-snap runs).

Description of the change

Support running inside a snap (without breaking non-snap runs).

For testing this, you can install silo 2129 (which will pull in a lot of other stuff too though...)

To post a comment you must log in.
293. By Michael Terry

Rely on PATH where possible

Revision history for this message
Albert Astals Cid (aacid) wrote :

I needed to add
  initctl set-env LD_LIBRARY_PATH=$SNAP/usr/lib/pulse-8.0/modules:$LD_LIBRARY_PATH
after
  initctl set-env --global PULSE_SCRIPT=$SNAP_USER_DATA/etc/pulse/touch.pa

so that pulseaudio actually started.

Lukas had a different/similar solution.

review: Needs Fixing
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Well we have currently this in our snacraft.yaml:

export PULSE_DLPATH=$(ls -d $SNAP/usr/lib/pulse-*/modules)

But that wasn't enough; what I did was to add:

export GST_PLUGIN_SYSTEM_PATH=$SNAP/usr/lib/$ARCH/gstreamer-1.0

and
...
 apps:
   unity8-session:
     command: snappyenv ${SNAP}/sbin/upstart --user
- plugs: [home]
+ plugs: [home, gsettings, pulseaudio, opengl]

After that, the indicator-sound starts and logout actually takes no more than a few seconds.

Revision history for this message
Michael Terry (mterry) wrote :

Hmm, I'm having pulseaudio start for me fine without any changes in this MP. I'm curious what our differences would be.

Revision history for this message
Albert Astals Cid (aacid) wrote :

You are running the snap in a xenial install while i'm running it in a zesty one? (Not idea about ltinkl)

294. By Michael Terry

Use .local/share/pulse instead of etc/pulse inside SNAP_USER_DATA in case we're using that for HOME too, like we do in u8 snap

Revision history for this message
Michael Terry (mterry) wrote :

I've committed a change to our snap packaging that uses the snapcraft-desktop-helpers scripts. I bet with those + this MP things work for you.

I'm working on updating the silo PPA and snap to have all the latest changes.

Revision history for this message
Michael Terry (mterry) wrote :

(or you could just build your own snap and test that way)

Revision history for this message
Michael Terry (mterry) wrote :

Try again. I fixed an issue with our wrapper script that might have prevented this from working. (I hope)

Revision history for this message
Albert Astals Cid (aacid) wrote :

> Try again. I fixed an issue with our wrapper script that might have prevented
> this from working. (I hope)

Yes, that worked.

Revision history for this message
Albert Astals Cid (aacid) :
review: Abstain
295. By Michael Terry

Only override PULSE_* if those vars aren't set (by a snap wrapper script, say)

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'etc/profile.d/upstart-phablet.sh'
--- etc/profile.d/upstart-phablet.sh 2014-04-01 12:24:32 +0000
+++ etc/profile.d/upstart-phablet.sh 2016-11-29 23:53:13 +0000
@@ -4,5 +4,5 @@
4 uid=$(getent passwd "$USER"|cut -d: -f3)4 uid=$(getent passwd "$USER"|cut -d: -f3)
5 export XDG_RUNTIME_DIR="/run/user/$uid"5 export XDG_RUNTIME_DIR="/run/user/$uid"
66
7 export UPSTART_SESSION=$(/sbin/initctl list-sessions | awk '{ print $NF; quit }')7 export UPSTART_SESSION=$(initctl list-sessions | awk '{ print $NF; quit }')
8fi8fi
99
=== modified file 'ubuntu-touch-lightdm-session'
--- ubuntu-touch-lightdm-session 2014-06-03 14:31:27 +0000
+++ ubuntu-touch-lightdm-session 2016-11-29 23:53:13 +0000
@@ -7,5 +7,5 @@
7if [ -n "$MIR_SOCKET" ]; then7if [ -n "$MIR_SOCKET" ]; then
8 exec $@8 exec $@
9else9else
10 exec /usr/sbin/lightdm-session $@10 exec lightdm-session $@
11fi11fi
1212
=== modified file 'ubuntu-touch-session'
--- ubuntu-touch-session 2016-10-11 10:07:50 +0000
+++ ubuntu-touch-session 2016-11-29 23:53:13 +0000
@@ -14,11 +14,11 @@
1414
15# override defaults by sourcing /etc/ubuntu-touch-session.d/$device.conf15# override defaults by sourcing /etc/ubuntu-touch-session.d/$device.conf
16device=$(getprop ro.product.device)16device=$(getprop ro.product.device)
17if [ -e /etc/ubuntu-touch-session.d/$device.conf ]; then17if [ -e $SNAP/etc/ubuntu-touch-session.d/$device.conf ]; then
18 . /etc/ubuntu-touch-session.d/$device.conf18 . $SNAP/etc/ubuntu-touch-session.d/$device.conf
19else19else
20 # android.conf is used by the bind mount20 # android.conf is used by the bind mount
21 . /etc/ubuntu-touch-session.d/android.conf21 . $SNAP/etc/ubuntu-touch-session.d/android.conf
22fi22fi
2323
24# Workaround for bug 1308210 / 1318070 (x86 emulator and scopes)24# Workaround for bug 1308210 / 1318070 (x86 emulator and scopes)
@@ -30,11 +30,11 @@
30fi30fi
3131
32# Set up xdg dirs32# Set up xdg dirs
33[ -z "$XDG_CONFIG_DIRS" ] && export XDG_CONFIG_DIRS=/etc/xdg33[ -z "$XDG_CONFIG_DIRS" ] && export XDG_CONFIG_DIRS=$SNAP/etc/xdg
34[ -z "$XDG_DATA_DIRS" ] && export XDG_DATA_DIRS=/usr/local/share:/usr/share34[ -z "$XDG_DATA_DIRS" ] && export XDG_DATA_DIRS=$SNAP/usr/local/share:$SNAP/usr/share
35if [ -n "$DESKTOP_SESSION" ]; then35if [ -n "$DESKTOP_SESSION" ]; then
36 export XDG_CONFIG_DIRS=/etc/xdg/xdg-$DESKTOP_SESSION:$XDG_CONFIG_DIRS36 export XDG_CONFIG_DIRS=$SNAP/etc/xdg/xdg-$DESKTOP_SESSION:$XDG_CONFIG_DIRS
37 export XDG_DATA_DIRS=/usr/share/$DESKTOP_SESSION:$XDG_DATA_DIRS37 export XDG_DATA_DIRS=$SNAP/usr/share/$DESKTOP_SESSION:$XDG_DATA_DIRS
38fi38fi
3939
40# if /custom/xdg/config exists, add it to xdg_config_dirs. this is so upstart can get job definitions from /custom40# if /custom/xdg/config exists, add it to xdg_config_dirs. this is so upstart can get job definitions from /custom
@@ -51,8 +51,8 @@
51grep -q GRID_UNIT_PX $dot_profile || echo "export GRID_UNIT_PX=${GRID_UNIT_PX}" >> $dot_profile51grep -q GRID_UNIT_PX $dot_profile || echo "export GRID_UNIT_PX=${GRID_UNIT_PX}" >> $dot_profile
5252
53# Make sure we're also exporting the profile.d variables53# Make sure we're also exporting the profile.d variables
54if [ -d /etc/profile.d ]; then54if [ -d $SNAP/etc/profile.d ]; then
55 for i in /etc/profile.d/*.sh; do55 for i in $SNAP/etc/profile.d/*.sh; do
56 if [ -r $i ]; then56 if [ -r $i ]; then
57 . $i57 . $i
58 fi58 fi
5959
=== modified file 'upstart-session/bluez-mpris-proxy.conf'
--- upstart-session/bluez-mpris-proxy.conf 2015-10-19 20:21:22 +0000
+++ upstart-session/bluez-mpris-proxy.conf 2016-11-29 23:53:13 +0000
@@ -6,4 +6,4 @@
66
7respawn7respawn
88
9exec /usr/lib/bluetooth/mpris-proxy -s core.ubuntu.media.Service9exec $SNAP/usr/lib/bluetooth/mpris-proxy -s core.ubuntu.media.Service
1010
=== modified file 'upstart-session/cameraservice-trust-stored.conf'
--- upstart-session/cameraservice-trust-stored.conf 2016-07-08 13:50:16 +0000
+++ upstart-session/cameraservice-trust-stored.conf 2016-11-29 23:53:13 +0000
@@ -22,7 +22,7 @@
22 # TODO check if needed by inspection of trust store library / camera service22 # TODO check if needed by inspection of trust store library / camera service
23 sleep 123 sleep 1
2424
25 exec /usr/bin/trust-stored-skeleton \25 exec trust-stored-skeleton \
26 --remote-agent UnixDomainSocketRemoteAgent --endpoint=$service_socket \26 --remote-agent UnixDomainSocketRemoteAgent --endpoint=$service_socket \
27 --local-agent MirAgent \27 --local-agent MirAgent \
28 --trusted-mir-socket=/var/run/user/$(id -u)/mir_socket_trusted \28 --trusted-mir-socket=/var/run/user/$(id -u)/mir_socket_trusted \
2929
=== modified file 'upstart-session/obexd.conf'
--- upstart-session/obexd.conf 2016-04-15 07:55:53 +0000
+++ upstart-session/obexd.conf 2016-11-29 23:53:13 +0000
@@ -7,4 +7,4 @@
7respawn7respawn
8expect fork8expect fork
99
10exec /usr/lib/bluetooth/obexd -P ftp,irmc,mas,pcsuite -r $HOME10exec $SNAP/usr/lib/bluetooth/obexd -P ftp,irmc,mas,pcsuite -r $HOME
1111
=== modified file 'upstart-session/ofono-setup.conf'
--- upstart-session/ofono-setup.conf 2015-07-28 19:02:49 +0000
+++ upstart-session/ofono-setup.conf 2016-11-29 23:53:13 +0000
@@ -4,4 +4,4 @@
4start on started dbus and started pulseaudio4start on started dbus and started pulseaudio
5stop on desktop-end5stop on desktop-end
66
7exec /usr/bin/ofono-setup7exec ofono-setup
88
=== modified file 'upstart-session/pulseaudio-trust-stored.conf'
--- upstart-session/pulseaudio-trust-stored.conf 2016-07-08 13:50:16 +0000
+++ upstart-session/pulseaudio-trust-stored.conf 2016-11-29 23:53:13 +0000
@@ -10,7 +10,7 @@
10 # for the service10 # for the service
11 sleep 211 sleep 2
1212
13 exec /usr/bin/trust-stored-skeleton \13 exec trust-stored-skeleton \
14 --remote-agent DBusRemoteAgent --bus=session \14 --remote-agent DBusRemoteAgent --bus=session \
15 --local-agent MirAgent \15 --local-agent MirAgent \
16 --trusted-mir-socket=/var/run/user/$(id -u)/mir_socket_trusted \16 --trusted-mir-socket=/var/run/user/$(id -u)/mir_socket_trusted \
1717
=== modified file 'upstart-session/pulseaudio.conf'
--- upstart-session/pulseaudio.conf 2015-04-07 04:25:00 +0000
+++ upstart-session/pulseaudio.conf 2016-11-29 23:53:13 +0000
@@ -9,14 +9,23 @@
99
10pre-start script10pre-start script
11 # Use the Touch specific Pulseaudio script file11 # Use the Touch specific Pulseaudio script file
12 initctl set-env --global PULSE_SCRIPT=/etc/pulse/touch.pa12 if [ -z "$PULSE_SCRIPT" ]; then
13 initctl set-env --global PULSE_CLIENTCONFIG=/etc/pulse/touch-client.conf13 initctl set-env --global PULSE_SCRIPT=/etc/pulse/touch.pa
14 fi
15 if [ -z "$PULSE_CLIENTCONFIG" ]; then
16 initctl set-env --global PULSE_CLIENTCONFIG=/etc/pulse/touch-client.conf
17 fi
1418
15 # Force a default audio role (apps can overwrite this)19 # Force a default audio role (apps can overwrite this)
16 initctl set-env --global PULSE_PROP='media.role=multimedia'20 initctl set-env --global PULSE_PROP='media.role=multimedia'
1721
18 # Force server-side corking when stalled (playback)22 # Force server-side corking when stalled (playback)
19 initctl set-env --global PULSE_PLAYBACK_CORK_STALLED=123 initctl set-env --global PULSE_PLAYBACK_CORK_STALLED=1
24
25 # Pulseaudio enforces this variable internally, but tries to re-exec itself
26 # when enabling it and has difficulty finding its own binary, if in a snap.
27 # So let's set it for the daemon, so it won't have to.
28 initctl set-env LD_BIND_NOW=1
20end script29end script
2130
22exec pulseaudio --start --log-target=syslog31exec pulseaudio --start --log-target=syslog
2332
=== modified file 'usc-wrapper'
--- usc-wrapper 2014-09-08 21:02:31 +0000
+++ usc-wrapper 2016-11-29 23:53:13 +0000
@@ -5,4 +5,4 @@
5. /etc/environment5. /etc/environment
6export ANDROID_ROOT6export ANDROID_ROOT
77
8exec unity-system-compositor --disable-overlays=false --spinner=/usr/bin/unity-system-compositor-spinner $@8exec unity-system-compositor --disable-overlays=false --spinner=$SNAP/usr/bin/unity-system-compositor-spinner $@

Subscribers

People subscribed via source and target branches