KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
14KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
  4. lang="en" dir="ltr">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>
  8. latency [LinuxMusicians Wiki]
  9. </title>
  10. <meta name="generator" content="DokuWiki Release 2008-05-05" />
  11. <meta name="robots" content="index,follow" />
  12. <meta name="date" content="2013-05-12T09:57:20-0400" />
  13. <meta name="keywords" content="latency" />
  14. <link rel="search" type="application/opensearchdescription+xml" href="/lib/exe/opensearch.php" title="LinuxMusicians Wiki" />
  15. <link rel="start" href="/" />
  16. <link rel="contents" href="/doku.php?id=latency&amp;do=index" title="Index" />
  17. <link rel="alternate" type="application/rss+xml" title="Recent Changes" href="/feed.php" />
  18. <link rel="alternate" type="application/rss+xml" title="Current Namespace" href="/feed.php?mode=list&amp;ns=" />
  19. <link rel="alternate" type="text/html" title="Plain HTML" href="/doku.php?do=export_xhtml&amp;id=latency" />
  20. <link rel="alternate" type="text/plain" title="Wiki Markup" href="/doku.php?do=export_raw&amp;id=latency" />
  21. <link rel="stylesheet" media="all" type="text/css" href="/lib/exe/css.php?s=all&amp;t=default" />
  22. <link rel="stylesheet" media="screen" type="text/css" href="/lib/exe/css.php?t=default" />
  23. <link rel="stylesheet" media="print" type="text/css" href="/lib/exe/css.php?s=print&amp;t=default" />
  24. <script type="text/javascript" charset="utf-8" src="/lib/exe/js.php?edit=0&amp;write=0" ></script>
  25. <link rel="shortcut icon" href="/lib/tpl/default/images/favicon.ico" />
  26. </head>
  27. <body>
  28. <div class="dokuwiki">
  29. <div class="stylehead">
  30. <div class="header">
  31. <div class="pagename">
  32. [[<a href="/doku.php?id=latency&amp;do=backlink" title="Backlinks">latency</a>]]
  33. </div>
  34. <div class="logo">
  35. <a href="/doku.php" name="dokuwiki__top" id="dokuwiki__top" accesskey="h" title="[ALT+H]">LinuxMusicians Wiki</a> </div>
  36. <div class="clearer"></div>
  37. </div>
  38. <div class="bar" id="bar__top">
  39. <div class="bar-left" id="bar__topleft">
  40. <form class="button btn_source" method="post" action="/doku.php"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="" /><input type="hidden" name="id" value="latency" /><input type="submit" value="Show pagesource" class="button" accesskey="v" title="Show pagesource [ALT+V]" /></div></form> <form class="button btn_revs" method="get" action="/doku.php"><div class="no"><input type="hidden" name="do" value="revisions" /><input type="hidden" name="id" value="latency" /><input type="submit" value="Old revisions" class="button" accesskey="o" title="Old revisions [ALT+O]" /></div></form> </div>
  41. <div class="bar-right" id="bar__topright">
  42. <form class="button btn_recent" method="get" action="/doku.php"><div class="no"><input type="hidden" name="do" value="recent" /><input type="hidden" name="id" value="" /><input type="submit" value="Recent changes" class="button" accesskey="r" title="Recent changes [ALT+R]" /></div></form> <form action="/doku.php" accept-charset="utf-8" class="search" id="dw__search"><div class="no"><input type="hidden" name="do" value="search" /><input type="text" id="qsearch__in" accesskey="f" name="id" class="edit" title="[ALT+F]" /><input type="submit" value="Search" class="button" title="Search" /><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form>&nbsp;
  43. </div>
  44. <div class="clearer"></div>
  45. </div>
  46. <div class="breadcrumbs">
  47. <span class="bchead">Trace:</span> <span class="bcsep">&raquo;</span> <span class="curid"><a href="/doku.php?id=latency" class="breadcrumbs" title="latency">latency</a></span> </div>
  48. </div>
  49. <div class="page">
  50. <!-- wikipage start -->
  51. <!-- TOC START -->
  52. <div class="toc">
  53. <div class="tocheader toctoggle" id="toc__header">Table of Contents</div>
  54. <div id="toc__inside">
  55. <ul class="toc">
  56. <li class="level1"><div class="li"><span class="li"><a href="#latency_compensation_and_xrun_reduction_tips" class="toc">Latency compensation and xrun reduction tips</a></span></div>
  57. <ul class="toc">
  58. <li class="level2"><div class="li"><span class="li"><a href="#compensating_for_loopback_latency" class="toc">Compensating for loopback latency</a></span></div></li>
  59. <li class="level2"><div class="li"><span class="li"><a href="#minimizing_xruns" class="toc">Minimizing xruns</a></span></div>
  60. <ul class="toc">
  61. <li class="level3"><div class="li"><span class="li"><a href="#disable_wireless_internet_when_recording" class="toc">Disable wireless internet when recording</a></span></div></li>
  62. <li class="level3"><div class="li"><span class="li"><a href="#close_browsers_when_recording" class="toc">Close browsers when recording</a></span></div></li>
  63. <li class="level3"><div class="li"><span class="li"><a href="#avoid_realtime_resampling" class="toc">Avoid realtime resampling</a></span></div></li>
  64. <li class="level3"><div class="li"><span class="li"><a href="#check_for_irq_conflicts" class="toc">Check for IRQ conflicts</a></span></div></li></ul>
  65. </li></ul>
  66. </li></ul>
  67. </div>
  68. </div>
  69. <!-- TOC END -->
  70. <h1><a name="latency_compensation_and_xrun_reduction_tips" id="latency_compensation_and_xrun_reduction_tips">Latency compensation and xrun reduction tips</a></h1>
  71. <div class="level1">
  72. </div>
  73. <h2><a name="compensating_for_loopback_latency" id="compensating_for_loopback_latency">Compensating for loopback latency</a></h2>
  74. <div class="level2">
  75. <p>
  76. Although latency mostly refers to buffer size which delays immediate feedback of input, there is additional latency due to the basic processing of your audio interface. There is no way to reduce this “loopback” latency, but its existence will affect the timing of recorded overdubs. To address this, you can tell programs what the delay amount is so that compensation can be made, i.e. the recorded audio will be adjusted in time to account for this delay. Software alone cannot discover what the loopback latency is, so the following procedure is needed to determine the amount of compensation required:
  77. </p>
  78. <p>
  79. You will need a loopback cable capable of connecting your audio device&#039;s physical input to its physical output.
  80. </p>
  81. <p>
  82. 1 - Connect your (mic) input to your (headphone) output with the loopback cable
  83. </p>
  84. <p>
  85. 2 - Start JACK with known good settings
  86. </p>
  87. <p>
  88. 3 - Open a terminal and run jack_iodelay. It will print &#039;Signal below threshold…&#039; until we make the JACK connections
  89. </p>
  90. <p>
  91. 4 - Use Catia or Claudia to connect the system capture_1 to &#039;jack_delay in&#039; and connect &#039;jack_delay out&#039; to the system playback_1 port
  92. </p>
  93. <p>
  94. 5 - With both physical and JACK connections made, jack_iodelay should print output such as &#039;use X for the backend arguments -I and -O&#039;
  95. </p>
  96. <p>
  97. 6 - In the terminal, use ctrl-C to stop jack_iodelay
  98. </p>
  99. <p>
  100. 7 - In Cadence or Claudia, open the JACK settings and enter the value X from jack_iodelay for both the the input and output extra latency values
  101. </p>
  102. <p>
  103. 8 - Engage the new JACK settings with the “Switch Master” button. If you re-run the above test there should be no additional loopback latency.
  104. </p>
  105. <p>
  106. This information is used to tell programs how to adjust recordings so that the recorded result will line up precisely with how the original performance aligned with the previous tracks.
  107. </p>
  108. <p>
  109. Because these settings are not saved in the software to go with the interface choice, you&#039;ll need to change them every time you switch devices. The easiest way to do this is to have Claudia sessions for each device so all the settings are saved together.
  110. </p>
  111. </div>
  112. <h2><a name="minimizing_xruns" id="minimizing_xruns">Minimizing xruns</a></h2>
  113. <div class="level2">
  114. </div>
  115. <h3><a name="disable_wireless_internet_when_recording" id="disable_wireless_internet_when_recording">Disable wireless internet when recording</a></h3>
  116. <div class="level3">
  117. <p>
  118. Wifi adapters have been known to cause random xruns. Some laptops have an external hardware switch to disable wifi. Otherwise, uncheck “enable wireless” in the KDE system tray&#039;s network control. If primarily using ethernet, consider disabling wifi (aka 802.11 a/b/g/n) in the BIOS or UEFI menu.
  119. </p>
  120. </div>
  121. <h3><a name="close_browsers_when_recording" id="close_browsers_when_recording">Close browsers when recording</a></h3>
  122. <div class="level3">
  123. <p>
  124. Many pop-up ads and popular web sites make use of Adobe Flash. If you have any browser tabs open, it only takes one to be using a little bit of Flash to cause a big loss of CPU, lower latency and more xruns. You should try to avoid running unnecessary, CPU intensive programs when recording.
  125. </p>
  126. </div>
  127. <h3><a name="avoid_realtime_resampling" id="avoid_realtime_resampling">Avoid realtime resampling</a></h3>
  128. <div class="level3">
  129. <p>
  130. When using Digital Audio Workstations and similar apps such as samplers etc, it is recommended you convert any sound files you wish to import to use the same sample rate as the one you are using for JACK. Many apps let you import and use sound files of different sample rates to the one you are running JACK with but then attempt to resample the audio &#039;on-the-fly&#039; and this leads to xruns if your CPU cannot keep up.
  131. </p>
  132. <p>
  133. You can check the sample rate of audio files using your favourite media player such as smplayer (push CTRL+I when playing your file) or VLC (push CTRL+J) or you can find out from the terminal using mediainfo. soundkonverter and XCFA are good tools for batch conversion of audio files.
  134. </p>
  135. </div>
  136. <h3><a name="check_for_irq_conflicts" id="check_for_irq_conflicts">Check for IRQ conflicts</a></h3>
  137. <div class="level3">
  138. <p>
  139. Open a terminal and run:
  140. </p>
  141. <pre class="code">cat /proc/interrupts</pre>
  142. <p>
  143. Ensure that your audio driver is not sharing an IRQ with another device. Fixing this can be as simple as changing which port a USB audio device is using, but otherwise <a href="http://www.wiki.linuxmusicians.com/doku.php?id=system_configuration#solve_irq_conflict_by_unbinding_devices" class="urlextern" title="http://www.wiki.linuxmusicians.com/doku.php?id=system_configuration#solve_irq_conflict_by_unbinding_devices" rel="nofollow">see this guide to fixing IRQ conflicts.</a>
  144. </p>
  145. </div>
  146. <!-- wikipage stop -->
  147. </div>
  148. <div class="clearer">&nbsp;</div>
  149. <div class="stylefoot">
  150. <div class="meta">
  151. <div class="user">
  152. </div>
  153. <div class="doc">
  154. latency.txt &middot; Last modified: 2013/05/12 09:57 by danboid </div>
  155. </div>
  156. <div class="bar" id="bar__bottom">
  157. <div class="bar-left" id="bar__bottomleft">
  158. <form class="button btn_source" method="post" action="/doku.php"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="" /><input type="hidden" name="id" value="latency" /><input type="submit" value="Show pagesource" class="button" accesskey="v" title="Show pagesource [ALT+V]" /></div></form> <form class="button btn_revs" method="get" action="/doku.php"><div class="no"><input type="hidden" name="do" value="revisions" /><input type="hidden" name="id" value="latency" /><input type="submit" value="Old revisions" class="button" accesskey="o" title="Old revisions [ALT+O]" /></div></form> </div>
  159. <div class="bar-right" id="bar__bottomright">
  160. <form class="button btn_login" method="get" action="/doku.php"><div class="no"><input type="hidden" name="do" value="login" /><input type="hidden" name="sectok" value="750db7530570a8fa4c1d1c538abedb18" /><input type="hidden" name="id" value="latency" /><input type="submit" value="Login" class="button" title="Login" /></div></form> <form class="button btn_index" method="get" action="/doku.php"><div class="no"><input type="hidden" name="do" value="index" /><input type="hidden" name="id" value="latency" /><input type="submit" value="Index" class="button" accesskey="x" title="Index [ALT+X]" /></div></form> <a class="nolink" href="#dokuwiki__top"><input type="button" class="button" value="Back to top" onclick="window.scrollTo(0, 0)" title="Back to top" /></a>&nbsp;
  161. </div>
  162. <div class="clearer"></div>
  163. </div>
  164. </div>
  165. </div>
  166. <div class="footerinc">
  167. <a href="/feed.php" title="Recent changes RSS feed"><img src="/lib/tpl/default/images/button-rss.png" width="80" height="15" alt="Recent changes RSS feed" /></a>
  168. <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/" rel="license" title="Creative Commons License"><img src="/lib/tpl/default/images/button-cc.gif" width="80" height="15" alt="Creative Commons License" /></a>
  169. <a href="http://wiki.splitbrain.org/wiki:donate" title="Donate"><img src="/lib/tpl/default/images/button-donate.gif" alt="Donate" width="80" height="15" /></a>
  170. <a href="http://www.php.net" title="Powered by PHP"><img src="/lib/tpl/default/images/button-php.gif" width="80" height="15" alt="Powered by PHP" /></a>
  171. <a href="http://validator.w3.org/check/referer" title="Valid XHTML 1.0"><img src="/lib/tpl/default/images/button-xhtml.png" width="80" height="15" alt="Valid XHTML 1.0" /></a>
  172. <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3" title="Valid CSS"><img src="/lib/tpl/default/images/button-css.png" width="80" height="15" alt="Valid CSS" /></a>
  173. <a href="http://wiki.splitbrain.org/wiki:dokuwiki" title="Driven by DokuWiki"><img src="/lib/tpl/default/images/button-dw.png" width="80" height="15" alt="Driven by DokuWiki" /></a>
  174. <!--
  175. <rdf:RDF xmlns="http://web.resource.org/cc/"
  176. xmlns:dc="http://purl.org/dc/elements/1.1/"
  177. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  178. <Work rdf:about="">
  179. <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
  180. <license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.0/" />
  181. </Work>
  182. <License rdf:about="http://creativecommons.org/licenses/by-nc-sa/2.0/">
  183. <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
  184. <permits rdf:resource="http://web.resource.org/cc/Distribution" />
  185. <requires rdf:resource="http://web.resource.org/cc/Notice" />
  186. <requires rdf:resource="http://web.resource.org/cc/Attribution" />
  187. <prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" />
  188. <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
  189. <requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
  190. </License>
  191. </rdf:RDF>
  192. -->
  193. </div>
  194. <div class="no"><img src="/lib/exe/indexer.php?id=latency&amp;1369167600" width="1" height="1" alt="" /></div>
  195. </body>
  196. </html>