]> git.sesse.net Git - nageru-docs/commitdiff
Write about audio latency.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 3 Apr 2017 21:05:54 +0000 (23:05 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 3 Apr 2017 21:06:08 +0000 (23:06 +0200)
hdmisdi.rst

index cc4d438f78a7cc9d24a685ae51189204a5287a4b..c3028af503a97103fb347743756528823e94d173 100644 (file)
@@ -129,7 +129,8 @@ on the terminal if this happens.) The latency budget is set by
 *--output-buffer-frames=*, where the default is a pretty generous 6.0,
 or 100 ms at 60 fps; if you want lower latency, this you probably want
 to adjust this value down to the point where Nageru starts complaining about
-dropped or late frames, and then a bit up again to get some margin. Note that
+dropped or late frames, and then a bit up again to get some margin.
+(But see the part about `audio latency <audio-latency>` below.) Note that
 the value can be fractional.
 
 As an exception to the above, Nageru also allows *slop*; if the frame is
@@ -139,10 +140,28 @@ cause it to be displayed. The slop is set with *--output-slop-frames=*,
 where the default is 0.5 frames.
 
 
+.. _audio-latency:
+
 Audio latency
 .............
 
-TODO: Write about audio.
+Since Nageru does not require synchronized audio sources, neither to video
+nor to each other (which would require a common, locked reference clock for all
+capture and sound cards), it needs to *resample* incoming audio to match
+the rate of the master video clock. To avoid buffer underruns caused by
+uneven delivery of input audio, each card needs an audio input queue,
+just like the video input queue; by default, this is set to 100 ms, which then
+acts as a lower bound on your latency.
+
+If you want to reduce video latency, you will probably want to reduce audio
+latency correspondingly, or audio will arrive too late to be heard. You can
+adjust the audio latency with the *--audio-queue-length-ms=* flag, but notice
+that this value is in milliseconds, not in frames.
+
+Audio and video queue lengths do not need to match exactly; the two streams
+(audio and video) will be synchronized at playback, both for network streaming
+and for HDMI/SDI output.
+
 
 Measuring latency
 .................