is_input_device: Make sure is_input device is initialized to false

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Add helper functions for opening and closing the buffer

We have basically the same code for opening and closing the buffer in the
oneshot and in the continuous sample mode path. Factor this out into common
helper functions. Also open the buffer before trying to configure it. This acts
as a kind of mutex to protect one application from messing with another
applications config while it is actively sampling.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Break capture startup into two phases

Break the startup sequence into setup and start. This allows us to factor out
some common code which needs to run between these phases.

Also abort the setup phase if not the right number of channels are selected.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Make channel and device list non-sensitive during sampling

We don't want the user to change the device or channel selection while sampling
is in progress.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Relicense under GPL-2

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>