* [PATCH] pulseaudio: rescale input being passed to float method of speex @ 2013-12-24 14:37 Fahad Arslan 2013-12-24 16:54 ` Saul Wold 2013-12-26 11:57 ` Koen Kooi 0 siblings, 2 replies; 12+ messages in thread From: Fahad Arslan @ 2013-12-24 14:37 UTC (permalink / raw) To: openembedded-core From: Fahad Arslan <Fahad_Arslan@mentor.com> Pulseaudio uses Speex to do resampling. Default Pulseaudio resampler is speex-float-1. However, Speex recipe in poky configures speex in fixed point. This scenario creates a situation in which audio streams that need to be resampled are not playedback since input to speex is zeroed out when flaot input in range of +/-1 is converted to int. So we are rescaling the input before invoking speex flaot method. Upstream-Status: Submitted [pulseaudio-discuss@lists.freedesktop.org] Signed-off-by: Fahad Arslan <Fahad_Arslan@mentor.com> --- .../pulseaudio/rescale_input_to_speex_float.patch | 24 ++++++++++++++++++++ .../pulseaudio/pulseaudio_4.0.bb | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch new file mode 100644 index 0000000..fe5e6a7 --- /dev/null +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch @@ -0,0 +1,24 @@ +diff -Naur a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c +--- a/src/pulsecore/resampler.c 2013-12-24 18:25:08.164787401 +0500 ++++ b/src/pulsecore/resampler.c 2013-12-24 18:24:43.056787026 +0500 +@@ -1347,7 +1347,7 @@ + + static void speex_resample_float(pa_resampler *r, const pa_memchunk *input, unsigned in_n_frames, pa_memchunk *output, unsigned *out_n_frames) { + float *in, *out; +- uint32_t inf = in_n_frames, outf = *out_n_frames; ++ uint32_t inf = in_n_frames, outf = *out_n_frames, i; + + pa_assert(r); + pa_assert(input); +@@ -1357,6 +1357,11 @@ + in = pa_memblock_acquire_chunk(input); + out = pa_memblock_acquire_chunk(output); + ++ /* Speex float API scale range is +/-32768 instead of +/-1. ++ So rescale input before passing it to Speex. */ ++ for (i = 0; i < inf; i++) ++ in[i] = 32768.*in[i]; ++ + pa_assert_se(speex_resampler_process_interleaved_float(r->speex.state, in, &inf, out, &outf) == 0); + + pa_memblock_release(input->memblock); diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb index b419c54..5afa20b 100644 --- a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb @@ -1,7 +1,8 @@ require pulseaudio.inc SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${PV}.tar.xz \ - file://volatiles.04_pulse" + file://volatiles.04_pulse \ + file://rescale_input_to_speex_float.patch" SRC_URI[md5sum] = "591f211db2790a7e4d222f2dc6858db3" SRC_URI[sha256sum] = "35ceb36bb1822fe54f0b5e4863b4f486769fdfb8ff2111f01fd8778928f9cdae" -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] pulseaudio: rescale input being passed to float method of speex 2013-12-24 14:37 [PATCH] pulseaudio: rescale input being passed to float method of speex Fahad Arslan @ 2013-12-24 16:54 ` Saul Wold 2014-01-01 16:01 ` Arslan, Fahad 2013-12-26 11:57 ` Koen Kooi 1 sibling, 1 reply; 12+ messages in thread From: Saul Wold @ 2013-12-24 16:54 UTC (permalink / raw) To: Fahad Arslan, openembedded-core On 12/24/2013 06:37 AM, Fahad Arslan wrote: > From: Fahad Arslan <Fahad_Arslan@mentor.com> > > Pulseaudio uses Speex to do resampling. Default Pulseaudio resampler > is speex-float-1. However, Speex recipe in poky configures speex in > fixed point. This scenario creates a situation in which audio streams > that need to be resampled are not playedback since input to speex is > zeroed out when flaot input in range of +/-1 is converted to int. > So we are rescaling the input before invoking speex flaot method. > > Upstream-Status: Submitted [pulseaudio-discuss@lists.freedesktop.org] > > Signed-off-by: Fahad Arslan <Fahad_Arslan@mentor.com> > --- > .../pulseaudio/rescale_input_to_speex_float.patch | 24 ++++++++++++++++++++ > .../pulseaudio/pulseaudio_4.0.bb | 3 ++- > 2 files changed, 26 insertions(+), 1 deletion(-) > create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch > > diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch > new file mode 100644 > index 0000000..fe5e6a7 > --- /dev/null > +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch Fahad, The patch itself is missing the Upstream-Status: and Signed-off-by: Tags, I know you included them in the commit message above, but they need to be in this patch file also. Thanks Sau! > @@ -0,0 +1,24 @@ > +diff -Naur a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c > +--- a/src/pulsecore/resampler.c 2013-12-24 18:25:08.164787401 +0500 > ++++ b/src/pulsecore/resampler.c 2013-12-24 18:24:43.056787026 +0500 > +@@ -1347,7 +1347,7 @@ > + > + static void speex_resample_float(pa_resampler *r, const pa_memchunk *input, unsigned in_n_frames, pa_memchunk *output, unsigned *out_n_frames) { > + float *in, *out; > +- uint32_t inf = in_n_frames, outf = *out_n_frames; > ++ uint32_t inf = in_n_frames, outf = *out_n_frames, i; > + > + pa_assert(r); > + pa_assert(input); > +@@ -1357,6 +1357,11 @@ > + in = pa_memblock_acquire_chunk(input); > + out = pa_memblock_acquire_chunk(output); > + > ++ /* Speex float API scale range is +/-32768 instead of +/-1. > ++ So rescale input before passing it to Speex. */ > ++ for (i = 0; i < inf; i++) > ++ in[i] = 32768.*in[i]; > ++ > + pa_assert_se(speex_resampler_process_interleaved_float(r->speex.state, in, &inf, out, &outf) == 0); > + > + pa_memblock_release(input->memblock); > diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb > index b419c54..5afa20b 100644 > --- a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb > +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb > @@ -1,7 +1,8 @@ > require pulseaudio.inc > > SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${PV}.tar.xz \ > - file://volatiles.04_pulse" > + file://volatiles.04_pulse \ > + file://rescale_input_to_speex_float.patch" > > SRC_URI[md5sum] = "591f211db2790a7e4d222f2dc6858db3" > SRC_URI[sha256sum] = "35ceb36bb1822fe54f0b5e4863b4f486769fdfb8ff2111f01fd8778928f9cdae" > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] pulseaudio: rescale input being passed to float method of speex 2013-12-24 16:54 ` Saul Wold @ 2014-01-01 16:01 ` Arslan, Fahad 2014-01-02 18:47 ` Saul Wold 0 siblings, 1 reply; 12+ messages in thread From: Arslan, Fahad @ 2014-01-01 16:01 UTC (permalink / raw) To: Saul Wold, openembedded-core@lists.openembedded.org Pulseaudio upstream says that this patch breaks speex-float if it isn't compiled with FIXED_POINT defined, which is valid concern. So what is the best option now to avoid the no sound issue: a. replace --enable-fixed-point and --disable-float-api with --enable-float-api in Speex's recipe b. replace default resampler (speex-float-1) used by Pulseaudio to speex-fixed-1 In my opinion option (a) above is better. Thoughts/suggestions? Thanks, Fahad ________________________________________ From: Saul Wold [sgw@linux.intel.com] Sent: Tuesday, December 24, 2013 9:54 PM To: Arslan, Fahad; openembedded-core@lists.openembedded.org Subject: Re: [OE-core] [PATCH] pulseaudio: rescale input being passed to float method of speex On 12/24/2013 06:37 AM, Fahad Arslan wrote: > From: Fahad Arslan <Fahad_Arslan@mentor.com> > > Pulseaudio uses Speex to do resampling. Default Pulseaudio resampler > is speex-float-1. However, Speex recipe in poky configures speex in > fixed point. This scenario creates a situation in which audio streams > that need to be resampled are not playedback since input to speex is > zeroed out when flaot input in range of +/-1 is converted to int. > So we are rescaling the input before invoking speex flaot method. > > Upstream-Status: Submitted [pulseaudio-discuss@lists.freedesktop.org] > > Signed-off-by: Fahad Arslan <Fahad_Arslan@mentor.com> > --- > .../pulseaudio/rescale_input_to_speex_float.patch | 24 ++++++++++++++++++++ > .../pulseaudio/pulseaudio_4.0.bb | 3 ++- > 2 files changed, 26 insertions(+), 1 deletion(-) > create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch > > diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch > new file mode 100644 > index 0000000..fe5e6a7 > --- /dev/null > +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch Fahad, The patch itself is missing the Upstream-Status: and Signed-off-by: Tags, I know you included them in the commit message above, but they need to be in this patch file also. Thanks Sau! > @@ -0,0 +1,24 @@ > +diff -Naur a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c > +--- a/src/pulsecore/resampler.c 2013-12-24 18:25:08.164787401 +0500 > ++++ b/src/pulsecore/resampler.c 2013-12-24 18:24:43.056787026 +0500 > +@@ -1347,7 +1347,7 @@ > + > + static void speex_resample_float(pa_resampler *r, const pa_memchunk *input, unsigned in_n_frames, pa_memchunk *output, unsigned *out_n_frames) { > + float *in, *out; > +- uint32_t inf = in_n_frames, outf = *out_n_frames; > ++ uint32_t inf = in_n_frames, outf = *out_n_frames, i; > + > + pa_assert(r); > + pa_assert(input); > +@@ -1357,6 +1357,11 @@ > + in = pa_memblock_acquire_chunk(input); > + out = pa_memblock_acquire_chunk(output); > + > ++ /* Speex float API scale range is +/-32768 instead of +/-1. > ++ So rescale input before passing it to Speex. */ > ++ for (i = 0; i < inf; i++) > ++ in[i] = 32768.*in[i]; > ++ > + pa_assert_se(speex_resampler_process_interleaved_float(r->speex.state, in, &inf, out, &outf) == 0); > + > + pa_memblock_release(input->memblock); > diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb > index b419c54..5afa20b 100644 > --- a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb > +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb > @@ -1,7 +1,8 @@ > require pulseaudio.inc > > SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${PV}.tar.xz \ > - file://volatiles.04_pulse" > + file://volatiles.04_pulse \ > + file://rescale_input_to_speex_float.patch" > > SRC_URI[md5sum] = "591f211db2790a7e4d222f2dc6858db3" > SRC_URI[sha256sum] = "35ceb36bb1822fe54f0b5e4863b4f486769fdfb8ff2111f01fd8778928f9cdae" > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] pulseaudio: rescale input being passed to float method of speex 2014-01-01 16:01 ` Arslan, Fahad @ 2014-01-02 18:47 ` Saul Wold 2014-01-07 9:59 ` Arslan, Fahad 0 siblings, 1 reply; 12+ messages in thread From: Saul Wold @ 2014-01-02 18:47 UTC (permalink / raw) To: Arslan, Fahad, openembedded-core@lists.openembedded.org Cc: Marcin Juszkiewicz On 01/01/2014 08:01 AM, Arslan, Fahad wrote: > Pulseaudio upstream says that this patch breaks speex-float if > it isn't compiled with FIXED_POINT defined, which is valid concern. > So what is the best option now to avoid the no sound issue: > a. replace --enable-fixed-point and --disable-float-api with --enable-float-api in Speex's recipe There is a commit message from 2008 by Marcin J. that seems to disable this, I am not sure why that choice was made at that time. What affect does it have on the overall size of speex > b. replace default resampler (speex-float-1) used by Pulseaudio to speex-fixed-1 > > In my opinion option (a) above is better. Thoughts/suggestions? > > Thanks, > Fahad > > ________________________________________ > From: Saul Wold [sgw@linux.intel.com] > Sent: Tuesday, December 24, 2013 9:54 PM > To: Arslan, Fahad; openembedded-core@lists.openembedded.org > Subject: Re: [OE-core] [PATCH] pulseaudio: rescale input being passed to float method of speex > > On 12/24/2013 06:37 AM, Fahad Arslan wrote: >> From: Fahad Arslan <Fahad_Arslan@mentor.com> >> >> Pulseaudio uses Speex to do resampling. Default Pulseaudio resampler >> is speex-float-1. However, Speex recipe in poky configures speex in >> fixed point. This scenario creates a situation in which audio streams >> that need to be resampled are not playedback since input to speex is >> zeroed out when flaot input in range of +/-1 is converted to int. >> So we are rescaling the input before invoking speex flaot method. >> >> Upstream-Status: Submitted [pulseaudio-discuss@lists.freedesktop.org] >> >> Signed-off-by: Fahad Arslan <Fahad_Arslan@mentor.com> >> --- >> .../pulseaudio/rescale_input_to_speex_float.patch | 24 ++++++++++++++++++++ >> .../pulseaudio/pulseaudio_4.0.bb | 3 ++- >> 2 files changed, 26 insertions(+), 1 deletion(-) >> create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch >> >> diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch >> new file mode 100644 >> index 0000000..fe5e6a7 >> --- /dev/null >> +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch > > Fahad, > > The patch itself is missing the Upstream-Status: and Signed-off-by: > Tags, I know you included them in the commit message above, but they > need to be in this patch file also. > > Thanks > Sau! > >> @@ -0,0 +1,24 @@ >> +diff -Naur a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c >> +--- a/src/pulsecore/resampler.c 2013-12-24 18:25:08.164787401 +0500 >> ++++ b/src/pulsecore/resampler.c 2013-12-24 18:24:43.056787026 +0500 >> +@@ -1347,7 +1347,7 @@ >> + >> + static void speex_resample_float(pa_resampler *r, const pa_memchunk *input, unsigned in_n_frames, pa_memchunk *output, unsigned *out_n_frames) { >> + float *in, *out; >> +- uint32_t inf = in_n_frames, outf = *out_n_frames; >> ++ uint32_t inf = in_n_frames, outf = *out_n_frames, i; >> + >> + pa_assert(r); >> + pa_assert(input); >> +@@ -1357,6 +1357,11 @@ >> + in = pa_memblock_acquire_chunk(input); >> + out = pa_memblock_acquire_chunk(output); >> + >> ++ /* Speex float API scale range is +/-32768 instead of +/-1. >> ++ So rescale input before passing it to Speex. */ >> ++ for (i = 0; i < inf; i++) >> ++ in[i] = 32768.*in[i]; >> ++ >> + pa_assert_se(speex_resampler_process_interleaved_float(r->speex.state, in, &inf, out, &outf) == 0); >> + >> + pa_memblock_release(input->memblock); >> diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb >> index b419c54..5afa20b 100644 >> --- a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb >> +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb >> @@ -1,7 +1,8 @@ >> require pulseaudio.inc >> >> SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${PV}.tar.xz \ >> - file://volatiles.04_pulse" >> + file://volatiles.04_pulse \ >> + file://rescale_input_to_speex_float.patch" >> >> SRC_URI[md5sum] = "591f211db2790a7e4d222f2dc6858db3" >> SRC_URI[sha256sum] = "35ceb36bb1822fe54f0b5e4863b4f486769fdfb8ff2111f01fd8778928f9cdae" >> > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] pulseaudio: rescale input being passed to float method of speex 2014-01-02 18:47 ` Saul Wold @ 2014-01-07 9:59 ` Arslan, Fahad 2014-01-07 10:03 ` Koen Kooi 0 siblings, 1 reply; 12+ messages in thread From: Arslan, Fahad @ 2014-01-07 9:59 UTC (permalink / raw) To: Saul Wold, openembedded-core@lists.openembedded.org; +Cc: Marcin Juszkiewicz > What affect does it have on the overall size of speex If we enable floating point support, there is decrease in size of libs. libspeexdsp.so is ~480 KB in fixed point configuration libspeexdsp.so is ~220 KB in floating point configuration Further details are shown below: Case-1 (current configuration) ====== EXTRA_OECONF = " --enable-fixed-point --with-ogg-libraries=${STAGING_LIBDIR} \ --disable-float-api --disable-vbr \ --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" build$ build$ ls -l src/.libs/speex* -rwxr-xr-x 1 farslan farslan 75112 Jan 7 14:09 src/.libs/speexdec -rwxr-xr-x 1 farslan farslan 76989 Jan 7 14:09 src/.libs/speexenc build$ file src/.libs/speex* src/.libs/speexdec: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped src/.libs/speexenc: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped build$ build$ build$ ls -l libspeex/.libs/libspeex*.so.1.5.0 -rwxr-xr-x 1 farslan farslan 484940 Jan 7 14:09 libspeex/.libs/libspeexdsp.so.1.5.0 -rwxr-xr-x 1 farslan farslan 370309 Jan 7 14:09 libspeex/.libs/libspeex.so.1.5.0 build$ build$ file libspeex/.libs/libspeex*.so.1.5.0 libspeex/.libs/libspeexdsp.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped libspeex/.libs/libspeex.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped build$ Case-2 (suggested configuration) ====== EXTRA_OECONF = " --with-ogg-libraries=${STAGING_LIBDIR} \ --enable-float-api --disable-vbr \ --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" build$ build$ ls -l src/.libs/speex* -rwxr-xr-x 1 farslan farslan 75112 Jan 7 14:40 src/.libs/speexdec -rwxr-xr-x 1 farslan farslan 76989 Jan 7 14:40 src/.libs/speexenc build$ file src/.libs/speex* src/.libs/speexdec: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped src/.libs/speexenc: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped build$ build$ build$ ls -l libspeex/.libs/libspeex*.so.1.5.0 -rwxr-xr-x 1 farslan farslan 222582 Jan 7 14:40 libspeex/.libs/libspeexdsp.so.1.5.0 -rwxr-xr-x 1 farslan farslan 280029 Jan 7 14:39 libspeex/.libs/libspeex.so.1.5.0 build$ build$ file libspeex/.libs/libspeex*.so.1.5.0 libspeex/.libs/libspeexdsp.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped libspeex/.libs/libspeex.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped build$ Thanks, Fahad ________________________________________ From: Saul Wold [sgw@linux.intel.com] Sent: Thursday, January 02, 2014 11:47 PM To: Arslan, Fahad; openembedded-core@lists.openembedded.org Cc: Marcin Juszkiewicz Subject: Re: [OE-core] [PATCH] pulseaudio: rescale input being passed to float method of speex On 01/01/2014 08:01 AM, Arslan, Fahad wrote: > Pulseaudio upstream says that this patch breaks speex-float if > it isn't compiled with FIXED_POINT defined, which is valid concern. > So what is the best option now to avoid the no sound issue: > a. replace --enable-fixed-point and --disable-float-api with --enable-float-api in Speex's recipe There is a commit message from 2008 by Marcin J. that seems to disable this, I am not sure why that choice was made at that time. What affect does it have on the overall size of speex > b. replace default resampler (speex-float-1) used by Pulseaudio to speex-fixed-1 > > In my opinion option (a) above is better. Thoughts/suggestions? > > Thanks, > Fahad > > ________________________________________ > From: Saul Wold [sgw@linux.intel.com] > Sent: Tuesday, December 24, 2013 9:54 PM > To: Arslan, Fahad; openembedded-core@lists.openembedded.org > Subject: Re: [OE-core] [PATCH] pulseaudio: rescale input being passed to float method of speex > > On 12/24/2013 06:37 AM, Fahad Arslan wrote: >> From: Fahad Arslan <Fahad_Arslan@mentor.com> >> >> Pulseaudio uses Speex to do resampling. Default Pulseaudio resampler >> is speex-float-1. However, Speex recipe in poky configures speex in >> fixed point. This scenario creates a situation in which audio streams >> that need to be resampled are not playedback since input to speex is >> zeroed out when flaot input in range of +/-1 is converted to int. >> So we are rescaling the input before invoking speex flaot method. >> >> Upstream-Status: Submitted [pulseaudio-discuss@lists.freedesktop.org] >> >> Signed-off-by: Fahad Arslan <Fahad_Arslan@mentor.com> >> --- >> .../pulseaudio/rescale_input_to_speex_float.patch | 24 ++++++++++++++++++++ >> .../pulseaudio/pulseaudio_4.0.bb | 3 ++- >> 2 files changed, 26 insertions(+), 1 deletion(-) >> create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch >> >> diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch >> new file mode 100644 >> index 0000000..fe5e6a7 >> --- /dev/null >> +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch > > Fahad, > > The patch itself is missing the Upstream-Status: and Signed-off-by: > Tags, I know you included them in the commit message above, but they > need to be in this patch file also. > > Thanks > Sau! > >> @@ -0,0 +1,24 @@ >> +diff -Naur a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c >> +--- a/src/pulsecore/resampler.c 2013-12-24 18:25:08.164787401 +0500 >> ++++ b/src/pulsecore/resampler.c 2013-12-24 18:24:43.056787026 +0500 >> +@@ -1347,7 +1347,7 @@ >> + >> + static void speex_resample_float(pa_resampler *r, const pa_memchunk *input, unsigned in_n_frames, pa_memchunk *output, unsigned *out_n_frames) { >> + float *in, *out; >> +- uint32_t inf = in_n_frames, outf = *out_n_frames; >> ++ uint32_t inf = in_n_frames, outf = *out_n_frames, i; >> + >> + pa_assert(r); >> + pa_assert(input); >> +@@ -1357,6 +1357,11 @@ >> + in = pa_memblock_acquire_chunk(input); >> + out = pa_memblock_acquire_chunk(output); >> + >> ++ /* Speex float API scale range is +/-32768 instead of +/-1. >> ++ So rescale input before passing it to Speex. */ >> ++ for (i = 0; i < inf; i++) >> ++ in[i] = 32768.*in[i]; >> ++ >> + pa_assert_se(speex_resampler_process_interleaved_float(r->speex.state, in, &inf, out, &outf) == 0); >> + >> + pa_memblock_release(input->memblock); >> diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb >> index b419c54..5afa20b 100644 >> --- a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb >> +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb >> @@ -1,7 +1,8 @@ >> require pulseaudio.inc >> >> SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${PV}.tar.xz \ >> - file://volatiles.04_pulse" >> + file://volatiles.04_pulse \ >> + file://rescale_input_to_speex_float.patch" >> >> SRC_URI[md5sum] = "591f211db2790a7e4d222f2dc6858db3" >> SRC_URI[sha256sum] = "35ceb36bb1822fe54f0b5e4863b4f486769fdfb8ff2111f01fd8778928f9cdae" >> > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] pulseaudio: rescale input being passed to float method of speex 2014-01-07 9:59 ` Arslan, Fahad @ 2014-01-07 10:03 ` Koen Kooi 2014-01-07 10:22 ` Koen Kooi 0 siblings, 1 reply; 12+ messages in thread From: Koen Kooi @ 2014-01-07 10:03 UTC (permalink / raw) To: Arslan, Fahad Cc: Marcin Juszkiewicz, openembedded-core@lists.openembedded.org Op 7 jan. 2014, om 10:59 heeft Arslan, Fahad <Fahad_Arslan@mentor.com> het volgende geschreven: >> What affect does it have on the overall size of speex > > If we enable floating point support, there is decrease in size of libs. > libspeexdsp.so is ~480 KB in fixed point configuration > libspeexdsp.so is ~220 KB in floating point configuration > > Further details are shown below: > > > Case-1 (current configuration) > ====== > > EXTRA_OECONF = " --enable-fixed-point --with-ogg-libraries=${STAGING_LIBDIR} \ > --disable-float-api --disable-vbr \ > --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" > > build$ > build$ ls -l src/.libs/speex* > -rwxr-xr-x 1 farslan farslan 75112 Jan 7 14:09 src/.libs/speexdec > -rwxr-xr-x 1 farslan farslan 76989 Jan 7 14:09 src/.libs/speexenc > build$ file src/.libs/speex* > src/.libs/speexdec: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped > src/.libs/speexenc: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped > build$ > build$ > build$ ls -l libspeex/.libs/libspeex*.so.1.5.0 > -rwxr-xr-x 1 farslan farslan 484940 Jan 7 14:09 libspeex/.libs/libspeexdsp.so.1.5.0 > -rwxr-xr-x 1 farslan farslan 370309 Jan 7 14:09 libspeex/.libs/libspeex.so.1.5.0 > build$ > build$ file libspeex/.libs/libspeex*.so.1.5.0 > libspeex/.libs/libspeexdsp.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped > libspeex/.libs/libspeex.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped > build$ > > > Case-2 (suggested configuration) > ====== > > EXTRA_OECONF = " --with-ogg-libraries=${STAGING_LIBDIR} \ > --enable-float-api --disable-vbr \ > --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" Or case 3, which I implemented 3 years ago in https://github.com/openembedded/openembedded/commit/e06553979d23531397af3dd71870abb80718c681 : def get_speex_fpu_setting(bb, d): if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: return "--enable-fixed-point --disable-float-api --disable-vbr" return "" EXTRA_OECONF += "${@get_speex_fpu_setting(bb, d)} That OE-classic recipe also has support for arm asm which speed things up a lot. regards, Koen ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] pulseaudio: rescale input being passed to float method of speex 2014-01-07 10:03 ` Koen Kooi @ 2014-01-07 10:22 ` Koen Kooi 2014-01-10 7:48 ` Arslan, Fahad 0 siblings, 1 reply; 12+ messages in thread From: Koen Kooi @ 2014-01-07 10:22 UTC (permalink / raw) To: Arslan, Fahad; +Cc: openembedded-core@lists.openembedded.org, marcin Marcins linaro mail address has expired, adding the other one Op 7 jan. 2014, om 11:03 heeft Koen Kooi <koen@dominion.thruhere.net> het volgende geschreven: > > Op 7 jan. 2014, om 10:59 heeft Arslan, Fahad <Fahad_Arslan@mentor.com> het volgende geschreven: > >>> What affect does it have on the overall size of speex >> >> If we enable floating point support, there is decrease in size of libs. >> libspeexdsp.so is ~480 KB in fixed point configuration >> libspeexdsp.so is ~220 KB in floating point configuration >> >> Further details are shown below: >> >> >> Case-1 (current configuration) >> ====== >> >> EXTRA_OECONF = " --enable-fixed-point --with-ogg-libraries=${STAGING_LIBDIR} \ >> --disable-float-api --disable-vbr \ >> --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" >> >> build$ >> build$ ls -l src/.libs/speex* >> -rwxr-xr-x 1 farslan farslan 75112 Jan 7 14:09 src/.libs/speexdec >> -rwxr-xr-x 1 farslan farslan 76989 Jan 7 14:09 src/.libs/speexenc >> build$ file src/.libs/speex* >> src/.libs/speexdec: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped >> src/.libs/speexenc: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped >> build$ >> build$ >> build$ ls -l libspeex/.libs/libspeex*.so.1.5.0 >> -rwxr-xr-x 1 farslan farslan 484940 Jan 7 14:09 libspeex/.libs/libspeexdsp.so.1.5.0 >> -rwxr-xr-x 1 farslan farslan 370309 Jan 7 14:09 libspeex/.libs/libspeex.so.1.5.0 >> build$ >> build$ file libspeex/.libs/libspeex*.so.1.5.0 >> libspeex/.libs/libspeexdsp.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped >> libspeex/.libs/libspeex.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped >> build$ >> >> >> Case-2 (suggested configuration) >> ====== >> >> EXTRA_OECONF = " --with-ogg-libraries=${STAGING_LIBDIR} \ >> --enable-float-api --disable-vbr \ >> --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" > > Or case 3, which I implemented 3 years ago in https://github.com/openembedded/openembedded/commit/e06553979d23531397af3dd71870abb80718c681 : > > def get_speex_fpu_setting(bb, d): > if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: > return "--enable-fixed-point --disable-float-api --disable-vbr" > return "" > > > EXTRA_OECONF += "${@get_speex_fpu_setting(bb, d)} > > That OE-classic recipe also has support for arm asm which speed things up a lot. > > regards, > > Koen ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] pulseaudio: rescale input being passed to float method of speex 2014-01-07 10:22 ` Koen Kooi @ 2014-01-10 7:48 ` Arslan, Fahad 2014-01-10 15:33 ` Koen Kooi 0 siblings, 1 reply; 12+ messages in thread From: Arslan, Fahad @ 2014-01-10 7:48 UTC (permalink / raw) To: Koen Kooi; +Cc: openembedded-core@lists.openembedded.org, marcin@juszkiewicz.pl >def get_speex_fpu_setting(bb, d): > if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: > return "--enable-fixed-point --disable-float-api --disable-vbr" > return "" If we are using Pulseaudio with default settings (speex-float-1) and the if condition in above method is evaluated true, we will end up facing the original issue: streams that need to be resampled are not playedback since input to speex is zeroed out when float input passed by Pulseaudio in range of +/-1 is converted to int. So isn't Case 2 appropriate, thoughts? Regards, Fahad ________________________________________ From: Koen Kooi [koen@dominion.thruhere.net] Sent: Tuesday, January 07, 2014 3:22 PM To: Arslan, Fahad Cc: Saul Wold; openembedded-core@lists.openembedded.org; marcin@juszkiewicz.pl Subject: Re: [OE-core] [PATCH] pulseaudio: rescale input being passed to float method of speex Marcins linaro mail address has expired, adding the other one Op 7 jan. 2014, om 11:03 heeft Koen Kooi <koen@dominion.thruhere.net> het volgende geschreven: > > Op 7 jan. 2014, om 10:59 heeft Arslan, Fahad <Fahad_Arslan@mentor.com> het volgende geschreven: > >>> What affect does it have on the overall size of speex >> >> If we enable floating point support, there is decrease in size of libs. >> libspeexdsp.so is ~480 KB in fixed point configuration >> libspeexdsp.so is ~220 KB in floating point configuration >> >> Further details are shown below: >> >> >> Case-1 (current configuration) >> ====== >> >> EXTRA_OECONF = " --enable-fixed-point --with-ogg-libraries=${STAGING_LIBDIR} \ >> --disable-float-api --disable-vbr \ >> --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" >> >> build$ >> build$ ls -l src/.libs/speex* >> -rwxr-xr-x 1 farslan farslan 75112 Jan 7 14:09 src/.libs/speexdec >> -rwxr-xr-x 1 farslan farslan 76989 Jan 7 14:09 src/.libs/speexenc >> build$ file src/.libs/speex* >> src/.libs/speexdec: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped >> src/.libs/speexenc: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped >> build$ >> build$ >> build$ ls -l libspeex/.libs/libspeex*.so.1.5.0 >> -rwxr-xr-x 1 farslan farslan 484940 Jan 7 14:09 libspeex/.libs/libspeexdsp.so.1.5.0 >> -rwxr-xr-x 1 farslan farslan 370309 Jan 7 14:09 libspeex/.libs/libspeex.so.1.5.0 >> build$ >> build$ file libspeex/.libs/libspeex*.so.1.5.0 >> libspeex/.libs/libspeexdsp.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped >> libspeex/.libs/libspeex.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped >> build$ >> >> >> Case-2 (suggested configuration) >> ====== >> >> EXTRA_OECONF = " --with-ogg-libraries=${STAGING_LIBDIR} \ >> --enable-float-api --disable-vbr \ >> --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" > > Or case 3, which I implemented 3 years ago in https://github.com/openembedded/openembedded/commit/e06553979d23531397af3dd71870abb80718c681 : > > def get_speex_fpu_setting(bb, d): > if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: > return "--enable-fixed-point --disable-float-api --disable-vbr" > return "" > > > EXTRA_OECONF += "${@get_speex_fpu_setting(bb, d)} > > That OE-classic recipe also has support for arm asm which speed things up a lot. > > regards, > > Koen ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] pulseaudio: rescale input being passed to float method of speex 2014-01-10 7:48 ` Arslan, Fahad @ 2014-01-10 15:33 ` Koen Kooi 2014-01-16 12:08 ` Arslan, Fahad 0 siblings, 1 reply; 12+ messages in thread From: Koen Kooi @ 2014-01-10 15:33 UTC (permalink / raw) To: Arslan, Fahad Cc: Marcin Juszkiewicz, openembedded-core@lists.openembedded.org Op 10 jan. 2014, om 08:48 heeft Arslan, Fahad <Fahad_Arslan@mentor.com> het volgende geschreven: >> def get_speex_fpu_setting(bb, d): >> if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: >> return "--enable-fixed-point --disable-float-api --disable-vbr" >> return "" > > If we are using Pulseaudio with default settings (speex-float-1) and > the if condition in above method is evaluated true, we will end up facing > the original issue: streams that need to be resampled are not playedback > since input to speex is zeroed out when float input passed by Pulseaudio > in range of +/-1 is converted to int. > > So isn't Case 2 appropriate, thoughts? It's also 10-50x slower on ARM, so always enabling float is a bad option. Just patch it to work, no matter what upstream says :) > > Regards, > Fahad > > ________________________________________ > From: Koen Kooi [koen@dominion.thruhere.net] > Sent: Tuesday, January 07, 2014 3:22 PM > To: Arslan, Fahad > Cc: Saul Wold; openembedded-core@lists.openembedded.org; marcin@juszkiewicz.pl > Subject: Re: [OE-core] [PATCH] pulseaudio: rescale input being passed to float method of speex > > Marcins linaro mail address has expired, adding the other one > > Op 7 jan. 2014, om 11:03 heeft Koen Kooi <koen@dominion.thruhere.net> het volgende geschreven: > >> >> Op 7 jan. 2014, om 10:59 heeft Arslan, Fahad <Fahad_Arslan@mentor.com> het volgende geschreven: >> >>>> What affect does it have on the overall size of speex >>> >>> If we enable floating point support, there is decrease in size of libs. >>> libspeexdsp.so is ~480 KB in fixed point configuration >>> libspeexdsp.so is ~220 KB in floating point configuration >>> >>> Further details are shown below: >>> >>> >>> Case-1 (current configuration) >>> ====== >>> >>> EXTRA_OECONF = " --enable-fixed-point --with-ogg-libraries=${STAGING_LIBDIR} \ >>> --disable-float-api --disable-vbr \ >>> --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" >>> >>> build$ >>> build$ ls -l src/.libs/speex* >>> -rwxr-xr-x 1 farslan farslan 75112 Jan 7 14:09 src/.libs/speexdec >>> -rwxr-xr-x 1 farslan farslan 76989 Jan 7 14:09 src/.libs/speexenc >>> build$ file src/.libs/speex* >>> src/.libs/speexdec: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped >>> src/.libs/speexenc: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped >>> build$ >>> build$ >>> build$ ls -l libspeex/.libs/libspeex*.so.1.5.0 >>> -rwxr-xr-x 1 farslan farslan 484940 Jan 7 14:09 libspeex/.libs/libspeexdsp.so.1.5.0 >>> -rwxr-xr-x 1 farslan farslan 370309 Jan 7 14:09 libspeex/.libs/libspeex.so.1.5.0 >>> build$ >>> build$ file libspeex/.libs/libspeex*.so.1.5.0 >>> libspeex/.libs/libspeexdsp.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped >>> libspeex/.libs/libspeex.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped >>> build$ >>> >>> >>> Case-2 (suggested configuration) >>> ====== >>> >>> EXTRA_OECONF = " --with-ogg-libraries=${STAGING_LIBDIR} \ >>> --enable-float-api --disable-vbr \ >>> --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" >> >> Or case 3, which I implemented 3 years ago in https://github.com/openembedded/openembedded/commit/e06553979d23531397af3dd71870abb80718c681 : >> >> def get_speex_fpu_setting(bb, d): >> if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: >> return "--enable-fixed-point --disable-float-api --disable-vbr" >> return "" >> >> >> EXTRA_OECONF += "${@get_speex_fpu_setting(bb, d)} >> >> That OE-classic recipe also has support for arm asm which speed things up a lot. >> >> regards, >> >> Koen > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] pulseaudio: rescale input being passed to float method of speex 2014-01-10 15:33 ` Koen Kooi @ 2014-01-16 12:08 ` Arslan, Fahad 2014-01-16 19:16 ` Koen Kooi 0 siblings, 1 reply; 12+ messages in thread From: Arslan, Fahad @ 2014-01-16 12:08 UTC (permalink / raw) To: Koen Kooi; +Cc: Marcin Juszkiewicz, openembedded-core@lists.openembedded.org >It's also 10-50x slower on ARM, so always enabling float is a bad option. Just patch it to work, no matter what upstream says :) Seems I misunderstood the statement earlier. So to confirm, do you mean I should submit patch here for original bug in Speex source code? ________________________________________ From: Koen Kooi [koen@dominion.thruhere.net] Sent: Friday, January 10, 2014 8:33 PM To: Arslan, Fahad Cc: Saul Wold; openembedded-core@lists.openembedded.org; Marcin Juszkiewicz Subject: Re: [OE-core] [PATCH] pulseaudio: rescale input being passed to float method of speex Op 10 jan. 2014, om 08:48 heeft Arslan, Fahad <Fahad_Arslan@mentor.com> het volgende geschreven: >> def get_speex_fpu_setting(bb, d): >> if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: >> return "--enable-fixed-point --disable-float-api --disable-vbr" >> return "" > > If we are using Pulseaudio with default settings (speex-float-1) and > the if condition in above method is evaluated true, we will end up facing > the original issue: streams that need to be resampled are not playedback > since input to speex is zeroed out when float input passed by Pulseaudio > in range of +/-1 is converted to int. > > So isn't Case 2 appropriate, thoughts? It's also 10-50x slower on ARM, so always enabling float is a bad option. Just patch it to work, no matter what upstream says :) > > Regards, > Fahad > > ________________________________________ > From: Koen Kooi [koen@dominion.thruhere.net] > Sent: Tuesday, January 07, 2014 3:22 PM > To: Arslan, Fahad > Cc: Saul Wold; openembedded-core@lists.openembedded.org; marcin@juszkiewicz.pl > Subject: Re: [OE-core] [PATCH] pulseaudio: rescale input being passed to float method of speex > > Marcins linaro mail address has expired, adding the other one > > Op 7 jan. 2014, om 11:03 heeft Koen Kooi <koen@dominion.thruhere.net> het volgende geschreven: > >> >> Op 7 jan. 2014, om 10:59 heeft Arslan, Fahad <Fahad_Arslan@mentor.com> het volgende geschreven: >> >>>> What affect does it have on the overall size of speex >>> >>> If we enable floating point support, there is decrease in size of libs. >>> libspeexdsp.so is ~480 KB in fixed point configuration >>> libspeexdsp.so is ~220 KB in floating point configuration >>> >>> Further details are shown below: >>> >>> >>> Case-1 (current configuration) >>> ====== >>> >>> EXTRA_OECONF = " --enable-fixed-point --with-ogg-libraries=${STAGING_LIBDIR} \ >>> --disable-float-api --disable-vbr \ >>> --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" >>> >>> build$ >>> build$ ls -l src/.libs/speex* >>> -rwxr-xr-x 1 farslan farslan 75112 Jan 7 14:09 src/.libs/speexdec >>> -rwxr-xr-x 1 farslan farslan 76989 Jan 7 14:09 src/.libs/speexenc >>> build$ file src/.libs/speex* >>> src/.libs/speexdec: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped >>> src/.libs/speexenc: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped >>> build$ >>> build$ >>> build$ ls -l libspeex/.libs/libspeex*.so.1.5.0 >>> -rwxr-xr-x 1 farslan farslan 484940 Jan 7 14:09 libspeex/.libs/libspeexdsp.so.1.5.0 >>> -rwxr-xr-x 1 farslan farslan 370309 Jan 7 14:09 libspeex/.libs/libspeex.so.1.5.0 >>> build$ >>> build$ file libspeex/.libs/libspeex*.so.1.5.0 >>> libspeex/.libs/libspeexdsp.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped >>> libspeex/.libs/libspeex.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped >>> build$ >>> >>> >>> Case-2 (suggested configuration) >>> ====== >>> >>> EXTRA_OECONF = " --with-ogg-libraries=${STAGING_LIBDIR} \ >>> --enable-float-api --disable-vbr \ >>> --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" >> >> Or case 3, which I implemented 3 years ago in https://github.com/openembedded/openembedded/commit/e06553979d23531397af3dd71870abb80718c681 : >> >> def get_speex_fpu_setting(bb, d): >> if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: >> return "--enable-fixed-point --disable-float-api --disable-vbr" >> return "" >> >> >> EXTRA_OECONF += "${@get_speex_fpu_setting(bb, d)} >> >> That OE-classic recipe also has support for arm asm which speed things up a lot. >> >> regards, >> >> Koen > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] pulseaudio: rescale input being passed to float method of speex 2014-01-16 12:08 ` Arslan, Fahad @ 2014-01-16 19:16 ` Koen Kooi 0 siblings, 0 replies; 12+ messages in thread From: Koen Kooi @ 2014-01-16 19:16 UTC (permalink / raw) To: Arslan, Fahad Cc: Marcin Juszkiewicz, openembedded-core@lists.openembedded.org Op 16 jan. 2014, om 13:08 heeft Arslan, Fahad <Fahad_Arslan@mentor.com> het volgende geschreven: >> It's also 10-50x slower on ARM, so always enabling float is a bad option. Just patch it to work, no matter what upstream says :) > > Seems I misunderstood the statement earlier. So to confirm, do you mean I should submit patch here for original bug in Speex source code? Whatever allows us to use fixed-point mode on fpuless systems > > ________________________________________ > From: Koen Kooi [koen@dominion.thruhere.net] > Sent: Friday, January 10, 2014 8:33 PM > To: Arslan, Fahad > Cc: Saul Wold; openembedded-core@lists.openembedded.org; Marcin Juszkiewicz > Subject: Re: [OE-core] [PATCH] pulseaudio: rescale input being passed to float method of speex > > Op 10 jan. 2014, om 08:48 heeft Arslan, Fahad <Fahad_Arslan@mentor.com> het volgende geschreven: > >>> def get_speex_fpu_setting(bb, d): >>> if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: >>> return "--enable-fixed-point --disable-float-api --disable-vbr" >>> return "" >> >> If we are using Pulseaudio with default settings (speex-float-1) and >> the if condition in above method is evaluated true, we will end up facing >> the original issue: streams that need to be resampled are not playedback >> since input to speex is zeroed out when float input passed by Pulseaudio >> in range of +/-1 is converted to int. >> >> So isn't Case 2 appropriate, thoughts? > > It's also 10-50x slower on ARM, so always enabling float is a bad option. Just patch it to work, no matter what upstream says :) > > >> >> Regards, >> Fahad >> >> ________________________________________ >> From: Koen Kooi [koen@dominion.thruhere.net] >> Sent: Tuesday, January 07, 2014 3:22 PM >> To: Arslan, Fahad >> Cc: Saul Wold; openembedded-core@lists.openembedded.org; marcin@juszkiewicz.pl >> Subject: Re: [OE-core] [PATCH] pulseaudio: rescale input being passed to float method of speex >> >> Marcins linaro mail address has expired, adding the other one >> >> Op 7 jan. 2014, om 11:03 heeft Koen Kooi <koen@dominion.thruhere.net> het volgende geschreven: >> >>> >>> Op 7 jan. 2014, om 10:59 heeft Arslan, Fahad <Fahad_Arslan@mentor.com> het volgende geschreven: >>> >>>>> What affect does it have on the overall size of speex >>>> >>>> If we enable floating point support, there is decrease in size of libs. >>>> libspeexdsp.so is ~480 KB in fixed point configuration >>>> libspeexdsp.so is ~220 KB in floating point configuration >>>> >>>> Further details are shown below: >>>> >>>> >>>> Case-1 (current configuration) >>>> ====== >>>> >>>> EXTRA_OECONF = " --enable-fixed-point --with-ogg-libraries=${STAGING_LIBDIR} \ >>>> --disable-float-api --disable-vbr \ >>>> --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" >>>> >>>> build$ >>>> build$ ls -l src/.libs/speex* >>>> -rwxr-xr-x 1 farslan farslan 75112 Jan 7 14:09 src/.libs/speexdec >>>> -rwxr-xr-x 1 farslan farslan 76989 Jan 7 14:09 src/.libs/speexenc >>>> build$ file src/.libs/speex* >>>> src/.libs/speexdec: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped >>>> src/.libs/speexenc: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped >>>> build$ >>>> build$ >>>> build$ ls -l libspeex/.libs/libspeex*.so.1.5.0 >>>> -rwxr-xr-x 1 farslan farslan 484940 Jan 7 14:09 libspeex/.libs/libspeexdsp.so.1.5.0 >>>> -rwxr-xr-x 1 farslan farslan 370309 Jan 7 14:09 libspeex/.libs/libspeex.so.1.5.0 >>>> build$ >>>> build$ file libspeex/.libs/libspeex*.so.1.5.0 >>>> libspeex/.libs/libspeexdsp.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped >>>> libspeex/.libs/libspeex.so.1.5.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped >>>> build$ >>>> >>>> >>>> Case-2 (suggested configuration) >>>> ====== >>>> >>>> EXTRA_OECONF = " --with-ogg-libraries=${STAGING_LIBDIR} \ >>>> --enable-float-api --disable-vbr \ >>>> --with-ogg-includes=${STAGING_INCDIR} --disable-oggtest" >>> >>> Or case 3, which I implemented 3 years ago in https://github.com/openembedded/openembedded/commit/e06553979d23531397af3dd71870abb80718c681 : >>> >>> def get_speex_fpu_setting(bb, d): >>> if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: >>> return "--enable-fixed-point --disable-float-api --disable-vbr" >>> return "" >>> >>> >>> EXTRA_OECONF += "${@get_speex_fpu_setting(bb, d)} >>> >>> That OE-classic recipe also has support for arm asm which speed things up a lot. >>> >>> regards, >>> >>> Koen >> >> > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] pulseaudio: rescale input being passed to float method of speex 2013-12-24 14:37 [PATCH] pulseaudio: rescale input being passed to float method of speex Fahad Arslan 2013-12-24 16:54 ` Saul Wold @ 2013-12-26 11:57 ` Koen Kooi 1 sibling, 0 replies; 12+ messages in thread From: Koen Kooi @ 2013-12-26 11:57 UTC (permalink / raw) To: Fahad Arslan; +Cc: Patches and discussions about the oe-core layer Op 24 dec. 2013, om 15:37 heeft Fahad Arslan <fahad_arslan@mentor.com> het volgende geschreven: > From: Fahad Arslan <Fahad_Arslan@mentor.com> > > Pulseaudio uses Speex to do resampling. Default Pulseaudio resampler > is speex-float-1. However, Speex recipe in poky configures speex in s/poky/oe-core/ > fixed point. This scenario creates a situation in which audio streams > that need to be resampled are not playedback since input to speex is > zeroed out when flaot input in range of +/-1 is converted to int. > So we are rescaling the input before invoking speex flaot method. s/flaot/float/g > > Upstream-Status: Submitted [pulseaudio-discuss@lists.freedesktop.org] > > Signed-off-by: Fahad Arslan <Fahad_Arslan@mentor.com> > --- > .../pulseaudio/rescale_input_to_speex_float.patch | 24 ++++++++++++++++++++ > .../pulseaudio/pulseaudio_4.0.bb | 3 ++- > 2 files changed, 26 insertions(+), 1 deletion(-) > create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch > > diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch > new file mode 100644 > index 0000000..fe5e6a7 > --- /dev/null > +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/rescale_input_to_speex_float.patch > @@ -0,0 +1,24 @@ > +diff -Naur a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c > +--- a/src/pulsecore/resampler.c 2013-12-24 18:25:08.164787401 +0500 > ++++ b/src/pulsecore/resampler.c 2013-12-24 18:24:43.056787026 +0500 > +@@ -1347,7 +1347,7 @@ > + > + static void speex_resample_float(pa_resampler *r, const pa_memchunk *input, unsigned in_n_frames, pa_memchunk *output, unsigned *out_n_frames) { > + float *in, *out; > +- uint32_t inf = in_n_frames, outf = *out_n_frames; > ++ uint32_t inf = in_n_frames, outf = *out_n_frames, i; > + > + pa_assert(r); > + pa_assert(input); > +@@ -1357,6 +1357,11 @@ > + in = pa_memblock_acquire_chunk(input); > + out = pa_memblock_acquire_chunk(output); > + > ++ /* Speex float API scale range is +/-32768 instead of +/-1. > ++ So rescale input before passing it to Speex. */ > ++ for (i = 0; i < inf; i++) > ++ in[i] = 32768.*in[i]; > ++ > + pa_assert_se(speex_resampler_process_interleaved_float(r->speex.state, in, &inf, out, &outf) == 0); > + > + pa_memblock_release(input->memblock); > diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb > index b419c54..5afa20b 100644 > --- a/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb > +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_4.0.bb > @@ -1,7 +1,8 @@ > require pulseaudio.inc > > SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${PV}.tar.xz \ > - file://volatiles.04_pulse" > + file://volatiles.04_pulse \ > + file://rescale_input_to_speex_float.patch" > > SRC_URI[md5sum] = "591f211db2790a7e4d222f2dc6858db3" > SRC_URI[sha256sum] = "35ceb36bb1822fe54f0b5e4863b4f486769fdfb8ff2111f01fd8778928f9cdae" > -- > 1.7.9.5 > > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2014-01-16 19:15 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-12-24 14:37 [PATCH] pulseaudio: rescale input being passed to float method of speex Fahad Arslan 2013-12-24 16:54 ` Saul Wold 2014-01-01 16:01 ` Arslan, Fahad 2014-01-02 18:47 ` Saul Wold 2014-01-07 9:59 ` Arslan, Fahad 2014-01-07 10:03 ` Koen Kooi 2014-01-07 10:22 ` Koen Kooi 2014-01-10 7:48 ` Arslan, Fahad 2014-01-10 15:33 ` Koen Kooi 2014-01-16 12:08 ` Arslan, Fahad 2014-01-16 19:16 ` Koen Kooi 2013-12-26 11:57 ` Koen Kooi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox