2017-09-19 19:29:46 -04:00
|
|
|
ardour { ["type"] = "Snippet", name = "Dump Latency",
|
|
|
|
license = "MIT",
|
|
|
|
author = "Ardour Team",
|
|
|
|
}
|
|
|
|
|
|
|
|
function factory () return function ()
|
2017-09-27 22:25:50 -04:00
|
|
|
local all_procs = true
|
2020-01-09 12:18:46 -05:00
|
|
|
local show_ports = true
|
2017-09-27 22:25:50 -04:00
|
|
|
|
2017-09-19 19:29:46 -04:00
|
|
|
print (" -- Session --")
|
|
|
|
print ("Worst Output Latency: ", Session:worst_output_latency ())
|
|
|
|
print ("Worst Input Latency: ", Session:worst_input_latency ())
|
2017-09-27 22:25:50 -04:00
|
|
|
print ("Worst Track Latency: ", Session:worst_route_latency ())
|
|
|
|
print ("Worst Latency Preroll: ", Session:worst_latency_preroll ())
|
2021-09-08 15:45:16 -04:00
|
|
|
print ("I/O Latency: ", Session:io_latency ())
|
2017-09-27 22:25:50 -04:00
|
|
|
|
|
|
|
print (" -- Routes --")
|
|
|
|
for t in Session:get_routes ():iter () do
|
|
|
|
print (string.format ("%-30s signal-latency: %4d align: %4d play: %4d || in: %4d out: %4d",
|
2021-09-14 15:39:41 -04:00
|
|
|
string.sub (t:name(), 0, 30),
|
2017-09-27 22:25:50 -04:00
|
|
|
t:signal_latency (), t:playback_latency (false), t:playback_latency (true),
|
|
|
|
t:input():latency(), t:output():latency()))
|
|
|
|
local i = 0
|
|
|
|
while true do
|
|
|
|
local proc = t:nth_processor (i)
|
|
|
|
if proc:isnil () then break end
|
|
|
|
if all_procs and not proc:to_send():isnil () then
|
|
|
|
print (string.format (" * %-27s L: %4d in: %4d out: %4d capt: %4d play %4d DLY-SRC: %4d DLY-DST: %4d",
|
|
|
|
string.sub (proc:name(), 0, 27) , proc:signal_latency(),
|
|
|
|
proc:input_latency(), proc:output_latency(),
|
|
|
|
proc:capture_offset(), proc:playback_offset(),
|
|
|
|
proc:to_send():get_delay_in(), proc:to_send():get_delay_out()
|
|
|
|
))
|
2023-12-06 21:47:31 -05:00
|
|
|
elseif all_procs and not proc:to_surroundsend():isnil () then
|
|
|
|
print (string.format (" * %-27s L: %4d in: %4d out: %4d capt: %4d play %4d DLY-SRC: %4d DLY-DST: %4d",
|
|
|
|
string.sub (proc:name(), 0, 27) , proc:signal_latency(),
|
|
|
|
proc:input_latency(), proc:output_latency(),
|
|
|
|
proc:capture_offset(), proc:playback_offset(),
|
|
|
|
proc:to_surroundsend():get_delay_in(), proc:to_surroundsend():get_delay_out()
|
|
|
|
))
|
2017-09-27 22:25:50 -04:00
|
|
|
elseif all_procs or not proc:to_diskioprocessor():isnil () then
|
|
|
|
print (string.format (" * %-27s L: %4d in: %4d out: %4d capt: %4d play %4d",
|
|
|
|
string.sub (proc:name(), 0, 27) , proc:signal_latency(),
|
|
|
|
proc:input_latency(), proc:output_latency(),
|
|
|
|
proc:capture_offset(), proc:playback_offset()
|
|
|
|
))
|
|
|
|
end
|
|
|
|
i = i + 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if show_ports then
|
|
|
|
print (" -- Ports -- (latencies: port, priv, pub)")
|
|
|
|
local a = Session:engine()
|
|
|
|
_, t = a:get_ports (ARDOUR.DataType("audio"), ARDOUR.PortList())
|
|
|
|
-- table 't' holds argument references. t[2] is the PortList
|
|
|
|
for p in t[2]:iter() do
|
|
|
|
local lp = p:get_connected_latency_range (ARDOUR.LatencyRange(), true)
|
|
|
|
local lc = p:get_connected_latency_range (ARDOUR.LatencyRange(), false)
|
|
|
|
local ppl = p:private_latency_range (true)
|
|
|
|
local pcl = p:private_latency_range (false)
|
|
|
|
local bpl = p:public_latency_range (true)
|
|
|
|
local bcl = p:public_latency_range (false)
|
|
|
|
print (string.format ("%-30s play: (%4d, %4d) (%4d, %4d) (%4d, %4d) capt: (%4d, %4d) (%4d, %4d) (%4d, %4d)",
|
2021-09-14 15:39:41 -04:00
|
|
|
string.sub (p:name(), 0, 30),
|
2017-09-27 22:25:50 -04:00
|
|
|
lp[1].min, lp[1].max, ppl.min, ppl.max, bpl.min, bpl.max,
|
|
|
|
lc[1].min, lc[1].max, pcl.min, pcl.max, bcl.min, bcl.max))
|
|
|
|
end
|
2020-01-09 12:18:46 -05:00
|
|
|
_, t = a:get_ports (ARDOUR.DataType("midi"), ARDOUR.PortList())
|
|
|
|
-- table 't' holds argument references. t[2] is the PortList
|
|
|
|
for p in t[2]:iter() do
|
|
|
|
local lp = p:get_connected_latency_range (ARDOUR.LatencyRange(), true)
|
|
|
|
local lc = p:get_connected_latency_range (ARDOUR.LatencyRange(), false)
|
|
|
|
local ppl = p:private_latency_range (true)
|
|
|
|
local pcl = p:private_latency_range (false)
|
|
|
|
local bpl = p:public_latency_range (true)
|
|
|
|
local bcl = p:public_latency_range (false)
|
|
|
|
print (string.format ("%-30s play: (%4d, %4d) (%4d, %4d) (%4d, %4d) capt: (%4d, %4d) (%4d, %4d) (%4d, %4d)",
|
2021-09-14 15:39:41 -04:00
|
|
|
string.sub (p:name(), 0, 30),
|
2020-01-09 12:18:46 -05:00
|
|
|
lp[1].min, lp[1].max, ppl.min, ppl.max, bpl.min, bpl.max,
|
|
|
|
lc[1].min, lc[1].max, pcl.min, pcl.max, bcl.min, bcl.max))
|
|
|
|
end
|
2017-09-19 19:29:46 -04:00
|
|
|
end
|
|
|
|
end end
|