NOOP - LTC generator: bit-alignment add comments and made permanent
authorRobin Gareus <robin@gareus.org>
Mon, 5 Nov 2012 22:55:13 +0000 (22:55 +0000)
committerRobin Gareus <robin@gareus.org>
Mon, 5 Nov 2012 22:55:13 +0000 (22:55 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13388 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/session_ltc.cc

index 35b175e531b5eca7f3653e17afbd67457d2e3171..94d7d6de21544c326c4b2c96709feaee70550513 100644 (file)
@@ -479,24 +479,26 @@ Session::ltc_tx_send_time_code_for_cycle (framepos_t start_frame, framepos_t end
                DEBUG_TRACE (DEBUG::LTC, string_compose("LTC TX5 restart @ %1 + %2 - %3 |  byte %4\n",
                                        ltc_enc_pos, ltc_enc_cnt, cyc_off, ltc_enc_byte));
        }
-#if 1 /* experimental sample bit alignment */
        else if (ltc_speed != 0 && (fptcf / ltc_speed / 80) > 3 ) {
-               /* We may get away without a DLL if speed-changes are uniform enough and
-                * no oscillation takes place, the linear approx here should reduce the
-                * jitter sufficiently when generating LTC from another LTC source or
-                * JACK-transport or ardour internal clock.
-                *
-                * Note that the granularity of the LTC encoder speed is 1 byte =
+               /* reduce (low freq) jitter.
+                * The granularity of the LTC encoder speed is 1 byte =
                 * (frames-per-timecode-frame / 10) audio-samples.
+                * Thus, tiny speed changes [as produced by the slave]
+                * may not have any effect in the cycle when they occur,
+                * but they will add up over time.
+                *
+                * This is a linear approx to compensate for this drift
+                * and prempt re-sync when the drift builds up.
                 *
-                * Thus, tiny speed changes won't have any effect and larger ones
-                * may lead to oscillations.
-                * To be better than that, resampling (or a rewrite of the encoder) is
-                * required.
+                * However, for very fast speeds - when 1 LTC bit is
+                * <= 3 audio-sample - adjusting speed may lead to
+                * invalid frames.
+                *
+                * To do better than this, resampling (or a rewrite of the
+                * encoder) is required.
                 */
                ltc_speed -= ((ltc_enc_pos + ltc_enc_cnt - poff) - cycle_start_frame) / engine().frame_rate();
        }
-#endif
 
 
        // (6) encode and output