Discussion:
Hard Coded clients number limit on jackdmp?
Juan-Pablo Caceres
2008-10-02 00:09:11 UTC
Permalink
Hello all,

I am working on an applications that generates a lot of Jack clients in
jackdmp. When I tested and dynamically create these clients, I get up to
client 61, after which I get the following error:

Cannot open JackTrip-60 client
jack_client_open() failed, status = 0x21

Is the number 61 hardcoded somewhere? I am setting the port maximum to
2048 in qjackctl.

Thanks!
Juan-Pablo
Stéphane Letz
2008-10-02 06:02:37 UTC
Permalink
Post by Juan-Pablo Caceres
Hello all,
I am working on an applications that generates a lot of Jack
clients in jackdmp. When I tested and dynamically create these
Cannot open JackTrip-60 client
jack_client_open() failed, status = 0x21
Is the number 61 hardcoded somewhere?
64 is the current upper limit yes (= 3 drivers + 61 clients)
Post by Juan-Pablo Caceres
I am setting the port maximum to 2048 in qjackctl.
You're mixing port number and client numbers.

Stephane
Fernando Lopez-Lezcano
2008-10-02 06:19:15 UTC
Permalink
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello all,
I am working on an applications that generates a lot of Jack
clients in jackdmp. When I tested and dynamically create these
Cannot open JackTrip-60 client
jack_client_open() failed, status = 0x21
Is the number 61 hardcoded somewhere?
64 is the current upper limit yes (= 3 drivers + 61 clients)
Is this something that can be changed at compile time?
Post by Stéphane Letz
Post by Juan-Pablo Caceres
I am setting the port maximum to 2048 in qjackctl.
You're mixing port number and client numbers.
-- Fernando
Stéphane Letz
2008-10-02 14:13:43 UTC
Permalink
Post by Fernando Lopez-Lezcano
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello all,
I am working on an applications that generates a lot of Jack
clients in jackdmp. When I tested and dynamically create these
Cannot open JackTrip-60 client
jack_client_open() failed, status = 0x21
Is the number 61 hardcoded somewhere?
64 is the current upper limit yes (= 3 drivers + 61 clients)
Is this something that can be changed at compile time?
rev 2957 now allows that : use --clients=num and --ports=num to
configure max client and ports numbers.

Just out curiosity: what use case needs such a high number of jack
clients?

Stephane
Juan-Pablo Caceres
2008-10-02 17:04:20 UTC
Permalink
Hello Stéphane,
Post by Stéphane Letz
Post by Fernando Lopez-Lezcano
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello all,
I am working on an applications that generates a lot of Jack
clients in jackdmp. When I tested and dynamically create these
Cannot open JackTrip-60 client
jack_client_open() failed, status = 0x21
Is the number 61 hardcoded somewhere?
64 is the current upper limit yes (= 3 drivers + 61 clients)
Is this something that can be changed at compile time?
rev 2957 now allows that : use --clients=num and --ports=num to
configure max client and ports numbers.
Just out curiosity: what use case needs such a high number of jack clients?
I am building a server in which clients connect and listen to a physical
model (a ping sound) that tells them what's the quality of the
connection. We'll also going to use this server to connect several
machines around the world at the same time.

The server works by dynamically sending each new client (when a
connection is requested) to a Thread Pool. Each connection is a new Jack
Client. We're scaling up this to the hundreds, that's why I needed more
than 61 separate clients at the same time. This will run on a 16 core
machine.

Best!
Juan-Pablo
Stéphane Letz
2008-10-02 20:31:01 UTC
Permalink
Post by Juan-Pablo Caceres
Hello Stéphane,
Post by Stéphane Letz
Post by Fernando Lopez-Lezcano
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello all,
I am working on an applications that generates a lot of Jack
clients in jackdmp. When I tested and dynamically create these
Cannot open JackTrip-60 client
jack_client_open() failed, status = 0x21
Is the number 61 hardcoded somewhere?
64 is the current upper limit yes (= 3 drivers + 61 clients)
Is this something that can be changed at compile time?
rev 2957 now allows that : use --clients=num and --ports=num to
configure max client and ports numbers.
Just out curiosity: what use case needs such a high number of jack clients?
I am building a server in which clients connect and listen to a
physical model (a ping sound) that tells them what's the quality of
the connection. We'll also going to use this server to connect
several machines around the world at the same time.
The server works by dynamically sending each new client (when a
connection is requested) to a Thread Pool. Each connection is a new
Jack Client. We're scaling up this to the hundreds, that's why I
needed more than 61 separate clients at the same time. This will
run on a 16 core machine.
Are those client allocated in the same process?

Don't forget also that each clients consume "some" ressources, like 2
threads for each client. What is this Thread Pool used for? Are you
sure this design is the best one?

Stephane
Juan-Pablo Caceres
2008-10-02 21:15:43 UTC
Permalink
Hi Stéphane,
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello Stéphane,
Post by Stéphane Letz
Post by Fernando Lopez-Lezcano
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello all,
I am working on an applications that generates a lot of Jack
clients in jackdmp. When I tested and dynamically create these
Cannot open JackTrip-60 client
jack_client_open() failed, status = 0x21
Is the number 61 hardcoded somewhere?
64 is the current upper limit yes (= 3 drivers + 61 clients)
Is this something that can be changed at compile time?
rev 2957 now allows that : use --clients=num and --ports=num to
configure max client and ports numbers.
Just out curiosity: what use case needs such a high number of jack clients?
I am building a server in which clients connect and listen to a
physical model (a ping sound) that tells them what's the quality of
the connection. We'll also going to use this server to connect several
machines around the world at the same time.
The server works by dynamically sending each new client (when a
connection is requested) to a Thread Pool. Each connection is a new
Jack Client. We're scaling up this to the hundreds, that's why I
needed more than 61 separate clients at the same time. This will run
on a 16 core machine.
Are those client allocated in the same process?
Don't forget also that each clients consume "some" ressources, like 2
threads for each client. What is this Thread Pool used for? Are you sure
this design is the best one?
No, each clients has an independent process callback. That was something
that was actually hard to implement, and I came with a solution before
being in this list, so here it is. The trick in on the
wrapperProcessCallback function.

The thread pool is used to send the whole class, which in itself
consists on several threads (jack threads + network threads). I am not
sure if it's the best design, but it's the best I could come with ;) Do
you have any suggestions?



//=================================================================================
/** \brief JACK process callback
*
* This is the function to be called to process audio. This function is
* of the type JackProcessCallback, which is defined as:\n
* <tt>typedef int(* JackProcessCallback)(jack_nframes_t nframes,
void *arg)</tt>
* \n
* See
*
http://jackaudio.org/files/docs/html/types_8h.html#4923142208a8e7dacf00ca7a10681d2b
* for more details
*/
int processCallback(jack_nframes_t nframes);

/** \brief Wrapper to cast the member processCallback to a static
function pointer
* that can be used with <tt>jack_set_process_callback</tt>
*
* <tt>jack_set_process_callback</tt> needs a static member function
pointer. A normal
* member function won't work because a <b><i>this</i></b> pointer is
passed under the scenes.
* That's why we
* need to cast the member funcion processCallback to the static function
* wrapperProcessCallback. The callback is then set as:\n
* <tt>jack_set_process_callback(mClient,
JackAudioInterface::wrapperProcessCallback,
* this)</tt>
*/
// reference : http://article.gmane.org/gmane.comp.audio.jackit/12873
static int wrapperProcessCallback(jack_nframes_t nframes, void *arg)
{
return static_cast<JackAudioInterface*>(arg)->processCallback(nframes);
}

/** \brief Set the process callback of the member function
processCallback.
* This process will be called by the JACK server whenever there is
work to be done.
* \return 0 on success, otherwise a non-zero error code,
* causing JACK to remove that client from the process() graph.
*/
int setProcessCallback()
{
std::cout << "Setting JACK Process Callback..." << std::endl;
if ( int code =
jack_set_process_callback(mClient,
JackAudioInterface::wrapperProcessCallback, this)
)
{
std::cerr << "Could not set the process callback" << std::endl;
return(code);
}
std::cout << "SUCCESS" << std::endl;
std::cout << gPrintSeparator << std::endl;
return(0);
}
Stéphane Letz
2008-10-02 21:21:04 UTC
Permalink
Post by Juan-Pablo Caceres
Hi Stéphane,
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello Stéphane,
Post by Stéphane Letz
Post by Fernando Lopez-Lezcano
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello all,
I am working on an applications that generates a lot of Jack
clients in jackdmp. When I tested and dynamically create these
clients, I get up to client 61, after which I get the
Cannot open JackTrip-60 client
jack_client_open() failed, status = 0x21
Is the number 61 hardcoded somewhere?
64 is the current upper limit yes (= 3 drivers + 61 clients)
Is this something that can be changed at compile time?
rev 2957 now allows that : use --clients=num and --ports=num to
configure max client and ports numbers.
Just out curiosity: what use case needs such a high number of jack clients?
I am building a server in which clients connect and listen to a
physical model (a ping sound) that tells them what's the quality
of the connection. We'll also going to use this server to connect
several machines around the world at the same time.
The server works by dynamically sending each new client (when a
connection is requested) to a Thread Pool. Each connection is a
new Jack Client. We're scaling up this to the hundreds, that's
why I needed more than 61 separate clients at the same time. This
will run on a 16 core machine.
Are those client allocated in the same process?
Don't forget also that each clients consume "some" ressources,
like 2 threads for each client. What is this Thread Pool used for?
Are you sure this design is the best one?
No, each clients has an independent process callback. That was
something that was actually hard to implement, and I came with a
solution before being in this list, so here it is. The trick in on
the wrapperProcessCallback function.
The thread pool is used to send the whole class, which in itself
consists on several threads (jack threads + network threads). I am
not sure if it's the best design, but it's the best I could come
with ;) Do you have any suggestions?
I'm not sure to understand: what do you mean by "send the whole
class," ??

Do you have any scheme/picture of the whole program? Having to open
hundreds of jack client seems a bit suspicious to me....

Stephane
Juan-Pablo Caceres
2008-10-02 21:28:28 UTC
Permalink
Post by Juan-Pablo Caceres
Hi Stéphane,
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello Stéphane,
Post by Stéphane Letz
Post by Fernando Lopez-Lezcano
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello all,
I am working on an applications that generates a lot of Jack
clients in jackdmp. When I tested and dynamically create these
Cannot open JackTrip-60 client
jack_client_open() failed, status = 0x21
Is the number 61 hardcoded somewhere?
64 is the current upper limit yes (= 3 drivers + 61 clients)
Is this something that can be changed at compile time?
rev 2957 now allows that : use --clients=num and --ports=num to
configure max client and ports numbers.
Just out curiosity: what use case needs such a high number of jack clients?
I am building a server in which clients connect and listen to a
physical model (a ping sound) that tells them what's the quality of
the connection. We'll also going to use this server to connect
several machines around the world at the same time.
The server works by dynamically sending each new client (when a
connection is requested) to a Thread Pool. Each connection is a new
Jack Client. We're scaling up this to the hundreds, that's why I
needed more than 61 separate clients at the same time. This will run
on a 16 core machine.
Are those client allocated in the same process?
Don't forget also that each clients consume "some" ressources, like 2
threads for each client. What is this Thread Pool used for? Are you
sure this design is the best one?
No, each clients has an independent process callback. That was
something that was actually hard to implement, and I came with a
solution before being in this list, so here it is. The trick in on the
wrapperProcessCallback function.
The thread pool is used to send the whole class, which in itself
consists on several threads (jack threads + network threads). I am not
sure if it's the best design, but it's the best I could come with ;)
Do you have any suggestions?
I'm not sure to understand: what do you mean by "send the whole class," ??
Do you have any scheme/picture of the whole program? Having to open
hundreds of jack client seems a bit suspicious to me....
When I say the whole class I mean the Class that cotains all the threads
and make the connections with one client. When a Connection with a
client is established, this class is sent to the threadpool, until it's
done. When there's a new request from a new client, then this is sent in
to the thread pool, etc... Each "class" or "metathread" contains one
jack client. I don't know if this makes sense, it's hard to explain as
you say without pictures. I don't have documentation yet, but will have
soon.

Juan-Pablo
Juan-Pablo Caceres
2008-10-02 17:05:45 UTC
Permalink
BTW, thanks a lot for adding the clinets num option!
Post by Stéphane Letz
Post by Fernando Lopez-Lezcano
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello all,
I am working on an applications that generates a lot of Jack
clients in jackdmp. When I tested and dynamically create these
Cannot open JackTrip-60 client
jack_client_open() failed, status = 0x21
Is the number 61 hardcoded somewhere?
64 is the current upper limit yes (= 3 drivers + 61 clients)
Is this something that can be changed at compile time?
rev 2957 now allows that : use --clients=num and --ports=num to
configure max client and ports numbers.
Just out curiosity: what use case needs such a high number of jack clients?
Stephane
Juan-Pablo Caceres
2008-10-02 18:16:49 UTC
Permalink
Hi Stéphane,

Nando just compiled
jack-audio-connection-kit-1.90-0.svn2957.1.fc9.ccrma.i386
but the option --clients doesn't seem to be there... We get this error:

/usr/bin/jackd -R -p2048 -dalsa -dhw:0 -r48000 -p256 -n2 --clients 200

Unknownage with option ''

Any ideas?
Thanks again,
Juan-Pablo
Post by Stéphane Letz
Post by Fernando Lopez-Lezcano
Post by Stéphane Letz
Post by Juan-Pablo Caceres
Hello all,
I am working on an applications that generates a lot of Jack
clients in jackdmp. When I tested and dynamically create these
Cannot open JackTrip-60 client
jack_client_open() failed, status = 0x21
Is the number 61 hardcoded somewhere?
64 is the current upper limit yes (= 3 drivers + 61 clients)
Is this something that can be changed at compile time?
rev 2957 now allows that : use --clients=num and --ports=num to
configure max client and ports numbers.
Just out curiosity: what use case needs such a high number of jack clients?
Stephane
t***@gmx.de
2008-10-03 00:19:50 UTC
Permalink
Hi St?phane,
Nando just compiled
jack-audio-connection-kit-1.90-0.svn2957.1.fc9.ccrma.i386
/usr/bin/jackd -R -p2048 -dalsa -dhw:0 -r48000 -p256 -n2 --clients 200
try:
/usr/bin/jackd -R -p2048 --clients 200 -dalsa -dhw:0 -r48000 -p256 -n2
--
torben Hohn
http://galan.sourceforge.net -- The graphical Audio language
Fernando Lopez-Lezcano
2008-10-03 00:20:46 UTC
Permalink
Post by t***@gmx.de
Hi St?phane,
Nando just compiled
jack-audio-connection-kit-1.90-0.svn2957.1.fc9.ccrma.i386
/usr/bin/jackd -R -p2048 -dalsa -dhw:0 -r48000 -p256 -n2 --clients 200
/usr/bin/jackd -R -p2048 --clients 200 -dalsa -dhw:0 -r48000 -p256 -n2
Turns out it was a compile time option only :-(
-- Fernando

Loading...