Topic: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

Hi there!

Last weekend I installed pianoteq on my Odroid C2. My aim was to have a 100% headless setup that starts pianoteq during boot and can be controlled via Tablet/Smartphone if needed. I do not own an external monitor at all.

Used Hardware:

  • Odroid C2, 2GB Ram, 4x1.6GHz arm64

  • 16GB SD Card class 10

  • Zyxel G220 WLan stick (based on zd1211)

  • Behringer UCA222 usb audio

  • Roland HP508 digital piano

I decided to go for dietpi as a distro, because it is lightweight, available for many SBC out there, and most important has a high level of automation for installing wifi, desktop and vnc. The README_LINUX.txt was fairly useful. The hardest part was to install the necessary 32bit libraries needed to run pianoteq.

In hope my short notes could serve me and others:

INSTALL SYSTEM

  • download and install dietpi to sd card0

  • activate auto install options in boot partition, dietpi.txt:
      Ethernet_Enabled=0
      Wifi_Enabled=1
      Wifi_SSID="Fritz..."
      Wifi_KEY="123..."
      Swapfile_Size=0
      Auto_Install_Enable=1
      AUTO_DietpiSoftware_Install_ID=23 # lxde
      AUTO_DietpiSoftware_Install_ID=28 # vnc4
      AUTO_DietpiSoftware_Install_ID=20 # vim
      AUTO_Timezone=Europe/Berlin
      cpu_governor=performance
      wifi_country_code=DE

  • copy zd1211 firmware files to sd: rootfs partition, /lib/firmware

  • boot and wait for software installation to finish (might take 1-2h)

CONFIGURE SYSTEM

  • setup vnc via 'sudo vncpasswd' and 'systemctl restart vncserver.service',
      or run dietpi-software vnc4 again to set vnc password (connect via ssh)
      connect to desktop via "Android VNCViewer IP:1" or "Gnome remote desktop viewer IP:1"

  • edit /etc/security/limits.conf (use @root ...) according to the pianoteq README_LINUX.txt:
       @root - rtprio 90
       @root - nice -10
       @root - memlock 500000

  • disable bright blue onboard LED heartbeat:
      add "echo sd > /sys/class/leds/blue\:heartbeat/trigger" in /etc/rc.local

  • raise alsa volume (fairly low by default) using 'alsamixer' and F6 to select USB DAC

  • install 32bit packages, needed to run pianoteq (the tricky part):
      dpkg --add-architecture armhf
      apt-get update
      apt-get install libc6:armhf libX11-6:armhf libasound2:armhf libfreetype6:armhf libxext6:armhf

SETUP PIANOTEQ

  • download and copy pianoteq to /usr/bin/pianoteq using vnc
      put into autostart using "Start -> Preferences -> Default Applications for LXSession" then Tab 'Autostart', and add an entry for "pianoteq --multicore max --fullscreen"

  • configure pianoteq using vnc:
      choose velocity curve
      assign midi buttons to change presets
      choose midi device and soundcard output (probably run 'dietpi-config' and choose USB-DAC as audio device?), select one carrying "...direct without conversion..."
      choose internal sample rate (44kHz), polyphony (48) and buffer (64 samples, 2.6ms latency)

Performance: From power on to play takes ~30-40s. Pianoteq performance index is ~17. Auto polyphony settles at ~10 and ~12 (pessi/optimistic). Perfomance is good and realtime stuff works surprisingly well. No crackles unless playing really heavy-pedalling double-handed accords (Rach prelude op23/5 g minor, Steinway D 3 Mics).

The solution via VNC is really great! Wireless controller when needed and the box can be hidden, too. Feels now like a wireless android version of pianoteq running directly on the digital piano.

Lukas

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

Thank you! That was very useful.

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

Luba, this is very similar to what I achieved with a NUC last weekend and what I am working on with a pi 3 via Edgar's excellent guide.

I do think posts such as yours and Edgar's represent the beginning of a revolution for PT6. The following combination is what makes this so compelling
- trivially cheap hardware
- auto start
- headless with wireless tablet solution, thus forget and play. This is the absolute killer feature
- latency well below 10ms
- sample rate at or above 44.1khz
- polyphony sufficient for nearly all practical purposes 
- reasonable dac - I'm delighted with my audio engine d1 which arrived this week - lost all that just perceptible but hugely annoying distortion

I'm currently not sure how much if at all I will need to overclock the pi 3 to achieve all this. Job for next weekend.

If you look at the above it makes buying an expensive laptop/pc/laptop suddenly look rather....well....unecessary. Possibly that is why some other posters seem a bit annoyed by all this pi/Linux talk. I would too if I'd dropped, say, a grand on a Mac just for PTQ.

The barrier to all of this is of course that it's fiddly and requires patience and poking around in Linux. Ultimately I wonder if SD card images will be shared on this forum to make the whole thing accessible to non techy types.

I'm wondering if you routed the sound through your Roland piano. I tried this on my slightly old Clavinova (170) and certainly would not recommend.

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

Whallsey wrote:

The barrier to all of this is of course that it's fiddly and requires patience and poking around in Linux. Ultimately I wonder if SD card images will be shared on this forum to make the whole thing accessible to non techy types.

This would be very useful!

And it is very easy to do, because linux is made to be shared...

Once I swap the hard disk of two laptops, the only thing I had to do was to reactivate Pianoteq (Pianoteq detects hardware changes)

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

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

Would Luba's guide work for the Odroid XU4?

Would it be worth the increased cost?

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

Yes, I tried to route the sound through the Roland. Unfortunately I have an ugly ground-loop issue when USB and Line are plugged in at the same time (which is necessary for that purpose).

For a digital piano the internal speakers are pretty capable, but with an annoying hiss even on headphones and line-in somehow does not use their full potential. With the internal sounds though, the sound projection works well with a spatial sound and good low end and at that time - in addition to the good playability of the internal sounds - was the reason to go for that specific model.

On speakers, pianoteq sound is at most comparable, with a slightly less direct experience, but this might be due to playing a different grand piano as well. This week I mostly used pianoteq over headphones connected directly to the sound card, which really is the more enjoyable experience!

I find a headless setup significantly less distracting than one with a monitor that permanently invites you to tweak something. This increases the pianoteq experience even more!

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

The guide should directly work on XU4 and any other board dietpi is available for as well. XU4 seems to have a more cores (8 vs 4) and higher single core clock (2GHz vs 1.5GHz) at the 'cost' of a probably noisy active fan.

The question here is, is Pianoteq able to use the full potential of 8 cores?

I assume no one ever seriously tested that. So far, Desktop CPUs were powerful enough with 1-2 cores, pianoteq-arm is still very new and my impression is that the '--multicore max' strategy was implemented specifically to better use the four cores of the pi. In general, the higher the number of cores, the harder it is to make use them.

Performance is good enough for everyday usage, even with heavy pedalling. Polyphony in pianoteq seems to be implemented in an intelligent manner such that a rather 'low' value of 48 does not cancel the longest sounding notes, but the least perceptible ones.

Prebuilt images with let's say pianoteq-demo seems like a good idea, but frustration potential is high if something does not work (happens almost surely to someone). Compared to a good guide with a clean starting point (Edgars guide is very well written), where you can always consult general linux guides, fora, the system maintainer and so on.

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

Knowing little about Linux and these processors, I have to ask:

1. How small is the form factor? Smaller than the old piano modules, yes?
2. Can a monitor be easily attached? (Plug and play would be nice for live performances, but people would still want to be able to make edits.)
3. Some people will want to know--it is possible to attach an LCD and buttons for basic functions--Next preset, volume, etc--or would these commands have to be made through MIDI commands sent from the MIDI keyboard? (Which might be fine, of course.)
4. What about combining one of these processors\boxes with an external sound card? I'm assuming that the sound chip on the board, if it has one, is not going to compete with a full-blown external device such as a Zoom.

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

1) Those computers are more or less the same size of a credit card, and as they usually feature USB and LAN ports, they can't be as thin as a credit card...
2) Yes, they feature HDMI and, in the case of Raspberry, AV just in case you have an old CRT TV . You can also set the board to see its desktop through the network (with VNC for instance)
3) You can attach a USB keyboard (or a reduced keyboard if this exsist...). By the way Pianoteq has built in the ability of learning to change settings from MIDI commands. There is a user who developed an interface for Pianoteq but I think it is written for Windows. There are other simple options like HMI Nextion LCDs. Sadly, as far as I know Pianoteq has not the ability to send its settings, so devevloping a MIDI interface to change it settings is a bit more dificult...
4) Edgard's tutorial speaks about that point. I have an USB external soundcard (ESI UDJ6) which works well in Raspberry pi 3. In fact it works as bad as in a x86 Windows or Linux PC, with an no acceptable latency.

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

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

I'd like to see how Rock64, Asus tinker, Banana pi, etc. run Pianoteq

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

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

I have tested an asus tinkerboard and unfortunately its cpu gets too hot very quickly with the stock dissipator, it would need an active fan in order to run Pianoteq at 44kHz.

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

I tried my pi3 tonight for the first time. No overclocking. Was looking to see how well it performed at 2 to 5 milliseconds latency without overclock. It ran very comfortably at 33khz but was poppy at 44khz. Used an audioengine D1 dac.

Suspect that a little bit of overclocking might solve it based on Edgar's results (running at higher latency but at 192khz, if I recall).

Perhaps an overclocked Pi might be similar to a non-overclocked C2. Will let you know how the overclocking goes when I get to it.

If anyone can tell me how to autostart the Pianoteq on boot (using Edgar's script to ensure maximising cores) on Raspbian please let me know. I'm sure it's just a couple of lines of code and knowing where to plonk them.

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

Hi there!

An update from my side. During the last week I played really a lot on my odroid-pianoteq setup, very happy so far :-). There are two things that I changed:

  • In order to signalize that the virtual piano is ready to play, I recorded a short midi file playing only the two notes A-E. My new autostart command now includes playback of that jingle: "pianoteq --fullscreen --multicore max --midi /root/jingle.mid --play"

  • Changing internal sample rate to 29 kHz allows me to use 128 polyphony with 96 samples (2.2ms). The higher polyphony sounds to me more pleasing and natural than a high sample rate with low polyphony, when using pedalling, note repetition and so on. Currently, my favourite preset is the rather mellow Steinway D Jazz.

CPU temperatures during normal playing are around 60C. Thermal throttling happen just at 80C and the board was not expensive enough to worry about temperatures.

I think the biggest hurdle for curious non-techies is really setting up the software part of the system. Specialized hardware seems not to be the problem, USB soundcards, digital pianos etc, even a pi3 are probably already present. Maybe one day, someone should really try to provide a ready-to-run image for the pi3, installable in a couple of minutes, with a running vnc server on it, autostarting pianoteq demo, and a ready-to-connect wifi hotspot. Anyone interested?

@Whallsey: Does 'lxsession-default-apps' help? Or the file '~/.config/lxsession/LXDE/autostart'?

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

Any further progress on this? I'm about to purchase a SBC so not sure whether to try one of the alternatives to Raspberry Pi.  The Sparky appeals as I'm also interested in Hifi, but it doesn't seem to be easily avaible in UK/EU.

Last edited by grazie (15-01-2018 11:42)

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

LuBa, thank you for your work on this. :-)

I have my RPi system up and running thanks to Edgar's guide and your ideas on this thread.
It starts up completely automatically so I only need UI access when fiddling with settings, and for that I'm using VNCViewer from an Android tablet.

I still have some improvements to make (add a DAC 'hat' and put it in a proper enclosure) but it's working and sounding great already with a USB external DAC.

(Sorry to bump both this and Edgar's threads. Thanks were due).

Last edited by mattsplatt (19-01-2018 04:21)

Re: guide to setup pianoteq on an Odroid C2 headless 'forget and play'

Whallsey wrote:

If anyone can tell me how to autostart the Pianoteq on boot (using Edgar's script to ensure maximising cores) on Raspbian please let me know. I'm sure it's just a couple of lines of code and knowing where to plonk them.

http://www.raspberry-projects.com/pi/pi...ograms-gui

The above link explains better than I can how to auto start programs on Raspbian. I'd happily share exactly what I did, but I found the embedded spaces in Pianoteq paths and filenames as supplied causes problems, so I changed them to make life easier. I didn't want to confuse things by posting.