Re: [pulseaudio-discuss] [PATCH] modules: Disable timer scheduling for a2dp playback to reduce power consumption.

2014-08-04 Thread Sajeesh Sidharthan
Title: Samsung Enterprise Portal mySingle


Hi,
I have disabled timer scheduling for a2dp playback with this patch to reduce power consumption.
Could you please review this change and let me know if it can cause any side effect.
If its worth giving an option to disable timer scheduling similar to alsa-sink ( tsched param ), I would like to do the same.
Thank You.
Sajeesh
 
--- Original Message ---
Sender : Sajeesh Sidharthan Chief Engineer/SRI-Bangalore-MM & Applications/Samsung Electronics
Date : Aug 05, 2014 14:35 (GMT+09:00)
Title : [pulseaudio-discuss] [PATCH] modules: Disable timer scheduling for a2dp playback to reduce power consumption.
 ---src/modules/bluetooth/module-bluez5-device.c |8 1 file changed, 4 insertions(+), 4 deletions(-)diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.cindex 57b2791..eda7a9d 100644--- a/src/modules/bluetooth/module-bluez5-device.c+++ b/src/modules/bluetooth/module-bluez5-device.c@@ -1170,10 +1170,10 @@ static void thread_func(void *userdata) { a2dp_reduce_bitpool(u); } }--do_write = 1;-pending_read_bytes = 0; }++do_write = 1;+pending_read_bytes = 0; } if (writable && do_write > 0) {@@ -1208,7 +1208,7 @@ static void thread_func(void *userdata) { sleep_for = PA_USEC_PER_MSEC * 500; pa_rtpoll_set_timer_relative(u->rtpoll, sleep_for);-disable_timer = false;+/* disable_timer = false; *//* Disable timer to reduce power consumption */ } } }-- 1.7.9.5___pulseaudio-discuss mailing listpulseaudio-discuss@lists.freedesktop.orghttp://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
 
 




___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] modules: Disable timer scheduling for a2dp playback to reduce power consumption.

2014-08-04 Thread Sajeesh Sidharthan
---
 src/modules/bluetooth/module-bluez5-device.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/modules/bluetooth/module-bluez5-device.c 
b/src/modules/bluetooth/module-bluez5-device.c
index 57b2791..eda7a9d 100644
--- a/src/modules/bluetooth/module-bluez5-device.c
+++ b/src/modules/bluetooth/module-bluez5-device.c
@@ -1170,10 +1170,10 @@ static void thread_func(void *userdata) {
 a2dp_reduce_bitpool(u);
 }
 }
-
-do_write = 1;
-pending_read_bytes = 0;
 }
+
+do_write = 1;
+pending_read_bytes = 0;
 }
 
 if (writable && do_write > 0) {
@@ -1208,7 +1208,7 @@ static void thread_func(void *userdata) {
 sleep_for = PA_USEC_PER_MSEC * 500;
 
 pa_rtpoll_set_timer_relative(u->rtpoll, sleep_for);
-disable_timer = false;
+/* disable_timer = false; *//* Disable timer to reduce 
power consumption */
 }
 }
 }
-- 
1.7.9.5

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] core: Closing proper file descriptor when pipe creation fails.

2014-08-04 Thread Sajeesh Sidharthan
Title: Samsung Enterprise Portal mySingle


Hi Arun,
This is the first time I have submitted a patch to open source.
Could you please let me know if I have to do anything further if the change is acceptable?
Thank You.
Sajeesh
 
--- Original Message ---
Sender : Arun Raghavan
Date : Aug 04, 2014 17:42 (GMT+09:00)
Title : Re: [pulseaudio-discuss] [PATCH] core: Closing proper file descriptor when pipe creation fails.
 On Mon, 2014-08-04 at 14:32 +0530, Sajeesh Sidharthan wrote:> --->  src/pulsecore/pipe.c |2 +->  1 file changed, 1 insertion(+), 1 deletion(-)> > diff --git a/src/pulsecore/pipe.c b/src/pulsecore/pipe.c> index f873ef6..4e3c0c3 100644> --- a/src/pulsecore/pipe.c> +++ b/src/pulsecore/pipe.c> @@ -149,7 +149,7 @@ error:>  if (filedes[0] >= 0)>  pa_close(filedes[0]);>  if (filedes[1] >= 0)> -pa_close(filedes[0]);> +pa_close(filedes[1]);>  >  return -1;>  }I've pulled this now. Thanks for the patch!-- Arun___pulseaudio-discuss mailing listpulseaudio-discuss@lists.freedesktop.orghttp://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
 
 




___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Pulseaudio 5.0 compilation error: ./.libs/libpulse.so: undefined reference to `is_error'

2014-08-04 Thread Dâniel Fraga
On Mon, 4 Aug 2014 22:54:38 -0300
Dâniel Fraga  wrote:

> /home/fraga/src/pulseaudio-5.0/src/.libs/libpulse.so: undefined reference to 
> `is_error'

Ok, it seems Pulseaudio 5.0 won't compile with latest Json-c,
so I've to add a deprecated header file in src/pulse/format.c:

#include 

A possible workaround in case someone gets the same error.

-- 
Linux 3.16.0-00115-g19583ca: Shuffling Zombie Juror
http://www.youtube.com/DanielFragaBR
http://exchangewar.info
Bitcoin: 12H6661yoLDUZaYPdah6urZS5WiXwTAUgL


___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] Pulseaudio 5.0 compilation error: ./.libs/libpulse.so: undefined reference to `is_error'

2014-08-04 Thread Dâniel Fraga
I'm trying to compile Pulseaudio 5.0 with gcc 4.9.1 and I get
the following:

libtool: link: gcc -std=gnu99 -pthread 
-DPA_SRCDIR=\"/home/fraga/src/pulseaudio-5.0/src\" 
-DPA_BUILDDIR=\"/home/fraga/src/pulseaudio-5.0/src\" 
-I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -march=native 
-O3 -pipe -floop-interchange -floop-strip-mine -floop-block -Wall -W -Wextra 
-Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef 
-Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs 
-Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement 
-Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations 
-Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing 
-Wwrite-strings -Wno-unused-parameter -ffast-math -fno-common 
-fdiagnostics-show-option -Wl,-z -Wl,nodelete -Wl,-z -Wl,now 
.libs/pulseaudioS.o -o .libs/pulseaudio daemon/pulseaudio-caps.o 
daemon/pulseaudio-cmdline.o daemon/pulseaudio-cpulimit.o 
daemon/pulseaudio-daemon-conf.o daemon/pulseaudio-dumpmodules.o daemon/p
 ulseaudio-ltdl-bind-now.o daemon/pulseaudio-main.o 
daemon/pulseaudio-server-lookup.o -Wl,--export-dynamic  -L/usr/local/ssl/lib 
-L/usr/local/BerkeleyDB/lib -L/usr/X11/lib -L/usr/local/lib64 
./.libs/libpulsecore-5.0.so -L/usr/xorg/lib -L/usr/local/lib -L/usr/lib64 
/usr/local/lib/libsamplerate.so /usr/local/lib/libspeexdsp.so 
/home/fraga/src/pulseaudio-5.0/src/.libs/libpulse.so 
/usr/local/lib/liborc-0.4.so ./.libs/libpulsecommon-5.0.so ./.libs/libpulse.so 
/home/fraga/src/pulseaudio-5.0/src/.libs/libpulsecommon-5.0.so 
/usr/xorg/lib/libX11-xcb.so /usr/xorg/lib/libSM.so /usr/xorg/lib/libICE.so 
/usr/lib64/libuuid.so /usr/xorg/lib/libXtst.so /usr/xorg/lib/libXi.so 
/usr/xorg/lib/libXext.so /usr/xorg/lib/libX11.so /usr/xorg/lib/libxcb.so 
/usr/xorg/lib/libXau.so /usr/xorg/lib/libXdmcp.so 
/usr/lib64/libsystemd-journal.so /usr/local/lib/liblzma.so 
/usr/local/lib/libgcrypt.so /usr/local/lib/libgpg-error.so 
/usr/lib64/libsystemd-id128.so /usr/local/lib/libjson-c.so 
/usr/local/lib/libsndfile.so /u
 sr/local/lib/libltdl.so /usr/local/lib/libdbus-1.so /usr/local/lib/libgdbm.so 
-lcap -lpthread -lrt -ldl -lm -pthread -Wl,-rpath -Wl,/usr/local/lib/pulseaudio 
-Wl,-rpath -Wl,/usr/xorg/lib
/home/fraga/src/pulseaudio-5.0/src/.libs/libpulse.so: undefined reference to 
`is_error'
collect2: error: ld returned 1 exit status
Makefile:6365: recipe for target 'pulseaudio' failed
make[3]: *** [pulseaudio] Error 1
make[3]: Leaving directory '/home/fraga/src/pulseaudio-5.0/src'
Makefile:4655: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/fraga/src/pulseaudio-5.0/src'
Makefile:756: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/fraga/src/pulseaudio-5.0'
Makefile:591: recipe for target 'all' failed
make: *** [all] Error 2

***

Any hints? Thanks.

-- 
Linux 3.16.0-00115-g19583ca: Shuffling Zombie Juror
http://www.youtube.com/DanielFragaBR
http://exchangewar.info
Bitcoin: 12H6661yoLDUZaYPdah6urZS5WiXwTAUgL


___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] sink-input, source-output: Assign to reference_ratio from a single place

2014-08-04 Thread Tanu Kaskinen
This makes it easy to log a message every time the reference ratio
changes. I also need to add a hook for reference ratio changes, but
that need will go away if the stream relative volume controls will be
created by the core in the future.
---
 src/pulsecore/sink-input.c| 28 ++--
 src/pulsecore/sink-input.h|  6 ++
 src/pulsecore/sink.c  | 11 +++
 src/pulsecore/source-output.c | 26 +-
 src/pulsecore/source-output.h |  6 ++
 src/pulsecore/source.c| 11 +++
 6 files changed, 77 insertions(+), 11 deletions(-)

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 6169d47..b9698b9 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1273,7 +1273,7 @@ void pa_sink_input_set_volume(pa_sink_input *i, const 
pa_cvolume *volume, bool s
 /* OK, we are in normal volume mode. The volume only affects
  * ourselves */
 set_real_ratio(i, volume);
-i->reference_ratio = i->volume;
+pa_sink_input_set_reference_ratio(i, &i->volume);
 
 /* Copy the new soft_volume to the thread_info struct */
 pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), 
PA_SINK_INPUT_MESSAGE_SET_SOFT_VOLUME, NULL, 0, NULL) == 0);
@@ -1673,7 +1673,7 @@ static void update_volume_due_to_moving(pa_sink_input *i, 
pa_sink *dest) {
 
 pa_cvolume_reset(&new_volume, i->volume.channels);
 pa_sink_input_set_volume_direct(i, &new_volume);
-pa_cvolume_reset(&i->reference_ratio, i->reference_ratio.channels);
+pa_sink_input_set_reference_ratio(i, &new_volume);
 pa_assert(pa_cvolume_is_norm(&i->real_ratio));
 pa_assert(pa_cvolume_equal(&i->soft_volume, &i->volume_factor));
 }
@@ -2238,3 +2238,27 @@ void pa_sink_input_set_volume_direct(pa_sink_input *i, 
const pa_cvolume *volume)
 pa_subscription_post(i->core, 
PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
 pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_VOLUME_CHANGED], i);
 }
+
+/* Called from the main thread. */
+void pa_sink_input_set_reference_ratio(pa_sink_input *i, const pa_cvolume 
*ratio) {
+pa_cvolume old_ratio;
+char old_ratio_str[PA_CVOLUME_SNPRINT_VERBOSE_MAX];
+char new_ratio_str[PA_CVOLUME_SNPRINT_VERBOSE_MAX];
+
+pa_assert(i);
+pa_assert(ratio);
+
+old_ratio = i->reference_ratio;
+
+if (pa_cvolume_equal(ratio, &old_ratio))
+return;
+
+i->reference_ratio = *ratio;
+
+if (!PA_SINK_INPUT_IS_LINKED(i->state))
+return;
+
+pa_log_debug("Sink input %u reference ratio changed from %s to %s.", 
i->index,
+ pa_cvolume_snprint_verbose(old_ratio_str, 
sizeof(old_ratio_str), &old_ratio, &i->channel_map, true),
+ pa_cvolume_snprint_verbose(new_ratio_str, 
sizeof(new_ratio_str), ratio, &i->channel_map, true));
+}
diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
index a48476c..15f9315 100644
--- a/src/pulsecore/sink-input.h
+++ b/src/pulsecore/sink-input.h
@@ -423,6 +423,12 @@ pa_memchunk* pa_sink_input_get_silence(pa_sink_input *i, 
pa_memchunk *ret);
  * and fires change notifications. */
 void pa_sink_input_set_volume_direct(pa_sink_input *i, const pa_cvolume 
*volume);
 
+/* Called from the main thread, from sink.c only. This shouldn't be a public
+ * function, but the flat volume logic in sink.c currently needs a way to
+ * directly set the sink input reference ratio. This function simply sets
+ * i->reference_ratio and logs a message if the value changes. */
+void pa_sink_input_set_reference_ratio(pa_sink_input *i, const pa_cvolume 
*ratio);
+
 #define pa_sink_input_assert_io_context(s) \
 pa_assert(pa_thread_mq_get() || !PA_SINK_INPUT_IS_LINKED((s)->state))
 
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index ccf6ea1..274fe83 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1610,6 +1610,7 @@ void pa_sink_leave_passthrough(pa_sink *s) {
 static void compute_reference_ratio(pa_sink_input *i) {
 unsigned c = 0;
 pa_cvolume remapped;
+pa_cvolume ratio;
 
 pa_assert(i);
 pa_assert(pa_sink_flat_volume_enabled(i->sink));
@@ -1624,7 +1625,7 @@ static void compute_reference_ratio(pa_sink_input *i) {
 remapped = i->sink->reference_volume;
 pa_cvolume_remap(&remapped, &i->sink->channel_map, &i->channel_map);
 
-i->reference_ratio.channels = i->sample_spec.channels;
+ratio = i->reference_ratio;
 
 for (c = 0; c < i->sample_spec.channels; c++) {
 
@@ -1634,14 +1635,16 @@ static void compute_reference_ratio(pa_sink_input *i) {
 
 /* Don't update the reference ratio unless necessary */
 if (pa_sw_volume_multiply(
-i->reference_ratio.values[c],
+ratio.values[c],
 remapped.values[c]) == i->volume.values[c])
 continue;
 
-i->refer

Re: [pulseaudio-discuss] [PATCH 1/3] resampler: Split the resampler implementations into separate files

2014-08-04 Thread Alexander E. Patrakov

04.08.2014 18:40, Peter Meerwald wrote:

  static bool speex_is_fixed_point(void) {


I am of the mixed opinion on the fact that this function is not moved to 
speex.c. The patch subjectively feels incomplete because of that - but 
this function is special due to the fact that it also has to exist (as a 
stub) even without speex.  Maybe it indeed should not be moved, maybe it 
should be moved and a stub has to be created then in resampler.h.


Other than that, the patch looks good.

--
Alexander E. Patrakov
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] sconv: Use optimized conversion function for both directions

2014-08-04 Thread Peter Meerwald
From: Peter Meerwald 

for example, the conversion function for
convert_from_float32ne(PA_SAMPLE_S16LE) can also be used for
convert_to_s16ne(PA_SAMPLE_FLOAT32LE)

v2: ARM can potentially be big- or little endian; only apply
optimization on LE based on WORDS_BIGENDIAN #define (thanks, Tanu)

Signed-off-by: Peter Meerwald 
---
 src/pulsecore/sconv_neon.c |4 
 src/pulsecore/sconv_sse.c  |3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/pulsecore/sconv_neon.c b/src/pulsecore/sconv_neon.c
index 6c2a2b3..11d94d2 100644
--- a/src/pulsecore/sconv_neon.c
+++ b/src/pulsecore/sconv_neon.c
@@ -89,4 +89,8 @@ void pa_convert_func_init_neon(pa_cpu_arm_flag_t flags) {
 pa_log_info("Initialising ARM NEON optimized conversions.");
 pa_set_convert_from_float32ne_function(PA_SAMPLE_S16LE, 
(pa_convert_func_t) pa_sconv_s16le_from_f32ne_neon);
 pa_set_convert_to_float32ne_function(PA_SAMPLE_S16LE, (pa_convert_func_t) 
pa_sconv_s16le_to_f32ne_neon);
+#ifndef WORDS_BIGENDIAN
+pa_set_convert_from_s16ne_function(PA_SAMPLE_FLOAT32LE, 
(pa_convert_func_t) pa_sconv_s16le_to_f32ne_neon);
+pa_set_convert_to_s16ne_function(PA_SAMPLE_FLOAT32LE, (pa_convert_func_t) 
pa_sconv_s16le_from_f32ne_neon);
+#endif
 }
diff --git a/src/pulsecore/sconv_sse.c b/src/pulsecore/sconv_sse.c
index 10943ba..9cfb9d9 100644
--- a/src/pulsecore/sconv_sse.c
+++ b/src/pulsecore/sconv_sse.c
@@ -168,10 +168,11 @@ void pa_convert_func_init_sse(pa_cpu_x86_flag_t flags) {
 if (flags & PA_CPU_X86_SSE2) {
 pa_log_info("Initialising SSE2 optimized conversions.");
 pa_set_convert_from_float32ne_function(PA_SAMPLE_S16LE, 
(pa_convert_func_t) pa_sconv_s16le_from_f32ne_sse2);
-
+pa_set_convert_to_s16ne_function(PA_SAMPLE_FLOAT32LE, 
(pa_convert_func_t) pa_sconv_s16le_from_f32ne_sse2);
 } else if (flags & PA_CPU_X86_SSE) {
 pa_log_info("Initialising SSE optimized conversions.");
 pa_set_convert_from_float32ne_function(PA_SAMPLE_S16LE, 
(pa_convert_func_t) pa_sconv_s16le_from_f32ne_sse);
+pa_set_convert_to_s16ne_function(PA_SAMPLE_FLOAT32LE, 
(pa_convert_func_t) pa_sconv_s16le_from_f32ne_sse);
 }
 
 #endif /* defined (__i386__) || defined (__amd64__) */
-- 
1.7.9.5

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] remap: Add 4-channel to mono channel rearrangement

2014-08-04 Thread Peter Meerwald
From: Peter Meerwald 

Signed-off-by: Peter Meerwald 
---
 src/pulsecore/remap.c |   36 +++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/src/pulsecore/remap.c b/src/pulsecore/remap.c
index 37213d5..09d4837 100644
--- a/src/pulsecore/remap.c
+++ b/src/pulsecore/remap.c
@@ -239,9 +239,12 @@ static void remap_channels_matrix_float32ne_c(pa_remap_t 
*m, float *dst, const f
 }
 }
 
+/* Produce an array containing input channel indices to map to output channels.
+ * If the output channel is empty, the array element is -1. */
 bool pa_setup_remap_arrange(const pa_remap_t *m, int8_t 
arrange[PA_CHANNELS_MAX]) {
 unsigned ic, oc;
 unsigned n_ic, n_oc;
+unsigned count_output = 0;
 
 pa_assert(m);
 
@@ -262,10 +265,22 @@ bool pa_setup_remap_arrange(const pa_remap_t *m, int8_t 
arrange[PA_CHANNELS_MAX]
 return false;
 
 arrange[oc] = ic;
+count_output++;
 }
 }
 
-return true;
+return count_output > 0;
+}
+
+static void remap_arrange_mono_s16ne_c(pa_remap_t *m, int16_t *dst, const 
int16_t *src, unsigned n) {
+const unsigned n_ic = m->i_ss.channels;
+const int8_t *arrange = m->state;
+
+src += arrange[0];
+for (; n > 0; n--) {
+*dst++ = *src;
+src += n_ic;
+}
 }
 
 static void remap_arrange_stereo_s16ne_c(pa_remap_t *m, int16_t *dst, const 
int16_t *src, unsigned n) {
@@ -295,6 +310,17 @@ static void remap_arrange_ch4_s16ne_c(pa_remap_t *m, 
int16_t *dst, const int16_t
 }
 }
 
+static void remap_arrange_mono_float32ne_c(pa_remap_t *m, float *dst, const 
float *src, unsigned n) {
+const unsigned n_ic = m->i_ss.channels;
+const int8_t *arrange = m->state;
+
+src += arrange[0];
+for (; n > 0; n--) {
+*dst++ = *src;
+src += n_ic;
+}
+}
+
 static void remap_arrange_stereo_float32ne_c(pa_remap_t *m, float *dst, const 
float *src, unsigned n) {
 const unsigned n_ic = m->i_ss.channels;
 const int8_t *arrange = m->state;
@@ -370,6 +396,14 @@ static void init_remap_c(pa_remap_t *m) {
 pa_log_info("Using 4-channel to mono remapping");
 pa_set_remap_func(m, (pa_do_remap_func_t) remap_ch4_to_mono_s16ne_c,
 (pa_do_remap_func_t) remap_ch4_to_mono_float32ne_c);
+} else if (pa_setup_remap_arrange(m, arrange) && n_oc == 1) {
+
+pa_log_info("Using mono arrange remapping");
+pa_set_remap_func(m, (pa_do_remap_func_t) remap_arrange_mono_s16ne_c,
+(pa_do_remap_func_t) remap_arrange_mono_float32ne_c);
+
+/* setup state */
+m->state = pa_xnewdup(int8_t, arrange, PA_CHANNELS_MAX);
 } else if (pa_setup_remap_arrange(m, arrange) && n_oc == 2) {
 
 pa_log_info("Using stereo arrange remapping");
-- 
1.7.9.5

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Pulseaudio test suite failures

2014-08-04 Thread Felipe Sateler
On Mon, Aug 4, 2014 at 11:55 AM, Peter Meerwald  wrote:
>> > posted here
>> > http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021051.html
>>
>> Still failing on powerpc and s390x.
>
> do you have the link to the build bot?
> that was rather helpful last time

No, I don't. I ran these on the porterboxes, not on the build farm.
I'll schedule a build tonight on the build farm.

>>
>> I'm also getting this (after disabling timeouts) on powerpc:
>>
>> tests/once-test.c:74:F:once:once_test:0: Assertion
>> 'pthread_setaffinity_np(pthread_self(), sizeof(mask), &mask) == 0'
>> failed
>
> hm
>
>> >
>> > and here
>> > http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021053.html
>>
>> I haven't tested that yet. I did also apply this patch to build
>> correctly on kFreeBSD:
>>
>> http://anonscm.debian.org/cgit/pkg-pulseaudio/pulseaudio.git/tree/debian/patches/gnu-kfreebsd.patch
>
> I disagree with the patch; why should the SSE optimizations be disabled
> when running a FreeBSD kernel?

I don't really know. I just mimicked commit b0a04d8031f9ef, which does
not give much info, unfortunately. I presumed the problem was with the
kernel and not the compiler, but of course I could be wrong.


-- 

Saludos,
Felipe Sateler
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Pulseaudio test suite failures

2014-08-04 Thread Peter Meerwald
> > posted here
> > http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021051.html
> 
> Still failing on powerpc and s390x.

do you have the link to the build bot?
that was rather helpful last time

> 
> I'm also getting this (after disabling timeouts) on powerpc:
> 
> tests/once-test.c:74:F:once:once_test:0: Assertion
> 'pthread_setaffinity_np(pthread_self(), sizeof(mask), &mask) == 0'
> failed

hm

> >
> > and here
> > http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021053.html
> 
> I haven't tested that yet. I did also apply this patch to build
> correctly on kFreeBSD:
> 
> http://anonscm.debian.org/cgit/pkg-pulseaudio/pulseaudio.git/tree/debian/patches/gnu-kfreebsd.patch

I disagree with the patch; why should the SSE optimizations be disabled 
when running a FreeBSD kernel?

> I will send it when I rebase it to current git head.

p.

-- 

Peter Meerwald
+43-664-218 (mobile)
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Pulseaudio test suite failures

2014-08-04 Thread Felipe Sateler
On Mon, Aug 4, 2014 at 9:10 AM, Peter Meerwald  wrote:
> Hello,
>
>> > I think pa_mix_s24_32re_c() is simply wrong, and has never worked; it
>> > should advance m->ptr by sizeof(int32_t), not 3 -- will submit a fix and
>> > update the test code
>>
>> I can test the patch, if you can send me one :)
>
> posted here
> http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021051.html

Still failing on powerpc and s390x.


I'm also getting this (after disabling timeouts) on powerpc:

tests/once-test.c:74:F:once:once_test:0: Assertion
'pthread_setaffinity_np(pthread_self(), sizeof(mask), &mask) == 0'
failed

>
> and here
> http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021053.html

I haven't tested that yet. I did also apply this patch to build
correctly on kFreeBSD:

http://anonscm.debian.org/cgit/pkg-pulseaudio/pulseaudio.git/tree/debian/patches/gnu-kfreebsd.patch

I will send it when I rebase it to current git head.

> could you please try to pass --enable-neon-opt for the armhf build? I
> think ARMHF is supposed to provide NEON support

I'm not sure. I'll check and if so I will enable it.


-- 

Saludos,
Felipe Sateler
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] util: Fix pa_get_binary_name() on Debian/kFreeBSD

2014-08-04 Thread Peter Meerwald

> > Debian GNU/kFreeBSD uses a FreeBSD kernel and GLIBC,
> > it #defines __FreeBSD_kernel__, but not __FreeBSD__ nor __linux__
> > Debian GNU/kFreeBSD does have a /proc/self/exe
> >
> > FreeBSD #defines __FreeBSD__ and __FreeBSD_kernel__
> >
> > problem reporte here:
> > http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html
> >
> > Signed-off-by: Peter Meerwald 
> > ---
> >  src/pulse/util.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/pulse/util.c b/src/pulse/util.c
> > index 50f90b8..42b160a 100644
> > --- a/src/pulse/util.c
> > +++ b/src/pulse/util.c
> > @@ -193,7 +193,7 @@ char *pa_get_binary_name(char *s, size_t l) {
> >  }
> >  #endif
> >
> > -#ifdef __linux__
> > +#if defined(__linux__) || defined(__FreeBSD_kernel__)
> 
> If FreeBSD does not have /proc/self/exe, but defines
> __FreeBSD_kernel__ then this check will pass, which I don't think is
> intended.

on FreeBSD it will call pa_readlink("/proc/self/exe") which will return 
NULL and then continue with the FreeBSD-specific code
 
> Perhaps the check needs to be defined(__FreeBSD_kernel__) &&
> !defined(__FreeBSD__)?

would work as well, I prefer simpler #defines;
defined(__FreeBSD_kernel__) && defined(__GLIBC__) should do as well
 
one extra readlink() doesn't hurt

> Note the ifs: I do not know if real FreeBSD has /proc/self/exe, nor if
> it defines  __FreeBSD_kernel__

it does not have /proc/self/exe (at least default install) and it should 
#define __FreeBSD_kernel__ according to 
http://sourceforge.net/p/predef/wiki/Home/

p.

-- 

Peter Meerwald
+43-664-218 (mobile)
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] mix: Fix mixing of S24 samples stored as S32RE

2014-08-04 Thread Felipe Sateler
On Mon, Aug 4, 2014 at 8:42 AM, Peter Meerwald  wrote:
> pa_mix_s24_32re_c() should advance m->ptr by sizeof(int32_t)
>
> http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html
>
> Signed-off-by: Peter Meerwald 

Will test as soon as I can.

-- 

Saludos,
Felipe Sateler
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] util: Fix pa_get_binary_name() on Debian/kFreeBSD

2014-08-04 Thread Felipe Sateler
On Mon, Aug 4, 2014 at 8:50 AM, Peter Meerwald  wrote:
> Debian GNU/kFreeBSD uses a FreeBSD kernel and GLIBC,
> it #defines __FreeBSD_kernel__, but not __FreeBSD__ nor __linux__
> Debian GNU/kFreeBSD does have a /proc/self/exe
>
> FreeBSD #defines __FreeBSD__ and __FreeBSD_kernel__
>
> problem reporte here:
> http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html
>
> Signed-off-by: Peter Meerwald 
> ---
>  src/pulse/util.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/pulse/util.c b/src/pulse/util.c
> index 50f90b8..42b160a 100644
> --- a/src/pulse/util.c
> +++ b/src/pulse/util.c
> @@ -193,7 +193,7 @@ char *pa_get_binary_name(char *s, size_t l) {
>  }
>  #endif
>
> -#ifdef __linux__
> +#if defined(__linux__) || defined(__FreeBSD_kernel__)

If FreeBSD does not have /proc/self/exe, but defines
__FreeBSD_kernel__ then this check will pass, which I don't think is
intended.

Perhaps the check needs to be defined(__FreeBSD_kernel__) &&
!defined(__FreeBSD__)?

Note the ifs: I do not know if real FreeBSD has /proc/self/exe, nor if
it defines  __FreeBSD_kernel__

-- 

Saludos,
Felipe Sateler
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 0/3] resamplers

2014-08-04 Thread Peter Meerwald
Hello Arun,
 
> > the work was mostly done by poljar (Damir Jelić) during GSoC'13, this is 
> > just
> > a rebase
> > 
> > my goal would be to establish libavresample as the new default resampler and
> > drop the ffmpeg code copied into PA currently; don't worry, this would be 
> > further work based on the feedback received :)
 
> The split looks good to go in now.

good
 
> For the other two, I think it would be nice to have some
> measurements/justification. We have the resampler test to do CPU
> measurements (and I see that poljar already did some comparisons that
> show soxr to be favourable in the int case at least), but I think we
> need to also have a justification based on quality. Any thoughts on
> measuring that?

ok, will provide more info/justification in a v2
quality is more difficult
 
> I should also add that for libavresample to be the default
> implementation, it needs to be easily available in distributions, and I
> think this might be a concern unless the packaging is split off (at
> least on my Fedora box, this comes from rpmfusion and not offcial Fedora
> packages).

ok, libavresample is in libav v0.9
Ubuntu has libavresample-dev/libavresample1

p.

-- 

Peter Meerwald
+43-664-218 (mobile)___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 0/3] resamplers

2014-08-04 Thread Arun Raghavan
On Mon, 2014-08-04 at 14:40 +0200, Peter Meerwald wrote:
> Hello,
> 
> this patch series splits up the resampler implementation found in pulsecore
> into separate files and adds two new resampler implementations: soxr and
> libavresample
> 
> the work was mostly done by poljar (Damir Jelić) during GSoC'13, this is just
> a rebase
> 
> my goal would be to establish libavresample as the new default resampler and
> drop the ffmpeg code copied into PA currently; don't worry, this would be 
> further work based on the feedback received :)

The split looks good to go in now.

For the other two, I think it would be nice to have some
measurements/justification. We have the resampler test to do CPU
measurements (and I see that poljar already did some comparisons that
show soxr to be favourable in the int case at least), but I think we
need to also have a justification based on quality. Any thoughts on
measuring that?

I should also add that for libavresample to be the default
implementation, it needs to be easily available in distributions, and I
think this might be a concern unless the packaging is split off (at
least on my Fedora box, this comes from rpmfusion and not offcial Fedora
packages).

Cheers,
Arun

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] mix: Fix mixing of S24 samples stored as S32RE

2014-08-04 Thread Arun Raghavan
On Mon, 2014-08-04 at 14:42 +0200, Peter Meerwald wrote:
> pa_mix_s24_32re_c() should advance m->ptr by sizeof(int32_t)
> 
> http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html
> 
> Signed-off-by: Peter Meerwald 
> ---
>  src/pulsecore/mix.c  | 2 +-
>  src/tests/mix-test.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/pulsecore/mix.c b/src/pulsecore/mix.c
> index 4b789a6..10567d6 100644
> --- a/src/pulsecore/mix.c
> +++ b/src/pulsecore/mix.c
> @@ -445,7 +445,7 @@ static void pa_mix_s24_32re_c(pa_mix_info streams[], 
> unsigned nstreams, unsigned
>  v = (v * cv) >> 16;
>  sum += v;
>  }
> -m->ptr = (uint8_t*) m->ptr + 3;
> +m->ptr = (uint8_t*) m->ptr + sizeof(int32_t);
>  }
>  
>  sum = PA_CLAMP_UNLIKELY(sum, -0x8000LL, 0x7FFFLL);
> diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
> index ae65209..9e5a0cc 100644
> --- a/src/tests/mix-test.c
> +++ b/src/tests/mix-test.c
> @@ -126,7 +126,7 @@ static const uint32_t s24_32le_result[3][10] = {
>  static const uint32_t s24_32be_result[3][10] = {
>  { 0x0001, 0x0002, 0x7fff0003, 0x8004, 0x9fff0005, 0x3fff0006, 
> 0x00010007, 0xf008, 0x0029, 0x0021000a },
>  { 0x, 0x65e6, 0xf1e5, 0x7300, 0x0ee6, 0xb8e5, 
> 0xe600, 0xd700, 0xcc1c, 0xb31d },
> -{ 0x, 0xe5010200, 0x00036400, 0x0470e500, 0xf300, 0xe5010500, 
> 0x0006ad00, 0x07f7e400, 0xe601, 0x0800 },
> +{ 0x, 0x64e60100, 0x70e50100, 0xf300, 0xade50100, 0xf7e40100, 
> 0xe601, 0xc701, 0xcc3c, 0xb33e },
>  };
>  
>  static void compare_block(const pa_sample_spec *ss, const pa_memchunk 
> *chunk, int iter) {

Yikes. :) This one looks good too, please push.

-- Arun

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] util: Fix pa_get_binary_name() on Debian/kFreeBSD

2014-08-04 Thread Arun Raghavan
On Mon, 2014-08-04 at 14:50 +0200, Peter Meerwald wrote:
> Debian GNU/kFreeBSD uses a FreeBSD kernel and GLIBC,
> it #defines __FreeBSD_kernel__, but not __FreeBSD__ nor __linux__
> Debian GNU/kFreeBSD does have a /proc/self/exe
> 
> FreeBSD #defines __FreeBSD__ and __FreeBSD_kernel__
> 
> problem reporte here:
> http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html
> 
> Signed-off-by: Peter Meerwald 
> ---
>  src/pulse/util.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/pulse/util.c b/src/pulse/util.c
> index 50f90b8..42b160a 100644
> --- a/src/pulse/util.c
> +++ b/src/pulse/util.c
> @@ -193,7 +193,7 @@ char *pa_get_binary_name(char *s, size_t l) {
>  }
>  #endif
>  
> -#ifdef __linux__
> +#if defined(__linux__) || defined(__FreeBSD_kernel__)
>  {
>  char *rp;
>  /* This works on Linux only */

Looks good.

-- Arun

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 0/3] resamplers

2014-08-04 Thread Alexander E. Patrakov

04.08.2014 19:05, Peter Meerwald wrote:

Hello Alexander,


my goal would be to establish libavresample as the new default resampler and
drop the ffmpeg code copied into PA currently; don't worry, this would be
further work based on the feedback received :)



This conflicts with my goal of writing and getting a rewindable
resampler into pulseaudio.


First, sorry for the very harsh reply.



ok, so general direction is not undisputed :)

do you know if libavresample can do rewind?

do you oppose the present patches to split up resampler.c and add new
resamplers? nothing would prevent yet another resampler

probably different applications need different resamplers, i.e. fast vs.
correct

currently, speex and ffmpeg are kind-of default:

speexdsp is largely unmaintained, very recently there seems to be some
activity [0]; speex has SSE and NEON code path

ffmpeg code is copied into the PA repo and has been superceeded by
libavresample

libavresample has AARCH64, NEON and SSE/AVX codepath, although only
AARCH64 (!) has SIMD resampling code (yet)

libavresample might be a good basis for general purpose resampling with
a good infrastructure for architecture specific optimization

regards, p.

[0] https://git.xiph.org/speexdsp.git



OK, now I see what you are after. Let me answer point-by-point.

First, libavresample cannot rewind. There is currently no open-source 
rewindable resampler. Just look at the header. There is nothing that 
could save and restore the delay buffer in avresample.


As for the current patch to split up resampler.c (1/3 in your series), I 
don't have any inherent objection to its intent. However, I should look 
more closely before I can say whether its content is good. Will do that 
today.


As for adding _any_ new resamplers, well, I would like to see the 
justification in the commit message for each new resampler. Otherwise 
we'll end up with the equivalent of GNOME 1 situation with clocks.


For libavresample, you have already provided a good justification 
(upstream deprecation of the ffmpeg resampler + SIMD addition) in the 
e-mail I am replying to, please copy it into the commit message. Still, 
I have to look at the patch more thoroughly.


Maybe the end result for the "rewindable resampler" quest will be 
something based on libavresample - but then we'll have to either 
maintain it indefinitely or submit our modifications upstream (where 
they will be likely rejected, as "not needed for libav").


For soxr, I have not seen such justification yet, and thus currently 
have a slight objection to its addition.


Anyway, I think that the task of objectively testing the resampler speed 
and quality also needs to be done, in order to provide such 
justifications. Please see 
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-February/019968.html 
for the formulation.


Feel free to come to the Plumbers conference and discuss it there if we 
don't reach any conclusion before that.


--
Alexander E. Patrakov
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Pulseaudio test suite failures

2014-08-04 Thread Peter Meerwald
Hello,

> > I think pa_mix_s24_32re_c() is simply wrong, and has never worked; it
> > should advance m->ptr by sizeof(int32_t), not 3 -- will submit a fix and
> > update the test code
> 
> I can test the patch, if you can send me one :)

posted here
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021051.html

and here
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021053.html


could you please try to pass --enable-neon-opt for the armhf build? I 
think ARMHF is supposed to provide NEON support

p.

-- 

Peter Meerwald
+43-664-218 (mobile)
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 0/3] resamplers

2014-08-04 Thread Peter Meerwald
Hello Alexander, 

> > my goal would be to establish libavresample as the new default resampler and
> > drop the ffmpeg code copied into PA currently; don't worry, this would be
> > further work based on the feedback received :)
 
> This conflicts with my goal of writing and getting a rewindable 
> resampler into pulseaudio.

ok, so general direction is not undisputed :)

do you know if libavresample can do rewind?

do you oppose the present patches to split up resampler.c and add new 
resamplers? nothing would prevent yet another resampler

probably different applications need different resamplers, i.e. fast vs. 
correct 

currently, speex and ffmpeg are kind-of default:

speexdsp is largely unmaintained, very recently there seems to be some 
activity [0]; speex has SSE and NEON code path

ffmpeg code is copied into the PA repo and has been superceeded by 
libavresample

libavresample has AARCH64, NEON and SSE/AVX codepath, although only 
AARCH64 (!) has SIMD resampling code (yet)

libavresample might be a good basis for general purpose resampling with 
a good infrastructure for architecture specific optimization

regards, p.

[0] https://git.xiph.org/speexdsp.git

-- 

Peter Meerwald
+43-664-218 (mobile)
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] util: Fix pa_get_binary_name() on Debian/kFreeBSD

2014-08-04 Thread Peter Meerwald
Debian GNU/kFreeBSD uses a FreeBSD kernel and GLIBC,
it #defines __FreeBSD_kernel__, but not __FreeBSD__ nor __linux__
Debian GNU/kFreeBSD does have a /proc/self/exe

FreeBSD #defines __FreeBSD__ and __FreeBSD_kernel__

problem reporte here:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html

Signed-off-by: Peter Meerwald 
---
 src/pulse/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pulse/util.c b/src/pulse/util.c
index 50f90b8..42b160a 100644
--- a/src/pulse/util.c
+++ b/src/pulse/util.c
@@ -193,7 +193,7 @@ char *pa_get_binary_name(char *s, size_t l) {
 }
 #endif
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
 {
 char *rp;
 /* This works on Linux only */
-- 
1.9.1

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 0/3] resamplers

2014-08-04 Thread Alexander E. Patrakov

04.08.2014 18:40, Peter Meerwald wrote:

Hello,

this patch series splits up the resampler implementation found in pulsecore
into separate files and adds two new resampler implementations: soxr and
libavresample

the work was mostly done by poljar (Damir Jelić) during GSoC'13, this is just
a rebase

my goal would be to establish libavresample as the new default resampler and
drop the ffmpeg code copied into PA currently; don't worry, this would be
further work based on the feedback received :)


This conflicts with my goal of writing and getting a rewindable 
resampler into pulseaudio.




thanks, p.

Peter Meerwald (3):
   resampler: Split the resampler implementations into separate files
   resampler: Add optional soxr resampler
   resampler: Add optional libavresample resampler

  configure.ac|  34 ++
  src/Makefile.am |  30 +-
  src/pulsecore/resampler.c   | 660 +++-
  src/pulsecore/resampler.h   |  54 +++
  src/pulsecore/resampler/ffmpeg.c| 132 +++
  src/pulsecore/resampler/lavr.c  | 160 
  src/pulsecore/resampler/libsamplerate.c | 102 +
  src/pulsecore/resampler/peaks.c | 163 
  src/pulsecore/resampler/soxr.c  | 124 ++
  src/pulsecore/resampler/speex.c | 151 
  src/pulsecore/resampler/trivial.c   | 102 +
  11 files changed, 1107 insertions(+), 605 deletions(-)
  create mode 100644 src/pulsecore/resampler/ffmpeg.c
  create mode 100644 src/pulsecore/resampler/lavr.c
  create mode 100644 src/pulsecore/resampler/libsamplerate.c
  create mode 100644 src/pulsecore/resampler/peaks.c
  create mode 100644 src/pulsecore/resampler/soxr.c
  create mode 100644 src/pulsecore/resampler/speex.c
  create mode 100644 src/pulsecore/resampler/trivial.c




--
Alexander E. Patrakov
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] mix: Fix mixing of S24 samples stored as S32RE

2014-08-04 Thread Peter Meerwald
pa_mix_s24_32re_c() should advance m->ptr by sizeof(int32_t)

http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html

Signed-off-by: Peter Meerwald 
---
 src/pulsecore/mix.c  | 2 +-
 src/tests/mix-test.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pulsecore/mix.c b/src/pulsecore/mix.c
index 4b789a6..10567d6 100644
--- a/src/pulsecore/mix.c
+++ b/src/pulsecore/mix.c
@@ -445,7 +445,7 @@ static void pa_mix_s24_32re_c(pa_mix_info streams[], 
unsigned nstreams, unsigned
 v = (v * cv) >> 16;
 sum += v;
 }
-m->ptr = (uint8_t*) m->ptr + 3;
+m->ptr = (uint8_t*) m->ptr + sizeof(int32_t);
 }
 
 sum = PA_CLAMP_UNLIKELY(sum, -0x8000LL, 0x7FFFLL);
diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
index ae65209..9e5a0cc 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -126,7 +126,7 @@ static const uint32_t s24_32le_result[3][10] = {
 static const uint32_t s24_32be_result[3][10] = {
 { 0x0001, 0x0002, 0x7fff0003, 0x8004, 0x9fff0005, 0x3fff0006, 
0x00010007, 0xf008, 0x0029, 0x0021000a },
 { 0x, 0x65e6, 0xf1e5, 0x7300, 0x0ee6, 0xb8e5, 
0xe600, 0xd700, 0xcc1c, 0xb31d },
-{ 0x, 0xe5010200, 0x00036400, 0x0470e500, 0xf300, 0xe5010500, 
0x0006ad00, 0x07f7e400, 0xe601, 0x0800 },
+{ 0x, 0x64e60100, 0x70e50100, 0xf300, 0xade50100, 0xf7e40100, 
0xe601, 0xc701, 0xcc3c, 0xb33e },
 };
 
 static void compare_block(const pa_sample_spec *ss, const pa_memchunk *chunk, 
int iter) {
-- 
1.9.1

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH 2/3] resampler: Add optional soxr resampler

2014-08-04 Thread Peter Meerwald
see http://sourceforge.net/p/soxr/wiki/Home/

Signed-off-by: Peter Meerwald 
Signed-off-by: poljar (Damir Jelić) 

--

rebased and leftover handling is external to _resample() now;
this fixes a bug in the leftover_length computation since soxr supports
s16 and float32, hence sizeof(float) is wrong
---
 configure.ac   |  17 ++
 src/Makefile.am|   6 ++
 src/pulsecore/resampler.c  |  14 -
 src/pulsecore/resampler.h  |   2 +
 src/pulsecore/resampler/soxr.c | 124 +
 5 files changed, 162 insertions(+), 1 deletion(-)
 create mode 100644 src/pulsecore/resampler/soxr.c

diff --git a/configure.ac b/configure.ac
index 837e81e..cf63eca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1109,6 +1109,21 @@ AS_IF([test "x$with_speex" = "xyes" && test 
"x$HAVE_SPEEX" = "x0"],
 AM_CONDITIONAL([HAVE_SPEEX], [test "x$HAVE_SPEEX" = "x1"])
 AS_IF([test "x$HAVE_SPEEX" = "x1"], AC_DEFINE([HAVE_SPEEX], 1, [Have speex]))
 
+ sox resampler support (optional) 
+
+AC_ARG_ENABLE([soxr],
+AS_HELP_STRING([--disable-soxr],[Disable optional soxr support]))
+
+AS_IF([test "x$enable_soxr" != "xno"],
+[PKG_CHECK_MODULES(SOXR, soxr, HAVE_SOXR=1, HAVE_SOXR=0)],
+HAVE_SOXR=0)
+
+AS_IF([test "x$enable_soxr" = "xyes" && test "x$HAVE_SOXR" = "x0"],
+[AC_MSG_ERROR([*** soxr not found])])
+
+AM_CONDITIONAL([HAVE_SOXR], [test "x$HAVE_SOXR" = x1])
+AS_IF([test "x$HAVE_SOXR" = "x1"], AC_DEFINE([HAVE_SOXR], 1, [Have soxr]))
+
  Xen support (optional) 
 
 AC_ARG_ENABLE([xen],
@@ -1445,6 +1460,7 @@ AS_IF([test "x$HAVE_FFTW" = "x1"], ENABLE_FFTW=yes, 
ENABLE_FFTW=no)
 AS_IF([test "x$HAVE_ORC" = "xyes"], ENABLE_ORC=yes, ENABLE_ORC=no)
 AS_IF([test "x$HAVE_ADRIAN_EC" = "x1"], ENABLE_ADRIAN_EC=yes, 
ENABLE_ADRIAN_EC=no)
 AS_IF([test "x$HAVE_SPEEX" = "x1"], ENABLE_SPEEX=yes, ENABLE_SPEEX=no)
+AS_IF([test "x$HAVE_SOXR" = "x1"], ENABLE_SOXR=yes, ENABLE_SOXR=no)
 AS_IF([test "x$HAVE_WEBRTC" = "x1"], ENABLE_WEBRTC=yes, ENABLE_WEBRTC=no)
 AS_IF([test "x$HAVE_TDB" = "x1"], ENABLE_TDB=yes, ENABLE_TDB=no)
 AS_IF([test "x$HAVE_GDBM" = "x1"], ENABLE_GDBM=yes, ENABLE_GDBM=no)
@@ -1501,6 +1517,7 @@ echo "
 Enable orc:${ENABLE_ORC}
 Enable Adrian echo canceller:  ${ENABLE_ADRIAN_EC}
 Enable speex (resampler, AEC): ${ENABLE_SPEEX}
+Enable soxr:   ${ENABLE_SOXR}
 Enable WebRTC echo canceller:  ${ENABLE_WEBRTC}
 Enable gcov coverage:  ${ENABLE_GCOV}
 Enable unit tests: ${ENABLE_TESTS}
diff --git a/src/Makefile.am b/src/Makefile.am
index 21eb365..9df52df 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -992,6 +992,12 @@ libpulsecore_@PA_MAJORMINOR@_la_CFLAGS += 
$(LIBSAMPLERATE_CFLAGS)
 libpulsecore_@PA_MAJORMINOR@_la_LIBADD += $(LIBSAMPLERATE_LIBS)
 endif
 
+if HAVE_SOXR
+libpulsecore_@PA_MAJORMINOR@_la_SOURCES += pulsecore/resampler/soxr.c
+libpulsecore_@PA_MAJORMINOR@_la_CFLAGS += $(SOXR_CFLAGS)
+libpulsecore_@PA_MAJORMINOR@_la_LIBADD += $(SOXR_LIBS)
+endif
+
 # We split the foreign code off to not be annoyed by warnings we don't care 
about
 noinst_LTLIBRARIES += libpulsecore-foreign.la
 
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index de58f3f..e366be6 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -117,6 +117,11 @@ static int (* const init_table[])(pa_resampler *r) = {
 [PA_RESAMPLER_AUTO]= NULL,
 [PA_RESAMPLER_COPY]= copy_init,
 [PA_RESAMPLER_PEAKS]   = pa_resampler_peaks_init,
+#ifdef HAVE_SOXR
+[PA_RESAMPLER_SOXR]= pa_resampler_soxr_init,
+#else
+[PA_RESAMPLER_SOXR]= NULL,
+#endif
 };
 
 static bool speex_is_fixed_point(void);
@@ -163,6 +168,7 @@ static pa_resample_method_t fix_method(
 break;
 }
  /* Else fall through */
+case PA_RESAMPLER_SOXR:
 case PA_RESAMPLER_FFMPEG:
 if (flags & PA_RESAMPLER_VARIABLE_RATE) {
 pa_log_info("Resampler '%s' cannot do variable rate, reverting 
to resampler 'auto'.", pa_resample_method_to_string(method));
@@ -606,7 +612,8 @@ static const char * const resample_methods[] = {
 "ffmpeg",
 "auto",
 "copy",
-"peaks"
+"peaks",
+"soxr"
 };
 
 const char *pa_resample_method_to_string(pa_resample_method_t m) {
@@ -634,6 +641,11 @@ int pa_resample_method_supported(pa_resample_method_t m) {
 return 0;
 #endif
 
+#ifndef HAVE_SOXR
+if (m == PA_RESAMPLER_SOXR)
+return 0;
+#endif
+
 return 1;
 }
 
diff --git a/src/pulsecore/resampler.h b/src/pulsecore/resampler.h
index 13d8c35..1d248e2 100644
--- a/src/pulsecore/resampler.h
+++ b/src/pulsecore/resampler.h
@@ -61,6 +61,7 @@ typedef enum pa_resample_method {
 PA_RESAMPLER_AUTO, /* automatic select based on sample format */
 PA_RESAMPLER_COPY,
 PA_RESAMPLER_PEAKS,
+

[pulseaudio-discuss] [PATCH 3/3] resampler: Add optional libavresample resampler

2014-08-04 Thread Peter Meerwald
see https://libav.org/doxygen/master/group__lavr.html

Signed-off-by: Peter Meerwald 
Signed-off-by: poljar (Damir Jelić) 
---
 configure.ac   |  17 +
 src/Makefile.am|   6 ++
 src/pulsecore/resampler.c  |  14 +++-
 src/pulsecore/resampler.h  |   2 +
 src/pulsecore/resampler/lavr.c | 160 +
 5 files changed, 198 insertions(+), 1 deletion(-)
 create mode 100644 src/pulsecore/resampler/lavr.c

diff --git a/configure.ac b/configure.ac
index cf63eca..578508b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1124,6 +1124,21 @@ AS_IF([test "x$enable_soxr" = "xyes" && test 
"x$HAVE_SOXR" = "x0"],
 AM_CONDITIONAL([HAVE_SOXR], [test "x$HAVE_SOXR" = x1])
 AS_IF([test "x$HAVE_SOXR" = "x1"], AC_DEFINE([HAVE_SOXR], 1, [Have soxr]))
 
+ libavresample support (optional) 
+
+AC_ARG_ENABLE([libavresample],
+   AS_HELP_STRING([--disable-libavresample],[Disable optional libavresample 
support]))
+
+AS_IF([test "x$enable_libavresample" != "xno"],
+[PKG_CHECK_MODULES(LIBAVRESAMPLE, libavresample, HAVE_LIBAVRESAMPLE=1, 
HAVE_LIBAVRESAMPLE=0)],
+HAVE_LIBAVRESAMPLE=0)
+
+AS_IF([test "x$enable_libavresample" = "xyes" && test "x$HAVE_LIBAVRESAMPLE" = 
"x0"],
+[AC_MSG_ERROR([*** libavresample not found])])
+
+AM_CONDITIONAL([HAVE_LIBAVRESAMPLE], [test "x$HAVE_LIBAVRESAMPLE" = x1])
+AS_IF([test "x$HAVE_LIBAVRESAMPLE" = "x1"], AC_DEFINE([HAVE_LIBAVRESAMPLE], 1, 
[Have libavresample]))
+
  Xen support (optional) 
 
 AC_ARG_ENABLE([xen],
@@ -1461,6 +1476,7 @@ AS_IF([test "x$HAVE_ORC" = "xyes"], ENABLE_ORC=yes, 
ENABLE_ORC=no)
 AS_IF([test "x$HAVE_ADRIAN_EC" = "x1"], ENABLE_ADRIAN_EC=yes, 
ENABLE_ADRIAN_EC=no)
 AS_IF([test "x$HAVE_SPEEX" = "x1"], ENABLE_SPEEX=yes, ENABLE_SPEEX=no)
 AS_IF([test "x$HAVE_SOXR" = "x1"], ENABLE_SOXR=yes, ENABLE_SOXR=no)
+AS_IF([test "x$HAVE_LIBAVRESAMPLE" = "x1"], ENABLE_LIBAVRESAMPLE=yes, 
ENABLE_LIBAVRESAMPLE=no)
 AS_IF([test "x$HAVE_WEBRTC" = "x1"], ENABLE_WEBRTC=yes, ENABLE_WEBRTC=no)
 AS_IF([test "x$HAVE_TDB" = "x1"], ENABLE_TDB=yes, ENABLE_TDB=no)
 AS_IF([test "x$HAVE_GDBM" = "x1"], ENABLE_GDBM=yes, ENABLE_GDBM=no)
@@ -1518,6 +1534,7 @@ echo "
 Enable Adrian echo canceller:  ${ENABLE_ADRIAN_EC}
 Enable speex (resampler, AEC): ${ENABLE_SPEEX}
 Enable soxr:   ${ENABLE_SOXR}
+Enable libavresample:  ${ENABLE_LIBAVRESAMPLE}
 Enable WebRTC echo canceller:  ${ENABLE_WEBRTC}
 Enable gcov coverage:  ${ENABLE_GCOV}
 Enable unit tests: ${ENABLE_TESTS}
diff --git a/src/Makefile.am b/src/Makefile.am
index 9df52df..e333e8a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -998,6 +998,12 @@ libpulsecore_@PA_MAJORMINOR@_la_CFLAGS += $(SOXR_CFLAGS)
 libpulsecore_@PA_MAJORMINOR@_la_LIBADD += $(SOXR_LIBS)
 endif
 
+if HAVE_LIBAVRESAMPLE
+libpulsecore_@PA_MAJORMINOR@_la_SOURCES += pulsecore/resampler/lavr.c
+libpulsecore_@PA_MAJORMINOR@_la_CFLAGS += $(LIBAVRESAMPLE_CFLAGS)
+libpulsecore_@PA_MAJORMINOR@_la_LIBADD += $(LIBAVRESAMPLE_LIBS)
+endif
+
 # We split the foreign code off to not be annoyed by warnings we don't care 
about
 noinst_LTLIBRARIES += libpulsecore-foreign.la
 
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index e366be6..f477613 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -122,6 +122,11 @@ static int (* const init_table[])(pa_resampler *r) = {
 #else
 [PA_RESAMPLER_SOXR]= NULL,
 #endif
+#ifdef HAVE_LIBAVRESAMPLE
+[PA_RESAMPLER_LAVR]= pa_resampler_lavr_init,
+#else
+[PA_RESAMPLER_LAVR]= NULL,
+#endif
 };
 
 static bool speex_is_fixed_point(void);
@@ -169,6 +174,7 @@ static pa_resample_method_t fix_method(
 }
  /* Else fall through */
 case PA_RESAMPLER_SOXR:
+case PA_RESAMPLER_LAVR:
 case PA_RESAMPLER_FFMPEG:
 if (flags & PA_RESAMPLER_VARIABLE_RATE) {
 pa_log_info("Resampler '%s' cannot do variable rate, reverting 
to resampler 'auto'.", pa_resample_method_to_string(method));
@@ -613,7 +619,8 @@ static const char * const resample_methods[] = {
 "auto",
 "copy",
 "peaks",
-"soxr"
+"soxr",
+"lavr"
 };
 
 const char *pa_resample_method_to_string(pa_resample_method_t m) {
@@ -646,6 +653,11 @@ int pa_resample_method_supported(pa_resample_method_t m) {
 return 0;
 #endif
 
+#ifndef HAVE_LIBAVRESAMPLE
+if (m == PA_RESAMPLER_LAVR)
+return 0;
+#endif
+
 return 1;
 }
 
diff --git a/src/pulsecore/resampler.h b/src/pulsecore/resampler.h
index 1d248e2..19e8743 100644
--- a/src/pulsecore/resampler.h
+++ b/src/pulsecore/resampler.h
@@ -62,6 +62,7 @@ typedef enum pa_resample_method {
 PA_RESAMPLER_COPY,
 PA_RESAMPLER_PEAKS,
 PA_RESAMPLER_SOXR,
+PA_RESAMPLER_LAVR,
 PA_RESAMPLER_MAX
 } pa_resample_method_t;
 
@@ -162,6 +163,7 @@ const pa_sample_spec* 
pa_resa

[pulseaudio-discuss] [PATCH 1/3] resampler: Split the resampler implementations into separate files

2014-08-04 Thread Peter Meerwald
Signed-off-by: Peter Meerwald 
Signed-off-by: poljar (Damir Jelić) 

--

changes over 
https://github.com/poljar/pulseaudio/commits/resampler_implementations_v2:
rebased
---
 src/Makefile.am |  18 +-
 src/pulsecore/resampler.c   | 634 ++--
 src/pulsecore/resampler.h   |  50 +++
 src/pulsecore/resampler/ffmpeg.c| 132 +++
 src/pulsecore/resampler/libsamplerate.c | 102 +
 src/pulsecore/resampler/peaks.c | 163 
 src/pulsecore/resampler/speex.c | 151 
 src/pulsecore/resampler/trivial.c   | 102 +
 8 files changed, 748 insertions(+), 604 deletions(-)
 create mode 100644 src/pulsecore/resampler/ffmpeg.c
 create mode 100644 src/pulsecore/resampler/libsamplerate.c
 create mode 100644 src/pulsecore/resampler/peaks.c
 create mode 100644 src/pulsecore/resampler/speex.c
 create mode 100644 src/pulsecore/resampler/trivial.c

diff --git a/src/Makefile.am b/src/Makefile.am
index 5924bd8..21eb365 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -901,6 +901,8 @@ libpulsecore_@PA_MAJORMINOR@_la_SOURCES = \
pulsecore/remap.c pulsecore/remap.h \
pulsecore/remap_mmx.c pulsecore/remap_sse.c \
pulsecore/resampler.c pulsecore/resampler.h \
+   pulsecore/resampler/ffmpeg.c pulsecore/resampler/peaks.c \
+   pulsecore/resampler/trivial.c \
pulsecore/rtpoll.c pulsecore/rtpoll.h \
pulsecore/stream-util.c pulsecore/stream-util.h \
pulsecore/mix.c pulsecore/mix.h \
@@ -925,9 +927,9 @@ libpulsecore_@PA_MAJORMINOR@_la_SOURCES = \
pulsecore/thread-mq.c pulsecore/thread-mq.h \
pulsecore/database.h
 
-libpulsecore_@PA_MAJORMINOR@_la_CFLAGS = $(AM_CFLAGS) $(SERVER_CFLAGS) 
$(LIBSAMPLERATE_CFLAGS) $(LIBSPEEX_CFLAGS) $(LIBSNDFILE_CFLAGS) 
$(WINSOCK_CFLAGS)
+libpulsecore_@PA_MAJORMINOR@_la_CFLAGS = $(AM_CFLAGS) $(SERVER_CFLAGS) 
$(LIBSNDFILE_CFLAGS) $(WINSOCK_CFLAGS)
 libpulsecore_@PA_MAJORMINOR@_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
-libpulsecore_@PA_MAJORMINOR@_la_LIBADD = $(AM_LIBADD) $(LIBLTDL) 
$(LIBSAMPLERATE_LIBS) $(LIBSPEEX_LIBS) $(LIBSNDFILE_LIBS) $(WINSOCK_LIBS) 
$(LTLIBICONV) libpulsecommon-@PA_MAJORMINOR@.la libpulse.la 
libpulsecore-foreign.la
+libpulsecore_@PA_MAJORMINOR@_la_LIBADD = $(AM_LIBADD) $(LIBLTDL) 
$(LIBSNDFILE_LIBS) $(WINSOCK_LIBS) $(LTLIBICONV) 
libpulsecommon-@PA_MAJORMINOR@.la libpulse.la libpulsecore-foreign.la
 
 if HAVE_NEON
 noinst_LTLIBRARIES += libpulsecore_sconv_neon.la libpulsecore_mix_neon.la 
libpulsecore_remap_neon.la
@@ -978,6 +980,18 @@ if HAVE_SIMPLEDB
 libpulsecore_@PA_MAJORMINOR@_la_SOURCES += pulsecore/database-simple.c
 endif
 
+if HAVE_SPEEX
+libpulsecore_@PA_MAJORMINOR@_la_SOURCES += pulsecore/resampler/speex.c
+libpulsecore_@PA_MAJORMINOR@_la_CFLAGS += $(LIBSPEEX_CFLAGS)
+libpulsecore_@PA_MAJORMINOR@_la_LIBADD += $(LIBSPEEX_LIBS)
+endif
+
+if HAVE_LIBSAMPLERATE
+libpulsecore_@PA_MAJORMINOR@_la_SOURCES += pulsecore/resampler/libsamplerate.c
+libpulsecore_@PA_MAJORMINOR@_la_CFLAGS += $(LIBSAMPLERATE_CFLAGS)
+libpulsecore_@PA_MAJORMINOR@_la_LIBADD += $(LIBSAMPLERATE_LIBS)
+endif
+
 # We split the foreign code off to not be annoyed by warnings we don't care 
about
 noinst_LTLIBRARIES += libpulsecore-foreign.la
 
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index 2842e65..de58f3f 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -25,106 +25,39 @@
 
 #include 
 
-#ifdef HAVE_LIBSAMPLERATE
-#include 
-#endif
-
 #ifdef HAVE_SPEEX
 #include 
+#include 
 #endif
 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include "ffmpeg/avcodec.h"
 
 #include "resampler.h"
 
 /* Number of samples of extra space we allow the resamplers to return */
 #define EXTRA_FRAMES 128
 
-struct pa_resampler {
-pa_resample_method_t method;
-pa_resample_flags_t flags;
-
-pa_sample_spec i_ss, o_ss;
-pa_channel_map i_cm, o_cm;
-size_t i_fz, o_fz, w_fz, w_sz;
-pa_mempool *mempool;
-
-pa_memchunk to_work_format_buf;
-pa_memchunk remap_buf;
-pa_memchunk resample_buf;
-pa_memchunk from_work_format_buf;
-size_t to_work_format_buf_size;
-size_t remap_buf_size;
-size_t resample_buf_size;
-size_t from_work_format_buf_size;
-
-/* points to buffer before resampling stage, remap or to_work */
-pa_memchunk *leftover_buf;
-size_t *leftover_buf_size;
-
-/* have_leftover points to leftover_in_remap or leftover_in_to_work */
-bool *have_leftover;
-bool leftover_in_remap;
-bool leftover_in_to_work;
-
-pa_sample_format_t work_format;
-uint8_t work_channels;
-
-pa_convert_func_t to_work_format_func;
-pa_convert_func_t from_work_format_func;
-
-pa_remap_t remap;
-bool map_required;
-
-pa_resampler_impl impl;
-};
-
-struct trivial_data { /* data specific to the trivial res

[pulseaudio-discuss] [PATCH 0/3] resamplers

2014-08-04 Thread Peter Meerwald
Hello,

this patch series splits up the resampler implementation found in pulsecore
into separate files and adds two new resampler implementations: soxr and
libavresample

the work was mostly done by poljar (Damir Jelić) during GSoC'13, this is just
a rebase

my goal would be to establish libavresample as the new default resampler and
drop the ffmpeg code copied into PA currently; don't worry, this would be 
further work based on the feedback received :)

thanks, p.

Peter Meerwald (3):
  resampler: Split the resampler implementations into separate files
  resampler: Add optional soxr resampler
  resampler: Add optional libavresample resampler

 configure.ac|  34 ++
 src/Makefile.am |  30 +-
 src/pulsecore/resampler.c   | 660 +++-
 src/pulsecore/resampler.h   |  54 +++
 src/pulsecore/resampler/ffmpeg.c| 132 +++
 src/pulsecore/resampler/lavr.c  | 160 
 src/pulsecore/resampler/libsamplerate.c | 102 +
 src/pulsecore/resampler/peaks.c | 163 
 src/pulsecore/resampler/soxr.c  | 124 ++
 src/pulsecore/resampler/speex.c | 151 
 src/pulsecore/resampler/trivial.c   | 102 +
 11 files changed, 1107 insertions(+), 605 deletions(-)
 create mode 100644 src/pulsecore/resampler/ffmpeg.c
 create mode 100644 src/pulsecore/resampler/lavr.c
 create mode 100644 src/pulsecore/resampler/libsamplerate.c
 create mode 100644 src/pulsecore/resampler/peaks.c
 create mode 100644 src/pulsecore/resampler/soxr.c
 create mode 100644 src/pulsecore/resampler/speex.c
 create mode 100644 src/pulsecore/resampler/trivial.c

-- 
1.9.1

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Any master plan on equalizer/ladspa settings?

2014-08-04 Thread Tanu Kaskinen
On Mon, 2014-08-04 at 00:32 +0600, Alexander E. Patrakov wrote:
> Hello.
> 
> Is there any plan to replace the custom DBus-based volume-like APIs 
> currently used by module-equalizer-sink and module-ladspa-sink?

Nobody has volunteered to work on that. That said, the new volume
control API is designed with the possibility of filter controls in mind.

> I am asking because of the "New volume functionality for PulseAudio" 
> thread (that didn't mention these modules explicitly) and because of 
> various bugs that are reported against module-dbus-protocol used by both 
> sinks. However, the "struct pa_bvolume + struct pa_control_volume_data" 
> solution proposed in the thread doesn't cover all the needed 
> functionality for the ladspa sink. Namely, some controls are not volumes 
> but frequencies or enumerations.

pa_bvolume and pa_control_volume_data indeed are inappropriate for the
ladspa sink, but look at the pa_control_info struct:

struct pa_control_info {
uint32_t index;
const char *name;
const char *description;
pa_proplist *proplist;

pa_control_type_t type;
void *data;
};

We can introduce new control types by extending the pa_control_type_t
enumeration and using something else than pa_control_volume_data as the
control data.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] RFC: New volume functionality for PulseAudio

2014-08-04 Thread Tanu Kaskinen
On Fri, 2014-08-01 at 12:30 +0200, David Henningsson wrote:
> 
> On 2014-07-29 20:46, Tanu Kaskinen wrote:
> >> The idea is that pa_cvolume is the "bare minimum" struct and the
> >> pa_bvolume is the "extra everything" struct. Does that make sense?
> >
> > I don't really see the point of bundling all that stuff in pa_bvolume.
> > IIRC, in my original proposal there was no pa_bvolume, but you suggested
> > putting the overall volume, balance and channel map together in a
> > struct, and that was a good idea, because those bits are needed together
> > by several functions, so having a struct reduces the need to have many
> > function parameters. The rest of the stuff that you now suggested to add
> > to pa_bvolume doesn't have such benefit. The fields are irrelevant for
> > functions that need to take a pa_bvolume as a parameter, so it's better
> > to store those things in pa_control_info.
> >
> > I think the important thing here, though, is that you think that adding
> > has_volume (and maybe has_mute) fields is ok. I don't think it makes
> > sense for me to continue pushing for separate volume and mute controls
> > (I'm not sure any more I'd even prefer separate controls), so it's
> > starting to be clear what kind of design I should implement. The
> > variable naming and whether to store things in pa_bvolume or
> > pa_control_info are details that don't necessarily need to be decided
> > before I can start preparing some patches.
> >
> > Here's my current plan how the structs in the client API should look
> > like:
> >
> > struct pa_bvolume {
> >  pa_volume_t volume;
> >  double balance[PA_CHANNELS_MAX];
> >  pa_channel_map channel_map;
> > };
> >
> > struct pa_control_volume_data {
> >  pa_bvolume volume;
> >  pa_volume_t *steps;
> >  unsigned n_steps;
> >  int convertible_to_dB;
> >
> >  int mute;
> >
> >  int has_volume;
> >  int has_mute;
> > };
> 
> Hmm, as it looks now, I don't think the pa_bvolume encapsulation has any 
> benefit. Any initialization functions (or similar) should just take the 
> full pa_control_volume_data struct instead.

I don't think that can work. Consider this function, for example:

pa_context_set_control_volume(pa_context *c, uint32_t control_idx,
  pa_bvolume *bvolume, int set_volume,
  int set_balance, pa_success_cb_t cb,
  void *userdata);

The bvolume parameter is supposed to be allocated from stack, so the
application does something like this:

pa_bvolume v;
pa_bvolume_init_mono(&v, 0.3 * PA_VOLUME_NORM);
pa_context_set_control_volume(context, idx, &v, true, false, NULL, NULL);

pa_control_volume_data is supposed to be extensible. Now if pa_bvolume
is actually the same thing as pa_control_volume_data, then when
pa_bvolume is extended, the pa_bvolume_init_mono() and
pa_context_set_control_volume() calls will probably break if the client
was built against an older libpulse version, because the new libpulse
assumes that the pa_bvolume size is bigger than what was actually
allocated in this example.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] core: Closing proper file descriptor when pipe creation fails.

2014-08-04 Thread Arun Raghavan
On Mon, 2014-08-04 at 14:32 +0530, Sajeesh Sidharthan wrote:
> ---
>  src/pulsecore/pipe.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/pulsecore/pipe.c b/src/pulsecore/pipe.c
> index f873ef6..4e3c0c3 100644
> --- a/src/pulsecore/pipe.c
> +++ b/src/pulsecore/pipe.c
> @@ -149,7 +149,7 @@ error:
>  if (filedes[0] >= 0)
>  pa_close(filedes[0]);
>  if (filedes[1] >= 0)
> -pa_close(filedes[0]);
> +pa_close(filedes[1]);
>  
>  return -1;
>  }

I've pulled this now. Thanks for the patch!

-- Arun

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] core: Closing proper file descriptor when pipe creation fails.

2014-08-04 Thread Sajeesh Sidharthan
---
 src/pulsecore/pipe.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pulsecore/pipe.c b/src/pulsecore/pipe.c
index f873ef6..4e3c0c3 100644
--- a/src/pulsecore/pipe.c
+++ b/src/pulsecore/pipe.c
@@ -149,7 +149,7 @@ error:
 if (filedes[0] >= 0)
 pa_close(filedes[0]);
 if (filedes[1] >= 0)
-pa_close(filedes[0]);
+pa_close(filedes[1]);
 
 return -1;
 }
-- 
1.7.9.5

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] echo-cancel: Fix drift timer restart logic across suspend

2014-08-04 Thread Arun Raghavan
The IS_ACTIVE() macro does a pa_sink/source_get_state() on our sink and
source, which does not work in the state change callback, since the
state is not actually committed at that point.
---
 src/modules/echo-cancel/module-echo-cancel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/echo-cancel/module-echo-cancel.c 
b/src/modules/echo-cancel/module-echo-cancel.c
index 9df2899..62429fd 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -475,7 +475,7 @@ static int source_set_state_cb(pa_source *s, 
pa_source_state_t state) {
 
 if (state == PA_SOURCE_RUNNING) {
 /* restart timer when both sink and source are active */
-if (IS_ACTIVE(u) && u->adjust_time)
+if ((pa_sink_get_state(u->sink) == PA_SINK_RUNNING) && u->adjust_time)
 pa_core_rttime_restart(u->core, u->time_event, pa_rtclock_now() + 
u->adjust_time);
 
 pa_atomic_store(&u->request_resync, 1);
@@ -500,7 +500,7 @@ static int sink_set_state_cb(pa_sink *s, pa_sink_state_t 
state) {
 
 if (state == PA_SINK_RUNNING) {
 /* restart timer when both sink and source are active */
-if (IS_ACTIVE(u) && u->adjust_time)
+if ((pa_source_get_state(u->source) == PA_SOURCE_RUNNING) && 
u->adjust_time)
 pa_core_rttime_restart(u->core, u->time_event, pa_rtclock_now() + 
u->adjust_time);
 
 pa_atomic_store(&u->request_resync, 1);
-- 
1.9.3

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss