Merge ~robertliu/snappy-hwe-snaps/+git/pulseaudio:master into ~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio:master

Proposed by Robert Liu
Status: Superseded
Proposed branch: ~robertliu/snappy-hwe-snaps/+git/pulseaudio:master
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio:master
Diff against target: 164 lines (+91/-8)
4 files modified
bin/pulseaudio (+4/-1)
libasound2-data-patch/Makefile (+13/-0)
libasound2-data-patch/patch-libasound2-data.sh (+17/-0)
snapcraft.yaml (+57/-7)
Reviewer Review Type Date Requested Status
Jim Hodapp (community) code Needs Fixing
Snappy HWE Team Pending
Review via email: mp+309540@code.launchpad.net

This proposal has been superseded by a proposal from 2016-11-23.

Description of the change

When using the original pulseaudio snap on Intel NUC, pulseaudio only listed the analog output but not HDMI audio port. After some debug, I found libasound2 has several hard-coded path variables. These modifications are used to change the paths in libasound2-data.

1. Copy usr/share/alsa from stage of pulseaudio
2. Add the $SNAP environment variable before 'datadir' in alsa/alsa.conf
3. "confdir" which is used by alsa/cards/*.conf
4. Use stage of libasound2-data-patch instead of pulseaudio's

Also export more variables in bin/pulseaudio.

To post a comment you must log in.
Revision history for this message
Simon Fels (morphis) wrote :

This needs rebase or merge now that https://code.launchpad.net/~jhodapp/snappy-hwe-snaps/+git/fix-pulseaudio-slots-plugs/+merge/309604 is merged. Leaving detailed review up to Jim.

Revision history for this message
Jim Hodapp (jhodapp) wrote :

Thanks for the changes. Please see my comments inline below.

review: Needs Fixing (code)
Revision history for this message
Robert Liu (robertliu) wrote :

Jim, thank you for the comments.
I'll create a downstream branch then update the commits.

4ff410e... by Robert Liu

* rebase to jhodapp

Revision history for this message
Jim Hodapp (jhodapp) wrote :

Not a problem, sounds good.

3b203f5... by Robert Liu

Using local libasound2 and libasound2-data

Unmerged commits

3b203f5... by Robert Liu

Using local libasound2 and libasound2-data

4ff410e... by Robert Liu

* rebase to jhodapp

50f0ad8... by Robert Liu

* modify script name in Makefile

baf496b... by Robert Liu

* move libasound2-data patch related files to a sub directory

5300c7b... by Robert Liu

* add more ALSA config environments and rewrite the pathes in libasound2-data

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/pulseaudio b/bin/pulseaudio
index ff69475..d9fb85f 100755
--- a/bin/pulseaudio
+++ b/bin/pulseaudio
@@ -5,14 +5,17 @@ set -x
5export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/usr/lib/pulseaudio:$SNAP/usr/lib/pulse-8.0/modules/5export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/usr/lib/pulseaudio:$SNAP/usr/lib/pulse-8.0/modules/
6export PULSE_STATE_PATH=$SNAP_DATA/state6export PULSE_STATE_PATH=$SNAP_DATA/state
7export ALSA_CONFIG_UCM=$SNAP/usr/share/alsa/ucm7export ALSA_CONFIG_UCM=$SNAP/usr/share/alsa/ucm
8export ALSA_CONFIG_TPLG=$SNAP/usr/share/alsa/topology
8export ALSA_CONFIG_PATH=$SNAP/usr/share/alsa/alsa.conf9export ALSA_CONFIG_PATH=$SNAP/usr/share/alsa/alsa.conf
10export ALSA_MIXER_SIMPLE=$SNAP/usr/share/alsa/smixer.conf
911
10mkdir -p $PULSE_STATE_PATH12mkdir -p $PULSE_STATE_PATH
1113
12EXTRA_ARGS=14EXTRA_ARGS=
1315
14if [ -e $SNAP_DATA/config/debug ] ; then16if [ -e $SNAP_DATA/config/debug ] ; then
15 EXTRA_ARGS="$EXTRA_ARGS -vvv"17 EXTRA_ARGS="$EXTRA_ARGS -vvvv"
18 export LIBASOUND_DEBUG=1
16fi19fi
1720
18$SNAP/usr/bin/pulseaudio \21$SNAP/usr/bin/pulseaudio \
diff --git a/libasound2-data-patch/Makefile b/libasound2-data-patch/Makefile
19new file mode 10064422new file mode 100644
index 0000000..419b2e5
--- /dev/null
+++ b/libasound2-data-patch/Makefile
@@ -0,0 +1,13 @@
1all:
2 @echo "copy files needed ..."
3 @cp -a ../../pulseaudio/install/usr/share/alsa alsa
4 @echo "apply patches ..."
5 @./patch-libasound2-data.sh
6
7install:
8 @mkdir -p $(DESTDIR)/usr/share/
9 @cp -a alsa $(DESTDIR)/usr/share/
10
11clean:
12 @echo "remove files"
13 @rm -rf alsa
diff --git a/libasound2-data-patch/patch-libasound2-data.sh b/libasound2-data-patch/patch-libasound2-data.sh
0new file mode 10075514new file mode 100755
index 0000000..9831d2b
--- /dev/null
+++ b/libasound2-data-patch/patch-libasound2-data.sh
@@ -0,0 +1,17 @@
1#!/bin/sh
2
3## debug path
4echo PWD=`pwd`
5
6# replace "confdir:" in usr/share/alsa/cards/*
7## confdir is hardcoded in libasound, there are only two ways to change this:
8## 1. change to /snap/pulseaudio/current/usr/share/alsa/
9## 2. modify libasound source and build it
10## Use the easy way (1) to achive this
11## TODO: use fixed version 'current' is not a good idea
12find alsa/cards/ -type f | xargs perl -i -pe 's/<confdir:/<\/snap\/pulseaudio\/current\/usr\/share\/alsa\//g'
13
14# add path of snap to config
15## insert $SNAP path (/snap/pulseaudio/VER/) before alsa datadir path (/usr/share/alsa)
16sed -i 's/{ @func datadir }/{\n\t\t\t\t\t\t@func getenv\n\t\t\t\t\t\tvars [ SNAP ]\n\t\t\t\t\t\tdefault 0\n\t\t\t\t\t}\n\t\t\t\t\t{ @func datadir }/g' alsa/alsa.conf
17
diff --git a/snapcraft.yaml b/snapcraft.yaml
index a7dd7e5..6482f32 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -1,5 +1,5 @@
1name: pulseaudio1name: pulseaudio
2version: 8.0-12version: 8.0-2
3summary: PulseAudio sound server3summary: PulseAudio sound server
4description: |4description: |
5 PulseAudio, previously known as Polypaudio, is a sound server for POSIX and5 PulseAudio, previously known as Polypaudio, is a sound server for POSIX and
@@ -27,6 +27,12 @@ apps:
27 plugs: [client]27 plugs: [client]
28 config:28 config:
29 command: bin/config29 command: bin/config
30slots:
31 service:
32 interface: pulseaudio
33plugs:
34 client:
35 interface: pulseaudio
3036
31slots:37slots:
32 service:38 service:
@@ -47,7 +53,38 @@ parts:
47 bin/config: bin/config53 bin/config: bin/config
48 data/copyright: usr/share/doc/pulseaudio/copyright54 data/copyright: usr/share/doc/pulseaudio/copyright
4955
56 alsa-lib:
57 plugin: autotools
58
59 source: https://git.launchpad.net/~robertliu/snappy-hwe-snaps/+git/pulseaudio
60 source-type: git
61 source-branch: alsa-lib/1.1.0
62
63 configflags:
64 - --prefix=/usr
65 - --sysconfdir=/etc
66 - --libexec=/usr/lib
67 - --libdir=/usr/lib
68 - --localstatedir=/var
69 - --with-plugindir=/usr/lib/alsa-lib
70 - --disable-silent-rules
71 - --disable-static
72 - --disable-python
73
74 filesets:
75 libasound2:
76 - usr/lib/libasound.so*
77 - usr/lib/alsa-lib/*
78 - usr/share/alsa/*
79
80 snap:
81 - $libasound2
82
83
50 pulseaudio:84 pulseaudio:
85 after:
86 - alsa-lib
87
51 plugin: autotools88 plugin: autotools
5289
53 source: https://git.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio90 source: https://git.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio
@@ -72,12 +109,6 @@ parts:
72 - libasyncns-dev109 - libasyncns-dev
73 - libxcb1-dev110 - libxcb1-dev
74111
75 stage-packages:
76 # Needed for various ALSA related configuration files the alsa
77 # module inside PulseAudio requires to use any available audio
78 # device properly
79 - libasound2-data
80
81 configflags:112 configflags:
82 - --prefix=/usr113 - --prefix=/usr
83 - --sysconfdir=/etc114 - --sysconfdir=/etc
@@ -104,3 +135,22 @@ parts:
104 - --disable-x11135 - --disable-x11
105 - --with-system-user=root136 - --with-system-user=root
106 - --with-system-group=root137 - --with-system-group=root
138
139 filesets:
140 pauseaudiofiles:
141 - etc/*
142 - lib/*
143 - usr/bin/pacat
144 - usr/bin/pactl
145 - usr/bin/paplay
146 - usr/bin/parec
147 - usr/bin/pulseaudio
148 - usr/lib/libpulse-mainloop-glib.so*
149 - usr/lib/libpulse-simple.so*
150 - usr/lib/libpulse.so*
151 - usr/lib/pulse-8.0/*
152 - usr/lib/pulseaudio/*.so
153 - usr/share/pulseaudio/*
154
155 snap:
156 - $pauseaudiofiles

Subscribers

People subscribed via source and target branches

to all changes: