05-12-2016 09:49 AM
Hello,
we have a problem in LabVIEW. We use the library called WaveIO. The purpose of this part of the program is simultaneous generating and recording signal using a sound card. (We have tryed both ASIO and standard drivers allowed by this library). We need to play and record the signal. After that increase the generated signal level and play and record again.
We have modified the example vi from waveIO library but the original untouched VI gives the same error. We control the subvis (stop them) using a global variable "StopGlobal.vi". First step executes correctly but repeated execution of these subvi generates unspecified error -5.
We included simplified part of our code.
Thank you for your help. This is our first project in LabView so we appreciate any advice.
05-12-2016 02:08 PM
I suspect the -5 error was generated by the Third-Party Software that actually "does the work" for you. Do your manuals list error codes that the software packages can produce? Often times errors arise because of "bad timing" or not doing things in the right sequence. I would examine the Third-Party hardware and its accompanying drivers and utilities.
Bob Schor
04-10-2019 03:29 PM
Hello,
I am also facing the same problem. Did you got a solution?
Thanks,
Rajesh
04-10-2019 11:29 PM
The -5 error is from WaveIO, and is a timeout in calling the underlying WaveIO DLL. The WaveIO manual describes the timeout configuration:
"A watchdog thread is started, if the specified timeout is greater than zero. The watchdog will close the device, if no call to the DLL is detected within the given time window. For each device (and I/O mode) a separate watchdog thread is started."
You might try setting the timeout to 0 to disable the watchdog timer.
I have run into unexpected timeouts even though the WaveIO DLL is called tens of times per second. In these cases closing and reopening the device is normally enough. If you get error -3, that requires a restart of LabVIEW to fully unload and load the WaveIO DLL again.
If you're still running into error -5, could you provide a code example?
04-22-2019 02:40 PM
Thanks for the reply. The tone generation VI for ASIO is called dynamically and I bench marked the tone generation. Its around 5ms and still am getting timeout error. And I am seeing glitches in the tone (when CPU is getting loaded, CPU usage more than 80%) and its a big issue for my application which is Audio. Am attaching the code, please open the vi named Gen.vi PFA.
FYI, and this code is the part of Veristand custom device which we are developing.
04-23-2019 09:11 AM
Hi Rajesh,
Thanks for posting the code. I don't have access to VeriStand (and I think there are a few missing VIs too), but can see how it should all work.
For glitch-free, continuous audio output you'll probably need to separate the WaveIO code into a subVI running in parallel, and have it run using a higher thread priority and a different execution system. Apart from a larger audio buffer, these execution settings seem to make the biggest difference in maintaining glitch-free audio output. When running within the User Interface thread (the default), it's competing with other tasks also running in the UI thread (VI Server, the "root loop") plus actual UI events (window drawing, user inputs, etc) which are all potential sources of glitch causing jitter.
Other things to help reduce glitches include disabling debugging in VIs, and ensuring no calls to VI Server occur within non-UI execution thread VIs.
As an example of all of the above, I recently wrote an open source DJing application in LabVIEW which achieves glitch-free, low-latency, continuous audio output using LabVIEW's sound API or the WaveIO API. Here's a short example video of it in action, showing simultaneous playback, file loading, and interactive audio processing, while maintaining glitch-free output.
Some questions and things to try:
06-11-2019 12:25 PM - edited 06-11-2019 12:26 PM
Thanks for the reply and sorry for the delayed response.
Your application is superb, well done man.
Actually I am talking with the person who developed WaveIO, he found some issues with thread priority. I am working with him. I will keep you posted.
Again appreciate your support.
07-29-2024 07:30 PM
Hi! I am using waveio in my application and wondering if there was any update to the library. I see Rajesh mentioned that the owner of the library found some issue with thread priority back in 2019. Waveio webpage states that it was last modified in 2017 so I am not sure if the problem related to thread priority got resolved or not.
Also, I'd like to know if anyone has any experience using Waveio for synchronous play and record signals. I am using waveio for my audio measurement system and need the input and output to be synchronized. waveio library has separate functions for play and record, so I am looking for any ideas on how to sync the two functions.
Thanks!