[pulseaudio-discuss] [PATCH] Implement Fortemedia SMA processing.

David Henningsson david.henningsson at canonical.com
Thu Jan 6 07:19:01 PST 2011


On 2011-01-06 01:32, Alban Browaeys wrote:
>  From 853a4d96bf2624ef30f86cf4819382949d039c87 Mon Sep 17 00:00:00 2001
> From: Alban Browaeys<prahal at yahoo.com>
> Date: Wed, 5 Jan 2011 17:13:04 +0100
> Subject: [PATCH] Implement Fortemedia SMA processing.
>
> Those small array microphones returns two channels of opposite
> phase thus the default remap in pulseaudio doing the sum output
> silence.

Sounds very useful, but...

> +void pa_fmaudiosma_run(pa_fmaudiosma *fs, const uint8_t *rec, uint8_t *out, int n) {
> +    unsigned i;
> +
> +    float *d, *s;
> +    int n_frames = n / (sizeof(float) *  2);
> +    memset(out, 0, n_frames * sizeof (float) * 2);
> +
> +    d = (float *)out;
> +    s = (float *)rec;
> +    for (i = n_frames; i>  0; i--, s += 2, d += 2)
> +	d[0] = d[1] = s[0] - (s[0] + s[1]);

"s[0] - (s[0] + s[1])" can be simplified to "-s[1]", unless my junior 
high math fails me completely. Are you sure you don't mean "s[0] - s[1]"?

-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic



More information about the pulseaudio-discuss mailing list