From: Saul Wold <sgw@linux.intel.com>
To: Fahad Arslan <fahad_arslan@mentor.com>,
openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] pulseaudio: rescale input being passed to float method of speex
Date: Tue, 24 Dec 2013 08:54:04 -0800 [thread overview]
Message-ID: <52B9BC2C.7080709@linux.intel.com> (raw)
In-Reply-To: <1387895862-15110-1-git-send-email-fahad_arslan@mentor.com>
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"
>
next prev parent reply other threads:[~2013-12-24 16:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52B9BC2C.7080709@linux.intel.com \
--to=sgw@linux.intel.com \
--cc=fahad_arslan@mentor.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox