Time mismatch with Sound Input Read VI

Hi Folk,
I am acquiring the signal of the PC
sound card with the "Sound Input Read VI" and I have
noticed that between subsequent waveform data packets there are time
mismatch, both overlap and gap.
To point out the observed behavior, I
have posted a modified example, the "Continuous Sound Input.vi". In the example, I have computed the
time difference between the t0 of the actual waveform packet and t0
expected on the basis of the previous waveform packet.
Consistently, in the indicator "Time
series" (Waveform Charts), each time there is a time overlap or
gap the Charts resets it self or presents a gap.
By reading 1 second of data the time
mismatch is about 0.015625 or 0.03125 sec. (both positive and
negative).
The repetition frequency of the time
mismatch decreases as the acquisition sample rate increases.
The amount of the time mismatch seems
to be sample rate invariant.
Do you have any idea from where this
problem is coming out and how to solve it?
Thanks for your help,
Asper
Attachments:
Time mismatch with Sound Input Read VI.png ‏51 KB

Pre made Labview functions are not some holly grails that is newer to be touched and modified. In fact many included functions in Labview has what I will name as "high flimflam factor" That will say a lot of functions you do not really need. Express VIs are grim examples of this.
Anyway I have made some modifications and removed some babyfat in the sound input VI. Take a look at it. The top level VI is the "time fixed sound.vi" It could be that you will get an error because Labview will not find a DLL. If a DLL is reported missing you will find it in C:\Program files\National Instruments\LabVIEW 2010\resource\lvsound2.dll
Remember to save the modified VIs in a separate folder, and not in the vi.lib folder at all. Be careful so you do not overwrite any Labview function
Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Attachments:
Sound Input Read (DBL)_time_fixed.vi ‏30 KB
time fixed sound.vi ‏19 KB

Similar Messages

  • Sound Input Read VI hangs

    I'm using the SI Read VI to sample from the Soundblaster card in my Dell PC. I've configured the device for 16-bit mono input, sample rate 44.1 kHz, and the buffer size is 1024 samples. The SI Read VI is in a Timed Loop whose period I've set to 23 ms (1024 / 44.1kHz). Following each acquisition, I do some filtering, frequency analysis, and plotting inside the loop.
    The acquisition works well for the first 10 minutes or so that it is running. But sometime after about 10 or 15 minutes, the VI hangs. I've traced the hang back to the SI Read VI, but have not yet figured out how to avoid the hang or recover from it (I have to abort and restart the program).
    Has anyone had similar problems with the SI Read VI? Could there be a problem with the DLL that the SI Read VI calls? Are there any upgrades or fixes for this? Can someone suggest a way to recover from the hang?
    Thanks for any help,
    Mark

    This message is a reply to "Sound Input Read VI hangs" (National Instrument) NI Discussion Forums posting found at: http://forums.ni.com/ni/board/message?board.id=170&message.id=137258 and http://forums.ni.com/ni/board/message?board.id=170&message.id=110656&requireLogin=False
    Hi everybody,
    From the large count of how many of you guys read the above thread of messages, including myself, and who are dealing with the same problem of SI Read VI hanging found National Instrument (NI) LabVIEW (LV), I decided to share my (not so perfect) solution with you guys to save you time and frustration. Here is the story of 3 days (18 hrs/day) of my life, fighting a bug in SI Read VI (SI: Sound Input) (I am currently using LabVIEW Pro v 7.1.1):
    For the reason that "A Message cannot exceed 10,000 characters" on this Forum I included my message in the attached Word doc. Hopefully, there is no such limitation on uploaded files!
    Samir Berjawi
    Research Assistant and Lab Instructor
    American University of Beirut
    [email protected]
    [email protected]
    Attachments:
    LabVIEW SI Read freezes - Report.doc ‏39 KB
    Sound Acquisition Test.zip ‏995 KB

  • Wrong sampling rate from Sound Input Read VI on Dell Latitude E6510

    Hi,
    When I
    receive data from the sound card with the Sound Input Read VI, the actual
    sampling rate is not equal to the sampling rate set in the Sound Input
    Configure VI. I estimate the sampling ratio by dividing the number of samples received
    by the difference between the first and the last t0 from Sound Input Read. For
    example, if the sampling rate is set to 7000 S/s, the actual sampling rate is
    around 6900 S/s. If the sampling rate is set to 7050 S/s, the actual sampling
    rate is around 7200.
    This problem appears when the
    code is run on my Dell Latitude E6510 machine. When I run the
    same code on my Lenovo ThinkPad, the sampling rate is correct.
    The Labview application I
    am developing is to be used to acquire data synchronously from several sources,
    including the sound card input. It is therefore important that the sampling rate
    is correct.
    If anybody has any idea
    about what may cause this problem, and a way to fix it, I would be grateful.
    Ole

    It has been a trend the last years that sound card only support some sampling rates, not a range. You should refer to your sound card manual for this kind of information.  You should also be aware of that the NI sound interface is junk, and they do care about it either. Use the WaveIO interface instead See the link. But I am quite sure your problem is related to the sound card hardware not some NI driver issue
    http://www.zeitnitz.de/Christian/waveio
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Sound input read multiple soundcards

    Heey everybody,
    I have a problem. I want to read two different signals at the same time from 2 different soundcards. 1 internal soundcard from my laptop, and 1 usb soundcard. 
    So i used the Acquire Sound VI.
    Reading both signals at the same time is not a problem until i set the measuring time to about more that 30 seconds. It gets a buffer overflow.
    So i tried to do the following:
    I first made this with 1 signal first, and it worked perfectly, every second it got updated.
    But, when i added the second signal it only wanted to read the first second of the first signal and then it got stuck, and i had to stop the software by closing it. And then killing labview with the taskmanagement thingey from windows.
    Anyone have any idea what the problem is?
    Greetings,
    Jory 
    Solved!
    Go to Solution.

    Ok, never mind, i've solved it. I made the buffers larger (at the sound input configure block) and now it works like a charm

  • Sound Input Read Spectrum Analyzer

    I am working on a project with Arduino to do a spectrum analyzer. The LVIFA part of it is working fine.
    The part that I am struggling with is the audio input.
    I am using the Sound Input Pallet.
    My troubles are two-fold.
    1. A single read takes quite some time and I need to have a pretty quick response. I decreased the samples per read and came up with problem #2.
    2. I can get one read out of the Sound Read In and then the VI locks up. I have my timeout set to 1 Sec and it never times out. I have to restart LabVIEW.
    While it would be nice to have this VI working, I'm not even sure that I am using the correct tool. If I am going to be running an audio spectrum analyzer display off of the data input, I need to response to be within a few mS (ie. <200) so that it looks visually correct.
    If this library will not achieve this, then I need to look into a different tool.

    Hi,
    I have a similar project, actually I am using a Audio frequency range as input to the Arduino and do an FFT to receive the spectrum out of it.
    See the YOUTUBE video I did and the code in *.jpg. I took actually the Continous Input example and modified it.
    Hope that helps.
    Keep me posted, since we might work on a same project.
    http://youtu.be/aqzyofQHXDM
    Y3G
    Attachments:
    Uno Blockpanel.JPG ‏104 KB
    Uno FRONTpanel.JPG ‏99 KB

  • PLEASE can a AE from NI take a look at my problem. Sound input read behave in strange manner then the buffer size is larger than 2X number of samples to read.

    On my computer I have discovered some strange behavior then reading data from the sound card. Then the buffer size is 2x samples to read everything is as expected. But since I read the sound card 10 times pr second I feel a .2 second buffer is to small. I am using XP, and XP is not a RTOS so with a buffer set to 0.2 seconds I may lose data. Therefore I set the buffer size (number samples/ch on Sound Input Configure.vi) to be in range of 2 seconds. The result then is that then reading from Sound input.vi, a reading often take more than 0.1 second. On my computer it is often 500mSec. Then the next 5 read follows with almost zero interval. I do not loose data. But on my front panel the graphs looks like an very early silent movie. This error was introduced in Labview 8.x. To be honest I think the labview 7.x sound system was much better in many ways.
    But before I point any finger NI. Other people has to verify the behavior I experience. I have made an example showing this error. It is a modified version  of the "Continuous Sound Input.vi" example. Then the "buffer in seconds" control is set to 0.2 every thing works OK. Changer this to a larger number will produce the mentioned above hiccup. The larger number in this control the larger hiccup. Is it any way to fix this? My solution up to now has to use a free 3. part software(http://www.zeitnitz.de/Christian/index.php?sel=wav​eio) But I guess it soon will be outdated. It may not work with newer windows versions.
    Any help at all will be appreciated 
    And yes I have the most updated version fo DirectX. Also I se this in Labview 2009 which I have trail version of. The VI I have made is in 8.6
    Message Edited by Coq Rouge on 09-07-2009 10:54 AM
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    Continuous Sound Input with timing.vi ‏23 KB

    macaba wrote:
    If you take a moving average of the 0.2s buffer vs. 3s buffer at an update rate of 10, then they are the same (just under 100ms), so the average refresh rate is the same. I agree that is odd behaviour that the time between sound reads go to zero quite a lot then take a long time once in a while (presumably to fill the buffer
    I guess it goes to zero because it is reading data from the buffer it do not has to wait for data from the sound card. The mysterious thing is the periodic delay. You are also correct then saying that average timing is correct. And in my application I have no data loss.
    If you search for sound in this forum you will find out that many people has reported trouble with the sound system.
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Dv video time stamp with analog input

    Hi,
    I have a dv video which I want to time stamp with a analog input.  For the video, which is dv brought into the computer with ieee1394, LabView calls up a C++ program which then stores the video.  Simultaneously, in the program which calls up the C++, an analog signal is also stored (seperately).  I know it sounds tricky as well as messy but this is the best we've been able to work out, given the uncorroperative nature of LabView with dv camera.  Does anyone have suggections for time stamping these two signals so that I know exactly where in the video the analog signal occurs?  The PCI board we use is the NI 6014, which I know is timestamp capable, but I dont know if it can stamp the video feed since it doesnt come in through the NI card.
    All thanks in advance for any help!
    Daniel

    Daniel,
    Does your DV camera have any sort of timing or triggering signals? Without these, it will be virtually impossible to correlate measurements. It is cetainly possible to accurately time an analog input with your DAQ card, but correlating these to the digital video would be extremely difficult. Is this video streaming in real time? Or are you reading it off of an already-recorded tape? If this video is streaming in real time, with an acquisition started in software, I would suggest attempting to start the software DV reading at the same time as your DAQ task. If you do have an external signal that can trigger the video acquisition, then I would suggest using that same signal to start your analog acquisition.
    Hope this helps,
    Ryan Verret
    Product Marketing Engineer
    Signal Generators
    National Instruments

  • G5 sound input reads drums but no sound coming out

    i'm not sure what the deal is, the input is reading my drums fine but i hear no sound not through headphones or surround sound or computers speakers. All my sound works for anyhting else. please help me

    My present computer has no sound input capabilities but there may be a setting in sound control panels or whatever software you are using for selecting sound output, including passthrough. There's also a midi application in your applications that controls sound features.

  • How to have Sound Input Read VI read .wav in sections

    Hi,
    I'm trying to read audio data from my laptop's soundcard, and it's really slowing down my VI's processing power. I read on the NI website to read the .wav file in sections instead of as a whole, but I have no idea how to do that. Any suggestions? My VI is attached.
    Thanks!
    Attachments:
    signalgen.vi ‏56 KB

    You have set the sample rate for the sound card to 100000 samples pr second. That is a sample rate your sound card will not be able to handle. Hence a error will occur. And you will not get any data from the sound card. Some sound cards may support samplerates in 1 Hz step but most sound cards do only support some rates. The latter is most typical. All sound cards do support 44100 Hz sample rates but typical sample rates are 44100,22050,11025, and 8000. Some sound card do also support higher sample rates than 44100. Refer to your sound card documentation for this. Your way of using the Daq card by reading 1 sample on each iteration, using software timing is also a Daq NO-NO. Read data in chunks and do not do to many updates pr second, and always use HW timing. If you need the waveform to appear "live", or "real-time" 10 updates pr second is more than enough.  
    I have included a sample vi. I suggest that you use that as your workhorse from this point. At least if you want more help from me
    Tip Labview is shiped with many very useful examples. Then you are stuck. Go to toolbar->help->fFind examples. As one example the Daq setup is from the "Cont Acq&Chart Samples-Int Clk.vi" vi example
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    workhorse.vi ‏37 KB

  • Problem with sound input/output settings

    Hello--
    Last night, my iBook suddenly stopped playing any sounds at all: itunes, CDs, etc, won't play at all. I looked in system preferences/sound, and the computer told me that there are no input or output devices at all. What's more, the sound seems to me on permanent mute, and it won't allow me to change it at all (F4 and F5 functions just show a "mute" sign under the volume bar). Is this a problem with the software, hardware, or what? Thanks in advance for any advice,
    JB Coleman

    here is a set of weird but probable solutions. Good luck
    Solutions

  • MAX with sound input

    How can I use MAX (the Measurement and Automation program) to test if the computer is able to read voltage changes via the sound card (fed into the computer via the microphone jack). Please walk me through the process...
    Thank you!

    MAX is for NI cards only.  Is your sound card an NI card; I don't think they make one?
    Message Edited by nyc on 07-13-2006 10:19 AM

  • Difficulty getting Sound input configure and sound input to read more than 2 channels

    I need multichannel audio input for my project. I can't seem to read more than 2 channels of my audio interface.
    The interface Im using is an Alesis Multimix8 USB 2 mixer and and audio interface. This supports 10 channels in and 2 out. With other software I can read all input channels simultaneously without any difficulty. When I specify the sound input configure and sound input read, to read more than 2 channels any extra channel is a blank signal. Im using Labview 8.5 here.
    Solved!
    Go to Solution.

    Take a look here
    http://forums.ni.com/t5/LabVIEW/Play-waveform-express-vi-list-devices-on-front-panel/td-p/1559336
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Can't aquire Sound input. Locks up instantly Dell optiplex 760

    With labview 8.6 and All previous versions of labview I have the same issue with this new computer. Using supplied example aquire sound input or my own app as soon your press run the VI hangs untill I use end task. It will play sound however. Issue is with sound input only. The new pc has integrated soundmax HD sound ans windows xp operating system. I have never had a problem aquiring sound input untill this recent pc change.
    I did take notice that the cpu is not being used when it hangs up.  Very odd problem.  If I change the device from 0 to 1 it will run but with no sound of course.

    Had the same issue (sound stutter / garble) after upgrade to 3.0.6.
    Fixed it by downgrading back to 3.0.4.
    In case it helps identify the issue, these are the sound modules I am using (they work fine under 3.0.4, but produce stuttering audio under 3.0.6, under ALL apps I use - firefox/flash videos, mplayer, ffplay, etc):
    $ lsmod | grep snd
    snd_hda_codec_realtek   222124  1
    snd_hda_intel          19101  3
    snd_hda_codec          66954  2 snd_hda_codec_realtek,snd_hda_intel
    snd_hwdep               4942  1 snd_hda_codec
    snd_pcm_oss            33792  0
    snd_pcm                60015  4 snd_hda_intel,snd_hda_codec,snd_pcm_oss
    snd_timer              15374  2 snd_pcm
    snd_page_alloc          5837  2 snd_hda_intel,snd_pcm
    snd_mixer_oss          12807  1 snd_pcm_oss
    snd                    43561  12 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm_oss,snd_pcm,snd_timer,snd_mixer_oss
    soundcore               4986  1 snd

  • How to use at the same time the audio sounds of a keyboard & the midi sounds with mainstage

    Hello! hope you can shed some light on my problem! I want to be able to use at the same time the real sounds of korg sv-1(stage keyboard, but it could be any stage piano with USB midi) and use other sounds from mainstage. Of course i switch between patches and sets with a footpedal so i can be quick with my changes of sounds so I try to keep my hands on the keys.
    My question is: Is there a way that one moment for example i have a silend patch (from mainstage) and the real sound i want passing through audio and the next moment silence from korg and the next patch a sound from mainstage? Or even combine them. I mean in general how am I able to integrate the sounds I prepared and organised in patches in mainstage with the beautiful piano & rhode sounds of my sv-1?
    thanx in advance for your response!

    Yes. To have a silent Mainstage patch, simply do not create any instrument channel strips. To have the SV-1 silent on a patch you should be able to set and save the volume for that patch to 0. As an alternative you could turn local off on the SV-1( this function will reset to local on after the SV-1 has been turned off). With local off you can determine with each Mainstage patch whether or not you want to transmit MIDI to the external instrument(SV-1) channel strip. If you have local on, be careful not to create a MIDI feedback/loop with the SV-1. This is a lot of info to digest at once, so take it slowly, step by step. Snapshots below are somewhat in order.
    Click on the cog wheel in the upper right corner of the channel strips section to get to this menu. Select add external instrument channel strip.
    The external channel instrument strip will look like this.
    Click on the MIDI output box to show the display below and choose your external keyboard destination(SV-1).
    In the channel strip inspector you can send patch changes to the SV-1.
    Here is where you select the MIDI input for routing MIDI to the SV-1. If want no SV-1 sound for this Mainstage patch, select none.
    You'll need to play with these parameters to get the desired results. Stepping through the MS patches with a footswitch can be done, too, but that can wait for now. Post another question when you master these steps.

  • I am not getting any sound input on my microphone. There is no microphone input on my new macbook pro, so I am using my old one. Is this a problem with the new operating system? Did they simply remove any microphone software?

    I am not getting any sound input on my microphone. There is no microphone input on my new macbook pro, so I am using my old one. Is this a problem with the new operating system? Did they simply remove any microphone software?

    Check System Preferences > Sound > Output
    Make sure the correct device is selected.

Maybe you are looking for