public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Ashish Chavan <ashish.chavan@kpitcummins.com>
To: alsa-devel <alsa-devel@alsa-project.org>
Subject: Template Based Coefficients Setting for Filters
Date: Tue, 9 Aug 2011 18:03:56 +0530	[thread overview]
Message-ID: <1312893236.8316.51.camel@matrix> (raw)

Hi,
   I am working on updating ASoC codec driver for Dialog's DA7210 codec
(sound/soc/codec/da7210.c). This update would be a major functionality
update in nature. Currently, I am implementing support for GP (general
purpose) filters of this codec and need some opinions/comments.

Brief info about GP filters:

The additional general purpose (GP) filter engine offers up
to eight 2nd order biquad filter stages with freely
configurable 16 bit coefficients and supports flexible
digital audio routing and mixing arrangements.

This engine implements transfer function to derive Hz which uses five
coefficients, a1, a1, a2, b1 and b2. The coefficients are specified
as 16 bit twos-complement numbers. There are total eight blocks which
can be interconnected as per requirement. 

Total number of registers to configure = (5 * 2 * 8) = 80

The GP filters are mainly designed to be used for following modes,

(1) Stereo Playback
(2) Stereo Capture
(3) Capture with monitoring
(4) Spatializer mode
(5) Left-Sidetone filtering
(6) Right-Sidetone filtering
(7) Left-Right Sidetone filtering

Each of this mode requires different set of coefficients to be
programmed in to those 80 registers.

My idea of implementation:

I believe that it would be quite non practical(because of number of
controls required to do that) to provide individual control to set each
coefficient independently. What I am thinking is a virtual control named
something like, "GP Filter Mode Selection". It would offer above seven
options to user. On selection of any option, driver will populate that
set of 80 registers with predefined coefficients. It would be like
selecting one out of seven predefined templates.

(Apart from the coefficients part, some interconnections between these
blocks and IOs need to be done to achieve desired mode.)

Is this a good/valid way to handle this? Is there any alternative?

Thanks,

-- Ashish

             reply	other threads:[~2011-08-09 12:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-09 12:33 Ashish Chavan [this message]
2011-08-09 15:16 ` Template Based Coefficients Setting for Filters Mark Brown
2011-08-09 17:19   ` Steve Calfee
2011-08-09 21:28     ` Johannes Stezenbach
2011-08-09 23:33       ` Mark Brown
2011-08-10  6:17         ` Takashi Iwai
2011-08-12  8:19       ` Ashish Chavan

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=1312893236.8316.51.camel@matrix \
    --to=ashish.chavan@kpitcummins.com \
    --cc=alsa-devel@alsa-project.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