Re: [Jack-Devel] use case for IIO was Re: [PATCH 6/6] Added author to the Changelog.
On 14/02/14 09:26, Chris Caudle wrote:
>> I do think however that it would make it very hard for people to
>> actually use the src code
> Speaking of using, what is the use case for this interface? I searched
> for IIO and it seems to be an in kernel interface for analog to digital
> converters that some embedded linux people developed. What kinds of uses
> would use that and JACK together?
>
End user cases ... I guess it isn't obvious.
I can think of a few :
A researcher wants to record high sample rate analog signals simply ...
well, why not connect a set of IIO modules to their computer, fire up a
standard audio recorder and record away.
Someone wants to implement ultrasound - for whatever reason - then using
Jack, there are plenty of end user applications off the shelf which can
be used ... which require no investment. Free software.
There are many many different ideas, but in general anything analog
which needs to run low latency, either locally or over the network.
There are also crazily high audio sample rate standard frequencies :
http://en.wikipedia.org/wiki/Sampling_rate#Audio
The whole idea here is to not re-invent the wheel ... glue pieces of
software together which are proven to work and implement what's required
in between ... free software ;-)
Say you wanted to implement a custom piece of software to do very high
frequency analog stuff, look no further - it is really a 7 line piece of
code to get processing defined :
class TestJackClient : public JackClient
<http://www.flatmax.org/gtkiostream/html/classJackClient.html> {
int processAudio
<http://www.flatmax.org/gtkiostream/html/classJackClient.html#add6551d28b1535e745c52586d781ac9a>(jack_nframes_t
nframes) {
jack_default_audio_sample_t *out = ( jack_default_audio_sample_t* )
jack_port_get_buffer ( outputPorts
<http://www.flatmax.org/gtkiostream/html/classJackClient.html#a4d7c45b32920c0f13854956feb39ef7b>[0],
nframes );
// load the output audio samples here
// do something with the audio samples here
jack_default_audio_sample_t *in = ( jack_default_audio_sample_t* )
jack_port_get_buffer ( inputPorts
<http://www.flatmax.org/gtkiostream/html/classJackClient.html#a68fe7ccf19776d5c8eb0dc6a1d6666c3>[0],
nframes );
// do something with the input audio samples here
return 0;
}
};
And then 4 lines to actually run it :
TestJackClient jackClient; // init the jack client
int res=jackClient.connect("jack test client"); // connect the client to
the Jack system indicating the callback
res=jackClient.createPorts("in ", 1, "out ", 1); // create the ports for
the jack patching system.
res=jackClient.startClient(1, 1, true); // Start the client running with
one input and one output port, which is auto-connected to the system ports
1392331685.22323_0.ltw:2,a <52FD4B98.1080907 at flatmax dot org>