<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Modartt user forum - Linux tips - fixes for latency, audio glitches, poor performance ...]]></title>
	<link rel="self" href="https://forum.modartt.com/extern.php?action=feed&amp;tid=4156&amp;type=atom"/>
	<updated>2015-12-29T17:38:35Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.modartt.com/viewtopic.php?id=4156</id>
		<entry>
			<title type="html"><![CDATA[Re: Linux tips - fixes for latency, audio glitches, poor performance ...]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=940992#p940992"/>
			<content type="html"><![CDATA[<p>I have JACK 1.9.10 (but I&#039;m not using JACK)</p><p>Still having some issues occasionally. Every now and again PTQ stops producing piano sounds and all I get is noise. Restarting it gets it working again. I&#039;m going to upgrade/change the whole OS soon (and ditch bloody KDE) so I won&#039;t bother trying to fix it now.</p><p><em>Edit:</em> Actually, restarting PTQ does not always fix the problem. Right now all that works is increasing the buffer size to around 1024 samples which results in unacceptable latency...</p><p><em>Edit #2 (30 Dec 2015):</em> Changing the sampling rate from 48kHz to 44.1kHz got things working again with buffer size of 128 (or even 64). And oddly enough, if I change the sampling rate back to 48kHz, it still works fine. Weird.</p><p><em>Edit #3 (4 Jan 2015)</em> After more of the same issues (ones mentioned in this post) I added myself to the <em>audio</em> group and rebooted. Everything works fine (for some days now). I use JACK sometimes to route MIDI between other software (e.g., MuseScore) and Pianoteq. All good.</p>]]></content>
			<author>
				<name><![CDATA[SteveLy]]></name>
				<uri>https://forum.modartt.com/profile.php?id=4729</uri>
			</author>
			<updated>2015-12-29T17:38:35Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=940992#p940992</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Linux tips - fixes for latency, audio glitches, poor performance ...]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=940989#p940989"/>
			<content type="html"><![CDATA[<p>I&#039;m using Mint 17.2 and my scaling driver shows up as Intel_Pstate. The RT kernel could be the culprit in switching back to the acpi driver in order to keep a consistent latency.</p><p>Could be a Dell BIOS issue or a bad temperature reporting issue.&nbsp; Perhaps the laptop is reporting that it&#039;s getting too hot and so it scales down when in reality it&#039;s not.</p>]]></content>
			<author>
				<name><![CDATA[Mossy]]></name>
				<uri>https://forum.modartt.com/profile.php?id=3856</uri>
			</author>
			<updated>2015-12-29T01:23:41Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=940989#p940989</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Linux tips - fixes for latency, audio glitches, poor performance ...]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=940973#p940973"/>
			<content type="html"><![CDATA[<p>I was wondering which Jack you were running (Jack 1 or Jack 2)?&nbsp; Maybe you already know this, but if running Jack 2, you may want to check to see if you are running it in synchronous or asynchronous mode (for example, see <a href="https://help.ubuntu.com/community/HowToJACKConfiguration">https://help.ubuntu.com/community/HowTo...figuration</a> or <a href="https://linuxmusicians.com/viewtopic.php?f=27&amp;t=14000">https://linuxmusicians.com/viewtopic.ph...mp;t=14000</a> for more information)?&nbsp; Running in synchronous mode significantly reduce xruns (i.e. cracks/pops) when running Jack 2.&nbsp; That is how I always run Jack on my machine and I get good performance this way.</p>]]></content>
			<author>
				<name><![CDATA[mwinthrop]]></name>
				<uri>https://forum.modartt.com/profile.php?id=156</uri>
			</author>
			<updated>2015-12-27T18:15:31Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=940973#p940973</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Linux tips - fixes for latency, audio glitches, poor performance ...]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=940971#p940971"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>alessandro wrote:</cite><blockquote><p>It&#039;s strange that you had issues: I&#039;m running fine with a less powerful i3-3217U with Lubuntu 15.04.</p></blockquote></div><p>I don&#039;t know the reason but the CPU speed switching seemed to have caused the glitches. I will try it with slower fixed speed CPU setting and see how that goes.</p>]]></content>
			<author>
				<name><![CDATA[SteveLy]]></name>
				<uri>https://forum.modartt.com/profile.php?id=4729</uri>
			</author>
			<updated>2015-12-27T17:14:42Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=940971#p940971</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Linux tips - fixes for latency, audio glitches, poor performance ...]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=940954#p940954"/>
			<content type="html"><![CDATA[<p>It&#039;s strange that you had issues: I&#039;m running fine with a less powerful i3-3217U with Lubuntu 15.04.</p><p>I applied the recommended steps in Pianoteq readme.txt (including Jack). It was running fine at 48000 Hz / 128 buffer, but needed to set &quot;performance&quot; governor for more demanding tasks (or increasing buffer size).<br />Then I installed the low latency kernel, and it made a big difference: now I seldom need to change the default &quot;powersave&quot; governor (it seems to me that the reason is that this low latency kernel is much more reactive to speed change needs). I prefer the &quot;powersave&quot; governor since the notebook is quieter, neeeding less fan cooling.</p>]]></content>
			<author>
				<name><![CDATA[alessandro]]></name>
				<uri>https://forum.modartt.com/profile.php?id=4781</uri>
			</author>
			<updated>2015-12-26T15:54:24Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=940954#p940954</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Linux tips - fixes for latency, audio glitches, poor performance ...]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=940950#p940950"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>SteveLy wrote:</cite><blockquote><p>acpi-cpufreq</p></blockquote></div><p>Thanks, interesting, that Linux Mint 17.2 has not switched over to scaling_driver intel_pstate.</p>]]></content>
			<author>
				<name><![CDATA[groovy]]></name>
				<uri>https://forum.modartt.com/profile.php?id=1021</uri>
			</author>
			<updated>2015-12-26T09:08:10Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=940950#p940950</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Linux tips - fixes for latency, audio glitches, poor performance ...]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=940946#p940946"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>groovy wrote:</cite><blockquote><p>could you please show, which scaling_driver your system is running?</p></blockquote></div><p>acpi-cpufreq</p>]]></content>
			<author>
				<name><![CDATA[SteveLy]]></name>
				<uri>https://forum.modartt.com/profile.php?id=4729</uri>
			</author>
			<updated>2015-12-25T22:50:54Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=940946#p940946</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Linux tips - fixes for latency, audio glitches, poor performance ...]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=940944#p940944"/>
			<content type="html"><![CDATA[<p>Hi,</p><p>could you please show, which scaling_driver your system is running?</p><p>with ...<br /></p><div class="codebox"><pre><code>cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver</code></pre></div>]]></content>
			<author>
				<name><![CDATA[groovy]]></name>
				<uri>https://forum.modartt.com/profile.php?id=1021</uri>
			</author>
			<updated>2015-12-25T20:07:18Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=940944#p940944</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Linux tips - fixes for latency, audio glitches, poor performance ...]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=940943#p940943"/>
			<content type="html"><![CDATA[<p><strong>TL;DR version:</strong><br />Cut and paste the following in a terminal window and hit enter:<br /></p><div class="codebox"><pre><code>for ((i=0; i&lt;$(cpufreq-info | grep analyzing | wc -l); i++)); do sudo cpufreq-set -g performance -c $i; done</code></pre></div><p>------------------------</p><p><strong>Long version:</strong><br /></p><h5>How I got Pianoteq 5 flying on Linux (after some initial woes)</h5><p>I had a bit of trouble getting Pianoteq Std working without issues on my Linux Mint 17.2 Dell laptop. It&#039;s a fairly capable machine, i5-3337U 1.8GHz, 8GB RAM - should be plenty to run PTQ.</p><p>Yet I kept getting crackling/popping sounds every now and again (even without CPU overload), and latency was not all that reliable or great (not near what PTQ claimed) and polyphony was pathetic (&lt;10, at most 20) on &quot;Pessimistic&quot;.</p><p>Things I tried (but did not solve the problems)<br />- Low latency Linux kernel (this is usually a good idea)<br />- JACK audio set up for realtime audio (this actually made things a bit worse; but it wasn&#039;t JACK&#039;s fault, see below)<br />- &quot;sudo renice&quot;-ing the &#039;Pianoteq 5&#039; process to -20 (if you don&#039;t know what that means, don&#039;t worry; if you&#039;re curious, look up the &quot;renice&quot; command in Linux)</p><p>What worked in the end:<br />- Disable CPU throttling and set all CPUs/cores to run at their maximum speed</p><p>You can accomplish this with the <em>cpufreq-set</em> command (part of the <em>cpufrequtils</em> package, installed by default on most Linux systems). But first to see your settings and hardware info run <em>cpufreq-info</em> (in a terminal window). The only info you really need is how many CPUs (cores) the OS thinks you have. You can read the full output of <em>cpufreq-info</em> or if it&#039;s too much info, do something like this:</p><div class="codebox"><pre><code>ptquser@mycompter:/home/ptquser/Pianoteq Standard 5.42/Pianoteq 5/amd64 &gt; cpufreq-info | grep analyzing
analyzing CPU 0:
analyzing CPU 1:
analyzing CPU 2:
analyzing CPU 3:</code></pre></div><p>So here we have four CPUs/cores and they are numbered 0 to 3. We want to configure all of these for performance, which will disable on-the-fly CPU speed changes and will always run them at their max rated speed (without overclocking). This is accomplished with cpufreq-set:</p><div class="codebox"><pre><code>ptquser@mycompter:/home/ptquser/Pianoteq Standard 5.42/Pianoteq 5/amd64 &gt; sudo cpufreq-set -g performance -c 0
[sudo] password for ptquser: 
sudo cpufreq-set -g performance -c 1
sudo cpufreq-set -g performance -c 2
sudo cpufreq-set -g performance -c 3</code></pre></div><p>This fixed all the issues. I torture tested it and polyphony &quot;Pessimistic&quot; goes over 100, latency is non-existent, there are no glitches in the sound output and the CPU never overloads. My final PTQ configuration is:</p><p>- Audio device type: ALSA (not using JACK, no need for now but may use it in future)<br />- Output: PulseAudio Sound Server<br />- Sample rate: 48000 Hz<br />- Audio buffer size: 128 samples (2.7 ms)<br />- Multicore rendering ON<br />- CPU Overload detection ON<br />- Internal sample rate: 48000 Hz<br />- Max polyphony: Auto (Pessimistic)</p><p>Cheers.</p>]]></content>
			<author>
				<name><![CDATA[SteveLy]]></name>
				<uri>https://forum.modartt.com/profile.php?id=4729</uri>
			</author>
			<updated>2015-12-25T16:59:48Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=940943#p940943</id>
		</entry>
</feed>
