01-31-2013 01:02 PM
I have hunch as to what the issue is, but I want to double check.
What I am trying to do is fairly simple: capture audio on two microphones and compare them continously. One microphone is the webcam mic in the laptop (input 0), the other is a standard desktop mic (input 1). I am assuming that these are being both processed by the sound card. Independently, the both can run for hours without issue, but together, sometimes it is 3 seconds, sometimes 10 minutes.
Attached is a simplified version of the program that I am putting together, which works, but an error occurs at random intervals, specifically:
Error 4823 occurred at Object Sound->mic_v3.vi
Possible reason(s):
LabVIEW: (Hex 0x12D7) You cannot perform this operation without an active task. Ensure that a task is active and try again. An input task might stop running if the input buffer overflows. Overflow occurs when the data is not read fast enough.
Up until this error, things work well. My hunch is that the issue is being caused by two audio streams trying to go through the A/D converter on the sound card, and one taking too long. Examples that I have found are using DAQ cards, which is a possibility, we were just hoping this would work.
I instituted a 0.1 second delay, which seems to help the issue, but I am wondering if I should switch to a timed loop, for better pacing.
Essentially, my question is can I do this through the sound card, or do I need to go DAQ card?
I am using the express vi for the audio input, but using the components (sound input configure, sound input read, etc.) do not help the issue. I have tried faster/slower sampling, same thing.
The labview version is 2010f2-32 bit. The laptop is a Dell Precision M4500, running Windows 7 64-bit. Why not LV 64-bit, because of difficulty finding 64-bit modules.
02-04-2013 10:07 AM
02-04-2013 10:41 AM
I did look over that forum post. I do not want to record the audio, but process it. What I am doing is along the lines of noise cancelling.
mic-1 has room noise.
mic-2 has room noise + signal I want.
I need to read mic-1 AND mic-2, then subtract mic-1 from mic-2, and what is left (ideally) is the signal I want.
I have no need to record the data, and I need them to be synced as much as possible. I need the mics to be separate audio streams so I can use them separately.
I am in the process of changing the program to work on a cRio or DAQ card, as everything I have found thus far uses these types of devices. We were thinking that since the laptop has a webcam microphone and a microphone/line-in, we could use it for this processing, but there appears to be an issue somewhere.
What it almost seems is that the two 'Acquire Sound' inputs are trying to write to the same buffer, as the top one always works, the bottom one sometimes works. I am not sure if there is a way to dictate that they are separate buffers (which I assume is what they are).
My question stems back to whether this is a A/D issue in the sound card, or Labview.
Since posting this I have tried two USB mics and onboard mic configurations, and the problem persists. I am not sure if the USB ones are still processed by the sound card, because, per my understanding, they are already digital.
I have tried implementing what is under the 'Acquire Sound' (configuring + reading, etc.), and the error persists. What is concerning is it is random: it will run for 10 minutes, then die many times in a row at maybe 3 second intervals. After that, the mics are out of sync and the result is jibberish.
Again, with the DAQ card and / or cRio, I am fairly confident the program will work, but in theory this should have worked as well.
02-05-2013 01:22 AM
Keep in mind that both mics run asynchrone. Each capture with it's own* samplerate and send a datastream ....
*) Soundcard crystals are low cost devices... Test: Use a stable tone generator (or your smartphone 😉 ) and capture 1s of a 10kHz sine with both mics. Use extract single tone information.vi and have a look at the frequency.
Use two mics in one soundcard!
02-05-2013 07:06 AM
For noise cancelling you need a constant phase relationship between the two signals. No chance in Windows with separate soundcards. USB microphones are soundcards. The two stereo channels in one analog input should do the job.
Cheers
Edgar