LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-24-2005, 03:22 PM   #1
controller
LQ Newbie
 
Registered: Nov 2005
Location: Austria
Distribution: Debian
Posts: 2

Rep: Reputation: 0
Question Soundcard Use for Sensor and controller


This is the first time I am posting. I guess I am having not a common problem, which I tried to solve for months:
I want to use my soundcard in a real time application with RTAI for reading and writing analog signals. I am using an usual Creative Live! soundcard. I am only looking for a function that allows me to write a value to the card, This value should get a proportional voltage on the line out of the card. It is the same with the Signal of the microphone signal. I want to read its value. The important thing is that the execution of the read and write command should be very fast (only a few nano seconds or one micro at maximum) as I want to use them in a real time controlling application.
Actually I read the whole driver code of the soundcard and I found there some functions like emu10k1_audio_write, which are called when I call the write function to the soundcard, but the output signal that I send to the soundcard looks different on the oscilloscope as it should. It is only one short peak but no maximum output for a few seconds. Maybe the reason for this is, that the data that is sent to the souncard gets interpreted in a wrong way. I think I should activate the so called passthrough mode for the card, but I could not find out how that works. It could also happen that I am on a totally wrong way, so could you experts help me out?
To summmarize the thing what I want to realize: I want to send an array of values (samples) to the card which should get turned into a voltage on the line out. THe voltage on the microphone in should get digitized and turned to an array of values which I can use in my application. Thanks for your help.

Clemens
 
Old 11-24-2005, 04:58 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
At a minimum, a read would take 20 microseconds. This is based on a sampling rate in the hardware of 48kHz. That's roughly one sample every 20 microseconds. I may be wrong, but I still don't think a generic soundcard gives you the ADC resolution you're looking for.
 
Old 11-25-2005, 02:33 PM   #3
controller
LQ Newbie
 
Registered: Nov 2005
Location: Austria
Distribution: Debian
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Matir
At a minimum, a read would take 20 microseconds. This is based on a sampling rate in the hardware of 48kHz. That's roughly one sample every 20 microseconds. I may be wrong, but I still don't think a generic soundcard gives you the ADC resolution you're looking for.
Thanks for this suggestion. But in my opinion the sampling rate is not a problem, it only gives a restriction to the frequency of my real time application. But for controlling mechanical systems like robots the application should be executed in 1 millisecond intervals. That means at the end of one millisecond I want to measure a sensor value, calculate a new control value and send this at the same time out again. The time between getting the signal and sending it out again should be put to a minimum, because that increases the so called latency time. But the value that is sent out stayes then for 1 ms the same until the real time app. gets executed again after 1 ms.
Actually I am only looking for a command that enables me to write into the register where the DAC converter of the soundcard gets its values from and read from the register where the ADC converter puts its values. As already mentioned this process should last as short as possible. If I run my real time application synchron with the sampling rate of my soundcard this should be technically possible, the only problem is that I do not know on which registers I should read and write and how I can find out to achieve this.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sensor-detect lasalsademuerte Linux - Software 2 10-18-2009 04:11 AM
gdesklets sensor SepitvaOra Linux - Software 3 04-06-2005 07:02 PM
offset on lm-sensor? bobbens Linux - Hardware 3 01-20-2005 03:34 PM
LM sensor help TuxFreak Linux - Hardware 0 10-24-2004 02:34 PM
is this an lm sensor bug? spyghost Linux - Software 0 11-01-2003 03:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration