10-13-2009 01:06 AM
I am trying to generate and play white noise through the sound card at the same time as switching up to 9 digital output ports. The digital outputs work OK, but the white noise 'stutters', and gets worse the more digital ouputs are used. Does anyone know how to configure things so that the sound will play continuously regardless of how hard the rest of the program is working at producing timed digital outputs?
I will attach my vi to this post. It is very much a 'work in progress' but will give an idea of what I am trying to do. The card I am using is a PCI-6221 (37 pin).
Thanks,
Brad Dawson
10-13-2009 04:56 AM
Brad,
i asume that the 'stuttering' is created each time you repeat the loop. This is somehow expected behaviour. You have to break up the task into two different loops.
Please take a look into producer/Consumer framework for further information on possible architectures.
Additionally, i recommend you to collect all digital lines to single ports and write values as U8/U16.
hope this helps,
Norbert
10-13-2009 06:54 AM
First of all. You are abusing local variables. Do not use them in this manner. I have also a hunch that it is more room for improvement in your code. But I have never used Labview with digital I/O so I can not advice you.
So regarding the sound problems. The Labview 8.x, and 9.0 sound system is a big disappointing and full of bugs. The sound get bad if you update the sound output more than 5 times pr second. The older system used in Labview 7.x was much better. But anyway your update rate would never have worked very well neither in 7.x or 8.x. The update rate is to fast. I have changed your program somewhat. I can not test it. But now it should play sound chunks of .5 second. The sound length must be a multiple of .5 seconds. With this solution I think you can use both 16 bits and higher sample rate if you need it.