kingst-la2016: use common support for sw limits and session feed
Use common sw_limits and feed_queue helpers. Which makes --time specs
for acquisition duration available, and dramatically reduces complexity
in the send_chunk() routine. Which improves usability and reliability
and maintainability at the same time.
Assign default rate/depth/ratio in scan() already when the devc gets
created. Make an msecs timeout stop the acquisition if the hardware has
not seen the desired number of samples or exhausted its memory before.
Immediately start recording in the absence of trigger specs, drop the
pre-trigger phase in that case. Shuffle the order of activities in the
periodic receive callback. Send headers before enabling communication,
end communication before sending end markers to the session feed. Cope
when USB data is received after the configured acquisition got processed
(the hardware always overshoots due to compression and chunking). Extend
comments and diag messages.
USB receive timeouts are not fatal any longer. They even were seen
during regular operation at higher log levels. Which resulted in one
capture getting split across several "frames" unexpectedly.
Acquisition limits are not enforced most precisely in this commit, as
this would be more expensive. A little overshoot of up to 1.5kSa seems
acceptable (up to five packets with an 8bit repeat count each).