summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/pulseaudio
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-multimedia/pulseaudio')
-rw-r--r--meta/recipes-multimedia/pulseaudio/libatomics-ops/doublefix.patch25
-rw-r--r--meta/recipes-multimedia/pulseaudio/libatomics-ops/fedora/libatomic_ops-1.2-ppclwzfix.patch15
-rw-r--r--meta/recipes-multimedia/pulseaudio/libatomics-ops_1.2.bb14
-rw-r--r--meta/recipes-multimedia/pulseaudio/libcanberra/autoconf_version.patch38
-rw-r--r--meta/recipes-multimedia/pulseaudio/libcanberra/nofallbackfix.patch16
-rw-r--r--meta/recipes-multimedia/pulseaudio/libcanberra_0.10.bb22
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/alsaerror.patch525
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/autoconf_version.patch13
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/buildfix.patch13
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/fallback.patch338
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/gcc4-compile-fix.patch18
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/periodfix.patch73
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/volatiles.04_pulse2
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio.inc126
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio_0.9.15.bb18
15 files changed, 1256 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/pulseaudio/libatomics-ops/doublefix.patch b/meta/recipes-multimedia/pulseaudio/libatomics-ops/doublefix.patch
new file mode 100644
index 0000000000..2172cac41e
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/libatomics-ops/doublefix.patch
@@ -0,0 +1,25 @@
1Double path references breaks recent autoconf+automake
2
3RP 2/1/10
4
5Index: libatomic_ops-1.2/src/atomic_ops/sysdeps/Makefile.am
6===================================================================
7--- libatomic_ops-1.2.orig/src/atomic_ops/sysdeps/Makefile.am 2005-09-28 00:53:16.000000000 +0100
8+++ libatomic_ops-1.2/src/atomic_ops/sysdeps/Makefile.am 2010-02-01 14:28:46.397820574 +0000
9@@ -25,7 +25,6 @@
10 README \
11 \
12 gcc/alpha.h gcc/arm.h gcc/x86.h \
13- gcc/hppa.h gcc/ia64.h \
14 gcc/powerpc.h gcc/sparc.h \
15 gcc/hppa.h gcc/m68k.h gcc/s390.h \
16 gcc/ia64.h gcc/x86_64.h gcc/cris.h \
17Index: libatomic_ops-1.2/doc/Makefile.am
18===================================================================
19--- libatomic_ops-1.2.orig/doc/Makefile.am 2010-02-01 15:20:09.207788884 +0000
20+++ libatomic_ops-1.2/doc/Makefile.am 2010-02-01 15:20:20.909049794 +0000
21@@ -1,3 +1,3 @@
22 # installed documentation
23 #
24-dist_pkgdata_DATA=COPYING LICENSING.txt README.txt COPYING README_stack.txt README_malloc.txt README_win32.txt
25+dist_pkgdata_DATA=LICENSING.txt README.txt COPYING README_stack.txt README_malloc.txt README_win32.txt
diff --git a/meta/recipes-multimedia/pulseaudio/libatomics-ops/fedora/libatomic_ops-1.2-ppclwzfix.patch b/meta/recipes-multimedia/pulseaudio/libatomics-ops/fedora/libatomic_ops-1.2-ppclwzfix.patch
new file mode 100644
index 0000000000..51161dbe0f
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/libatomics-ops/fedora/libatomic_ops-1.2-ppclwzfix.patch
@@ -0,0 +1,15 @@
1http://cvs.fedoraproject.org/viewcvs/devel/libatomic_ops/libatomic_ops-1.2-ppclwzfix.patch
2
3* add fix for bad variable handling on PPC
4
5--- libatomic_ops-1.2.orig/src/atomic_ops/sysdeps/gcc/powerpc.h 2007-05-29 19:29:52.000000000 +0200
6+++ libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/powerpc.h 2007-05-29 19:30:48.000000000 +0200
7@@ -72,7 +72,7 @@
8 /* registers. I always got "impossible constraint" when I */
9 /* tried the "y" constraint. */
10 __asm__ __volatile__ (
11- "lwz %0,%1\n"
12+ "lwz%U1%X1 %0,%1\n"
13 "cmpw cr7,%0,%0\n"
14 "bne- cr7,1f\n"
15 "1: isync\n"
diff --git a/meta/recipes-multimedia/pulseaudio/libatomics-ops_1.2.bb b/meta/recipes-multimedia/pulseaudio/libatomics-ops_1.2.bb
new file mode 100644
index 0000000000..207f1b1ec6
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/libatomics-ops_1.2.bb
@@ -0,0 +1,14 @@
1DESCRIPTION = "A library for atomic integer operations"
2LICENSE = "MIT"
3
4PR = "r4"
5
6SRC_URI = "http://www.hpl.hp.com/research/linux/atomic_ops/download/libatomic_ops-1.2.tar.gz \
7 file://fedora/libatomic_ops-1.2-ppclwzfix.patch;patch=1 \
8 file://doublefix.patch;patch=1"
9
10S = "${WORKDIR}/libatomic_ops-${PV}"
11
12ALLOW_EMPTY_${PN} = "1"
13
14inherit autotools pkgconfig
diff --git a/meta/recipes-multimedia/pulseaudio/libcanberra/autoconf_version.patch b/meta/recipes-multimedia/pulseaudio/libcanberra/autoconf_version.patch
new file mode 100644
index 0000000000..73a2ea6e49
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/libcanberra/autoconf_version.patch
@@ -0,0 +1,38 @@
1Allow a slightly older autoconf and disable the inbuild libltdl
2
3RP - 16/4/09
4
5Index: libcanberra-0.10/Makefile.am
6===================================================================
7--- libcanberra-0.10.orig/Makefile.am 2009-04-16 14:38:53.000000000 +0100
8+++ libcanberra-0.10/Makefile.am 2009-04-16 14:39:04.000000000 +0100
9@@ -19,7 +19,7 @@
10 dist_doc_DATA = README
11
12 EXTRA_DIST = bootstrap.sh autogen.sh LGPL libcanberra.schemas
13-SUBDIRS = src gtkdoc libltdl doc
14+SUBDIRS = src gtkdoc doc
15
16 MAINTAINERCLEANFILES = README
17 noinst_DATA = README
18Index: libcanberra-0.10/configure.ac
19===================================================================
20--- libcanberra-0.10.orig/configure.ac 2009-04-16 14:32:33.000000000 +0100
21+++ libcanberra-0.10/configure.ac 2009-04-16 14:37:50.000000000 +0100
22@@ -19,7 +19,7 @@
23 # License along with libcanberra. If not, see
24 # <http://www.gnu.org/licenses/>.
25
26-AC_PREREQ(2.62)
27+AC_PREREQ(2.61)
28
29 AC_INIT([libcanberra], 0.10, [mzyvopnaoreen (at) 0pointer (dot) de])
30 AC_CONFIG_SRCDIR([src/common.c])
31@@ -70,7 +70,6 @@
32 AC_PROG_LIBTOOL
33 AC_SUBST(LTDLINCL)
34 AC_SUBST(LIBLTDL)
35-AC_CONFIG_SUBDIRS(libltdl)
36
37 #### Determine build environment ####
38
diff --git a/meta/recipes-multimedia/pulseaudio/libcanberra/nofallbackfix.patch b/meta/recipes-multimedia/pulseaudio/libcanberra/nofallbackfix.patch
new file mode 100644
index 0000000000..89a4fbf9f1
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/libcanberra/nofallbackfix.patch
@@ -0,0 +1,16 @@
1Index: libcanberra-0.10/src/sound-theme-spec.c
2===================================================================
3--- libcanberra-0.10.orig/src/sound-theme-spec.c 2009-05-22 17:08:23.000000000 +0100
4+++ libcanberra-0.10/src/sound-theme-spec.c 2009-05-22 17:12:50.000000000 +0100
5@@ -398,9 +398,9 @@
6 if ((ret = load_theme_dir(t, name)) < 0)
7 goto fail;
8
9+ /* The fallback theme may intentionally not exist so ignore failure */
10 if (!t->loaded_fallback_theme)
11- if ((ret = load_theme_dir(t, FALLBACK_THEME)) < 0)
12- goto fail;
13+ load_theme_dir(t, FALLBACK_THEME);
14
15 if (*_t)
16 ca_theme_data_free(*_t);
diff --git a/meta/recipes-multimedia/pulseaudio/libcanberra_0.10.bb b/meta/recipes-multimedia/pulseaudio/libcanberra_0.10.bb
new file mode 100644
index 0000000000..c6d25dccb0
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/libcanberra_0.10.bb
@@ -0,0 +1,22 @@
1DESCRIPTION = "Libcanberra is an implementation of the XDG Sound Theme and Name Specifications, for generating event sounds on free desktops."
2LICENSE = "LGPL"
3DEPENDS = "gtk+ pulseaudio alsa-lib libtool"
4PR = "r3"
5
6inherit gconf autotools
7
8SRC_URI = "http://0pointer.de/lennart/projects/libcanberra/libcanberra-${PV}.tar.gz \
9 file://nofallbackfix.patch;patch=1 \
10 file://autoconf_version.patch;patch=1"
11
12EXTRA_OECONF = " --disable-oss --disable-ltdl-install"
13
14do_configure_prepend () {
15 rm -f ${S}/libltdl/configure*
16}
17
18FILES_${PN} += "${libdir}/gtk-2.0/modules/ ${datadir}/gnome"
19FILES_${PN}-dbg += "${libdir}/gtk-2.0/modules/.debug"
20
21AUTOTOOLS_STAGE_PKGCONFIG = "1"
22
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/alsaerror.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/alsaerror.patch
new file mode 100644
index 0000000000..2efa3e89b8
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/alsaerror.patch
@@ -0,0 +1,525 @@
1From: Lennart Poettering <lennart@poettering.net>
2Date: Sun, 19 Apr 2009 17:22:51 +0000 (+0200)
3Subject: alsa: properly convert return values of snd_strerror() to utf8
4X-Git-Url: http://git.0pointer.de/?p=pulseaudio.git;a=commitdiff_plain;h=98a25c506e692ab091b4af7e1b37e8432fc08e8f
5
6alsa: properly convert return values of snd_strerror() to utf8
7---
8
9diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
10index 2fbcd7b..41e8b47 100644
11--- a/src/modules/alsa/alsa-sink.c
12+++ b/src/modules/alsa/alsa-sink.c
13@@ -281,7 +281,7 @@ static int try_recover(struct userdata *u, const char *call, int err) {
14 pa_assert(call);
15 pa_assert(err < 0);
16
17- pa_log_debug("%s: %s", call, snd_strerror(err));
18+ pa_log_debug("%s: %s", call, pa_alsa_strerror(err));
19
20 pa_assert(err != -EAGAIN);
21
22@@ -289,7 +289,7 @@ static int try_recover(struct userdata *u, const char *call, int err) {
23 pa_log_debug("%s: Buffer underrun!", call);
24
25 if ((err = snd_pcm_recover(u->pcm_handle, err, 1)) < 0) {
26- pa_log("%s: %s", call, snd_strerror(err));
27+ pa_log("%s: %s", call, pa_alsa_strerror(err));
28 return -1;
29 }
30
31@@ -636,12 +636,12 @@ static void update_smoother(struct userdata *u) {
32 /* Let's update the time smoother */
33
34 if (PA_UNLIKELY((err = pa_alsa_safe_delay(u->pcm_handle, &delay, u->hwbuf_size, &u->sink->sample_spec)) < 0)) {
35- pa_log_warn("Failed to query DSP status data: %s", snd_strerror(err));
36+ pa_log_warn("Failed to query DSP status data: %s", pa_alsa_strerror(err));
37 return;
38 }
39
40 if (PA_UNLIKELY((err = snd_pcm_status(u->pcm_handle, status)) < 0))
41- pa_log_warn("Failed to get timestamp: %s", snd_strerror(err));
42+ pa_log_warn("Failed to get timestamp: %s", pa_alsa_strerror(err));
43 else {
44 snd_htimestamp_t htstamp = { 0, 0 };
45 snd_pcm_status_get_htstamp(status, &htstamp);
46@@ -764,7 +764,7 @@ static int update_sw_params(struct userdata *u) {
47 pa_log_debug("setting avail_min=%lu", (unsigned long) avail_min);
48
49 if ((err = pa_alsa_set_sw_params(u->pcm_handle, avail_min)) < 0) {
50- pa_log("Failed to set software parameters: %s", snd_strerror(err));
51+ pa_log("Failed to set software parameters: %s", pa_alsa_strerror(err));
52 return err;
53 }
54
55@@ -792,7 +792,7 @@ static int unsuspend(struct userdata *u) {
56 SND_PCM_NO_AUTO_RESAMPLE|
57 SND_PCM_NO_AUTO_CHANNELS|
58 SND_PCM_NO_AUTO_FORMAT)) < 0) {
59- pa_log("Error opening PCM device %s: %s", u->device_name, snd_strerror(err));
60+ pa_log("Error opening PCM device %s: %s", u->device_name, pa_alsa_strerror(err));
61 goto fail;
62 }
63
64@@ -803,7 +803,7 @@ static int unsuspend(struct userdata *u) {
65 d = u->use_tsched;
66
67 if ((err = pa_alsa_set_hw_params(u->pcm_handle, &ss, &nfrags, &period_size, u->hwbuf_size / u->frame_size, &b, &d, TRUE)) < 0) {
68- pa_log("Failed to set hardware parameters: %s", snd_strerror(err));
69+ pa_log("Failed to set hardware parameters: %s", pa_alsa_strerror(err));
70 goto fail;
71 }
72
73@@ -1030,7 +1030,7 @@ static void sink_get_volume_cb(pa_sink *s) {
74 return;
75
76 fail:
77- pa_log_error("Unable to read volume: %s", snd_strerror(err));
78+ pa_log_error("Unable to read volume: %s", pa_alsa_strerror(err));
79 }
80
81 static void sink_set_volume_cb(pa_sink *s) {
82@@ -1141,7 +1141,7 @@ static void sink_set_volume_cb(pa_sink *s) {
83 return;
84
85 fail:
86- pa_log_error("Unable to set volume: %s", snd_strerror(err));
87+ pa_log_error("Unable to set volume: %s", pa_alsa_strerror(err));
88 }
89
90 static void sink_get_mute_cb(pa_sink *s) {
91@@ -1152,7 +1152,7 @@ static void sink_get_mute_cb(pa_sink *s) {
92 pa_assert(u->mixer_elem);
93
94 if ((err = snd_mixer_selem_get_playback_switch(u->mixer_elem, 0, &sw)) < 0) {
95- pa_log_error("Unable to get switch: %s", snd_strerror(err));
96+ pa_log_error("Unable to get switch: %s", pa_alsa_strerror(err));
97 return;
98 }
99
100@@ -1167,7 +1167,7 @@ static void sink_set_mute_cb(pa_sink *s) {
101 pa_assert(u->mixer_elem);
102
103 if ((err = snd_mixer_selem_set_playback_switch_all(u->mixer_elem, !s->muted)) < 0) {
104- pa_log_error("Unable to set switch: %s", snd_strerror(err));
105+ pa_log_error("Unable to set switch: %s", pa_alsa_strerror(err));
106 return;
107 }
108 }
109@@ -1206,7 +1206,7 @@ static int process_rewind(struct userdata *u) {
110 pa_log_debug("Requested to rewind %lu bytes.", (unsigned long) rewind_nbytes);
111
112 if (PA_UNLIKELY((unused = pa_alsa_safe_avail(u->pcm_handle, u->hwbuf_size, &u->sink->sample_spec)) < 0)) {
113- pa_log("snd_pcm_avail() failed: %s", snd_strerror((int) unused));
114+ pa_log("snd_pcm_avail() failed: %s", pa_alsa_strerror((int) unused));
115 return -1;
116 }
117
118@@ -1228,7 +1228,7 @@ static int process_rewind(struct userdata *u) {
119 in_frames = (snd_pcm_sframes_t) (rewind_nbytes / u->frame_size);
120 pa_log_debug("before: %lu", (unsigned long) in_frames);
121 if ((out_frames = snd_pcm_rewind(u->pcm_handle, (snd_pcm_uframes_t) in_frames)) < 0) {
122- pa_log("snd_pcm_rewind() failed: %s", snd_strerror((int) out_frames));
123+ pa_log("snd_pcm_rewind() failed: %s", pa_alsa_strerror((int) out_frames));
124 return -1;
125 }
126 pa_log_debug("after: %lu", (unsigned long) out_frames);
127@@ -1359,7 +1359,7 @@ static void thread_func(void *userdata) {
128 pollfd = pa_rtpoll_item_get_pollfd(u->alsa_rtpoll_item, &n);
129
130 if ((err = snd_pcm_poll_descriptors_revents(u->pcm_handle, pollfd, n, &revents)) < 0) {
131- pa_log("snd_pcm_poll_descriptors_revents() failed: %s", snd_strerror(err));
132+ pa_log("snd_pcm_poll_descriptors_revents() failed: %s", pa_alsa_strerror(err));
133 goto fail;
134 }
135
136diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
137index c59fc75..843f70b 100644
138--- a/src/modules/alsa/alsa-source.c
139+++ b/src/modules/alsa/alsa-source.c
140@@ -278,7 +278,7 @@ static int try_recover(struct userdata *u, const char *call, int err) {
141 pa_assert(call);
142 pa_assert(err < 0);
143
144- pa_log_debug("%s: %s", call, snd_strerror(err));
145+ pa_log_debug("%s: %s", call, pa_alsa_strerror(err));
146
147 pa_assert(err != -EAGAIN);
148
149@@ -286,7 +286,7 @@ static int try_recover(struct userdata *u, const char *call, int err) {
150 pa_log_debug("%s: Buffer overrun!", call);
151
152 if ((err = snd_pcm_recover(u->pcm_handle, err, 1)) < 0) {
153- pa_log("%s: %s", call, snd_strerror(err));
154+ pa_log("%s: %s", call, pa_alsa_strerror(err));
155 return -1;
156 }
157
158@@ -606,12 +606,12 @@ static void update_smoother(struct userdata *u) {
159 /* Let's update the time smoother */
160
161 if (PA_UNLIKELY((err = pa_alsa_safe_delay(u->pcm_handle, &delay, u->hwbuf_size, &u->source->sample_spec)) < 0)) {
162- pa_log_warn("Failed to get delay: %s", snd_strerror(err));
163+ pa_log_warn("Failed to get delay: %s", pa_alsa_strerror(err));
164 return;
165 }
166
167 if (PA_UNLIKELY((err = snd_pcm_status(u->pcm_handle, status)) < 0))
168- pa_log_warn("Failed to get timestamp: %s", snd_strerror(err));
169+ pa_log_warn("Failed to get timestamp: %s", pa_alsa_strerror(err));
170 else {
171 snd_htimestamp_t htstamp = { 0, 0 };
172 snd_pcm_status_get_htstamp(status, &htstamp);
173@@ -721,7 +721,7 @@ static int update_sw_params(struct userdata *u) {
174 pa_log_debug("setting avail_min=%lu", (unsigned long) avail_min);
175
176 if ((err = pa_alsa_set_sw_params(u->pcm_handle, avail_min)) < 0) {
177- pa_log("Failed to set software parameters: %s", snd_strerror(err));
178+ pa_log("Failed to set software parameters: %s", pa_alsa_strerror(err));
179 return err;
180 }
181
182@@ -747,7 +747,7 @@ static int unsuspend(struct userdata *u) {
183 SND_PCM_NO_AUTO_RESAMPLE|
184 SND_PCM_NO_AUTO_CHANNELS|
185 SND_PCM_NO_AUTO_FORMAT)) < 0) {
186- pa_log("Error opening PCM device %s: %s", u->device_name, snd_strerror(err));
187+ pa_log("Error opening PCM device %s: %s", u->device_name, pa_alsa_strerror(err));
188 goto fail;
189 }
190
191@@ -758,7 +758,7 @@ static int unsuspend(struct userdata *u) {
192 d = u->use_tsched;
193
194 if ((err = pa_alsa_set_hw_params(u->pcm_handle, &ss, &nfrags, &period_size, u->hwbuf_size / u->frame_size, &b, &d, TRUE)) < 0) {
195- pa_log("Failed to set hardware parameters: %s", snd_strerror(err));
196+ pa_log("Failed to set hardware parameters: %s", pa_alsa_strerror(err));
197 goto fail;
198 }
199
200@@ -988,7 +988,7 @@ static void source_get_volume_cb(pa_source *s) {
201 return;
202
203 fail:
204- pa_log_error("Unable to read volume: %s", snd_strerror(err));
205+ pa_log_error("Unable to read volume: %s", pa_alsa_strerror(err));
206 }
207
208 static void source_set_volume_cb(pa_source *s) {
209@@ -1100,7 +1100,7 @@ static void source_set_volume_cb(pa_source *s) {
210 return;
211
212 fail:
213- pa_log_error("Unable to set volume: %s", snd_strerror(err));
214+ pa_log_error("Unable to set volume: %s", pa_alsa_strerror(err));
215 }
216
217 static void source_get_mute_cb(pa_source *s) {
218@@ -1111,7 +1111,7 @@ static void source_get_mute_cb(pa_source *s) {
219 pa_assert(u->mixer_elem);
220
221 if ((err = snd_mixer_selem_get_capture_switch(u->mixer_elem, 0, &sw)) < 0) {
222- pa_log_error("Unable to get switch: %s", snd_strerror(err));
223+ pa_log_error("Unable to get switch: %s", pa_alsa_strerror(err));
224 return;
225 }
226
227@@ -1126,7 +1126,7 @@ static void source_set_mute_cb(pa_source *s) {
228 pa_assert(u->mixer_elem);
229
230 if ((err = snd_mixer_selem_set_capture_switch_all(u->mixer_elem, !s->muted)) < 0) {
231- pa_log_error("Unable to set switch: %s", snd_strerror(err));
232+ pa_log_error("Unable to set switch: %s", pa_alsa_strerror(err));
233 return;
234 }
235 }
236@@ -1218,7 +1218,7 @@ static void thread_func(void *userdata) {
237 pollfd = pa_rtpoll_item_get_pollfd(u->alsa_rtpoll_item, &n);
238
239 if ((err = snd_pcm_poll_descriptors_revents(u->pcm_handle, pollfd, n, &revents)) < 0) {
240- pa_log("snd_pcm_poll_descriptors_revents() failed: %s", snd_strerror(err));
241+ pa_log("snd_pcm_poll_descriptors_revents() failed: %s", pa_alsa_strerror(err));
242 goto fail;
243 }
244
245diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
246index d2dc6e8..ddc3c77 100644
247--- a/src/modules/alsa/alsa-util.c
248+++ b/src/modules/alsa/alsa-util.c
249@@ -33,6 +33,7 @@
250 #include <pulse/timeval.h>
251 #include <pulse/util.h>
252 #include <pulse/i18n.h>
253+#include <pulse/utf8.h>
254
255 #include <pulsecore/log.h>
256 #include <pulsecore/macro.h>
257@@ -40,6 +41,7 @@
258 #include <pulsecore/atomic.h>
259 #include <pulsecore/core-error.h>
260 #include <pulsecore/once.h>
261+#include <pulsecore/thread.h>
262
263 #include "alsa-util.h"
264
265@@ -106,7 +108,7 @@ static void io_cb(pa_mainloop_api*a, pa_io_event* e, int fd, pa_io_event_flags_t
266 pa_assert(i != fdl->num_fds);
267
268 if ((err = snd_mixer_poll_descriptors_revents(fdl->mixer, fdl->work_fds, fdl->num_fds, &revents)) < 0) {
269- pa_log_error("Unable to get poll revent: %s", snd_strerror(err));
270+ pa_log_error("Unable to get poll revent: %s", pa_alsa_strerror(err));
271 return;
272 }
273
274@@ -129,7 +131,7 @@ static void defer_cb(pa_mainloop_api*a, pa_defer_event* e, void *userdata) {
275 a->defer_enable(fdl->defer, 0);
276
277 if ((n = snd_mixer_poll_descriptors_count(fdl->mixer)) < 0) {
278- pa_log("snd_mixer_poll_descriptors_count() failed: %s", snd_strerror(n));
279+ pa_log("snd_mixer_poll_descriptors_count() failed: %s", pa_alsa_strerror(n));
280 return;
281 }
282 num_fds = (unsigned) n;
283@@ -146,7 +148,7 @@ static void defer_cb(pa_mainloop_api*a, pa_defer_event* e, void *userdata) {
284 memset(fdl->work_fds, 0, sizeof(struct pollfd) * num_fds);
285
286 if ((err = snd_mixer_poll_descriptors(fdl->mixer, fdl->work_fds, num_fds)) < 0) {
287- pa_log_error("Unable to get poll descriptors: %s", snd_strerror(err));
288+ pa_log_error("Unable to get poll descriptors: %s", pa_alsa_strerror(err));
289 return;
290 }
291
292@@ -482,42 +484,42 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min) {
293 snd_pcm_sw_params_alloca(&swparams);
294
295 if ((err = snd_pcm_sw_params_current(pcm, swparams) < 0)) {
296- pa_log_warn("Unable to determine current swparams: %s\n", snd_strerror(err));
297+ pa_log_warn("Unable to determine current swparams: %s\n", pa_alsa_strerror(err));
298 return err;
299 }
300
301 if ((err = snd_pcm_sw_params_set_period_event(pcm, swparams, 0)) < 0) {
302- pa_log_warn("Unable to disable period event: %s\n", snd_strerror(err));
303+ pa_log_warn("Unable to disable period event: %s\n", pa_alsa_strerror(err));
304 return err;
305 }
306
307 if ((err = snd_pcm_sw_params_set_tstamp_mode(pcm, swparams, SND_PCM_TSTAMP_ENABLE)) < 0) {
308- pa_log_warn("Unable to enable time stamping: %s\n", snd_strerror(err));
309+ pa_log_warn("Unable to enable time stamping: %s\n", pa_alsa_strerror(err));
310 return err;
311 }
312
313 if ((err = snd_pcm_sw_params_get_boundary(swparams, &boundary)) < 0) {
314- pa_log_warn("Unable to get boundary: %s\n", snd_strerror(err));
315+ pa_log_warn("Unable to get boundary: %s\n", pa_alsa_strerror(err));
316 return err;
317 }
318
319 if ((err = snd_pcm_sw_params_set_stop_threshold(pcm, swparams, boundary)) < 0) {
320- pa_log_warn("Unable to set stop threshold: %s\n", snd_strerror(err));
321+ pa_log_warn("Unable to set stop threshold: %s\n", pa_alsa_strerror(err));
322 return err;
323 }
324
325 if ((err = snd_pcm_sw_params_set_start_threshold(pcm, swparams, (snd_pcm_uframes_t) -1)) < 0) {
326- pa_log_warn("Unable to set start threshold: %s\n", snd_strerror(err));
327+ pa_log_warn("Unable to set start threshold: %s\n", pa_alsa_strerror(err));
328 return err;
329 }
330
331 if ((err = snd_pcm_sw_params_set_avail_min(pcm, swparams, avail_min)) < 0) {
332- pa_log_error("snd_pcm_sw_params_set_avail_min() failed: %s", snd_strerror(err));
333+ pa_log_error("snd_pcm_sw_params_set_avail_min() failed: %s", pa_alsa_strerror(err));
334 return err;
335 }
336
337 if ((err = snd_pcm_sw_params(pcm, swparams)) < 0) {
338- pa_log_warn("Unable to set sw params: %s\n", snd_strerror(err));
339+ pa_log_warn("Unable to set sw params: %s\n", pa_alsa_strerror(err));
340 return err;
341 }
342
343@@ -854,7 +856,7 @@ snd_pcm_t *pa_alsa_open_by_device_string(
344 SND_PCM_NO_AUTO_RESAMPLE|
345 SND_PCM_NO_AUTO_CHANNELS|
346 (reformat ? 0 : SND_PCM_NO_AUTO_FORMAT))) < 0) {
347- pa_log_info("Error opening PCM device %s: %s", d, snd_strerror(err));
348+ pa_log_info("Error opening PCM device %s: %s", d, pa_alsa_strerror(err));
349 goto fail;
350 }
351
352@@ -882,7 +884,7 @@ snd_pcm_t *pa_alsa_open_by_device_string(
353 continue;
354 }
355
356- pa_log_info("Failed to set hardware parameters on %s: %s", d, snd_strerror(err));
357+ pa_log_info("Failed to set hardware parameters on %s: %s", d, pa_alsa_strerror(err));
358 snd_pcm_close(pcm_handle);
359
360 goto fail;
361@@ -1000,17 +1002,17 @@ int pa_alsa_prepare_mixer(snd_mixer_t *mixer, const char *dev) {
362 pa_assert(dev);
363
364 if ((err = snd_mixer_attach(mixer, dev)) < 0) {
365- pa_log_info("Unable to attach to mixer %s: %s", dev, snd_strerror(err));
366+ pa_log_info("Unable to attach to mixer %s: %s", dev, pa_alsa_strerror(err));
367 return -1;
368 }
369
370 if ((err = snd_mixer_selem_register(mixer, NULL, NULL)) < 0) {
371- pa_log_warn("Unable to register mixer: %s", snd_strerror(err));
372+ pa_log_warn("Unable to register mixer: %s", pa_alsa_strerror(err));
373 return -1;
374 }
375
376 if ((err = snd_mixer_load(mixer)) < 0) {
377- pa_log_warn("Unable to load mixer: %s", snd_strerror(err));
378+ pa_log_warn("Unable to load mixer: %s", pa_alsa_strerror(err));
379 return -1;
380 }
381
382@@ -1136,7 +1138,7 @@ int pa_alsa_find_mixer_and_elem(
383 }
384
385 if ((err = snd_mixer_open(&m, 0)) < 0) {
386- pa_log("Error opening mixer: %s", snd_strerror(err));
387+ pa_log("Error opening mixer: %s", pa_alsa_strerror(err));
388 return -1;
389 }
390
391@@ -1338,7 +1340,7 @@ void pa_alsa_dump(pa_log_level_t level, snd_pcm_t *pcm) {
392 pa_assert_se(snd_output_buffer_open(&out) == 0);
393
394 if ((err = snd_pcm_dump(pcm, out)) < 0)
395- pa_logl(level, "snd_pcm_dump(): %s", snd_strerror(err));
396+ pa_logl(level, "snd_pcm_dump(): %s", pa_alsa_strerror(err));
397 else {
398 char *s = NULL;
399 snd_output_buffer_string(out, &s);
400@@ -1362,7 +1364,7 @@ void pa_alsa_dump_status(snd_pcm_t *pcm) {
401 pa_assert_se(snd_pcm_status(pcm, status) == 0);
402
403 if ((err = snd_pcm_status_dump(status, out)) < 0)
404- pa_log_debug("snd_pcm_dump(): %s", snd_strerror(err));
405+ pa_log_debug("snd_pcm_dump(): %s", pa_alsa_strerror(err));
406 else {
407 char *s = NULL;
408 snd_output_buffer_string(out, &s);
409@@ -1524,7 +1526,7 @@ void pa_alsa_init_proplist_pcm(pa_core *c, pa_proplist *p, snd_pcm_t *pcm, snd_m
410 snd_pcm_info_alloca(&info);
411
412 if ((err = snd_pcm_hw_params_current(pcm, hwparams)) < 0)
413- pa_log_warn("Error fetching hardware parameter info: %s", snd_strerror(err));
414+ pa_log_warn("Error fetching hardware parameter info: %s", pa_alsa_strerror(err));
415 else {
416
417 if ((bits = snd_pcm_hw_params_get_sbits(hwparams)) >= 0)
418@@ -1535,7 +1537,7 @@ void pa_alsa_init_proplist_pcm(pa_core *c, pa_proplist *p, snd_pcm_t *pcm, snd_m
419 pa_proplist_sets(p, "alsa.mixer_element", snd_mixer_selem_get_name(elem));
420
421 if ((err = snd_pcm_info(pcm, info)) < 0)
422- pa_log_warn("Error fetching PCM info: %s", snd_strerror(err));
423+ pa_log_warn("Error fetching PCM info: %s", pa_alsa_strerror(err));
424 else
425 pa_alsa_init_proplist_pcm_info(c, p, info);
426 }
427@@ -1568,14 +1570,14 @@ int pa_alsa_recover_from_poll(snd_pcm_t *pcm, int revents) {
428
429 case SND_PCM_STATE_XRUN:
430 if ((err = snd_pcm_recover(pcm, -EPIPE, 1)) != 0) {
431- pa_log_warn("Could not recover from POLLERR|POLLNVAL|POLLHUP and XRUN: %s", snd_strerror(err));
432+ pa_log_warn("Could not recover from POLLERR|POLLNVAL|POLLHUP and XRUN: %s", pa_alsa_strerror(err));
433 return -1;
434 }
435 break;
436
437 case SND_PCM_STATE_SUSPENDED:
438 if ((err = snd_pcm_recover(pcm, -ESTRPIPE, 1)) != 0) {
439- pa_log_warn("Could not recover from POLLERR|POLLNVAL|POLLHUP and SUSPENDED: %s", snd_strerror(err));
440+ pa_log_warn("Could not recover from POLLERR|POLLNVAL|POLLHUP and SUSPENDED: %s", pa_alsa_strerror(err));
441 return -1;
442 }
443 break;
444@@ -1585,7 +1587,7 @@ int pa_alsa_recover_from_poll(snd_pcm_t *pcm, int revents) {
445 snd_pcm_drop(pcm);
446
447 if ((err = snd_pcm_prepare(pcm)) < 0) {
448- pa_log_warn("Could not recover from POLLERR|POLLNVAL|POLLHUP with snd_pcm_prepare(): %s", snd_strerror(err));
449+ pa_log_warn("Could not recover from POLLERR|POLLNVAL|POLLHUP with snd_pcm_prepare(): %s", pa_alsa_strerror(err));
450 return -1;
451 }
452 break;
453@@ -1602,7 +1604,7 @@ pa_rtpoll_item* pa_alsa_build_pollfd(snd_pcm_t *pcm, pa_rtpoll *rtpoll) {
454 pa_assert(pcm);
455
456 if ((n = snd_pcm_poll_descriptors_count(pcm)) < 0) {
457- pa_log("snd_pcm_poll_descriptors_count() failed: %s", snd_strerror(n));
458+ pa_log("snd_pcm_poll_descriptors_count() failed: %s", pa_alsa_strerror(n));
459 return NULL;
460 }
461
462@@ -1610,7 +1612,7 @@ pa_rtpoll_item* pa_alsa_build_pollfd(snd_pcm_t *pcm, pa_rtpoll *rtpoll) {
463 pollfd = pa_rtpoll_item_get_pollfd(item, NULL);
464
465 if ((err = snd_pcm_poll_descriptors(pcm, pollfd, (unsigned) n)) < 0) {
466- pa_log("snd_pcm_poll_descriptors() failed: %s", snd_strerror(err));
467+ pa_log("snd_pcm_poll_descriptors() failed: %s", pa_alsa_strerror(err));
468 pa_rtpoll_item_free(item);
469 return NULL;
470 }
471@@ -1819,3 +1821,30 @@ pa_bool_t pa_alsa_pcm_is_modem(snd_pcm_t *pcm) {
472
473 return snd_pcm_info_get_class(info) == SND_PCM_CLASS_MODEM;
474 }
475+
476+PA_STATIC_TLS_DECLARE(cstrerror, pa_xfree);
477+
478+const char* pa_alsa_strerror(int errnum) {
479+ const char *original = NULL;
480+ char *translated, *t;
481+ char errbuf[128];
482+
483+ if ((t = PA_STATIC_TLS_GET(cstrerror)))
484+ pa_xfree(t);
485+
486+ original = snd_strerror(errnum);
487+
488+ if (!original) {
489+ pa_snprintf(errbuf, sizeof(errbuf), "Unknown error %i", errnum);
490+ original = errbuf;
491+ }
492+
493+ if (!(translated = pa_locale_to_utf8(original))) {
494+ pa_log_warn("Unable to convert error string to locale, filtering.");
495+ translated = pa_utf8_filter(original);
496+ }
497+
498+ PA_STATIC_TLS_SET(cstrerror, translated);
499+
500+ return translated;
501+}
502diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
503index c8acc7c..77ac8a7 100644
504--- a/src/modules/alsa/alsa-util.h
505+++ b/src/modules/alsa/alsa-util.h
506@@ -146,4 +146,6 @@ pa_bool_t pa_alsa_pcm_is_hw(snd_pcm_t *pcm);
507
508 pa_bool_t pa_alsa_pcm_is_modem(snd_pcm_t *pcm);
509
510+const char* pa_alsa_strerror(int errnum);
511+
512 #endif
513diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
514index fdc952d..51d466e 100644
515--- a/src/modules/alsa/module-alsa-card.c
516+++ b/src/modules/alsa/module-alsa-card.c
517@@ -304,7 +304,7 @@ int pa__init(pa_module *m) {
518 u->modargs = ma;
519
520 if ((alsa_card_index = snd_card_get_index(u->device_id)) < 0) {
521- pa_log("Card '%s' doesn't exist: %s", u->device_id, snd_strerror(alsa_card_index));
522+ pa_log("Card '%s' doesn't exist: %s", u->device_id, pa_alsa_strerror(alsa_card_index));
523 goto fail;
524 }
525
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/autoconf_version.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/autoconf_version.patch
new file mode 100644
index 0000000000..7a0759da13
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/autoconf_version.patch
@@ -0,0 +1,13 @@
1Index: pulseaudio-0.9.15/configure.ac
2===================================================================
3--- pulseaudio-0.9.15.orig/configure.ac 2009-04-14 00:09:53.000000000 +0100
4+++ pulseaudio-0.9.15/configure.ac 2009-05-22 11:32:50.000000000 +0100
5@@ -20,7 +20,7 @@
6 # along with PulseAudio; if not, write to the Free Software Foundation,
7 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
8
9-AC_PREREQ(2.63)
10+AC_PREREQ(2.61)
11
12 m4_define(pa_major, [0])
13 m4_define(pa_minor, [9])
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/buildfix.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/buildfix.patch
new file mode 100644
index 0000000000..ca01e0d80f
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/buildfix.patch
@@ -0,0 +1,13 @@
1Index: pulseaudio-0.9.11/src/pulsecore/atomic.h
2===================================================================
3--- pulseaudio-0.9.11.orig/src/pulsecore/atomic.h
4+++ pulseaudio-0.9.11/src/pulsecore/atomic.h
5@@ -40,6 +40,8 @@
6 #error "Please include config.h before including this file!"
7 #endif
8
9+#include "macro.h"
10+
11 #ifdef HAVE_ATOMIC_BUILTINS
12
13 /* __sync based implementation */
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/fallback.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/fallback.patch
new file mode 100644
index 0000000000..2fae0d4e78
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/fallback.patch
@@ -0,0 +1,338 @@
1From: Lennart Poettering <lennart@poettering.net>
2Date: Tue, 28 Apr 2009 23:58:18 +0000 (+0200)
3Subject: alsa: allow configuration of fallback device strings in profiles
4X-Git-Url: http://git.0pointer.de/?p=pulseaudio.git;a=commitdiff_plain;h=d8710711fb0c74b4ad83ac99c2501218155b502b
5
6alsa: allow configuration of fallback device strings in profiles
7
8This has the benefit that we can properly support ALSA devices where
9only the raw 'hw' device exists but no 'front' although it's a proper
102ch stereo device.
11---
12
13diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
14index 18d6880..a3a0450 100644
15--- a/src/modules/alsa/alsa-util.c
16+++ b/src/modules/alsa/alsa-util.c
17@@ -528,7 +528,7 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min) {
18
19 static const struct pa_alsa_profile_info device_table[] = {
20 {{ 1, { PA_CHANNEL_POSITION_MONO }},
21- "hw",
22+ "hw", NULL,
23 N_("Analog Mono"),
24 "analog-mono",
25 1,
26@@ -536,7 +536,7 @@ static const struct pa_alsa_profile_info device_table[] = {
27 "Capture", "Mic" },
28
29 {{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
30- "front",
31+ "front", "hw",
32 N_("Analog Stereo"),
33 "analog-stereo",
34 10,
35@@ -544,7 +544,7 @@ static const struct pa_alsa_profile_info device_table[] = {
36 "Capture", "Mic" },
37
38 {{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
39- "iec958",
40+ "iec958", NULL,
41 N_("Digital Stereo (IEC958)"),
42 "iec958-stereo",
43 5,
44@@ -552,7 +552,7 @@ static const struct pa_alsa_profile_info device_table[] = {
45 "IEC958 In", NULL },
46
47 {{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
48- "hdmi",
49+ "hdmi", NULL,
50 N_("Digital Stereo (HDMI)"),
51 "hdmi-stereo",
52 4,
53@@ -561,7 +561,7 @@ static const struct pa_alsa_profile_info device_table[] = {
54
55 {{ 4, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
56 PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT }},
57- "surround40",
58+ "surround40", NULL,
59 N_("Analog Surround 4.0"),
60 "analog-surround-40",
61 7,
62@@ -570,7 +570,7 @@ static const struct pa_alsa_profile_info device_table[] = {
63
64 {{ 4, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
65 PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT }},
66- "a52",
67+ "a52", NULL,
68 N_("Digital Surround 4.0 (IEC958/AC3)"),
69 "iec958-ac3-surround-40",
70 2,
71@@ -580,7 +580,7 @@ static const struct pa_alsa_profile_info device_table[] = {
72 {{ 5, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
73 PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
74 PA_CHANNEL_POSITION_LFE }},
75- "surround41",
76+ "surround41", NULL,
77 N_("Analog Surround 4.1"),
78 "analog-surround-41",
79 7,
80@@ -590,7 +590,7 @@ static const struct pa_alsa_profile_info device_table[] = {
81 {{ 5, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
82 PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
83 PA_CHANNEL_POSITION_CENTER }},
84- "surround50",
85+ "surround50", NULL,
86 N_("Analog Surround 5.0"),
87 "analog-surround-50",
88 7,
89@@ -600,7 +600,7 @@ static const struct pa_alsa_profile_info device_table[] = {
90 {{ 6, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
91 PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
92 PA_CHANNEL_POSITION_CENTER, PA_CHANNEL_POSITION_LFE }},
93- "surround51",
94+ "surround51", NULL,
95 N_("Analog Surround 5.1"),
96 "analog-surround-51",
97 8,
98@@ -610,7 +610,7 @@ static const struct pa_alsa_profile_info device_table[] = {
99 {{ 6, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
100 PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
101 PA_CHANNEL_POSITION_FRONT_CENTER, PA_CHANNEL_POSITION_LFE}},
102- "a52",
103+ "a52", NULL,
104 N_("Digital Surround 5.1 (IEC958/AC3)"),
105 "iec958-ac3-surround-51",
106 3,
107@@ -621,16 +621,72 @@ static const struct pa_alsa_profile_info device_table[] = {
108 PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
109 PA_CHANNEL_POSITION_CENTER, PA_CHANNEL_POSITION_LFE,
110 PA_CHANNEL_POSITION_SIDE_LEFT, PA_CHANNEL_POSITION_SIDE_RIGHT }},
111- "surround71",
112+ "surround71", NULL,
113 N_("Analog Surround 7.1"),
114 "analog-surround-71",
115 7,
116 "Master", "PCM",
117 "Capture", "Mic" },
118
119- {{ 0, { 0 }}, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL }
120+ {{ 0, { 0 }}, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL }
121 };
122
123+static snd_pcm_t *open_by_device_string_with_fallback(
124+ const char *prefix,
125+ const char *prefix_fallback,
126+ const char *dev_id,
127+ char **dev,
128+ pa_sample_spec *ss,
129+ pa_channel_map* map,
130+ int mode,
131+ uint32_t *nfrags,
132+ snd_pcm_uframes_t *period_size,
133+ snd_pcm_uframes_t tsched_size,
134+ pa_bool_t *use_mmap,
135+ pa_bool_t *use_tsched,
136+ pa_bool_t require_exact_channel_number) {
137+
138+ snd_pcm_t *pcm_handle;
139+ char *d;
140+
141+ d = pa_sprintf_malloc("%s:%s", prefix, dev_id);
142+
143+ pcm_handle = pa_alsa_open_by_device_string(
144+ d,
145+ dev,
146+ ss,
147+ map,
148+ mode,
149+ nfrags,
150+ period_size,
151+ tsched_size,
152+ use_mmap,
153+ use_tsched,
154+ require_exact_channel_number);
155+ pa_xfree(d);
156+
157+ if (!pcm_handle && prefix_fallback) {
158+
159+ d = pa_sprintf_malloc("%s:%s", prefix_fallback, dev_id);
160+
161+ pcm_handle = pa_alsa_open_by_device_string(
162+ d,
163+ dev,
164+ ss,
165+ map,
166+ mode,
167+ nfrags,
168+ period_size,
169+ tsched_size,
170+ use_mmap,
171+ use_tsched,
172+ require_exact_channel_number);
173+ pa_xfree(d);
174+ }
175+
176+ return pcm_handle;
177+}
178+
179 snd_pcm_t *pa_alsa_open_by_device_id_auto(
180 const char *dev_id,
181 char **dev,
182@@ -671,14 +727,14 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
183
184 pa_log_debug("Checking for %s (%s)", device_table[i].name, device_table[i].alsa_name);
185
186- d = pa_sprintf_malloc("%s:%s", device_table[i].alsa_name, dev_id);
187-
188 try_ss.channels = device_table[i].map.channels;
189 try_ss.rate = ss->rate;
190 try_ss.format = ss->format;
191
192- pcm_handle = pa_alsa_open_by_device_string(
193- d,
194+ pcm_handle = open_by_device_string_with_fallback(
195+ device_table[i].alsa_name,
196+ device_table[i].alsa_name_fallback,
197+ dev_id,
198 dev,
199 &try_ss,
200 map,
201@@ -690,8 +746,6 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
202 use_tsched,
203 TRUE);
204
205- pa_xfree(d);
206-
207 if (pcm_handle) {
208
209 *ss = try_ss;
210@@ -703,6 +757,7 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
211
212 return pcm_handle;
213 }
214+
215 }
216
217 if (direction > 0) {
218@@ -775,7 +830,6 @@ snd_pcm_t *pa_alsa_open_by_device_id_profile(
219 pa_bool_t *use_tsched,
220 const pa_alsa_profile_info *profile) {
221
222- char *d;
223 snd_pcm_t *pcm_handle;
224 pa_sample_spec try_ss;
225
226@@ -787,14 +841,14 @@ snd_pcm_t *pa_alsa_open_by_device_id_profile(
227 pa_assert(period_size);
228 pa_assert(profile);
229
230- d = pa_sprintf_malloc("%s:%s", profile->alsa_name, dev_id);
231-
232 try_ss.channels = profile->map.channels;
233 try_ss.rate = ss->rate;
234 try_ss.format = ss->format;
235
236- pcm_handle = pa_alsa_open_by_device_string(
237- d,
238+ pcm_handle = open_by_device_string_with_fallback(
239+ profile->alsa_name,
240+ profile->alsa_name_fallback,
241+ dev_id,
242 dev,
243 &try_ss,
244 map,
245@@ -806,8 +860,6 @@ snd_pcm_t *pa_alsa_open_by_device_id_profile(
246 use_tsched,
247 TRUE);
248
249- pa_xfree(d);
250-
251 if (!pcm_handle)
252 return NULL;
253
254@@ -860,6 +912,8 @@ snd_pcm_t *pa_alsa_open_by_device_string(
255 goto fail;
256 }
257
258+ pa_log_debug("Managed to open %s", d);
259+
260 if ((err = pa_alsa_set_hw_params(pcm_handle, ss, nfrags, period_size, tsched_size, use_mmap, use_tsched, require_exact_channel_number)) < 0) {
261
262 if (!reformat) {
263@@ -928,26 +982,25 @@ int pa_alsa_probe_profiles(
264 snd_pcm_t *pcm_i = NULL;
265
266 if (i->alsa_name) {
267- char *id;
268 pa_sample_spec try_ss;
269 pa_channel_map try_map;
270
271 pa_log_debug("Checking for playback on %s (%s)", i->name, i->alsa_name);
272- id = pa_sprintf_malloc("%s:%s", i->alsa_name, dev_id);
273
274 try_ss = *ss;
275 try_ss.channels = i->map.channels;
276 try_map = i->map;
277
278- pcm_i = pa_alsa_open_by_device_string(
279- id, NULL,
280+ pcm_i = open_by_device_string_with_fallback(
281+ i->alsa_name,
282+ i->alsa_name_fallback,
283+ dev_id,
284+ NULL,
285 &try_ss, &try_map,
286 SND_PCM_STREAM_PLAYBACK,
287 NULL, NULL, 0, NULL, NULL,
288 TRUE);
289
290- pa_xfree(id);
291-
292 if (!pcm_i)
293 continue;
294 }
295@@ -956,26 +1009,25 @@ int pa_alsa_probe_profiles(
296 snd_pcm_t *pcm_j = NULL;
297
298 if (j->alsa_name) {
299- char *jd;
300 pa_sample_spec try_ss;
301 pa_channel_map try_map;
302
303 pa_log_debug("Checking for capture on %s (%s)", j->name, j->alsa_name);
304- jd = pa_sprintf_malloc("%s:%s", j->alsa_name, dev_id);
305
306 try_ss = *ss;
307 try_ss.channels = j->map.channels;
308 try_map = j->map;
309
310- pcm_j = pa_alsa_open_by_device_string(
311- jd, NULL,
312+ pcm_j = open_by_device_string_with_fallback(
313+ j->alsa_name,
314+ j->alsa_name_fallback,
315+ dev_id,
316+ NULL,
317 &try_ss, &try_map,
318 SND_PCM_STREAM_CAPTURE,
319 NULL, NULL, 0, NULL, NULL,
320 TRUE);
321
322- pa_xfree(jd);
323-
324 if (!pcm_j)
325 continue;
326 }
327diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
328index 77ac8a7..4c5d336 100644
329--- a/src/modules/alsa/alsa-util.h
330+++ b/src/modules/alsa/alsa-util.h
331@@ -56,6 +56,7 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min);
332 typedef struct pa_alsa_profile_info {
333 pa_channel_map map;
334 const char *alsa_name;
335+ const char *alsa_name_fallback;
336 const char *description; /* internationalized */
337 const char *name;
338 unsigned priority;
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/gcc4-compile-fix.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/gcc4-compile-fix.patch
new file mode 100644
index 0000000000..34ad026e4d
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/gcc4-compile-fix.patch
@@ -0,0 +1,18 @@
1| fix for more strict syntax compliance in gcc4.x
2| pulsecore/core-util.c: In function 'pa_raise_priority':
3| pulsecore/core-util.c:547: error: label at end of compound statement
4| Signed off: mickey@openmoko.org
5|
6Index: pulseaudio-0.9.6/src/pulsecore/core-util.c
7===================================================================
8--- pulseaudio-0.9.6.orig/src/pulsecore/core-util.c
9+++ pulseaudio-0.9.6/src/pulsecore/core-util.c
10@@ -535,7 +535,7 @@ void pa_raise_priority(void) {
11 pa_log_info("Successfully gained high priority class.");
12 #endif
13
14-fail:
15+fail:;
16
17 #if defined(HAVE_SYS_CAPABILITY_H)
18 if (caps) {
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/periodfix.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/periodfix.patch
new file mode 100644
index 0000000000..3a1c605009
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/periodfix.patch
@@ -0,0 +1,73 @@
1X-Git-Url: http://git.0pointer.de/?p=pulseaudio.git;a=blobdiff_plain;f=src%2Fmodules%2Falsa%2Falsa-util.c;h=107bec357c7889f0197853f5e5f1951a5a2f5be0;hp=a3a045080dac0e1b30e8671443ce73a03337cf14;hb=4bffc7849f7898fa85dd6ac8e735db86b57814b3;hpb=d2b5ae5525e9036c4f91b1615879a5a07aac5bf2
2
3diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
4index a3a0450..107bec3 100644
5--- a/src/modules/alsa/alsa-util.c
6+++ b/src/modules/alsa/alsa-util.c
7@@ -334,7 +334,6 @@ int pa_alsa_set_hw_params(
8 int ret = -1;
9 snd_pcm_uframes_t _period_size = period_size ? *period_size : 0;
10 unsigned int _periods = periods ? *periods : 0;
11- snd_pcm_uframes_t buffer_size;
12 unsigned int r = ss->rate;
13 unsigned int c = ss->channels;
14 pa_sample_format_t f = ss->format;
15@@ -390,39 +389,47 @@ int pa_alsa_set_hw_params(
16 goto finish;
17
18 if (_period_size && tsched_size && _periods) {
19+
20 /* Adjust the buffer sizes, if we didn't get the rate we were asking for */
21 _period_size = (snd_pcm_uframes_t) (((uint64_t) _period_size * r) / ss->rate);
22 tsched_size = (snd_pcm_uframes_t) (((uint64_t) tsched_size * r) / ss->rate);
23
24 if (_use_tsched) {
25- _period_size = tsched_size;
26- _periods = 1;
27+ snd_pcm_uframes_t buffer_size;
28
29 pa_assert_se(snd_pcm_hw_params_get_buffer_size_max(hwparams, &buffer_size) == 0);
30 pa_log_debug("Maximum hw buffer size is %u ms", (unsigned) buffer_size * 1000 / r);
31+
32+ _period_size = tsched_size;
33+ _periods = 1;
34 }
35
36+ if (_period_size > 0 && _periods > 0) {
37+ snd_pcm_uframes_t buffer_size;
38+
39 buffer_size = _periods * _period_size;
40
41+ if ((ret = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &buffer_size)) < 0)
42+ pa_log_info("snd_pcm_hw_params_set_buffer_size_near() failed: %s", pa_alsa_strerror(ret));
43+ }
44+
45 if (_periods > 0) {
46
47- /* First we pass 0 as direction to get exactly what we asked
48- * for. That this is necessary is presumably a bug in ALSA */
49+ /* First we pass 0 as direction to get exactly what we
50+ * asked for. That this is necessary is presumably a bug
51+ * in ALSA. All in all this is mostly a hint to ALSA, so
52+ * we don't care if this fails. */
53
54 dir = 0;
55- if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0) {
56+ if (snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir) < 0) {
57 dir = 1;
58- if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0) {
59+ if (snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir) < 0) {
60 dir = -1;
61 if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0)
62- goto finish;
63+ pa_log_info("snd_pcm_hw_params_set_periods_near() failed: %s", pa_alsa_strerror(ret));
64 }
65 }
66 }
67-
68- if (_period_size > 0)
69- if ((ret = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &buffer_size)) < 0)
70- goto finish;
71 }
72
73 if ((ret = snd_pcm_hw_params(pcm_handle, hwparams)) < 0)
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/volatiles.04_pulse b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/volatiles.04_pulse
new file mode 100644
index 0000000000..5b1998032b
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/volatiles.04_pulse
@@ -0,0 +1,2 @@
1# <type> <owner> <group> <mode> <path> <linksource>
2d pulse pulse 0755 /var/run/pulse none
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio.inc b/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
new file mode 100644
index 0000000000..fd8e60c471
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
@@ -0,0 +1,126 @@
1DESCRIPTION = "Pulseaudio is a sound server for Linux and Unix-like operating systems."
2HOMEPAGE = "http://www.pulseaudio.org"
3AUTHOR = "Lennart Poettering"
4SECTION = "libs/multimedia"
5LICENSE = "LGPL"
6DEPENDS = "libatomics-ops liboil avahi libsamplerate0 libsndfile1 libtool hal virtual/libx11"
7# optional
8DEPENDS += "alsa-lib glib-2.0 dbus consolekit hal"
9
10SRC_URI = "http://0pointer.de/lennart/projects/pulseaudio/pulseaudio-${PV}.tar.gz \
11 file://gcc4-compile-fix.patch;patch=1 \
12 file://volatiles.04_pulse"
13
14inherit autotools pkgconfig
15
16EXTRA_OECONF = "\
17 --disable-lynx \
18 --disable-bluez \
19 --disable-polkit \
20 --with-x \
21 --without-jack \
22 --with-glib \
23 --with-alsa \
24 --with-oss \
25 --with-hal \
26"
27
28PARALLEL_MAKE = ""
29
30export TARGET_PFPU = "${TARGET_FPU}"
31
32# TODO: Use more fine granular version
33#OE_LT_RPATH_ALLOW=":${libdir}/pulse-0.9:"
34OE_LT_RPATH_ALLOW = "any"
35OE_LT_RPATH_ALLOW[export]="1"
36
37do_install_append() {
38 install -d ${D}${sysconfdir}/default/volatiles
39 install -m 0644 ${WORKDIR}/volatiles.04_pulse ${D}${sysconfdir}/default/volatiles/volatiles.04_pulse
40
41 if [ "x${TARGET_PFPU}" == "xsoft" ] ; then
42 sed -i -e s:\;\ resample-method\ =\ sinc-fastest:resample-method\ =\ trivial: ${D}${sysconfdir}/pulse/daemon.conf
43 fi
44}
45
46PACKAGES =+ "libpulsecore libpulsecommon libpulsedsp libpulse libpulse-simple libpulse-browse libpulse-mainloop-glib \
47 pulseaudio-server pulseaudio-misc pulseaudio-gconf-helper"
48
49#upgrade path:
50RREPLACES_pulseaudio-server = "libpulse-bin libpulse-conf"
51
52PACKAGES_DYNAMIC = "pulseaudio-lib* pulseaudio-module* libpulse-lib* libpulse-module* "
53
54FILES_libpulsecore = "${libdir}/libpulsecore*.so"
55FILES_libpulsecommon = "${libdir}/libpulsecommon*.so"
56FILES_libpulsedsp = "${libdir}/libpulsedsp*.so"
57FILES_libpulse = "${libdir}/libpulse.so.*"
58FILES_libpulse-simple = "${libdir}/libpulse-simple.so.*"
59FILES_libpulse-browse = "${libdir}/libpulse-browse.so.*"
60FILES_libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*"
61
62FILES_${PN}-dbg += "${libexecdir}/pulse/.debug \
63 ${libdir}/pulse-${PV}/modules/.debug"
64FILES_${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la"
65FILES_${PN}-conf = "${sysconfdir}"
66FILES_${PN}-bin = "${bindir}/* \
67 ${sysconfdir}/default/volatiles/volatiles.04_pulse"
68FILES_${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl"
69FILES_${PN}-gconf-helper = "${libexecdir}/pulse/gconf-helper"
70FILES_${PN}-misc = "${bindir}/*"
71
72# Allow the pulseaudio package to be created empty as a placeholder (-dbg and -dev depend on it)
73ALLOW_EMPTY_${PN} = "1"
74
75CONFFILES_pulseaudio-server = "\
76 ${sysconfdir}/pulse/default.pa \
77 ${sysconfdir}/pulse/daemon.conf \
78 ${sysconfdir}/pulse/client.conf \
79 "
80
81pkg_postinst_${PN}-server() {
82 # can't do this offline
83 if [ "x$D" != "x" ]; then
84 exit 1
85 fi
86 grep -q pulse: /etc/group || addgroup pulse
87 grep -q pulse: /etc/passwd || \
88 adduser --disabled-password --home=/var/run/pulse --system \
89 --ingroup pulse --no-create-home -g "Pulse audio daemon" pulse
90 addgroup pulse audio
91 /etc/init.d/populate-volatile.sh update
92}
93
94pkg_postrm_${PN}-server() {
95 deluser pulse || true
96}
97
98python populate_packages_prepend() {
99 #bb.data.setVar('PKG_pulseaudio', 'pulseaudio', d)
100
101 plugindir = bb.data.expand('${libdir}/pulse-${PV}/modules/', d)
102 do_split_packages(d, plugindir, '^module-(.*)\.so$', 'pulseaudio-module-%s', 'PulseAudio module for %s', extra_depends='' )
103 do_split_packages(d, plugindir, '^lib(.*)\.so$', 'pulseaudio-lib-%s', 'PulseAudio library for %s', extra_depends='' )
104}
105
106RDEPENDS_pulseaudio-module-console-kit =+ "consolekit"
107RDEPENDS_pulseaudio-module-hal-detect =+ "hal"
108RDEPENDS_pulseaudio-server = " \
109 pulseaudio-module-device-restore \
110 pulseaudio-module-stream-restore \
111 pulseaudio-module-card-restore \
112 pulseaudio-module-augment-properties \
113 pulseaudio-module-detect \
114 pulseaudio-module-alsa-sink \
115 pulseaudio-module-alsa-source \
116 pulseaudio-module-alsa-card \
117 pulseaudio-module-native-protocol-unix \
118 pulseaudio-module-hal-detect \
119 pulseaudio-module-default-device-restore \
120 pulseaudio-module-rescue-streams \
121 pulseaudio-module-always-sink \
122 pulseaudio-module-suspend-on-idle \
123 pulseaudio-module-console-kit \
124 pulseaudio-module-position-event-sounds \
125 pulseaudio-module-cork-music-on-phone "
126
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_0.9.15.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_0.9.15.bb
new file mode 100644
index 0000000000..49387ece83
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_0.9.15.bb
@@ -0,0 +1,18 @@
1require pulseaudio.inc
2
3DEPENDS += "dbus gdbm speex"
4PR = "r14"
5
6SRC_URI += "\
7 file://buildfix.patch;patch=1 \
8 file://alsaerror.patch;patch=1 \
9 file://periodfix.patch;patch=1 \
10 file://fallback.patch;patch=1 \
11 file://autoconf_version.patch;patch=1 \
12"
13
14do_compile_prepend() {
15 cd ${S}
16 mkdir -p ${S}/libltdl
17 cp ${STAGING_LIBDIR}/libltdl* ${S}/libltdl
18}