Topic: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

I got a crazy performance boost by forcing Pianoteq to use the 4x high-performance CPU cores on the Odroid N2+, leaving the remaining 2x low-performance cores for the operating system (Ubuntu Linux).

Even with Pianoteq settings at ridiculous speed (see below), there's more than enough horsepower to keep the Performance Index at an almost unbreakable 33-35 and you have to try really hard to force a CPU overload (the most important part).

Now I'm thinking, this sounds too good to be true, and I'm a little paranoid that I'm doing something wrong, so I'm hoping you guys/gals will try this on your ARM/Raspberry installations to confirm if this hack is for realzzzzzz ....

https://i.ibb.co/SJNmS8j/Screenshot-at-2021-03-10-22-29-31.png

https://i.ibb.co/hx642ps/Insanely-great-performance-from-Pianoteq-and-Odroid-N2.png

How Do You Tell Pianoteq To Use Specific CPU Cores?

On Ubuntu Linux? Start Pianoteq like this.

taskset -c 2,3,4,5 'Pianoteq 7 STAGE'

On the Odroid N2+ the 6 CPU cores are numbered 0,1,2,3,4,5. The example starts Pianoteq dedicated to cores 2,3,4,5.  '-c 2,3,4,5' specifies the 4x high-performance cores on the Odroid N2+, '-c 0,1' would be the 2x low-performance cores.

What about the RASPBERRY PI with 4 CPU cores? - I'm guessing you would start Pianoteq like this dedicated to 2 cores.

taskset -c 2,3 'Pianoteq 7 STAGE'


How to figure out which CPU cores are high/low performance?
1. Start your Terminal

2. Install the CPU Frequency Utilities (a.k.a. cpufrequtils). In Ubuntu Linux it looks like this:

sudo apt update
sudo apt install cpufrequtils

3. Now, run 'cpufreq-info' to list out the CPU information. Warning, this will vomit data, and you'll have to scroll up/down to find the information.

cpufreq-info

4. There will be a section for each CPU core. Look for the following lines at the beginning and end of each section:

analyzing CPU 0:
... current CPU frequency is 1.91 GHz.

analyzing CPU 1:
... current CPU frequency is 1.91 GHz.

analyzing CPU 2:
... current CPU frequency is 2.21 GHz.

analyzing CPU 3:
... current CPU frequency is 2.21 GHz.
etc.

The 1st core is labeled 'CPU 0' running at 1.91 Ghz, 2nd core is 'CPU 1' etc. The 'CPU frequency' tells you if it's a high or low performance core

5. Run Pianoteq with the specified CPU cores.

taskset -c 2,3,4,5 'Pianoteq 7 STAGE'

The first 2 cores are constantly the first in line to be used, so to get better performance, tell Pianoteq to use all the cores AFTER the first 2 cores.

Last edited by Groove On (11-03-2021 05:52)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

A COMPARISON:

This is Pianoteq at maximum settings, run without being assigned to any cores. MIDI file is un-playable. Performance Index drops to 20 and there are red lines galore. *notice the audio load graph, the blue Performance Index line is a third of the way down from the top, orange audio load is very high and is consistently above blue Performance Index, Pianoteq reported CPU usage is a very high 76%.

https://i.ibb.co/h7jQhKy/Screenshot-at-2021-03-11-02-39-54.png



Pianoteq with same maximum settings, but now, dedicated to 4 cores. The MIDI file plays smoothly, Performance Index is stable at ~34 all the way through the song (no wild fluctuations).There were only  2-3 red red lines (not shown). *notice the differences in the audio load graph, blue Performance Index line is pegged to top, orange audio load is down and consistently below the blue Performance Index. Pianoteq reported CPU usage also down to 37%.

https://i.ibb.co/gFLyF3B/Screenshot-at-2021-03-11-02-41-14.png

Last edited by Groove On (17-03-2021 00:03)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Thanks for letting me know about this one!

My performance on the Raspberry Pi 400 was already fantastic and I was already running on high quality settings by default. I quickly tried this and there were no ill effects, but hard to say if there's a performance impact one way or the other yet.

I'll experiment some more when I get the chance.

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Cool, thank you.

Here's the simple test:
- set everything in Pianoteq to it's highest setting
- without assigning any cores, play a MIDI file and take note of the performance index + graph
- then, re-start Pianoteq with assigned cores and play the MIDI file see how the performance index + graph are affected.

Last edited by Groove On (11-03-2021 07:01)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Groove On wrote:

taskset -c 2,3,4,5

Quite interesting, thanks for that!!

Do you have a performance screenshot with samplingrate (internal&external) 48 kHz and 64 samples?

My special interest would be the output of 'cat /proc/asound/timers' on your used OS.

Cheers

PS: The odroid seems to have an onboard DAC, is the performance with an external USB-DAC the same on that system?

Last edited by groovy (11-03-2021 13:28)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

groovy wrote:

The odroid seems to have an onboard DAC, is the performance with an external USB-DAC the same on that system?

Performance is the same, I can't hear any quality differences between the onboard N2+ DAC and my external DAC. They both sound great with Pianoteq. The main difference: onboard DAC uses 3.5mm stereo jack, my external DAC has balanced XLR outs.

Specs:
The N2+ DAC/sound chip runs at 32-bit up to 192kHz.
My external DAC runs at 24-bit 96kHz

In Pianoteq:
The N2+ DAC/sound chip shows a bit depth of 32-bits up to 192000 Hz sample rate.
My external DAC runs at 24-bits up to 96000 Hz.

available options 44.1kHz and above:
44100 Hz (both)
48000 Hz (both)
88200 Hz (both)
96000 Hz (both)
176400 Hz (onboard DAC only)
192000 Hz (onboard DAC only)

For reference my external DAC is the Mackie MDB-USB DI box (has 2 XLR outs on the other side).
https://mackie.com/sites/default/files/mdb-usb_3qtr_r.png

Last edited by Groove On (11-03-2021 14:57)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

groovy wrote:

My special interest would be the output of 'cat /proc/asound/timers' on your used OS.

I am unfamiliar with this, but here is the output. Do I need to be doing anything else when I run this? What does it tell you?

G0: system timer : 4000.000us (10000000 ticks)
P0-0-0: PCM playback 0-0-0 : SLAVE
P0-1-0: PCM playback 0-1-0 : SLAVE
P0-1-1: PCM capture 0-1-1 : SLAVE
P0-2-0: PCM playback 0-2-0 : SLAVE
P1-0-0: PCM playback 1-0-0 : SLAVE

Last edited by Groove On (11-03-2021 14:58)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

groovy wrote:

Do you have a performance screenshot with samplingrate (internal&external) 48 kHz and 64 samples?

Is this what you're looking for?

USING ONBOARD N2+ DAC

https://i.ibb.co/N14w99Z/INT48k64samples-1.png

https://i.ibb.co/TvmqM4p/INT48k64samples-2.png



USING EXTERNAL DAC (Mackie MDB-USB DI)

https://i.ibb.co/t89hL00/MDB-USB-48k64samples-2.png

https://i.ibb.co/RTV11r9/MDB-USB-48k64samples-1.png

Last edited by Groove On (11-03-2021 15:08)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Hi,
thank you, but my question didn't target the performance specs, moreover the performance graph of pianoteq (that you showed in your previous screenshots). Often onboard PCI DACs are quoted to be better performing than external USB-DACs. Raspberry Pis are usually coupled with USB-DACs and it would be a fairer competition.

... ahh, while I'm writing this post you uploaded new screenshots, very nice!
Indeed  the onboard DAC seems to be slightly superior vs. the Mackie USB.

Interesting, that 256samples/192kHz seems to be on par with 64samples/48kHz (if not better!) while both combinations provide a nominal latency of 1.3 ms. Then one could choose that combi with the best stability.

The system timer is relevant for alsa, 4000.000µs means 4 ms resolution. My personal preference has always been 1 ms (1000.000µs), but it costs performance. Stock (server) kernels of Debian/Ubuntu often have 4 ms per default, Raspberry Pi400 default 32-bit-kernels with 10 ms even more.

Cheers

Last edited by groovy (11-03-2021 15:31)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Comparison of CPU Loads with and without assigning Pianoteq to specific cores

WITHOUT Core Assignment, the default CPU load-balancing algorithm tends to:
1. Favor the first core, often overloading it while under utilizing the other cores.
2. It does eventually round-robin and distribute the work load across the cores, but it's too slow for real-time music. Many times, by the time it realizes there's been a stressful "musical" event, it's too late to do anything about it.
3. To add insult to injury, it's favoring the first 2x low-performance cores, and under-utilizing the 4x high-performance cores.

Notice:
- Pianoteq reads CPU load around 60%
- Performance Index dropped to 20
- There's a couple of CPU overloads/red x-runs and orange audio load consistently above blue Performance Index.
https://i.ibb.co/k9TcbZf/normal.png


This is what it typically looks like when Pianoteq is assigned to specific cores (CPUs 3, 4, 5, 6).
- There tends to be a more even distribution across high-performance CPUs (3, 4, 5, 6)
- The 2x low-performance cores (1,2) aren't so overloaded and are free to attend to the needs of the OS and other programs.
- Pianoteq reads the CPU load as a more normal 302%
- Performance Index is pegged at 34 (no wild fluctuations), no x-runs/red cpu overloads, orange audio load is consistently below blue Performance Index.
https://i.ibb.co/gTvp3MP/withloadbalancing.png


Please keep in mind, these are snapshots of a live dynamic system, but I think these do show 'on average' CPU loads for each situation.

Last edited by Groove On (17-03-2021 00:01)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Groove On wrote:

Comparison of CPU Loads with and without assigning Pianoteq to specific cores

WITHOUT Core Assignment, the default CPU load-balancing algorithm tends to:
1. Favor the first core, often overloading it while under utilizing the other cores.
2. It does eventually round-robin and distribute the work load across the cores, but it's too slow for real-time music. Many times, by the time it realizes there's been a stressful "musical" event, it's too late to do anything about it.
3. To add insult to injury, it's favoring the first 2x low-performance cores, and under-utilizing the 4x high-performance cores.

Notice:
- Pianoteq reads CPU load around 60%
- Performance Index dropped to 20
- There's a couple of CPU overloads/red x-runs
https://i.ibb.co/k9TcbZf/normal.png


This is what it typically looks like when Pianoteq is assigned to specific cores (CPUs 3, 4, 5, 6).
- There tends to be a more even distribution across high-performance CPUs (3, 4, 5, 6)
- The 2x low-performance cores (1,2) aren't so overloaded and are free to attend to the needs of the OS and other programs.
- Pianoteq reads the CPU load as a more normal 302%
- Performance Index is pegged at 34 with no x-runs/red cpu overloads
https://i.ibb.co/gTvp3MP/withloadbalancing.png


Please keep in mind, these are snapshots of a live dynamic system, but I think these do show 'on average' CPU loads for each situation.

Interesting, my Pi4 seems to prefer the second core. I would think it uses the same scheduler. I noticed you seem to be running "on demand". There seems no need for "performance".

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

levinite wrote:

I noticed you seem to be running "on demand". There seems no need for "performance".

That’s a good point about On Demand vs. Performance CPU settings. It does look like the system is running ‘On Demand’ when no cores are assigned to Pianoteq. But when the cores are assigned to Pianoteq, those 4 cores act more like they are in Performance’ mode.

Last edited by Groove On (11-03-2021 23:35)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

levinite wrote:

Interesting, my Pi4 seems to prefer the second core. I would think it uses the same scheduler.

That is interesting. Under Pianoteq 64-bit, the Pi4 and N2+ are basically equal in performance (despite what the online benchmarks would suggest), so it’s a good system for comparison.

Assigning cores on the N2+ doesn’t increase performance so much as it stabilizes and focuses the performance power that it has. Before assigning cores, the N2+ acted like it had ADD, with a wildly fluctuating/inconsistent performance index (20-35) and a Pianoteq reported CPU usage of 50-70%. The CPU was always running behind what was needed, gasping for air.

After assigning cores to Pianoteq, the N2+ becomes consistently available with a performance index pegged at 33-35, PTQ reported CPU usage drops to 30-50%.  X-runs / CPU Overloads are reduced by around 98% (I’m making up that last statistic but that’s what it looks like).

The Pi4 gets a lot more love from developers, so it might already be more stable out of the box.

Last edited by Groove On (12-03-2021 00:25)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

I saw that you have chosen NY Steinway D Player clean and
NY Steinway Model D in your tests. With two virtual mics these are not the hardest challenge.
In the Pi400-thread me and navindra tested with NY Steinway D Classical Recording (4 virtual mics and thick ambience), unmodified preset and Pianoteq's Blues Demo.

With Player Clean (following snapshot) and also Model D the Pi400 is not bad too:

https://i.postimg.cc/sDB3ZZMM/NY-Steinway-D-Player-Clean-defaults-Blues-Demo-Pi400-perf.png

At the same time my Pi400 drives a vncserver and sends the Pianoteq GUI data per WLAN to the client. The interface in the snapshot had been the 48kHz-USB-DAC in a Korg B2,
1000 Hz kernel,
PiOS 64-bit beta,
governor performance,
PTQ Standard v7.2.0.

Last edited by groovy (12-03-2021 23:54)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

On a Odroid XU4, I get better performance using Armbian instead of Ubuntu. I don't know if this is extensible to the N2+. By the way, user Neo posted this some time ago in this forum: https://forum.modartt.com/viewtopic.php?id=7449

edit: by the way WHAT A NICE AND DETAILED WEB PAGE NEO
http://www.belleart.org/belleartwiki/in...MIDI-Input

Last edited by marcos daniel (13-03-2021 00:01)
Pianoteq Pro - Bechstein - Blüthner - Grotrian - K2 - Kremsegg 1 & 2 - Petrof - Steingraeber - Steinway B & D - YC5
Kawai CL35 & MP11

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

marcos daniel wrote:

On a Odroid XU4, I get better performance using Armbian instead of Ubuntu.

I agree Armbian had very good performance with Pianoteq, it's a very nice light-weight linux distribution. I really like their kernel build for customizing. So far though all the linux distributions I've tried have run Pianoteq very well.

I downloaded several linux versions specific to the Odroid N2+ / ARMv8 architecture and bought extra microSD cards so I could test them out (honestly, so I could geek out, but also to test them with Pianoteq). Right now, I'm running almost all of them off individual microSD cards. When I finally settle on one, I'll flash that one onto the slightly faster eMMC card.

1. Ubuntu MATE
2. Ubuntu Minimal
2. Armbian (Desktop/FOCAL)
3. Manjaro ARM
4. Arch Linux ARM (A.L.A.R.M!)

Ubuntu MATE & Ubuntu Minimal
Since they are "officially supported" by Hard Kernel, it was easy to get the N2+ hardware running on both of them. Pianoteq installed and ran immediately on both and they installed with a low-latency PREEMPTive kernel. My linux skills are rusty, so I'm mainly using the Ubuntu MATE with the GUI to get up to speed. My favorite so far is Ubuntu Minimal; command-line only, but I have Pianoteq running nicely with the i3 Window Manager, nice clean setup. Responsiveness of Ubuntu Minimal is better, but not sure if it makes a significant difference for Pianoteq. After a bit of tussling and getting up to speed, I like both just fine. Hardware requirements for Ubuntu MATE 2GB RAM / 8GB of disk space. Ubuntu Minimal 1GB RAM / 4GB disk space. Ubuntu MATE will run more comfortably on the 4GB model of the N2+, Ubuntu Minimal is a good fit for the 2GB model.

Armbian
Very responsive and light distribution. I installed the Desktop/Focal version. Default is a PREEMPTive kernel. Pianoteq installed and ran immediately. Main issue - couldn't the get onboard sound / 3.5mm jack to work. Otherwise, Pianoteq played fine through HDMI and external sound card.

My understanding is that Armbian is built off the Hard Kernel Ubuntu distributions with different options turned on/off, but I haven't dug too deep yet. AND - I really like their helpful Youtube videos and kernel builder platform.

Manjaro ARM
Very slick with good support. It's a well-packaged, light-weight, responsive Arch based distribution. Pianoteq installed and ran immediately, but once again - no sound thru 3.5mm jack. Pianoteq worked fine through HDMI and my external audio interface. Unfortunately, default kernel is a NON-PREEMPTive kernel - so no low-latency out of the box. One of Manjaro's main selling points is the ability to select and switch to low-latency and real-time kernels, but this feature wasn't working yet on Manjaro ARM. I will re-visit when this is working properly. One thing I liked in Manjaro ARM, it offers a command-line installer called Architect, let's you install exactly what you want, no more, no less.

Arch Linux ARM (A.L.A.R.M.)
I don't have the technical chops to install this yet (mostly it's getting the boot card formatted properly). Manjaro bills itself as the user-friendly version of Arch, while Arch's philosophy is DIY - do/only install what you want. At any rate, there is an Odroid N2+ version of Arch.

Last edited by Groove On (14-03-2021 12:49)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

groovy wrote:

I saw that you have chosen NY Steinway D Player clean and
NY Steinway Model D in your tests. With two virtual mics these are not the hardest challenge.
In the Pi400-thread me and navindra tested with NY Steinway D Classical Recording (4 virtual mics and thick ambience), unmodified preset and Pianoteq's Blues Demo.

That's a good point. I will run some tests with the NY Steinway D Classical Recording preset.

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

groovy wrote:

At the same time my Pi400 drives a vncserver and sends the Pianoteq GUI data per WLAN to the client. The interface in the snapshot had been the 48kHz-USB-DAC in a Korg B2,
1000 Hz kernel,
PiOS 64-bit beta,
governor performance,
PTQ Standard v7.2.0.

What improvements do you get with the 1000 Hz kernel? Is that specifically for MIDI hardware or does it also affect MIDI file playback?

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Groove On wrote:

What improvements do you get with the 1000 Hz kernel? Is that specifically for MIDI hardware or does it also affect MIDI file playback?

Playing the keyboard is more "tight". Always USB-MIDI and USB-Audio were involved at the same time and I had this impression with several MIDI- and Audiointerfaces. I never tested it with MIDI playback only, because live/interactive responsiveness is just, what I'm after.

I commented it recently here:
https://forum.modartt.com/viewtopic.php...63#p971663

But: This realtime situation is hard to measure, so I have no clear evidence, and it could be a placebo.

PS: Thanks for your OS comparison!

Last edited by groovy (15-03-2021 08:08)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

groovy wrote:
Groove On wrote:

What improvements do you get with the 1000 Hz kernel? Is that specifically for MIDI hardware or does it also affect MIDI file playback?

Playing the keyboard is more "tight". Always USB-MIDI and USB-Audio were involved at the same time and I had this impression with several MIDI- and Audiointerfaces. I never tested it with MIDI playback only, because live/interactive responsiveness is just, what I'm after.

I commented it recently here:
https://forum.modartt.com/viewtopic.php...63#p971663

But: This realtime situation is hard to measure, so I have no clear evidence, and it could be a placebo.

PS: Thanks for your OS comparison!

That's cool. Setting the system timer to 1000Hz is on my to-do list, but first, I have to figure out how to re-compile the Ubuntu kernel!

Note: I did find out that the default setting is 250Hz for Ubuntu-MATE on the Odroid N2+.

Last edited by Groove On (16-03-2021 05:13)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Another tweak that improved performance on a Raspberry pi 3 (anyway, it remained not suitable for proper playing) was to change the runlevel to avoid loading the x-server, desktop, etc. But for some reason (libraries I suppose) you need to have installed the desktop gui, the minimal distro image would not run Pianoteq. I haven't tested this on the XU4, since performance is good with the graphical desktop, but boot time is about 25s, which is not completely good...

Pianoteq Pro - Bechstein - Blüthner - Grotrian - K2 - Kremsegg 1 & 2 - Petrof - Steingraeber - Steinway B & D - YC5
Kawai CL35 & MP11

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

On advice from the Linux Musician forums I downloaded/ran the Perl scripts which check for real-time music optimizations.

Scripts can be downloaded here:
https://github.com/raboof/realtimeconfigquickscan


This runs the scripts in the Terminal

perl realTimeConfigQuickScan.pl


Results for my system.
I've already made many of the recommended adjustments so results are mostly "good". When a "not good" result is given, there is usually some advice how to fix it, for example the Kernel with Real-Time Preemption check below.

NOTE: by default, all the CPU Governors are installed as "performance" on Ubuntu/Odroid N2+, so that's nice.

== GUI-enabled checks ==
Checking if you are root... no - good
Checking filesystem 'noatime' parameter... 4.9.241 kernel - good
(relatime is default since 2.6.30)
Checking CPU Governors... CPU 0: 'performance' CPU 1: 'performance' CPU 2: 'performance' CPU 3: 'performance' CPU 4: 'performance' CPU 5: 'performance'  - good
Checking swappiness... 10 - good
Checking for resource-intensive background processes... none found - good
Checking checking sysctl inotify max_user_watches... >= 524288 - good
Checking whether you're in the 'audio' group... yes - good
Checking for multiple 'audio' groups... no - good
Checking the ability to prioritize processes with chrt... yes - good
Checking kernel support for high resolution timers... found - good
Kernel with Real-Time Preemption... not found - not good
Kernel without 'threadirqs' parameter or real-time capabilities found
For more information, see https://wiki.linuxaudio.org/wiki/system...ime_kernel
Checking if kernel system timer is high-resolution... found - good
Checking kernel support for tickless timer... found - good
== Other checks ==
Checking filesystem types... ok.
** Set $SOUND_CARD_IRQ to the IRQ of your soundcard to enable more checks.
   Find your sound card's IRQ by looking at '/proc/interrupts' and lspci.

Last edited by Groove On (16-03-2021 06:05)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

marcos daniel wrote:

haven't tested this on the XU4, since performance is good with the graphical desktop, but boot time is about 25s, which is not completely good...

I'm also getting good performance with the desktop GUI (Ubuntu-MATE). I'd swear it's slightly faster when I run Ubuntu Minimal with the i3 window manager, at least that's the way it feels, but the difference is small enough that I'm second guessing myself - if there's really a difference.

Boot time:
My current boot time for Ubuntu-MATE (GUI) is 35s from pressing the ON button to having Pianoteq ready to play. When I have everything configured under the GUI, I will try with Ubuntu Minimal so see if there's a difference. I suppose there are a few more optimizations to be made here.

Last edited by Groove On (16-03-2021 05:55)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

marcos daniel wrote:

Another tweak that improved performance on a Raspberry pi 3 (anyway, it remained not suitable for proper playing) was to change the runlevel to avoid loading the x-server, desktop, etc.

This may not be needed in the case of the N2+, by dedicating Pianoteq to the 4 high-performance cores, it leaves the 2 low-performing cores for the OS. I tried assigning Pianoteq to 5 and 6 cores, but it seems there is something optimal about using only 4, which works out for the CPU time needed by the OS.

Last edited by Groove On (16-03-2021 05:56)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

ISSUE:
Experienced a ground issue with my external USB audio interface when I connected to my mixer. It increased the noise floor to unacceptable levels.

[SOLVED]:
1. My audio interface has a ground lift switch, this fixed the noise floor issue.
2. I also tried a USB de-coupler between the audio interface and USB port, this also fixed the noise floor issue.

NOTES:
There are no ground issues if I'm listening direct through the audio interface. It only occurs when routing  audio to the mixer.

Last edited by Groove On (16-03-2021 06:03)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Groove On wrote:

Note: I did find out that the default setting is 250Hz for Ubuntu-MATE on the Odroid N2+.

Yes, because this is the function:
T = 1/250Hz = 4ms (=4000.000µs system timer)

marcos daniel wrote:

But for some reason (libraries I suppose) you need to have installed the desktop gui, the minimal distro image would not run Pianoteq.

Minimal distros (without desktop gui) can be used, when the Pianoteq-GUI is started directly into a vncserver for example --> https://forum.modartt.com/viewtopic.php...11#p971611

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

MUSICAL STRESS TEST #1

MIDI File: Pianoteq "Blues Demo"   
Preset: 'NY Steinway D Classical Recording'
Settings: Maximum (first 5 seconds of video show the settings)
Results: Clean playback, no red lines.

https://www.youtube.com/watch?v=dbFKjlUQCBM
* Set Youtube playback resolution to 720p or higher to see the graph more clearly. I used my iPhone to record the video and it's awful at low resolutions. Audio is from the 3.5mm jack, routed through an audio interface (SSL2) to iPhone.

Last edited by Groove On (16-03-2021 17:09)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

MUSICAL STRESS TEST - #2

MIDI File: Étude in A Minor , Op. 10, No. 2, “Chromatic” by Frédéric François Chopin. Performed by Sijing Ye.
https://www.yamahaden.com/midi-files/ca...1667694550
Preset: 'NY Steinway D Classical Recording'
Settings: Maximum (first 5 seconds of video show the settings)
Results: Clean playback. Ignore red line at the beginning, which happens sometimes when I switch windows.

https://www.youtube.com/watch?v=WOu1SUL9ld0

* Set Youtube playback resolution to 720p or higher to see the graph more clearly. I used my iPhone to record the video and it's awful at low resolutions. Audio is from the 3.5mm jack, routed through an audio interface (SSL2) to iPhone.

Last edited by Groove On (16-03-2021 17:12)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

MUSICAL STRESS TEST #3

MIDI File:
Étude in C-Sharp Minor , Op. 10, No. 4 by Frédéric François Chopin. Performed by Frank Dupree
https://www.yamahaden.com/midi-files/ca...2134128293

Preset: 'NY Steinway D Classical Recording'
Settings: Maximum (first 5 seconds of video show the settings)
Test Results
0:28 - minor event (single red line)
1:48 - minor event (single red line)

https://www.youtube.com/watch?v=YyU85vz6Pws* Set Youtube playback resolution to 720p or higher to see the graph more clearly. I used my iPhone to record the video and it's awful at low resolutions. Audio is from the 3.5mm jack, routed through an audio interface (SSL2) to iPhone.

Last edited by Groove On (16-03-2021 17:11)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

MUSICAL STRESS TEST #4

MIDI File:
Étude in G-Sharp Minor , Op. 25, No. 6, “Thirds” by Frédéric François Chopin. Performed by Jean-Selim Abdelmoula
https://www.yamahaden.com/midi-files/ca..._490225942

Preset: 'NY Steinway D Classical Recording'
Settings: Maximum (first 5 seconds of video show the settings)
Test Results:
00:45 - minor event (single red line)
00:54 - minor event (single red line)
00:58 - minor event (single red line)
01:08 - minor event (multiple red lines)
01:22 - minor event (single red line)

https://www.youtube.com/watch?v=xhDEUw4u_SY* Set Youtube playback resolution to 720p or higher to see the graph more clearly. I used my iPhone to record the video and it's awful at low resolutions. Audio is from the 3.5mm jack, routed through an audio interface (SSL2) to iPhone.

Last edited by Groove On (16-03-2021 17:11)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

MUSICAL STRESS TEST #5

MIDI File:
Piano Sonata No. 14 in C-Sharp Minor , Op. 27, No. 2, “Sonata quasi una fantasia” by Ludwig Beethoven. Performed by Scott Meek
https://www.yamahaden.com/midi-files/ca...1683551850

Preset: 'NY Steinway D Classical Recording'
Settings: Maximum (first 5 seconds of video show the settings)
Test Results
03:44 - minor event (2 red lines)
04:04 - minor event (2 red lines)
05:27 - minor event (5 red lines)

https://www.youtube.com/watch?v=9-I1pikMJF4* Set Youtube playback resolution to 720p or higher to see the graph more clearly. I used my iPhone to record the video and it's awful at low resolutions. Audio is from the 3.5mm jack, routed through an audio interface (SSL2) to iPhone.

Last edited by Groove On (16-03-2021 17:13)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

MUSICAL STRESS TEST #6

MIDI File:
Étude in C Major , Op. 10, No. 1 by Frédéric François Chopin. Performed by Maria Verbaite
https://www.yamahaden.com/midi-files/ca..._863189919

Preset: 'NY Steinway D Classical Recording'
Settings: Maximum (first 5 seconds of video show the settings)
Test Results
00:07 - minor event (1 red line)
00:43 - minor event (2 red lines)
00:54 - minor event (4 red lines)
01:15 - minor event (1 red line)

https://www.youtube.com/watch?v=eHpvlri5jC0* Set Youtube playback resolution to 720p or higher to see the graph more clearly. I used my iPhone to record the video and it's awful at low resolutions. Audio is from the 3.5mm jack, routed through an audio interface (SSL2) to iPhone.

Last edited by Groove On (16-03-2021 17:14)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

MUSICAL STRESS TEST #7

MIDI File:
Étude No. 3 in G-Sharp Minor , S.141, No. 3, La Campanella by Franz Liszt
Performed by Leeza Ali
https://www.yamahaden.com/midi-files/ca...1841172479

Preset: 'NY Steinway D Classical Recording'
Settings: Maximum (first 5 seconds of video show the settings)
Test Results:
Ignore red line at the beginning, which happens sometimes when I switch windows.
02:50 - minor event (1 line)
04:00 - minor event (1 line)
04:05 - catastrophic event (no audio)
04:13 - catastrophic event (no audio)
04:20 - minor event (4 lines)
04:27 - catastrophic event (no audio)
04:34 - catastrophic event (no audio)
04:47 - major event (several dense sections)

https://www.youtube.com/watch?v=m7GKfdchF4g* Set Youtube playback resolution to 720p or higher to see the graph more clearly. I used my iPhone to record the video and it's awful at low resolutions. Audio is from the 3.5mm jack, routed through an audio interface (SSL2) to iPhone.

Last edited by Groove On (16-03-2021 17:13)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

The 7 Musical Stress Tests I posted above are the easier/short ones. I tested another set of 7 more challenging pieces that were much longer (for example The Hammerklavier, Gaspard de la Nuit, and 3 Movements of Petrouschka). You can check them all out on this playlist. See where the Odroid N2+ really shines and where it takes a nose dive and crashes.
https://www.youtube.com/playlist?list=P...z0JrQRAfnF

Notes: MIDI files are competition/performance recordings from the Yamaha Signature MIDI Collection for their Disklavier series.
https://www.yamahaden.com/midi-files

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Stresstest passed with bravura in my opinion!
Very nice piece of hardware.

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

groovy wrote:

Stresstest passed with bravura in my opinion!
Very nice piece of hardware.

I still feel paranoid that I'm doing something wrong. Little voice in the back of my head keeps asking, "Should I be getting this kind of performance from a ~US$100 computer?"

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Whoops - correctly published the Pianoteq/N2+ Musical Stress Playlist, is now viewable.

https://www.youtube.com/playlist?list=P...z0JrQRAfnF

Last edited by Groove On (17-03-2021 00:42)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

SOME CONCLUSIONS

- The performance of Pianoteq on the Odroid N2+ comes mainly from the stability of the Performance Index (approx. 34), which is achieved by assigning the 4 high-performance cores to Pianoteq (taskset command). So, if a note can be played by the N2+, it will most likely be played. Without core assignment, the wild fluctuations drop the performance drastically and general performance is poor. If you take a look at some of the Musical Stress Tests, you'll see that the N2+ Performance Index is generally rock-solid.

- At max settings, the Pianoteq/N2+ excels up to around 128 polyphony. If playing in this range, the N2+ handles the notes well and is able to keep the audio load within the limits of the very stable Performance Index (approx. 34).

- the N2+ begins to fail above 128 polyphony. In Musical Stress Test #7 (La Campanella), there are several sections at the end where the polyphony soars to 190+, this completely crashes the N2+ playback. There are some other challenging MIDI files on the Stress Test Playlist that will do the same. To achieve better high-polyphony performance will require a more sophisticated chip that can give a higher Performance Index, for example a 6-core i3/i5/i7.

- Clean Playback with Minor Red Lines - if there are minor red lines, I can usually achieve clean playback by lowering the Host and Internal Sample Rates from maximum (e.g. down to 48k/48k), for persistent red lines, lowering the Audio Buffer (latency) to around 2-4 ms also helped. BUT there are still some ghosts in the machine causing oddball / random red lines, and chasing them down can be difficult. For example, starting playback and switching to the Audio Load/Performance screen can cause a red line, PulseAudio also caused repeated red lines (my startup script disablesPulseAudio when I start Pianoteq).

- Clean Playback with High Polyphony - For high polyphony, lowering the Host Sample rate and Audio Buffer (latency) were not effective, in fact, keep them at max is just fine. The most effective way to get clean playback with high polyphony, was to lower the Internal Sample Rate (e.g. down to 32k or 24k) and/or using the Auto Optimistic/Pessimistic polyphony settings, that is what worked best. The best way to handle higher polyphony is to use a CPU which has a higher Performance Index.

- The onboard sound chip is very good. I have a suspicion that it does a better job of lowering the audio load, compared to my external audio interface! Perhaps it's because the onboard sound chips runs at 32-bits vs 24-bits? Or maybe it's because the onboard sound chip skips the USB latency? I'll have to run a few more tests to confirm.

Last edited by Groove On (17-03-2021 04:26)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

The Hifi Shield 2 is now working with the Odroid N2+

https://forum.odroid.com/viewtopic.php?...mp;t=41967

Support for the board is now included in the kernel. This is awesome if you want balanced outputs on the N2+. I haven't tried Pianoteq yet, but the outputs work and sound great.

I've designed a box for the pair. If anyone would like to build it, I'll be putting the STL files on thingiverse tomorrow.  Can't wait to try this with Pianoteq!

PunBB bbcode test

PunBB bbcode test

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

kawsy wrote:

The Hifi Shield 2 is now working with the Odroid N2+

https://forum.odroid.com/viewtopic.php?...mp;t=41967

Support for the board is now included in the kernel. This is awesome if you want balanced outputs on the N2+. I haven't tried Pianoteq yet, but the outputs work and sound great.

I've designed a box for the pair. If anyone would like to build it, I'll be putting the STL files on thingiverse tomorrow.  Can't wait to try this with Pianoteq!

Cool! I like the metal case and I notice you enable the SPDIF port. Internally what are the RCA jacks connected to? SPDIF, HDMI or 3.5mm audio output or can you switch that?

Last edited by Groove On (19-03-2021 05:31)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Groove On wrote:
kawsy wrote:

The Hifi Shield 2 is now working with the Odroid N2+

https://forum.odroid.com/viewtopic.php?...mp;t=41967

Support for the board is now included in the kernel. This is awesome if you want balanced outputs on the N2+. I haven't tried Pianoteq yet, but the outputs work and sound great.

I've designed a box for the pair. If anyone would like to build it, I'll be putting the STL files on thingiverse tomorrow.  Can't wait to try this with Pianoteq!

Cool! I like the metal case and I notice you enable the SPDIF port. Internally what are the RCA jacks connected to? SPDIF, HDMI or 3.5mm audio output or can you switch that?

It's a separate audio interface, so it gives you a second set of outputs to choose from in addition to the N2+ ones.

https://www.hardkernel.com/shop/hifi-shield-2/

The case is 3D printed, wish I could do metal though!

Last edited by kawsy (19-03-2021 14:41)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Here is the link to enclosure STL files as promised.

https://www.thingiverse.com/thing:4799455

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Hey Groove On, thank you for your work in this thread!! You've basically created a howto Pianoteq for the N2+. With your CPU pinning tip and optimizations from the official docs and RealtimeConfigQuickScan script, I'm seeing performance identical to yours, at least as reported by performance index.  Earlier today I was seeing 35. The only change I can think I've made since was changing niceness for the audio group to -10.  Will have to remove that later and see if it goes back up.

I have it booting straight to full screen mode on Ubuntu minimal + lightdm + i3.  I'm using a touchscreen 7 inch display and my plan is to mount it on my CASIO px-150. Will post pics

Thanks for helping make this possible.

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

kawsy wrote:

Hey Groove On, thank you for your work in this thread!! You've basically created a howto Pianoteq for the N2+ ... I have it booting straight to full screen mode on Ubuntu minimal + lightdm + i3.  I'm using a touchscreen 7 inch display and my plan is to mount it on my CASIO px-150. Will post pics Thanks for helping make this possible.

Thank you! Interested in seeing how you mount it all together. I'll post pics as well when my new touchscreen arrives. (My touchscreen got commandeered for service elsewhere, so I'm waiting for another one). 

For Ubuntu minimal - did you have to do anything to get the audio working or did it install immediately?

kawsy wrote:

Here is the link to enclosure STL files as promisedhttps://www.thingiverse.com/thing:4799455

This is cool! I appreciate the built-in vents, good call on that!

Last edited by Groove On (21-03-2021 03:14)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Pulseaudio and x-runs (red-lines)
It's a good idea to turn off pulseaudio when running Pianoteq. It periodically wakes up and causes repeated/rhythmic x-runs (red-lines) during playback/performance. Here are the commands to turn it off/on.

To STOP Pulseaudio

systemctl --user stop pulseaudio.socket
systemctl --user stop pulseaudio.service

To START Pulseaudio

systemctl --user start pulseaudio.socket
systemctl --user start pulseaudio.service

Last edited by Groove On (21-03-2021 03:23)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

kawsy wrote:

The only change I can think I've made since was changing niceness for the audio group to -10.

I'm curious if that makes any difference (and how to measure if there's a difference). It's included in all the optimization advice I've seen, but I've also seen some recommendations to ignore it. I also wonder if it's redundant when assigning cores to Pianoteq, since it's basically doing something similar.

FWIW - during the jackd2 install, it gives real-time permissions to the audio group by adding these lines to your system.

@audio   -  rtprio         95
@audio   -  memlock    unlimited
@audio   -  niceness    -10

Those lines are stored in this file:

/etc/security/limits.d/audio.conf

You could create the file manually, but I usually just install jackd2 since it does it automatically.

Last edited by Groove On (21-03-2021 03:46)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Groove On wrote:
kawsy wrote:

The only change I can think I've made since was changing niceness for the audio group to -10.

I'm curious if that makes any difference (and how to measure if there's a difference). It's included in all the optimization advice I've seen, but I've also seen some recommendations to ignore it. I also wonder if it's redundant when assigning cores to Pianoteq, since it's basically doing something similar.

FWIW - during the jackd2 install, it gives real-time permissions to the audio group by adding these lines to your system.

@audio   -  rtprio         95
@audio   -  memlock    unlimited
@audio   -  niceness    -10

Those lines are stored in this file:

/etc/security/limits.d/audio.conf

You could create the file manually, but I usually just install jackd2 since it does it automatically.


I agree, pulse was creating problems right away so I removed it completely, it got added with lightdm, but was removed easily.


My limits.conf currently looks like:
@audio   -  rtprio         90
@audio   -  memlock    unlimited
@audio   -  niceness    -10

Do you think rtprio 90 vs 95 makes a difference? 

I don't have jack installed yet since Pianoteq is the only app I'm running but I also had it my head to use this as a supercollider box, so probably will need to install it soon.

It'll take me a week or so to get the display mount modeled, I need to spend some time actually practicing before Wednesday or my piano teacher is going to be upset with me! My plan is to remove the sheet music desk and mount the display something like this

PunBB bbcode test

I'm just going to just use a floor stand behind the piano for sheet music, the box with the n2+ will be velcro'd behind or underneath.

I'm also going to add a power button next to the display.  I'm hoping eventually to do a version with some extra buttons and rotary encoders, like a zynthian type thing.

Last edited by kawsy (21-03-2021 04:58)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

Groove On wrote:

For Ubuntu minimal - did you have to do anything to get the audio working or did it install immediately?

I only needed to do an apt upgrade to get the new kernel and edit config.ini

Last edited by kawsy (21-03-2021 05:01)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

kawsy wrote:

I agree, pulse was creating problems right away so I removed it completely, it got added with lightdm, but was removed easily.

That's a good idea to uninstall both pulseaudio and jackd2. Just Pianoteq + ALSA is very stable, especially for a standalone pianoteq sound module.

kawsy wrote:

My limits.conf currently looks like:
@audio   -  rtprio         90
@audio   -  memlock    unlimited
@audio   -  niceness    -10

Do you think rtprio 90 vs 95 makes a difference?

I think we'd have to test an extreme case to see if there's a difference or not. One of those challenging MIDI files played back with a real-time priority (rtprio) of 90 and then 95 and see if there's any effect on the x-runs (red-lines).

kawsy wrote:

I don't have jack installed yet since Pianoteq is the only app I'm running but I also had it my head to use this as a supercollider box, so probably will need to install it soon.

That was the reason I installed jackd - I thought I might want to run another VST, though they are pretty rare right now on ARM computers. Thank you for mentioning Supercollider, it looks interesting.

What I'd really like to find is a good Hammond organ VST for Linux ARM. Pianoteq does a good job covering the Electric Pianos and looks like Organteq could cover the pipe organs. Unfortunately other fun ones like OBxd are currently x86 only. Maybe the Mac moving to ARM will change that, who knows?!

kawsy wrote:

It'll take me a week or so to get the display mount modeled, I need to spend some time actually practicing before Wednesday or my piano teacher is going to be upset with me!

Exactly! This has been an interesting project, but I'll be really glad to get back to worry about harmonies and not config.ini files.

kawsy wrote:

My plan is to remove the sheet music desk and mount the display something like this PunBB bbcode test I'm just going to just use a floor stand behind the piano for sheet music, the box with the n2+ will be velcro'd behind or underneath.

I'm also going to add a power button next to the display.  I'm hoping eventually to do a version with some extra buttons and rotary encoders, like a zynthian type thing.

Nice, definitely a power button. I'm going to design mine to look more like a large upright metronome, so it can sit on the music desk. I with they'd port Zynthian over to the N2+. He has files to re-compile Zynthian using Ubuntu, but I'm gonna leave that for another enterprising person to do I really want to get back to playing the piano!

I think after the initial "prototype" is running solid for awhile, I'll make a more cohesive "Guide".

Last edited by Groove On (21-03-2021 07:48)

Re: Insanely great performance on ARM-64bit (Pianoteq, Odroid N2+, Linux)

My last hanging issues/questions:

1. Will a real-time kernel make a significant difference in stability? In the case of the Odroid N2+, will it give better high-polyphony performance (128+++) ?

2. Is a low-latency kernel good enough since it's already using real-time scheduling?

3. What about the sound card IRQ optimizations? Are those worth implementing?

Last edited by Groove On (21-03-2021 07:50)