09-04-2009 02:08 PM
Hello,
I have a program that I wrote a while ago that is based off of an example FM Radio app. (http://zone.ni.com/devzone/cda/epd/p/id/921). Like the example says, I'm using a PXI-5661 to stream and FM Demodulate an audio signal to the PC's speakers. I had to do longevity testing recently and I discovered that if audio playback is left running for a long period of time (say 8 hours or so just for an example) an out of memory error occurs. I found several other posts that refer to different issues pertaining to glitchy audio streams but none of them mention this memory leak issue. Even the example that I found online starts to leak memory pretty badly after about 5 minutes of audio playback. After about 8 hours or so I saw almost a 1 GB increase in memory usage by the application.
I've ensured that I'm not writing audio samples to the SO_Write.vi faster than the audio is playing back by slowing down the loop and keeping track of the theoretical number of samples that should have been writen to the device given the sample rate and the elapsed time since audio playback was started. I've tried a number of different things but no matter what I do the memory leak is still there. I've slowed it down but I still can't pinpoint where the issue is exactly or how to stop it completely.
Things worth mentioning: I'm using the older version of the Sound Output VI's which can be found under the vi.lib/sound directory as lvsound.llb (not lvsound2.llb). I don't vary too much from the example in the link above on how I'm getting data from the PXI-5661 and writing it to the sound device so that is a good example of how my application is operating.
Two questions for people interested are: Is this a known issue that has a fix? Or, is there another method for streaming audio to the PC sound card that could possibly avoid this memory issue?
Thanks,
Tim S.
09-09-2009 07:08 AM
Hello Tom,
The zip file that contains the example also has a document detailing hardware and software requirements - make sure that your setup satisfies these requirements. It would be great if you could try using the newer sound VIs to check if this makes a difference. To further troubleshoot this, a screenshot of the block diagram or the VI itself would really help. I have not found a known issue similar to this one in our database.
09-14-2009 11:11 AM
Hello Vivek,
I've run the example program on several PXI controllers (PXI-8105, PXIe-8106, & PXIe-8130) and all of them exhibit the same problem. Those controllers meet the minimum requirements defined in the examples documentation so I know that wasn't the issue.
I haven't had the chance, and probably won't have the chance, to try out the newer sound VI's and get it working fully. I briefly tried them a while back but I wasn't able to get it working correctly and not have stuttering sound. Time will most likely not allow me to experiment with them.
09-16-2009 09:15 AM
Not sure why this is happening. Let me look into this a bit more and I will let you know what I find out.