Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Ideas about an analog-to-digital converter API



>I can certainly understand your reluctance to go down the audio(4) path,
>although it seems to me that some API unifying the current audio drivers
>and what you need may be the right answer.

Perhaps ... although I guess I don't see the point.  For me, the advantage
of hooking into the audio(4) framework would be that I wouldn't have to
create a new API.  If there is some new super-API which is a superset of
the current audio(4) framework, well, that seems like double the work
to me (I'd have to create the new super-API AND fit audio devices into it).
And that doesn't make sense to me.  The only advantage to this new super-API
would be that you could use one API to access A/D converter hardware and
audio devices; I guess I wouldn't personally find that very useful.

>I don't understand why you think it's reasonable to use sysctl.  To me,
>sysctl is about managing the kernel and the hardware in use by the OS,
>but isn't a proper way to do general-purpose IO.  Perhaps I'm confused
>on this point.

Well, on this particular hardware sysctl was used to provide a simple
interface to the A/D converter hardware (you can see for yourself at
src/sys/arch/evbarm/tsarm/toastersensors.c).  Is this necessarily the
"right" solution?  Well, I don't know.  I wasn't aware that sysctl was
just for kernel/OS management; the man pages for sysctl just refer to
"system information" and "kernel state", which is pretty vague.  

Would sysctl be a good generic A/D converter interface?  No.  You could
use it to discover capabilities and set options reasonably well, but it
would suck to do a lot of conversions.  I was just thinking of it as an
easy-to-access "do a single conversion now" sort of thing.  Again, I'm
not convinced this is a good idea; I was just casting around to see
what other people have done, and this was one thing that popped up.

So, I guess one thing that occurs to me to ask is: do people actually
use an audio(4) or audio-style interface to do "generic" A/D
conversion?  In my brief looking around, it seems that the most common
thing to do is just have your userspace app talk to the hardware directly.
I could do that, but I was hoping to do better.

--Ken


Home | Main Index | Thread Index | Old Index