Re: [LAD] Tutorial for programming with JACK

From: <kallipygos@email-addr-hidden>
Date: Wed Feb 22 2012 - 11:56:11 EET
Hi experts
 
I followed your discussion about JACK API tutorial.
Actually i am beginner_from_zero in JACK programming.
 
Long long time ago i writed small JACK client, but i gotta problems with
x-runs and lost connections, and i not unterstood why.
 
Even if i read all this stuff, without tutorial and step_by_step examples
i can not programming stable JACK client.
http://jackaudio.org/files/docs/html/group__ClientFunctions.html
 
I found example 
https://github.com/harryhaaren/Linux-Audio-Programming-Documentation/blob/master/jackClient/jackClient.cpp
but i have some beginner questions about it.
 
Why it is written in C++ , not C ?
 
 float* inputBuffer = (float*)jack_port_get_buffer ( inputPort , nframes);
 float* outputBuffer= (float*)jack_port_get_buffer ( outputPort, nframes);
means "read" and "write" ?
 
If so then why callback func
process(jack_nframes_t nframes  )
have such structure ??
INPUT_READ
OUTPUT_WRITE
PROCESSING ?
 
 float* inputBuffer = (float*)jack_port_get_buffer ( inputPort , nframes);
 float* outputBuffer= (float*)jack_port_get_buffer ( outputPort, nframes);
  for ( i = 0; i < (int) nframes; i++)
  { // copy data from input to output. Note this is not optimized for speed!
    outputBuffer[i] = inputBuffer[i];
  }
It means that processed samples will go to output only @ next process() call ?
 
Why not 
INPUT_READ
PROCESSING
OUTPUT_WRITE ?
 
How can i detect (list) - all available ports:channels ?
How to automatic connect my client i/o ports to jackd ?
 
 jack_lsp -t
system:capture_1
32 bit float mono audio
system:capture_2
32 bit float mono audio
system:playback_1
32 bit float mono audio
system:playback_2
32 bit float mono audio
 
 
What means - 32 bit float mono audio ?
32 bit float - does JACK work with other sample formats ?
mono  - is it possible operate with interleaved stereo stream ?
audio - what else as audio ?
 
What about stereo stream ?
Must i create 2 ports ausL and ausR ?
 
  outputPort = jack_port_register ( client,
                                    "ausL",
                                    JACK_DEFAULT_AUDIO_TYPE,
                                    JackPortIsOutput,
                                    0 );
  outputPort = jack_port_register ( client,
                                    "ausR",
                                    JACK_DEFAULT_AUDIO_TYPE,
                                    JackPortIsOutput,
                                    0 );
If so, then how to write data and sync both seperate(d) channels?
With interleaved stream i do not care about sync between channels.
 
Tnx in advance @ all.
Alfs Kurmis
 




> Which leads me to my next question: are most JACK applications
> written in C/C++? I understand that programming as close to the
> hardware as possible is important for performance, but what about
> programming in a JVM language (I have Clojure in mind)? How
> reasonable is that?





----

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Wed Feb 22 12:15:01 2012

This archive was generated by hypermail 2.1.8 : Wed Feb 22 2012 - 12:15:01 EET