[wdmaudiodev] Re: Real Time Processing

  • From: George Yohng <george@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Thu, 03 Mar 2005 00:33:36 +0200

Normally sample-by-sample processing is not possible. Standard minimum buffer size is 64 samples, and thus, around 2ms latency. Soundcard DAC, ADC and other chips may delay sound further, so the actual latency will be even higher.

Not all soundcards support low-latency mode, even if WDM claims so. For example, on my IBM T40 laptop I was unable to set latency less than 2048 samples, so that it would play without being disturbed.

For such purposes it's best to use a soundcard that supports ASIO interface (developed by Steinberg). It appeared before WDM and has sane API, that it is possible to program using just single ASIO manual!!!

Creative SBLive/Audigy cards have a decent ASIO with the help of kxproject.com, but can only run 48khz fixed clock.

portaudio.com is a library, which is a further simplification of Audio I/O API.

Also - I assume that you already know, that soundcards are not respecting DC. Means, if you start feeding a constant value into the output, there likely will be a short plop in the the analog output, then it will return and stay at zero. It might be true for opposite also - recording DC will give a burst of digital impulses, then will yield with zero value.

If your external device is of a slow-signal-change nature, it should be capable of modulating the signal with quite high frequency in order to get is sampled properly by the sound card line input.

If you are developing realtime audio processor, this is of course not a problem at all.

Thanks,
George.

Pieterjan Demarcke wrote:
Hello,

in search of information about audio drivers i came across this
discussion group. I have a specific problem and i don't know what's
exactly possible, because i don't have the expertise. The situation is
as follows: for an engineering project i have to write software that
controls a self-made analog device. The controlled variable is the
output of -let's say- a sensor which is, with the help of some
electronics, connected to the sound card line-in. That signal must
then be rescaled and fed back to the line-out for controlling purposes
(btw. we have to use WinXP). This problem has to be solved this way,
as we can't make use of a microprocessor. My question to you is now:
how exactly can i get as less as latency as possible, so that the
delay between input and output is minimal? I already 'studied' the WDM
driver architecture and the best solution i have found so far is the
directks example on this site. But i am convinced it could be even
faster. I don't need any buffering as the processing must happen in
real time, sample by sample: the next sample of the signal should be
taken AFTER the previous one has finished processing and was already
sent back to the external device. I also need an interface to a
program in user mode which stores the original sample in a file. I
don't need the soundcard to do anything else so I thought the best
solution was to replace the vendor driver by my own, but as I don't
know how i should start with that, I'm also open to other ideas. A
certain latency between input and output is allowed, let's say max 5
ms. Is this possible and if so, what is the best way to approach this
problem? Any suggestions are welcome. Anyway thank you for your time,
I really appreciate it.

with kind regards,
Pieterjan Demarcke
******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/





******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/

Other related posts: