Subject: [linux-audio-dev] decoding SMPTE from a second sound card?
From: Chris Baugher (baugher_AT_enteract.com)
Date: Mon Jul 24 2000 - 03:01:49 EEST
I was thinking about what Paul said about wanting to record SMPTE code
from a second sound card, and I was wondering if something like the scheme
below might be used to circumvent the 2 soundcard syncing problem.
/* simplistic psuedocode for using a second sound card to record SMPTE */
/* queue for holding decoded SMPTE frames */
smpte_frame_queue smpte_q;
/* audio recording thread. this thread will record from the
"audio"(hammerfall?) soundcard and run at that cards clock rate */
while(1) {
audio_buffer_t audio_buf, smpte_buf;
/* read the audio channels like normal */
read( sound_card_1, audio_buf );
write( "audio_file", audio_buf );
/* check the smpte queue for a new frame. if there is a frame
encode it into an audio signal and write it to a separate file
otherwise just write zero's to the file */
if( smpte_q != EMPTY ) {
smpte_buf = smpte_encode( smpte_q.pop() );
write( "smpte_file", smpte_buf );
} else {
write( "smpte_file", 0 );
}
}
/* SMPTE decoding thread. this thread reads from a second(cheap?)
soundcard and decodes SMPTE data. It will be synced to the clock
rate of the second(cheap?) sound card. */
while(1) {
audio_buffer_t smpte_buf;
read( sound_card_2, smpte_buf );
/* check the data to see if it contains a SMPTE frame. If it does
decode it into some kind of SMPTE frame struct, then put it in
the smpte queue */
if( check_data_for_smpte_frame( smpte_buf ) == TRUE ) {
smpte_q.push( decode_smpte_frame( smpte_buf ) );
}
}
Does this make any sense? If so would it really be worth the extra
overhead just to save a channel on our good sound card?
Chris|
This archive was generated by hypermail 2b28 : Mon Jul 24 2000 - 03:38:16 EEST