Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maris <maris.rob@vdi.de>
To: alsa-devel@alsa-project.org
Subject: inserting operations while in rate conversion
Date: Wed, 22 Apr 2009 20:17:48 +0200	[thread overview]
Message-ID: <op.ussvry0i7fwl0e@rob-desktop.lan> (raw)

I'm running uClinux with ALSA in an Analog Devices' Blackfin CPU
environment.
Actually I'm checking possibilities in doing special things while ALSA is
going to do automatic rate conversion.

Specific description:
ADC is sampled with 32 or 64 ksps rate. The corresponding hardware driver
is specified to operate at one of these rates (which I'll specify later).
The application reads the ADC input stream at the output end of the ALSA
processing as a stream with a rate of 8 ksps. I need some information
about inside details of ALSA's automatic rate conversion (pointers to
appropriate information would be helpful).

What I want to do: insert a digital anti-aliasing filter algorithm which
limits the effective bandwidth of the ADC stream to 4 kHz prior to
actually have the rate converted.
Of course, I could also add the filter algorithm in the hardware device
driver - at the cost of not inherently being available as a hardware
independent algorithm.

Some detail info:
- ADC = AD73311 (speech codec). Basic drivers that allow e.g. arecord &
aplay are available.
- CPU: convergent DSP/microcontroller core @ 500 MHz and fixed point
processing.

Thanks for attention. BTW: this is my first dig into ALSA details...

Rob


Code snippet:
(currently only one rate is defined as a correspondence to the hardware
driver rate)

#define AD73311_RATES (SNDRV_PCM_RATE_8000  |	\
		      SNDRV_PCM_RATE_16000 |	\
		      SNDRV_PCM_RATE_32000 |	\
		      SNDRV_PCM_RATE_64000)

struct snd_soc_dai ad73311_dai = {
	.name = "AD73311",
	.playback = {
		.stream_name = "Playback",
		.channels_min = 1,
		.channels_max = 1,
		.rates = SNDRV_PCM_RATE_32000,
		.formats = SNDRV_PCM_FMTBIT_S16_LE, },
	.capture = {
		.stream_name = "Capture",
		.channels_min = 1,
		.channels_max = 1,
		.rates = SNDRV_PCM_RATE_32000,
		.formats = SNDRV_PCM_FMTBIT_S16_LE, },
};
EXPORT_SYMBOL_GPL(ad73311_dai);

                 reply	other threads:[~2009-04-22 18:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=op.ussvry0i7fwl0e@rob-desktop.lan \
    --to=maris.rob@vdi.de \
    --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