Pianoteq on Pentium M with Linux
I see that some users worry that a left-over computer they would like to dedicate for Pianoteq won't be peppy enough for the job. So just for laughs I installed Pianoteq 5.1 on a 10-year old Dell Latitude notebook with a single-core, Pentium M processor (M13/S6/F6, 1.8 MHz; pianoteq performance index 11 to 14) and 1 Gigabyte of RAM. An up-to-date Linux won't work on a cpu this old, so I'm still using Ubuntu Linux 10.4, non-PAE, kernel 2.6.32. I attached a Casio PX-150 sending high-definition Midi. Sound output was set to "stereophonic". I then tried to overload the processor by playing lots of bass chords, holding down the sustain pedal, adding runs and trills... and succeeded royally. Sometimes I only got crackles and pops. What surprised me, however, was that with not much tweeking, I could get sound from this old laptop that to my ears was hardly worse than I get from my modern office computer (Intel core i5-3570K, 4-core, 3.4 GHz, 8 G RAM; Pianoteq performance index 28).
The key was to look at the recommendations for Linux in the file 'README_LINUX.txt' and reduce the internal sampling rate (exact values seem to depend on your computer). After some experimentation, I found that I could get quite satisfying performance on my old laptop, except for the fan that had to run full tilt to carry out the heat.
Now in detail. You need to do four things: 1) Pare down the amount of other stuff running on your system, 2) get the cpu to run at full speed continuously, 3) get yourself privileges to start Pianoteq with real-time scheduling priority, 4) create a menu item to start Pianoteq with real-time scheduling (or at least high time-sharing priority).
One by one.
1) Presumably you're not going to be surfing, chatting or doing other things while practicing, so you might want to disable services that might take memory and processor time away from Pianoteq. First, open the dialog
System>Preferences>Startup applications
or install the terminal utility rcconf and disable all of the services, like WLAN, Bluetooth, Nepomuk, that a pure Pianoteq computer won't need. Set disk options to shut down the disk drive when not in use (package powertop).
2) The file README_LINUX.txt tells you to open a terminal window and type the terminal command
cpufreq-set -g performance
to get the cpu to run at full speed, without throttling.
On my Dell Latitude and with Ubuntu 10.4, this command did not disable throttling. To keep the processor running at maximum rate I needed to use the -d option, which sets a minimum clock frequency, like this
/usr/bin/cpufreq-set -d 1.8GHz
To avoid doing this by hand each time you start the computer, open the file '/etc/rc.local' (from a terminal window, using e.g. 'sudo gedit' or 'sudo kate') and add the line shown above, substituting whatever the maximum frequency is for your old computer. 'cpufreq-info' will tell you this. (With multi-core processors stick to 'cpufreq-set -g performance'; they tend to overheat if all cores are run full speed.) Note that you have to restart the computer for this command to take effect.
3) Normally you need to have root (administrator) privileges to set the scheduling priority ("niceness") of a program to -10. The file README_LINUX.txt tells you to add lines with "@audio rtprio 90" and "@audio nice -10" to '/etc/security/limits.conf' to get around this limitation. These lines also only take effect after you restart. You should check if your installation process made you a member of 'audio' (mine didn't). On Ubuntu, open System>Administration>Users and Groups>Users settings>Manage Groups>Group settings>Properties. Or from a terminal window, 'cat /etc/group' to see if you're listed at the line 'audio'; if not, use 'groupadd' to make yourself a member of that group and get scheduling privileges.
Now, these lines in 'limits.conf' don't set the run-time priority of Pianoteq; they just authorize members of the group 'audio' - or you alone, if you change @audio to @<your-name> - to start Pianoteq with high priority. This doesn't happen automatically. You must start Pianoteq with a priority-changing program, via a command line in a terminal, e.g.:
nice -n-10 '/path/to/your/Pianoteq 5'
or
chrt -r 88 '/path/to/your/Pianoteq 5'
From what I could find out, the default scheduling in Linux is a "time-sharing" mode, which tries to make sure that every process gets some cpu time. The 'nice' command, even with negative "niceness" of -10 (i.e., "pushiness") still lets things like the window manager react very quickly; if you try out this command you will see that, while Pianoteq is running, the cursor arrow on your desktop still moves smoothly; you can open and move windows as usual. Even when you don't do anything, the operating system still has all sorts of housekeeping things going on that want to compete with Pianoteq.
This isn't what you want on a lame laptop. You want Pianoteq to get nearly everything. This seems to happen with the second command; the -r option tells Linux to use a real-time scheduling regimen for Pianoteq, with very high priority (88). You'll notice that once Pianoteq starts playing music, the cursor arrow jumps while following the mouse, and everything else on the desktop is jerky and sluggish. That's because Pianoteq gets to use the cpu most of the time. 'chrt' definitely gives better performance than the 'nice' command. I can set sound card and internal sampling to 22050Hz and get no clicks or dropouts on the most complex midi file I could find, Marouan Benabdallah playing Rachmaninoff, Sonata in B-flat Minor, Op. 36, from the 2006 e-Piano competition, Univ. of Minnesota (I can't play this sort of thing myself). Even at 32000Hz only the worst passages with lots of bass chords and polyphony cause dropouts. Benabdallah's playing of Debussy's Suite Bergamasque (from the same competition) goes through at 32000Hz and polyphony of 64 without a hitch. (http://www.piano-e-competition.com/ecom...2006.asp#B). At this sampling rate the frequency bandwidth is presumably about 15 kHz, better than my hearing, and the sound is all I could wish for.
This second command (chrt) probably requires an up-to-date Linux kernel; I tested it only with 2.6.32, from the latest Ubuntu 10.4, non-PAE update.
4) Of course, you don't want to start Pianoteq from a terminal, using a command line that you'd have to write down somewhere. Use the menu editor of your Linux desktop to create a new command icon, and as command use one of the two commands from section 3). As icon for the menu item I had to take a picture of a quarter-note from /usr/share/icons; I wish I could find the Pianoteq icon somewhere.
That's it, and you might not need to buy a new computer.
Last edited by MinorChord (09-03-2015 21:44)