From: James Courtier-Dutton <James@superbug.demon.co.uk>
To: Ludwig Schwardt <schwardt@sun.ac.za>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Writing a mini ALSA driver from scratch
Date: Wed, 25 Aug 2004 22:16:57 +0100 [thread overview]
Message-ID: <412D01C9.4020403@superbug.demon.co.uk> (raw)
In-Reply-To: <412CF1DE.1060203@sun.ac.za>
Ludwig Schwardt wrote:
> Hi,
>
> A student of mine is working on an audio capture driver for an ARM Linux
> system. The ARM (AT91RM9200) processor talks via SSC and I2S to a set of
> audio ADCs that capture 6 channels of 24-bit 192 kHz audio (no playback
> involved).
>
> The application is real-time sound logging (latency not important). I
> figured it might save the application developers some hassles by
> presenting this capture device as a soundcard to Linux. That way it may
> simplify realtime processing by using standard callback interfaces such
> as JACK (less apps to write!).
>
> My questions to the ALSA gurus are:
>
> 1) Is this a sound approach? (sorry, that slipped out)
Yes.
>
> 2) Is it possible to write a bare-bones ALSA driver with only capturing
> functionality (no playback/mixer)? What are the bare essentials that
> make up an ALSA driver? (I'm worried about overkill)
You can do capture only, with no playback/mixer.
You will need to implement: -
a) probe, init, exit routies.
b) interrupt servicing routine.
c) and these functions:
static snd_pcm_ops_t snd_card_capture_ops = {
.open = snd_card_pcm_open_capture,
.close = snd_card_pcm_close_caputre,
.ioctl = snd_card_pcm_lib_ioctl,
.hw_params = snd_card_pcm_hw_params_caputre,
.hw_free = snd_card_pcm_hw_free_caputre,
.prepare = snd_card_pcm_prepare_caputre,
.trigger = snd_card_pcm_trigger_caputre,
.pointer = snd_card_pcm_pointer_caputre,
};
d) snd_card_pcm_pointer <- Tells alsa where the sound card hardware is
currently playing a sample from.
All those are explained in the "writing an alsa driver" docs.
>
> 3) Are there any existing drivers that could serve as a good template
> for a minimalist driver (I'm ignoring issues such as ISA/PCI etc.), to
> see how viable this option is? I was thinking maybe Gravis Ultrasound or
> such...
The "writing an alsa driver" is probably the best template.
The alsa drivers are very modular, so you will not have to write any
code that is common to other drivers. You only have to do the hardware
specific parts.
>
> 4) Is an ALSA driver even possible on ARM (dunno much about mmap and the
> like)?
It should be possible. I don't know how the ARM does mmap though.
You can use the snd-dummy alsa driver at first to check that alsa
compiles and installs OK on an ARM system.
>
> Thanks in advance for any tips. I was thinking of ploughing back any
> generic stuff along the way (like the AT91 SSC support).
>
> Ludwig Schwardt
>
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
prev parent reply other threads:[~2004-08-25 21:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1BzmB2-00014C-RI@sc8-sf-list2.sourceforge.net>
2004-08-25 8:03 ` low latency: which is the best distro-kernel-alsa version combo? Michele Spinolo
2004-08-25 20:09 ` Writing a mini ALSA driver from scratch Ludwig Schwardt
2004-08-25 21:16 ` James Courtier-Dutton [this message]
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=412D01C9.4020403@superbug.demon.co.uk \
--to=james@superbug.demon.co.uk \
--cc=alsa-devel@lists.sourceforge.net \
--cc=schwardt@sun.ac.za \
/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 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.