implementing network sync of jack_transports

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

implementing network sync of jack_transports

torbenh

hi all..

i am trying to implement transport_sync into the netjack software.

for those who dont know yet:

netjack consists of a jack_driver and a jack_client. on the Master machine the
client emits a network packet on each process() and tries to receive one
packet of data.

on the Slave Machine the Driver is waiting for an incoming Packet (like
the Alsa_Driver is waiting for an audio Interrupt) and emits a Packet.

so with this software you get two sample synchronous jackds. no need for
dynamic samplerate conversion and other hassle. there is one period of
roundtrip latency. this works very reliable on a LAN.

the thing which is missing is transport synchronisation.

i am currently trying to implement this but have a Problem with
Slow-Sync.

when a transport_locate() occurs it is clear that the "UnifiedTransport"
has to wait for all slow-sync clients on all computers to be ready.
while waiting the jacknet clients (a driver is/contains also a client)
have to report FALSE on slow sync, to hold the transport.

(add missing step here)

now when all clients are ready and the exchanged packet headers contain
the flag which indicates that all clients are ready to roll. both
clients may return TRUE to sync_calback() in the equvalent process
cycles. so that both transports start to roll.


the missing step is detecting that we are the only client returning
FALSE to slow sync.

this could be done with a function like:

get_remaining_sync_clients( jack_client_t *c )
{
    return c->engine->sync_remain
}

but this would not scale to 2 slaves connected to the master jackd.
so the quest is still on :(

currently in my mind is TransportPaused or Waiting
which is the transport state when all slow sync clients have returned
true and the engine is waiting for a transport_roll() call or something.

or is this all possible with stoping transport; locate_transport;
start_transport ?

hmmm... oh no... this looks like a can of worms.



--
torben Hohn
http://galan.sourceforge.net -- The graphical Audio language


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: implementing network sync of jack_transports

Dan Mills
On Friday 02 December 2005 20:42, [hidden email] wrote:
> hi all..
>
> i am trying to implement transport_sync into the netjack software.
>

<Snip>

>
> i am currently trying to implement this but have a Problem with
> Slow-Sync.
>
> when a transport_locate() occurs it is clear that the "UnifiedTransport"
> has to wait for all slow-sync clients on all computers to be ready.
> while waiting the jacknet clients (a driver is/contains also a client)
> have to report FALSE on slow sync, to hold the transport.
>
> (add missing step here)
>
> now when all clients are ready and the exchanged packet headers contain
> the flag which indicates that all clients are ready to roll. both
> clients may return TRUE to sync_calback() in the equvalent process
> cycles. so that both transports start to roll.
>
>
> the missing step is detecting that we are the only client returning
> FALSE to slow sync.
>
> this could be done with a function like:
>
> get_remaining_sync_clients( jack_client_t *c )
> {
>     return c->engine->sync_remain
> }
>
> but this would not scale to 2 slaves connected to the master jackd.
> so the quest is still on :(

I think that the only way this will work is if the master keeps track of the
sync status of all the slaves and only signals all slaves to roll transport
after it gets the OK from **all** the slave machines (and all local clients).

So a slave machine would transmit a flag to the master each period being
something like 'all other clients on this box are ready', but would not
itself report slow sync ready to the engine until the master responded with
'all clients everywhere are ready'.

The jack client 'master' for each slave host on the main system can report
slow sync ready if the slave reports all of its clients slow syncs ready,
and should only send 'all clients everywhere are ready' to its slave when we
are actually rolling (the one period latency should make this possible).

Just a thought.

Regards, Dan.
















-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: implementing network sync of jack_transports

torbenh
On Sun, Dec 04, 2005 at 01:18:35AM +0000, Dan Mills wrote:

> > the missing step is detecting that we are the only client returning
> > FALSE to slow sync.
> >
> > this could be done with a function like:
> >
> > get_remaining_sync_clients( jack_client_t *c )
> > {
> >     return c->engine->sync_remain
> > }
> >
> > but this would not scale to 2 slaves connected to the master jackd.
> > so the quest is still on :(
>
> I think that the only way this will work is if the master keeps track of the
> sync status of all the slaves and only signals all slaves to roll transport
> after it gets the OK from **all** the slave machines (and all local clients).
>
> So a slave machine would transmit a flag to the master each period being
> something like 'all other clients on this box are ready', but would not
> itself report slow sync ready to the engine until the master responded with
> 'all clients everywhere are ready'.
>
> The jack client 'master' for each slave host on the main system can report
> slow sync ready if the slave reports all of its clients slow syncs ready,
> and should only send 'all clients everywhere are ready' to its slave when we
> are actually rolling (the one period latency should make this possible).

you can not obtain this information with the current jack API.
but thanks for making clear what is needed, in a better way than i did.

the quest is for the best API in jack to get this job done.


--
torben Hohn
http://galan.sourceforge.net -- The graphical Audio language


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: implementing network sync of jack_transports

torbenh
In reply to this post by Dan Mills
On Sun, Dec 04, 2005 at 01:18:35AM +0000, Dan Mills wrote:

> > but this would not scale to 2 slaves connected to the master jackd.
> > so the quest is still on :(
>
> I think that the only way this will work is if the master keeps track of the
> sync status of all the slaves and only signals all slaves to roll transport
> after it gets the OK from **all** the slave machines (and all local clients).
>
> So a slave machine would transmit a flag to the master each period being
> something like 'all other clients on this box are ready', but would not
> itself report slow sync ready to the engine until the master responded with
> 'all clients everywhere are ready'.
>
> The jack client 'master' for each slave host on the main system can report
> slow sync ready if the slave reports all of its clients slow syncs ready,
> and should only send 'all clients everywhere are ready' to its slave when we
> are actually rolling (the one period latency should make this possible).
>
> Just a thought.

sorry for the sort of stupid reply. your thought is indeed correct.
determining whether all other clients on this box are ready is only
needed on a slave.

and on a slave machine it is possible, because i am running as a driver
here and can access private jack DataStructures.


--
torben Hohn
http://galan.sourceforge.net -- The graphical Audio language


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel