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
1diff --git a/bin/pulseaudio b/bin/pulseaudio
2index ff69475..d9fb85f 100755
3--- a/bin/pulseaudio
4+++ b/bin/pulseaudio
5@@ -5,14 +5,17 @@ set -x
6 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/usr/lib/pulseaudio:$SNAP/usr/lib/pulse-8.0/modules/
7 export PULSE_STATE_PATH=$SNAP_DATA/state
8 export ALSA_CONFIG_UCM=$SNAP/usr/share/alsa/ucm
9+export ALSA_CONFIG_TPLG=$SNAP/usr/share/alsa/topology
10 export ALSA_CONFIG_PATH=$SNAP/usr/share/alsa/alsa.conf
11+export ALSA_MIXER_SIMPLE=$SNAP/usr/share/alsa/smixer.conf
12
13 mkdir -p $PULSE_STATE_PATH
14
15 EXTRA_ARGS=
16
17 if [ -e $SNAP_DATA/config/debug ] ; then
18- EXTRA_ARGS="$EXTRA_ARGS -vvv"
19+ EXTRA_ARGS="$EXTRA_ARGS -vvvv"
20+ export LIBASOUND_DEBUG=1
21 fi
22
23 $SNAP/usr/bin/pulseaudio \
24diff --git a/libasound2-data-patch/Makefile b/libasound2-data-patch/Makefile
25new file mode 100644
26index 0000000..419b2e5
27--- /dev/null
28+++ b/libasound2-data-patch/Makefile
29@@ -0,0 +1,13 @@
30+all:
31+ @echo "copy files needed ..."
32+ @cp -a ../../pulseaudio/install/usr/share/alsa alsa
33+ @echo "apply patches ..."
34+ @./patch-libasound2-data.sh
35+
36+install:
37+ @mkdir -p $(DESTDIR)/usr/share/
38+ @cp -a alsa $(DESTDIR)/usr/share/
39+
40+clean:
41+ @echo "remove files"
42+ @rm -rf alsa
43diff --git a/libasound2-data-patch/patch-libasound2-data.sh b/libasound2-data-patch/patch-libasound2-data.sh
44new file mode 100755
45index 0000000..9831d2b
46--- /dev/null
47+++ b/libasound2-data-patch/patch-libasound2-data.sh
48@@ -0,0 +1,17 @@
49+#!/bin/sh
50+
51+## debug path
52+echo PWD=`pwd`
53+
54+# replace "confdir:" in usr/share/alsa/cards/*
55+## confdir is hardcoded in libasound, there are only two ways to change this:
56+## 1. change to /snap/pulseaudio/current/usr/share/alsa/
57+## 2. modify libasound source and build it
58+## Use the easy way (1) to achive this
59+## TODO: use fixed version 'current' is not a good idea
60+find alsa/cards/ -type f | xargs perl -i -pe 's/<confdir:/<\/snap\/pulseaudio\/current\/usr\/share\/alsa\//g'
61+
62+# add path of snap to config
63+## insert $SNAP path (/snap/pulseaudio/VER/) before alsa datadir path (/usr/share/alsa)
64+sed -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
65+
66diff --git a/snapcraft.yaml b/snapcraft.yaml
67index a7dd7e5..6482f32 100644
68--- a/snapcraft.yaml
69+++ b/snapcraft.yaml
70@@ -1,5 +1,5 @@
71 name: pulseaudio
72-version: 8.0-1
73+version: 8.0-2
74 summary: PulseAudio sound server
75 description: |
76 PulseAudio, previously known as Polypaudio, is a sound server for POSIX and
77@@ -27,6 +27,12 @@ apps:
78 plugs: [client]
79 config:
80 command: bin/config
81+slots:
82+ service:
83+ interface: pulseaudio
84+plugs:
85+ client:
86+ interface: pulseaudio
87
88 slots:
89 service:
90@@ -47,7 +53,38 @@ parts:
91 bin/config: bin/config
92 data/copyright: usr/share/doc/pulseaudio/copyright
93
94+ alsa-lib:
95+ plugin: autotools
96+
97+ source: https://git.launchpad.net/~robertliu/snappy-hwe-snaps/+git/pulseaudio
98+ source-type: git
99+ source-branch: alsa-lib/1.1.0
100+
101+ configflags:
102+ - --prefix=/usr
103+ - --sysconfdir=/etc
104+ - --libexec=/usr/lib
105+ - --libdir=/usr/lib
106+ - --localstatedir=/var
107+ - --with-plugindir=/usr/lib/alsa-lib
108+ - --disable-silent-rules
109+ - --disable-static
110+ - --disable-python
111+
112+ filesets:
113+ libasound2:
114+ - usr/lib/libasound.so*
115+ - usr/lib/alsa-lib/*
116+ - usr/share/alsa/*
117+
118+ snap:
119+ - $libasound2
120+
121+
122 pulseaudio:
123+ after:
124+ - alsa-lib
125+
126 plugin: autotools
127
128 source: https://git.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio
129@@ -72,12 +109,6 @@ parts:
130 - libasyncns-dev
131 - libxcb1-dev
132
133- stage-packages:
134- # Needed for various ALSA related configuration files the alsa
135- # module inside PulseAudio requires to use any available audio
136- # device properly
137- - libasound2-data
138-
139 configflags:
140 - --prefix=/usr
141 - --sysconfdir=/etc
142@@ -104,3 +135,22 @@ parts:
143 - --disable-x11
144 - --with-system-user=root
145 - --with-system-group=root
146+
147+ filesets:
148+ pauseaudiofiles:
149+ - etc/*
150+ - lib/*
151+ - usr/bin/pacat
152+ - usr/bin/pactl
153+ - usr/bin/paplay
154+ - usr/bin/parec
155+ - usr/bin/pulseaudio
156+ - usr/lib/libpulse-mainloop-glib.so*
157+ - usr/lib/libpulse-simple.so*
158+ - usr/lib/libpulse.so*
159+ - usr/lib/pulse-8.0/*
160+ - usr/lib/pulseaudio/*.so
161+ - usr/share/pulseaudio/*
162+
163+ snap:
164+ - $pauseaudiofiles

Subscribers

People subscribed via source and target branches

to all changes: