linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Robin Getz <rgetz@blackfin.uclinux.org>
To: "Robert Schwebel" <r.schwebel@pengutronix.de>
Cc: linuxppc-dev@ozlabs.org, Bodo Eggert <7eggert@gmx.de>,
	linux-kernel@vger.kernel.org
Subject: Re: Correct location for ADC/DAC drivers
Date: Sun, 6 May 2007 15:33:36 -0400	[thread overview]
Message-ID: <200705061533.36705.rgetz@blackfin.uclinux.org> (raw)
In-Reply-To: <20070506160104.GV22585@pengutronix.de>

On Sun 6 May 2007 12:01, Robert Schwebel pondered:
> On Sun, May 06, 2007 at 02:19:59PM +0200, Bodo Eggert wrote:
> > Since you ask for random thoughts:
> >
> > IO of data streams from or to a DAC/ADC is essentially what soundcards
> > do. I'm wondering if these cards are similar enough to use alsa, and if
> > using that interface would ease or hinder programming the driver.
>
> I had a short look at ALSA and it looks like it is a little bit too
> focussed towards "normal" audio. For example, if follows an asynchronous
> model in the sense that an application can read/write to a buffer at any
> time, taken that the ringbuffer doesn't overflow. That's not enough for
> example for control applications; you need the option for real
> synchronous operation there.

Yes - there are too many applications which require tight/sync connection with 
the data - control loops, software radios, machine control, etc - all have 
much different needs than audio, hwmon, or touchscreen.

> IMHO we need an API which offers
>
> - kernel ring buffers (to make it sure no data gets lost)
> - generic data types (streaming plain ADC values is just the simplest
>   case; we also have for example streaming FPGA data containing
>   preprocessed data sets)
> - optional timestamping for each sample
> - zero-copy from hardware into userspace memory, with DMA support

I am assuming that the driver takes care of all DMA/coherency issues that 
might pop up? (and handles all interrupts)?

> - application notification every N samples (N >= 1)
>
> v4l2 may also be worth a look; but in the end I suppose they are all
> specialized sub-cases of what we'd need for fast DAQ.

I would guess that something like v4l might be the best bet - the driver 
provides a few mmapped buffers that you can read/write into, and some 
mechanism to sync in/out of the buffers.

I was actually looking at UIO, but thought that since we really desire the 
kernel ring buffers, that a think model might be better.?

http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/gregkh-01-driver/uio-documentation.patch

-Robin

  reply	other threads:[~2007-05-06 19:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8fZXU-3EI-11@gated-at.bofh.it>
     [not found] ` <8haHG-6zd-19@gated-at.bofh.it>
     [not found]   ` <8hd2U-1Ca-39@gated-at.bofh.it>
     [not found]     ` <8heii-3GM-37@gated-at.bofh.it>
2007-05-06 12:19       ` Correct location for ADC/DAC drivers Bodo Eggert
2007-05-06 13:20         ` Paul Sokolovsky
2007-05-06 16:01         ` Robert Schwebel
2007-05-06 19:33           ` Robin Getz [this message]
2007-05-06 20:20         ` Guennadi Liakhovetski
2007-05-01 12:35 Stefan Roese
2007-05-01 21:03 ` Guennadi Liakhovetski
2007-05-02 10:25   ` Stefan Roese
2007-05-02 13:35     ` Robert Schwebel
2007-05-02 19:11       ` Russell King
2007-05-04  6:11         ` Stefan Roese
2007-05-04  7:44           ` Russell King
2007-05-04  8:24 ` Robert Schwebel
2007-05-04  8:54   ` Stefan Roese
2007-05-04 18:21     ` Robin Getz
2007-05-04 20:52       ` Robert Schwebel
2007-05-04 22:16         ` Robin Getz

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=200705061533.36705.rgetz@blackfin.uclinux.org \
    --to=rgetz@blackfin.uclinux.org \
    --cc=7eggert@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=r.schwebel@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).