Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Sound Card Internal Clock Sync (Read 9584 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Sound Card Internal Clock Sync

I wonder if it´s possible to detect the clock sync?

As i have problems with Video/Audio sync when record, The audio plays a bit to fast (ca 75ms per hour), and i am currently solving it by assuming samplerate of 47999 (if recorded as 48000).
But i want to know if it´s the Sound Card that produce the problem, and i am looking for a way to see how it keeps sync, but as i am not that knowledgeable at this, i don´t know how to check it.

And the only thing that seems to come up, is that sound cards can have a bad clock sync.

My card is not an onboard, it's an Creative Sound Blaster ZxR.

Thanks!

Sound Card Internal Clock Sync

Reply #1
Generally you use the same clock for both audio and video to prevent this problem.  What are you using?

Sound Card Internal Clock Sync

Reply #2
Quote
But i want to know if it´s the Sound Card that produce the problem
If you are recording sound separately through your soundcard, and not through your video camera or video capture device, yes.

Quote
...47999 (if recorded as 48000).
You've got an error of 1/48000?  That seems pretty doggone accurate!!!    Some cheap consumer soundcards can actually be off by a few percent!  (Useless for anything "serious".)  A garden-variety quartz crystal is usually rated for 50-100ppm, and that's about what I'd expect from a good soundcard/interface.  (I don't think I''ve ever seen clock accuracy in the specs.)

Professional equipment has a master clock input to keep everything in-sync.   The stand-alone master clocks that I know of are super-expensive (and super accurate).  Absolute accuracy isn't usually that important, and there might be some more-affordable audio interfaces that have a master-cock output (and input).  There is also some trick with a MIDI clock to keep multiple audio interfaces (with MIDI in/out) in-sync, but I'm not sure how that works.

I'm not sure if there is anything like that available in consumer/prosumer video equipment.  Video equipment uses an SMPT Clock, but I' don't know if there is any consumer equipment with SMPTE inputs/outputs.

Sound Card Internal Clock Sync

Reply #3
Generally you use the same clock for both audio and video to prevent this problem.  What are you using?


How do you do that?

What am i using, what do you mean?

If you wonder about the recording, i am talking about Recording on the PC, with recording the Audio Playback.
It happens all the time, as long as it doesn´t dynamicly resample (which solves it).

Here is a picture that i think generally proves the clock issue.


Sound Card Internal Clock Sync

Reply #4
Quote
...47999 (if recorded as 48000).
You've got an error of 1/48000?  That seems pretty doggone accurate!!!    Some cheap consumer soundcards can actually be off by a few percent!  (Useless for anything "serious".)  A garden-variety quartz crystal is usually rated for 50-100ppm, and that's about what I'd expect from a good soundcard/interface.  (I don't think I''ve ever seen clock accuracy in the specs.)

Professional equipment has a master clock input to keep everything in-sync.   The stand-alone master clocks that I know of are super-expensive (and super accurate).  Absolute accuracy isn't usually that important, and there might be some more-affordable audio interfaces that have a master-cock output (and input).  There is also some trick with a MIDI clock to keep multiple audio interfaces (with MIDI in/out) in-sync, but I'm not sure how that works.

I'm not sure if there is anything like that available in consumer/prosumer video equipment.  Video equipment uses an SMPT Clock, but I' don't know if there is any consumer equipment with SMPTE inputs/outputs.


I don´t think a Master Clock is for what i am doing, you are talking about Video/Audio production, as in broadcast and studios right?

Sound Card Internal Clock Sync

Reply #5
Generally you use the same clock for both audio and video to prevent this problem.  What are you using?


How do you do that?


The easiest way is to use the same device to record both audio and video.

Here is a picture that i think generally proves the clock issue.


I don't know what that is a picture of, but my point is that if you have multiple clocks you will not have audio and video in sync after recording long enough.  I'm surprised you only gain 75ms per hour.  Thats quite good. 

Sound Card Internal Clock Sync

Reply #6
Generally you use the same clock for both audio and video to prevent this problem.  What are you using?


How do you do that?


The easiest way is to use the same device to record both audio and video.

Here is a picture that i think generally proves the clock issue.


I don't know what that is a picture of, but my point is that if you have multiple clocks you will not have audio and video in sync after recording long enough.  I'm surprised you only gain 75ms per hour.  Thats quite good.


Well i am using same device, all is done internally.
Well from the PC, a game, recording or whatever i do to record from the audio card (I am not talking about capturing from outside, it´s all done from playback).

The picture shows Virtualdub, and i am recording randomly just to let it check my samplerate (it´s the only way i could think of to check the sync).
And as you can see, it´s set to 47999 (it´s fluctuating a bit though), but i am recording at 48000.
So it will go out of sync, and 47999 vs 48000 is about 75ms per hour.

Sound Card Internal Clock Sync

Reply #7
Generally you use the same clock for both audio and video to prevent this problem.  What are you using?


How do you do that?


The easiest way is to use the same device to record both audio and video.

Here is a picture that i think generally proves the clock issue.


I don't know what that is a picture of, but my point is that if you have multiple clocks you will not have audio and video in sync after recording long enough.  I'm surprised you only gain 75ms per hour.  Thats quite good.


Well i am using same device, all is done internally.
Well from the PC, a game, recording or whatever i do to record from the audio card


What sound card do you have that can record video?

Sound Card Internal Clock Sync

Reply #8
Yeah, but you don't have correct frame rates for either video or audio. There is checkbox while capturing to sync either video to audio, or audio to video. Set the correct frame rate for your video (I'll assume it's NTSC, so 29,97) and sync audio to video. If it fails, try the other way.
Error 404; signature server not available.

Sound Card Internal Clock Sync

Reply #9
Generally you use the same clock for both audio and video to prevent this problem.  What are you using?


How do you do that?


You use a video capture card that has its own audio interface.

As a rule, video capture cards that have their own audio interfaces clock the audio and video capture functions from the same clock.



Sound Card Internal Clock Sync

Reply #10
I have been a bit uninformative i think.

I am NOT capturing from outside the PC (VCR Console Broadcast etc).

I am recording what the PC displays or produces.

For example recording games, but it doesn´t really matter what i record.

It will always be desynced at about 47999 (if recorded as 48000), the audio is always off, probably even if i only record audio with no video at all (though then i don´t know how to check the sync, as i got nothing to compare to.)


Sound Card Internal Clock Sync

Reply #11
I know nothing about VirtualDub, but does the fact that it inserted 3 frames (i.e. 100mSec) have anything to do with the video running longer than the audio?

 

Sound Card Internal Clock Sync

Reply #12
I know nothing about VirtualDub, but does the fact that it inserted 3 frames (i.e. 100mSec) have anything to do with the video running longer than the audio?


Not in this case. It happens no matter what.
I am starting to think that it has to do with the motherboard, but it´s not a fault in it really.
It´s very hard to find any information on this stuff, i guess it´s because no one really cares, 75ms per hour isn´t that much.
But i get frustrated by it.

I can solve it more or less by resampling and stuff, but it just shouldn´t be needed.

Sound Card Internal Clock Sync

Reply #13
Does anyone know a way to compare playback to recording?

In another words.

I have a file wave file that plays a tone for 8 hours.

And the application (or whatever way to do it), will play that file, and compare it to what actually being played.

Comparing frequency, so it's possible to detect what the distortion is.

Something like how this seems to work:

http://www.agm.me.uk/blog/2007/09/soundcar...ck-accuracy.php

But it doesn´t work for my, maybe it´s only for older OSes.
But the application is supposed to compare the soundcard clock to the system clock, which i guess is what i am trying to do, so i can get the difference.

Sound Card Internal Clock Sync

Reply #14
Did you record and analyze the screencast on the same PC, i.e. using the same soundcard?

How did you create the video/audio file you are analyzing? Was video/audio recorded into the same video file, or merged from separate video and audio files later on? What software did you use for recording?

Was the recorded sound produced by the PC itself, or recorded via mic input (i.e. the soundcard)?

Sound Card Internal Clock Sync

Reply #15
Did you record and analyze the screencast on the same PC, i.e. using the same soundcard?

How did you create the video/audio file you are analyzing? Was video/audio recorded into the same video file, or merged from separate video and audio files later on? What software did you use for recording?

Was the recorded sound produced by the PC itself, or recorded via mic input (i.e. the soundcard)?


I analyzed the Waveform on the same PC using the same soundcard, correct.
With that, there is no problem, it´s the same ocmpared to the generated waveform.
If i compare to a video it isn´t.

The video and audio was recorded in the same file.
Doesn´t matter what software, but i use dxtory.

The sync is always off by the same amount.
I am pretty sure it has something to do with a clock drift occurring between the Sound Card clock and Multimedia clock.

The recorded sound was produced by the PC itself.
I am pretty sure i will get the same problem if i record outside through line in or mic aswell.

For example, if i record with my USB Mic the sync is off by another amount, as it´s clock is different.

Sound Card Internal Clock Sync

Reply #16
Different clocks will essentially always be different. What would be rare and unusual is two that run exactly at the same frequency. It might be possible if one had a large pool from which to choose. One might be able to find two that just happened to be close enough not to make a difference.

The differences are small with good equipment but they are enough that things will be noticeably out of synch if the recording is very long. The exact clock frequency isn't important. The important thing is that everything stays together. That is why any professional setup always uses one single clock for everything.

Sound Card Internal Clock Sync

Reply #17
Different clocks will essentially always be different. What would be rare and unusual is two that run exactly at the same frequency. It might be possible if one had a large pool from which to choose. One might be able to find two that just happened to be close enough not to make a difference.

The differences are small with good equipment but they are enough that things will be noticeably out of synch if the recording is very long. The exact clock frequency isn't important. The important thing is that everything stays together. That is why any professional setup always uses one single clock for everything.


Yeah but the thing is, if i record something on the PC, what clock is it going after?
I guess there must be to clocks, Audio Clock and Video Clock.

What i want to do, is to know the difference between them, if i know the difference, i can compensate for it.