* [PATCH] speex: Scale float input when FIXED_POINT is defined
@ 2013-12-20 16:06 Fahad Arslan
2013-12-20 16:14 ` Saul Wold
0 siblings, 1 reply; 3+ messages in thread
From: Fahad Arslan @ 2013-12-20 16:06 UTC (permalink / raw)
To: openembedded-core
From: Fahad Arslan <Fahad_Arslan@mentor.com>
When Speex is compiled with FIXED_POINT defined, it scales float
input to +/-32768 instead of +/-1. This was being missed at one
point causing the input to the resampler to be zeroed. As a result
there was no audio output.
Signed-off-by: Fahad Arslan <Fahad_Arslan@mentor.com>
---
.../speex/speex/scaling_fix.patch | 12 ++++++++++++
meta/recipes-multimedia/speex/speex_1.2rc1.bb | 3 ++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-multimedia/speex/speex/scaling_fix.patch b/meta/recipes-multimedia/speex/speex/scaling_fix.patch
new file mode 100644
index 0000000..a6340d7
--- /dev/null
+++ b/meta/recipes-multimedia/speex/speex/scaling_fix.patch
@@ -0,0 +1,12 @@
+diff -NaurbB a/libspeex/resample.c b/libspeex/resample.c
+--- a/libspeex/resample.c 2013-12-20 19:47:49.154454769 +0500
++++ b/libspeex/resample.c 2013-12-20 19:48:16.558454331 +0500
+@@ -915,7 +915,7 @@
+ if (in) {
+ for(j=0;j<ichunk;++j)
+ #ifdef FIXED_POINT
+- x[j+st->filt_len-1]=WORD2INT(in[j*istride_save]);
++ x[j+st->filt_len-1]=WORD2INT(32768.*in[j*istride_save]);
+ #else
+ x[j+st->filt_len-1]=in[j*istride_save];
+ #endif
diff --git a/meta/recipes-multimedia/speex/speex_1.2rc1.bb b/meta/recipes-multimedia/speex/speex_1.2rc1.bb
index faf63b0..0fea51e 100644
--- a/meta/recipes-multimedia/speex/speex_1.2rc1.bb
+++ b/meta/recipes-multimedia/speex/speex_1.2rc1.bb
@@ -9,7 +9,8 @@ DEPENDS = "libogg"
PR = "r2"
-SRC_URI = "http://downloads.us.xiph.org/releases/speex/speex-1.2rc1.tar.gz"
+SRC_URI = "http://downloads.us.xiph.org/releases/speex/speex-1.2rc1.tar.gz \
+ file://scaling_fix.patch"
SRC_URI[md5sum] = "c4438b22c08e5811ff10e2b06ee9b9ae"
SRC_URI[sha256sum] = "342f30dc57bd4a6dad41398365baaa690429660b10d866b7d508e8f1179cb7a6"
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] speex: Scale float input when FIXED_POINT is defined
2013-12-20 16:06 [PATCH] speex: Scale float input when FIXED_POINT is defined Fahad Arslan
@ 2013-12-20 16:14 ` Saul Wold
2013-12-24 13:52 ` Arslan, Fahad
0 siblings, 1 reply; 3+ messages in thread
From: Saul Wold @ 2013-12-20 16:14 UTC (permalink / raw)
To: Fahad Arslan, openembedded-core
On 12/20/2013 08:06 AM, Fahad Arslan wrote:
> From: Fahad Arslan <Fahad_Arslan@mentor.com>
>
> When Speex is compiled with FIXED_POINT defined, it scales float
> input to +/-32768 instead of +/-1. This was being missed at one
> point causing the input to the resampler to be zeroed. As a result
> there was no audio output.
>
> Signed-off-by: Fahad Arslan <Fahad_Arslan@mentor.com>
> ---
> .../speex/speex/scaling_fix.patch | 12 ++++++++++++
> meta/recipes-multimedia/speex/speex_1.2rc1.bb | 3 ++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-multimedia/speex/speex/scaling_fix.patch b/meta/recipes-multimedia/speex/speex/scaling_fix.patch
> new file mode 100644
> index 0000000..a6340d7
> --- /dev/null
> +++ b/meta/recipes-multimedia/speex/speex/scaling_fix.patch
The patch needs Upstream-Status: and Signed-off-by: tags please
Sau!
> @@ -0,0 +1,12 @@
> +diff -NaurbB a/libspeex/resample.c b/libspeex/resample.c
> +--- a/libspeex/resample.c 2013-12-20 19:47:49.154454769 +0500
> ++++ b/libspeex/resample.c 2013-12-20 19:48:16.558454331 +0500
> +@@ -915,7 +915,7 @@
> + if (in) {
> + for(j=0;j<ichunk;++j)
> + #ifdef FIXED_POINT
> +- x[j+st->filt_len-1]=WORD2INT(in[j*istride_save]);
> ++ x[j+st->filt_len-1]=WORD2INT(32768.*in[j*istride_save]);
> + #else
> + x[j+st->filt_len-1]=in[j*istride_save];
> + #endif
> diff --git a/meta/recipes-multimedia/speex/speex_1.2rc1.bb b/meta/recipes-multimedia/speex/speex_1.2rc1.bb
> index faf63b0..0fea51e 100644
> --- a/meta/recipes-multimedia/speex/speex_1.2rc1.bb
> +++ b/meta/recipes-multimedia/speex/speex_1.2rc1.bb
> @@ -9,7 +9,8 @@ DEPENDS = "libogg"
>
> PR = "r2"
>
> -SRC_URI = "http://downloads.us.xiph.org/releases/speex/speex-1.2rc1.tar.gz"
> +SRC_URI = "http://downloads.us.xiph.org/releases/speex/speex-1.2rc1.tar.gz \
> + file://scaling_fix.patch"
>
> SRC_URI[md5sum] = "c4438b22c08e5811ff10e2b06ee9b9ae"
> SRC_URI[sha256sum] = "342f30dc57bd4a6dad41398365baaa690429660b10d866b7d508e8f1179cb7a6"
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] speex: Scale float input when FIXED_POINT is defined
2013-12-20 16:14 ` Saul Wold
@ 2013-12-24 13:52 ` Arslan, Fahad
0 siblings, 0 replies; 3+ messages in thread
From: Arslan, Fahad @ 2013-12-24 13:52 UTC (permalink / raw)
To: Saul Wold, openembedded-core@lists.openembedded.org
Patch to Speex upstream has been denied with reason that fixing this will break other
applications using it.
I think appropriate place to fix the issue is Pulseaudio code. I've submitted patch
upstream for that and sending a new patch for that to oe-core as well and this speex
patch may be dropped.
Fahad
________________________________________
From: Saul Wold [sgw@linux.intel.com]
Sent: Friday, December 20, 2013 9:14 PM
To: Arslan, Fahad; openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] speex: Scale float input when FIXED_POINT is defined
On 12/20/2013 08:06 AM, Fahad Arslan wrote:
> From: Fahad Arslan <Fahad_Arslan@mentor.com>
>
> When Speex is compiled with FIXED_POINT defined, it scales float
> input to +/-32768 instead of +/-1. This was being missed at one
> point causing the input to the resampler to be zeroed. As a result
> there was no audio output.
>
> Signed-off-by: Fahad Arslan <Fahad_Arslan@mentor.com>
> ---
> .../speex/speex/scaling_fix.patch | 12 ++++++++++++
> meta/recipes-multimedia/speex/speex_1.2rc1.bb | 3 ++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-multimedia/speex/speex/scaling_fix.patch b/meta/recipes-multimedia/speex/speex/scaling_fix.patch
> new file mode 100644
> index 0000000..a6340d7
> --- /dev/null
> +++ b/meta/recipes-multimedia/speex/speex/scaling_fix.patch
The patch needs Upstream-Status: and Signed-off-by: tags please
Sau!
> @@ -0,0 +1,12 @@
> +diff -NaurbB a/libspeex/resample.c b/libspeex/resample.c
> +--- a/libspeex/resample.c 2013-12-20 19:47:49.154454769 +0500
> ++++ b/libspeex/resample.c 2013-12-20 19:48:16.558454331 +0500
> +@@ -915,7 +915,7 @@
> + if (in) {
> + for(j=0;j<ichunk;++j)
> + #ifdef FIXED_POINT
> +- x[j+st->filt_len-1]=WORD2INT(in[j*istride_save]);
> ++ x[j+st->filt_len-1]=WORD2INT(32768.*in[j*istride_save]);
> + #else
> + x[j+st->filt_len-1]=in[j*istride_save];
> + #endif
> diff --git a/meta/recipes-multimedia/speex/speex_1.2rc1.bb b/meta/recipes-multimedia/speex/speex_1.2rc1.bb
> index faf63b0..0fea51e 100644
> --- a/meta/recipes-multimedia/speex/speex_1.2rc1.bb
> +++ b/meta/recipes-multimedia/speex/speex_1.2rc1.bb
> @@ -9,7 +9,8 @@ DEPENDS = "libogg"
>
> PR = "r2"
>
> -SRC_URI = "http://downloads.us.xiph.org/releases/speex/speex-1.2rc1.tar.gz"
> +SRC_URI = "http://downloads.us.xiph.org/releases/speex/speex-1.2rc1.tar.gz \
> + file://scaling_fix.patch"
>
> SRC_URI[md5sum] = "c4438b22c08e5811ff10e2b06ee9b9ae"
> SRC_URI[sha256sum] = "342f30dc57bd4a6dad41398365baaa690429660b10d866b7d508e8f1179cb7a6"
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-12-24 13:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-20 16:06 [PATCH] speex: Scale float input when FIXED_POINT is defined Fahad Arslan
2013-12-20 16:14 ` Saul Wold
2013-12-24 13:52 ` Arslan, Fahad
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.