Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /usr/share/doc/libjack-dev/HTML/ |
Current File : //usr/share/doc/libjack-dev/HTML/transport-design.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JACK-AUDIO-CONNECTION-KIT: JACK Transport Design</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JACK-AUDIO-CONNECTION-KIT  <span id="projectnumber">0.122.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1.2 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li class="current"><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">JACK Transport Design </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><p>The <a class="el" href="index.html">JACK Audio Connection Kit</a> provides simple transport interfaces for starting, stopping and repositioning a set of clients. This document describes the overall design of these interfaces, their detailed specifications are in <<a class="el" href="transport_8h.html">jack/transport.h</a>></p> <ul> <li><a class="el" href="transport-design.html#requirements">Requirements</a></li> <li><a class="el" href="transport-design.html#overview">Overview</a></li> <li><a class="el" href="transport-design.html#timebase">Timebase Master</a></li> <li><a class="el" href="transport-design.html#transportcontrol">Transport Control</a></li> <li><a class="el" href="transport-design.html#transportclients">Transport Clients</a></li> <li><a class="el" href="transport-design.html#compatibility">Compatibility</a></li> <li><a class="el" href="transport-design.html#issues">Issues Not Addressed</a></li> </ul> <h1><a class="anchor" id="requirements"></a> Requirements</h1> <ul> <li>We need sample-level accuracy for transport control. This implies that the transport client logic has to be part of the realtime process chain.</li> </ul> <ul> <li>We don't want to add another context switch. So, the transport client logic has to run in the context of the client's process thread. To avoid making an extra pass through the process graph, no transport changes take effect until the following process cycle. That way, the transport info is stable throughout each cycle.</li> </ul> <ul> <li>We want to allow multiple clients to change the transport state. This is mostly a usability issue. Any client can start or stop playback, or seek to a new location. The user need not switch windows to accomplish these tasks.</li> </ul> <ul> <li>We want a way for clients with heavyweight state to sync up when the user presses "play", before the transport starts rolling.</li> </ul> <ul> <li>We want to provide for ongoing binary compatibility as the transport design evolves.</li> </ul> <h1><a class="anchor" id="overview"></a> Overview</h1> <p>The former transport master role has been divided into two layers:</p> <ul> <li><a class="el" href="transport-design.html#timebase">Timebase Master</a> - counting beats, frames, etc. on every cycle.</li> <li><a class="el" href="transport-design.html#transportcontrol">Transport Control</a> - start, stop and reposition the playback.</li> </ul> <p>Existing transport clients continue to work in compatibility mode. But, old-style timebase masters will no longer control the transport.</p> <h1><a class="anchor" id="timebase"></a> Timebase Master</h1> <p>The timebase master continuously updates extended position information, counting beats, timecode, etc. Without this extended information, there is no need for this function. There is at most one master active at a time. If no client is registered as timebase master, frame numbers will be the only position information available.</p> <p>The timebase master registers a callback that updates position information while the transport is rolling. Its output affects the following process cycle. This function is called immediately after the process callback in the same thread whenever the transport is rolling, or when any client has set a new position in the previous cycle. The first cycle after <a class="el" href="group__TransportControl.html#ga0c2f2f464f6ba1c0b2aa45e6507b7aa9">jack_set_timebase_callback()</a> is also treated as a new position, or the first cycle after <a class="el" href="group__ClientFunctions.html#ga9800d5b29bd7670d9944a15f6ea0ecf8">jack_activate()</a> if the client had been inactive.</p> <div class="fragment"><div class="line"><span class="keyword">typedef</span> int (*<a class="code" href="group__TransportControl.html#ga5861cf9b84a0a3c3f6ff0f193ca3ec2c">JackTimebaseCallback</a>)(<a class="code" href="transport_8h.html#a66e50952a88eb087867922bfe3d0bd72">jack_transport_state_t</a> state,</div> <div class="line"> <a class="code" href="types_8h.html#aa954df532e901ae5172e68a23f3da9b6">jack_nframes_t</a> nframes,</div> <div class="line"> <a class="code" href="structjack__position__t.html">jack_position_t</a> *pos,</div> <div class="line"> <span class="keywordtype">int</span> new_pos,</div> <div class="line"> <span class="keywordtype">void</span> *arg);</div> </div><!-- fragment --><p>When a new client takes over, the former timebase callback is no longer called. Taking over the timebase may be done conditionally, in which case the takeover fails when there is a master already. The existing master can release it voluntarily, if desired.</p> <div class="fragment"><div class="line"><span class="keywordtype">int</span> <a class="code" href="group__TransportControl.html#ga0c2f2f464f6ba1c0b2aa45e6507b7aa9">jack_set_timebase_callback</a> (<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *<a class="code" href="simple__client_8c.html#afed7053cd7bdd1cce33dec7213f340ea">client</a>,</div> <div class="line"> <span class="keywordtype">int</span> conditional,</div> <div class="line"> <a class="code" href="group__TransportControl.html#ga5861cf9b84a0a3c3f6ff0f193ca3ec2c">JackTimebaseCallback</a> timebase_callback,</div> <div class="line"> <span class="keywordtype">void</span> *arg);</div> <div class="line"></div> <div class="line"><span class="keywordtype">int</span> <a class="code" href="group__TransportControl.html#gaea06ff63b129ec6266b2b805b6c8216a">jack_release_timebase</a>(<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *<a class="code" href="simple__client_8c.html#afed7053cd7bdd1cce33dec7213f340ea">client</a>);</div> </div><!-- fragment --><p>If the timebase master releases the timebase or exits the JACK graph for any reason, the JACK engine takes over at the start of the next process cycle. The transport state does not change. If rolling, it continues to play, with frame numbers as the only available position information.</p> <h1><a class="anchor" id="transportcontrol"></a> Transport Control</h1> <p>The JACK engine itself manages stopping and starting of the transport. Any client can make transport control requests at any time. These requests take effect no sooner than the next process cycle, sometimes later. The transport state is always valid, initially it is <a class="el" href="transport_8h.html#a66e50952a88eb087867922bfe3d0bd72a30087dc754e67549d91e78a4242393f0">JackTransportStopped</a>.</p> <div class="fragment"><div class="line"><span class="keywordtype">void</span> <a class="code" href="group__TransportControl.html#gab7b158bec8f27c03da29795f142d1caf">jack_transport_start</a> (<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *<a class="code" href="simple__client_8c.html#afed7053cd7bdd1cce33dec7213f340ea">client</a>);</div> <div class="line"><span class="keywordtype">void</span> <a class="code" href="group__TransportControl.html#ga6be6637c314bd88344826e9bcc1957b0">jack_transport_stop</a> (<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *<a class="code" href="simple__client_8c.html#afed7053cd7bdd1cce33dec7213f340ea">client</a>);</div> </div><!-- fragment --><h2><a class="anchor" id="slowsyncclients"></a> Slow-sync clients</h2> <p>The engine handles polling of slow-sync clients. When someone calls <a class="el" href="group__TransportControl.html#gab7b158bec8f27c03da29795f142d1caf">jack_transport_start()</a>, the engine resets the poll bits and changes to a new state, <a class="el" href="transport_8h.html#a66e50952a88eb087867922bfe3d0bd72a8c1e22fce8ef6c18baf7a5c6a69060ac">JackTransportStarting</a>. The <em>sync_callback</em> function for each slow-sync client will be invoked in the JACK process thread while the transport is starting. If it has not already done so, the client needs to initiate a seek to reach the starting position. The <em>sync_callback</em> returns false until the seek completes and the client is ready to play. When all slow-sync clients are ready, the state changes to <a class="el" href="transport_8h.html#a66e50952a88eb087867922bfe3d0bd72a4077d7d6fe566f3f0441755a588ad1b2">JackTransportRolling</a>.</p> <div class="fragment"><div class="line"><span class="keyword">typedef</span> int (*<a class="code" href="group__TransportControl.html#gab6c4ce3efb68e584d589cf8765363411">JackSyncCallback</a>)(<a class="code" href="transport_8h.html#a66e50952a88eb087867922bfe3d0bd72">jack_transport_state_t</a> state,</div> <div class="line"> <a class="code" href="structjack__position__t.html">jack_position_t</a> *pos, <span class="keywordtype">void</span> *arg);</div> </div><!-- fragment --><p>This callback is a realtime function that runs in the JACK process thread.</p> <div class="fragment"><div class="line"><span class="keywordtype">int</span> <a class="code" href="group__TransportControl.html#gae53f7ac54804d2896d51b6ad599fa93c">jack_set_sync_callback</a> (<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *<a class="code" href="simple__client_8c.html#afed7053cd7bdd1cce33dec7213f340ea">client</a>,</div> <div class="line"> <a class="code" href="group__TransportControl.html#gab6c4ce3efb68e584d589cf8765363411">JackSyncCallback</a> sync_callback, <span class="keywordtype">void</span> *arg);</div> </div><!-- fragment --><p>Clients that don't declare a <em>sync_callback</em> are assumed to be ready immediately, any time the transport wants to start. If a client no longer requires slow-sync processing, it can set its <em>sync_callback</em> to NULL.</p> <div class="fragment"><div class="line"><span class="keywordtype">int</span> <a class="code" href="group__TransportControl.html#ga2e89b0bb8702d34bcbbe1eac70685ab2">jack_set_sync_timeout</a> (<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *<a class="code" href="simple__client_8c.html#afed7053cd7bdd1cce33dec7213f340ea">client</a>,</div> <div class="line"> <a class="code" href="types_8h.html#af9a29b8728e95cc38e2932c0ef855b7e">jack_time_t</a> usecs);</div> </div><!-- fragment --><p>There must be a <em>timeout</em> to prevent unresponsive slow-sync clients from completely halting the transport mechanism. Two seconds is the default. When this <em>timeout</em> expires, the transport will start rolling, even if some slow-sync clients are still unready. The <em>sync_callback</em> for these clients continues being invoked, giving them an opportunity to catch up.</p> <h2><a class="anchor" id="repositioning"></a> Repositioning</h2> <div class="fragment"><div class="line"><span class="keywordtype">int</span> <a class="code" href="group__TransportControl.html#ga2f371010358add3cbed8454bd0bd2ef8">jack_transport_reposition</a> (<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *<a class="code" href="simple__client_8c.html#afed7053cd7bdd1cce33dec7213f340ea">client</a>,</div> <div class="line"> <a class="code" href="structjack__position__t.html">jack_position_t</a> *pos);</div> <div class="line"><span class="keywordtype">int</span> <a class="code" href="group__TransportControl.html#gab3f52a42084aead87fd1ee75ed25b240">jack_transport_locate</a> (<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *<a class="code" href="simple__client_8c.html#afed7053cd7bdd1cce33dec7213f340ea">client</a>,</div> <div class="line"> <a class="code" href="types_8h.html#aa954df532e901ae5172e68a23f3da9b6">jack_nframes_t</a> frame);</div> </div><!-- fragment --><p>These request a new transport position. They can be called at any time by any client. Even the timebase master must use them. If the request is valid, it goes into effect in two process cycles. If there are slow-sync clients and the transport is already rolling, it will enter the <a class="el" href="transport_8h.html#a66e50952a88eb087867922bfe3d0bd72a8c1e22fce8ef6c18baf7a5c6a69060ac">JackTransportStarting</a> state and begin invoking their <em>sync_callbacks</em> until ready.</p> <h2><a class="anchor" id="transportstatetransitiondiagram"></a> Transport State Transition Diagram</h2> <div class="image"> <img src="fsm.png" alt="fsm.png"/> <div class="caption"> Transport State Transition Diagram</div></div> <h1><a class="anchor" id="transportclients"></a> Transport Clients</h1> <p>Transport clients were formerly known as "transport slaves". We want to make it easy for almost every JACK client to be a transport client.</p> <div class="fragment"><div class="line"><a class="code" href="transport_8h.html#a66e50952a88eb087867922bfe3d0bd72">jack_transport_state_t</a> <a class="code" href="group__TransportControl.html#ga5f08eb71a5ee5431a3d756af5729d5aa">jack_transport_query</a> (<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *<a class="code" href="simple__client_8c.html#afed7053cd7bdd1cce33dec7213f340ea">client</a>,</div> <div class="line"> <a class="code" href="structjack__position__t.html">jack_position_t</a> *pos);</div> </div><!-- fragment --><p>This function can be called from any thread. If called from the process thread, <em>pos</em> corresponds to the first frame of the current cycle and the state returned is valid for the entire cycle.</p> <h1><a class="anchor" id="compatibility"></a> Compatibility</h1> <p>During the transition period we will support the old-style interfaces in compatibility mode as deprecated interfaces. This compatibility is not 100%, there are limitations.</p> <p>The main reasons for doing this are:</p> <ul> <li>facilitate testing with clients that already have transport support</li> <li>provide a clean migration path, so application developers are not discouraged from supporting the transport interface</li> </ul> <p>These deprecated interfaces continue to work:</p> <div class="fragment"><div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structjack__transport__info__t.html">jack_transport_info_t</a>;</div> <div class="line"></div> <div class="line"><span class="keywordtype">void</span> <a class="code" href="transport_8h.html#a994ea49b518181fbdee2adc9be1ee40e">jack_get_transport_info</a> (<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *<a class="code" href="simple__client_8c.html#afed7053cd7bdd1cce33dec7213f340ea">client</a>,</div> <div class="line"> <a class="code" href="structjack__transport__info__t.html">jack_transport_info_t</a> *tinfo);</div> </div><!-- fragment --><p>Unfortunately, the old-style timebase master interface cannot coexist cleanly with such new features as <a class="el" href="group__TransportControl.html#gab3f52a42084aead87fd1ee75ed25b240">jack_transport_locate()</a> and slow-sync clients. So, these interfaces are only present as stubs:</p> <div class="fragment"><div class="line"><span class="keywordtype">void</span> <a class="code" href="transport_8h.html#ad27bdf22d5642f2291ba77d7bdb2725a">jack_set_transport_info</a> (<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *<a class="code" href="simple__client_8c.html#afed7053cd7bdd1cce33dec7213f340ea">client</a>,</div> <div class="line"> <a class="code" href="structjack__transport__info__t.html">jack_transport_info_t</a> *tinfo);</div> <div class="line"><span class="keywordtype">int</span> <a class="code" href="group__ServerControl.html#ga2db0a4e9ab7b6d9984e91abba27ab71d">jack_engine_takeover_timebase</a> (<a class="code" href="types_8h.html#a96cf103940d2ee71b141d4b9d0c116bf">jack_client_t</a> *);</div> </div><!-- fragment --><p>For compatibility with future changes, it would be good to avoid structures entirely. Nevertheless, the <a class="el" href="structjack__position__t.html">jack_position_t</a> structure provides a convenient way to collect timebase information in several formats that clearly all refer to a single moment. To minimize future binary compatibility problems, this structure has some padding at the end, making it possible to extend it without necessarily breaking compatibility. New fields can be allocated from the padding area, with access controlled by newly defined valid bits, all of which are currently forced to zero. That allows the structure size and offsets to remain constant.</p> <h1><a class="anchor" id="issues"></a> Issues Not Addressed</h1> <p>This design currently does not address several issues. This means they will probably not be included in JACK release 1.0.</p> <ul> <li>variable speed</li> <li>reverse play</li> <li>looping </li> </ul> </div></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Sun Sep 30 2012 09:08:39 for JACK-AUDIO-CONNECTION-KIT by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.1.2 </small></address> </body> </html>
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare