Topic: Raspberry Pi 4: Pianoteq 6.6, 98 polyphony, zero audio dropouts

Hey everyone, I'm excited to say I was able to run Pianoteq v6.6 smoothly without audio dropouts on the latest Raspberry Pi 4!

Here are the details. This was my first time messing with audio with the Raspberry Pi, and in hindsight this test could have been a lot cheaper (more below).

-----------------------------------------------------------------------------

My actual setup:

- Computer: Raspberry Pi 4 Model B 4 GB RAM
   - Running unmodified Raspbian Debian Buster Lite (desktop GUI packages installed after)
   - No real time operating system patches
   - No heatsinks or fans (but also no case covering)
   - Not overclocked (using factory 1.5 GHz)
- Audio Card: IQaudIO Pi-DAC+
- Piano VST Software: Pianoteq v6.6.0 Linux, Trial
- MIDI Song Played: Beethoven Symphony No. 6 "Pastoral" (5th movement) arranged for Piano solo

-----------------------------------------------------------------------------

Settings had to be tweaked down from maximum to allow for smooth playback. Here are the details:

- Operating System Setup: Followed the Raspberry Pi performance tweaks guide by Edgar Bustamante:  Setup Guide
- Output: IQaudIODAC: Direct hardware device without any conversions

   In hindsight, this $51.33 audio card wasn't necessary. I did a test using the default 3.5mm headphone jack output on the Raspberry Pi and while the sound isn't as "open" and "deep", the sound is similar and performance is identical. I had previously read that the default audio of the Raspberry Pi was horrible and would tie up the CPU. However it works, the result is that the default audio from the Pi without the sound card was very usable and even sounds good. It's just the audio from the sound card sounds better.

   "Direct hardware device without any conversions" is important for performance.

- Sample rate: 96000 Hz
- Audio buffer size: 256 samples (2.7 ms)

   If the buffer size is any smaller, audio crackles and dropouts start appearing. 2.7ms should be great for live performance, though I have yet to test this. Larger buffer sizes are not necessary (the smaller the better).

- Multicore rendering: MAX (from Edgar's guide)
- Internal sample rate: 24000  Hz

   24000 Hz was the highest usable internal sample rate. The next highest option (32000 Hz) caused even 10-note polyphony to peak the performance graph with scary red vertical lines and would cause audio dropouts to occasionally occur. But using 24000 Hz caused zero audio dropouts even at 98 note polyphony.

- Maximum polyphony: 256

   I didn't want polyphony to be capped. This is the highest setting.

-----------------------------------------------------------------------------

Here's how I tried to stress Pianoteq, as the screenshots below show:

- Network: A 200 MB file download test is running (also separately did a 100 MB file upload test)
- Other Software Running: Chromium web browser with multiple tabs, Linux desktop (i.e. Pianoteq is not running headless), VNC server and viewer (my Raspberry Pi is not hooked up to a monitor so these screenshots were taking remotely over the VNC software)
- Song Playing:
   - The most complicated section of Beethoven's symphony
   - With the "Cathedral" hall for more revert effects (to stress the engine)
   - With the sustain pedal depressed the entire time (to stress the engine)
   - Getting up to 98 note polyphony

Basically, the computer was being lightly used, the network was being heavily used, and the piano passages being played represent some of the most complicated passages a person could would play.

And Pianoteq took it amazingly well. With the decreased internal sample rate, there were zero audio dropouts. This is incredibly exciting! While there are some red vertical lines in the performance index, there were no audible crackles, dropouts, or static. It sounded like a very good piano VST with excellent audio quality and performance.

https://i.imgur.com/qM8oswD.png
https://i.imgur.com/fmd2BmY.png

-----------------------------------------------------------------------------

Note on Testing/Audio DAC: I haven't tried hooking this up to a MIDI keyboard yet. This test is just playing a MIDI file that is being loaded. I can give a more thorough report on performance latency delays later when I use this setup with a keyboard.

Last edited by sightread (29-09-2019 09:03)

Re: Raspberry Pi 4: Pianoteq 6.6, 98 polyphony, zero audio dropouts

Have you tried without GUI? It improved performance on the RPi3
(Runlevel 3 and Pianoteq headless)

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

Re: Raspberry Pi 4: Pianoteq 6.6, 98 polyphony, zero audio dropouts

I'm also interested to know if performance can be improved (setting internal freq. at 44 KHz for instance !) by

- running without X
- using a low latency / RT kernel
- starting pianoteq with the options specified in the README LINUX to use an alternate multithreading strategy (max)

Also, I'd be interested in a way to set it up on a screen-less RPi (and have a couple buttons mapped to switch instruments, active the metronome... and turn the RPi off :-)

Cheers !

Re: Raspberry Pi 4: Pianoteq 6.6, 98 polyphony, zero audio dropouts

I've managed to get amazing Pianoteq performance on an overlocked Raspberry Pi 4 with RT kernel, no audio dropouts with max audio sample rate and internal sample rate settings!!

Hardware setup:

- Computer: Raspberry Pi 4 Model B 2GB RAM
   - Running Raspbian Debian Buster Lite (desktop GUI installed after)
   - Raspbian Real Time Kernel (4.19.71-rt24-v7l+)
   - Large heatsink (no case covering)
   - Overclocked to 1.75 GHz
- Sound Card: Suptronics X400
- Pianoteq v6.7.0
- Piano: CLP-170 (GH3) USB MIDI connection

Pianoteq setup:
- Performance governor enabled and limits.conf edit (as described in Pianoteq readme)

- Devices settings
   - Audio device type: ALSA
   - Output: IQaudIODAC Direct hardware device without any conversions
   - Sample rate: 96000 Hz
   - Audio buffer size: 256 samples (2.7 ms)

- Performance settings
   - Performance index: 19
   - Multicore rendering: MAX
   - Internal sample rate: 48000 Hz
   - Maximum polyphony: Auto (optimistic)

I'm getting about 50-60% CPU load most of the time, no spikes that I can see with polyphony going up to about 30 with no issues whatsoever. And I'm running it on the desktop as it just works so well, this is more than I was hoping for

Re: Raspberry Pi 4: Pianoteq 6.6, 98 polyphony, zero audio dropouts

jari_42 wrote:

I've managed to get amazing Pianoteq performance on an overlocked Raspberry Pi 4 with RT kernel, no audio dropouts with max audio sample rate and internal sample rate settings!!

Wow, that all sounds pretty good. 

Where do I go to get a Raspian with the RT kernel?   I see this page on github: https://github.com/lemariva/RT-Tools-RPi   Which makes me wonder whether there's a downloadable image for Raspian RT, or whether I need to recompile the kernel or substitute RT binaries for standard binaries of the kernel.  How exactly did you get the RT kernel version?


Also, anywhere other than the Pianoteq readme file that has instructions for how you set yours up?

I'm also curious about the audio quality.  How is it from just the headphone jack of the Pi?  And how much better is that Suptronics board?

Last edited by hesitz (21-04-2020 06:49)

Re: Raspberry Pi 4: Pianoteq 6.6, 98 polyphony, zero audio dropouts

I compiled the RT kernel from scratch using the excellent instructions here:
https://lemariva.com/blog/2019/09/raspb...mance-test
you can either do the same or download the precompiled kernel he used from his github page:
https://github.com/lemariva/RT-Tools-RP...t23-v7l%2B
and substitute the binaries as described in the last few sections of his instructions. As far as I know there isn't a downloadable Raspbian RT image unfortunately.


As for setting up the Raspberry Pi, there's a great guide by Edgar Bustamante here:
https://www.modartt.com//downloads/gen/...Pi3_v3.pdf
and another good guide by jimmi here (he uses a headless setup with VNC):
https://drive.google.com/file/d/1uYW5p3...xcNAQ/view


Regarding the audio quality, when I tried it this morning with the headphone jack from the Pi it sounded quiet and fuzzy (I guess because it was only designed to drive headphones) but your mileage may vary. The Suptronics X400 sounds fantastic to my ears, powerful, clear with lovely bass. There are other audio boards you could use instead of the X400 like the IQaudIO Pi-DAC+ or the HiFiBerry DAC+ Pro (the main reason I got the X400 was because it was the only high-quality audio board Pi Hut had in stock).

Re: Raspberry Pi 4: Pianoteq 6.6, 98 polyphony, zero audio dropouts

Thanks for the tips.  I just ordered a Pi 4 with Hifiberry DAC, we'll see how it works. . .

Re: Raspberry Pi 4: Pianoteq 6.6, 98 polyphony, zero audio dropouts

I wonder if setting things to 96k might actually create additional CPU load. Did you perhaps try 48k but 128 samples buffer size?

Last edited by EvilDragon (21-04-2020 21:20)
Hard work and guts!

Re: Raspberry Pi 4: Pianoteq 6.6, 98 polyphony, zero audio dropouts

EvilDragon wrote:

I wonder if setting things to 96k might actually create additional CPU load. Did you perhaps try 48k but 128 samples buffer size?

For some reason 96k sounds so much richer than 48k and the CPU load at 96k with 256 samples seems to be much the same as at 48k with 128 samples (presumably because the X400 is doing the processing). But then I'm not pushing the polyphony that much with what I play or using crazy reverb.

Re: Raspberry Pi 4: Pianoteq 6.6, 98 polyphony, zero audio dropouts

Considering you put the internal SR of audio engine to the same value regardless of audio interface sample rate, this is pretty much inconsequential. Testing it with a spectrometer you can see nothing really changes in the frequency response between 48k and 96k when you have capped the internal audio engine sample rate to the same value... It just gets upsampled to audio interface sample rate. So when you say "so much richer", I would say "placebo". Maybe the audio interface DAC plays into it a little bit, but I'm listening here with a really decent and not cheap audio interface (RME UFX+), and there's literally no audible difference between 48k and 96k. There are some minor differences in transient response if you change the internal audio engine SR above 48k (transients are slightly more detailed then), but you gotta have Pianoteq Pro for that.

Here's some pics:

https://imgur.com/a/Tm1tP0K


It's roughly pretty much the same thing. Really hard to get a screenshot at exactly the same time in the piece, so that accounts for most of those differences in peaks and troughs. If you average the curve you'd get pretty much the same thing. Those tiny peaks above 20k are likely upsampling artifacts.

Let's just remember that pianos don't really have an awful lot of spectral energy above 10-12k.

Last edited by EvilDragon (22-04-2020 09:17)
Hard work and guts!

Re: Raspberry Pi 4: Pianoteq 6.6, 98 polyphony, zero audio dropouts

You are right EvilDragon, I can't actually hear any discernible difference between 96k and 48k now (it did strike me as nonsensical). I must have unintentionally changed a setting somewhere when I was trying it out this morning, clearly still asleep