LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneous sound i/o

Hi all...

 

I want to control a 24-bit I/O Sound Card with LabView. I have tried modifying the simultaneous i/o vi example, but I keep getting bogged down in the buffer handling, where I overfill my input buffer. Also, it seems that periodically the I/O crashes and the signal drops out. I am including my .vi file and a .pdf showing the signal that I read from my Sound Card using LabView (arbitrary units vs. time). If anyone can help me to fix the code or offer suggestions for buffer handling, I would be most appreciative.

Download All
0 Kudos
Message 1 of 7
(2,247 Views)

I don't know what is going on with your VI but you might want to look at this. It works pretty well but you are limited to using wav files.

=====================
LabVIEW 2012


0 Kudos
Message 2 of 7
(2,243 Views)

Thank you for your response. I looked at the VI that you linked to, but for me the problem is not playing multiple signals simultaneously, but correctly configuring sound I/O for continuous sending/receiving of signals from the input and output buffers. I would like to fix the problem of the signal dropping out during my measurement. Any ideas?

0 Kudos
Message 3 of 7
(2,236 Views)

Ah, I see. I thought you wanted to send multiple sound files to the device simultaniously which is something I worked on a while ago. I should have looked closer.

 

I just looked at your vi but unfortunately I don't have much experience with the sound library.

=====================
LabVIEW 2012


0 Kudos
Message 4 of 7
(2,231 Views)

Hi dgopman,

 

Have you tried using the same division VI that they use in the example?  You may be having issues doing the 2*x^(-1) command with integer values.

 

 

Brian

Brian G.
0 Kudos
Message 5 of 7
(2,212 Views)

Hi Brian,

 

That's a really interesting idea. In principle I can try converting back and forth from Ints to floats to process the division. I am usually entering something even into the scaling by a factor of 2 so the division doesn't have to lose any information but I should double check.

 


In my trials I am only running one iteration of the Sound Input Read command, passing to it 100k samples per channel, even though I set up a 200k sample input buffer size in the Sound Input Configure stage.

 

For the most part (so for the 4 seconds or so of my signal), the signal output is true. But as you can see in the attached pdf, the signal will degrade in one of two ways: (1) the signal will spike to about 15-20% higher than the peak amplitude of the single frequency sine wave that I generate and (2) (MORE CONCERNING) the periodic waveform suddenly breaks down and then resumes with a totally different phase than the original waveform. This happens more than once during the measurement, and does not seem to be periodic (I will try to look closer). Actually I think the input/output buffer management is somehow breaking down and one of the processes is blocking the other but I'm not sure how to best check this.

 

Any ideas how I might test this?

 

Thanks,

Daniel

0 Kudos
Message 6 of 7
(2,201 Views)

You are configuring the output and input to use two channels.  Is your .pdf file only showing one of these channels or both one after another?  Maybe you can try testing the program with a single channel?

 

Otherwise, I sometimes have problems with the generate waveform VI if you do not properly specify the values in the sampling info cluster.  Make sure that you properly connect the cluster to the VI and provide the correct number of samples to generate (in your case chunk size) and frequency.  Let me know what you find out.

 

 

Brian

Brian G.
0 Kudos
Message 7 of 7
(2,182 Views)