Topic: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

After 4 days of testing various settings my Raspberry Pi 4B running Pianoteq 7 gives me a PI of 32 and a stable well running environment, and was incredibly easy to configure. I would love to hear your results with alternate configurations and DACs.
http://catchlight.se/Pianoteq_rasp_2GHZ.jpg
HW configuration
•    Computer: Raspberry 4 Pi B 4GB
•    OS: 2020-08-24 64 bit OS + updates
•    Heatsinks on CPU, memory and USB controller
•    DAC: HIFIBERRY DAC+ PRO XLR
•    Steel case https://www.hifiberry.com/shop/cases/st...-xlr-pi-4/
•    External fan mounted on case
•    Headless – access via VNC
Midi file: Sonata No. 14 C# minor (Moonlight) , Opus 27/2 (1801) Movement 3
http://www.piano-midi.de/midis/beethove...ormat0.mid
•    Overclocked @ 2000Mhz
•    Performance index              32
•    Audio Output         snd_rpi_hifiberry_dacplus, HIFIBerry DAC+ Pro HiFi PCM512x hifi-0; direct hardware device without any conversions
•    Host sample rate             48000Hz
•    Internal sample rate     48000Hz
•    Bit depth                        32 bits
•    Buffer size                128 samples (2.7ms)
•    Max polyphony             256
•    No effects, no delay, no reverb
•    Max temp                56 degrees
•    Average temp loaded      50 degrees
•    Idle temp                        40 degrees
•    Only a handful of red lines observed in audio load, no audible defects.
Notes and Observations:
•    A good power supply is CRITICAL for stability.
•    The OKDO power supply included in the kit I purchased did not work properly and would not drive USB keyboard.
•    The Raspberry Original Power supply improved stability and allowed used of USB keyboard
•    The HIFIBERRY DAC+ PRO XLR precludes the use of a CPU fan, which I believe is a necessity.
•    Without a fan the temperature went into the mid 70’s.
•    Back of case was drilled out and cpu fan mounted externally
•    An external DAC is probably a better solution
•    VNC installed from https://www.realvnc.com/en/connect/down...spberrypi/
•    Youfou’s brilliant configuration script was used to configure the Pianoteq installation. See this thread: https://forum.modartt.com/viewtopic.php?id=8268 No other changes made.
•    My intended use is in a church connected to a Yamaha NU1, the output will go via XLR to a Behringer XR18 mixer where effects like EQ and reverb will be applied.

http://catchlight.se/image0.jpeg

Last edited by kingfisher (13-04-2021 14:12)
Photographer, cyclist (and now self-made livestream and audio tech for small church in Lund Sweden) , ex-pat American from San Diego living in southern Sweden. IG:catchlight.se

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

Update
The Hifiberry dac+ pro xlr has very high internal levels, so I had to set the volume level in Pianoteq to -20dB to avoid distortion. Unfortunately while listening to an extremely loud portion of Beethovens Sonata No. 14 C# minor (Moonlight) , Opus 27/2 (1801) I inadvertently switched presets to compare the difference.
Unfortunately the volume in the new preset was set to 0dB and in the few seconds before I could stop the playback, HIFIBerry hat seems to have been fried. No matter what level I play back now it crackles, so lesson learned.

I should have set a global freeze on the volume level
http://catchlight.se/pianoteq_volume_freeze.jpg

Next test will have to be with an external DAC.

Last edited by kingfisher (27-03-2021 11:41)
Photographer, cyclist (and now self-made livestream and audio tech for small church in Lund Sweden) , ex-pat American from San Diego living in southern Sweden. IG:catchlight.se

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

I don't think your HIFIBerry is fried. As a DAC it is just working at Line output levels and its digital input is inherently limited to 0 dBFS.

Poweramps or their inputs can be fried, have you checked this already?

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

groovy wrote:

I don't think your HIFIBerry is fried. As a DAC it is just working at Line output levels and its digital input is inherently limited to 0 dBFS.

Poweramps or their inputs can be fried, have you checked this already?

Thank you so much!

I had the XLR cables connected to my Zoom H5 and I must have bumped up the levels control on the H5 in my panic to lower the volume, causing the distortion. Now after resetting everything seems to work properly again.

Last edited by kingfisher (27-03-2021 14:10)
Photographer, cyclist (and now self-made livestream and audio tech for small church in Lund Sweden) , ex-pat American from San Diego living in southern Sweden. IG:catchlight.se

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

Thanks for that update!

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

Hello again!

You can reduce the output level in 2 ways:
1. use `alsamixer` (a built-in utility) to adjust the output level of your Hifiberry DAC:
    - just type "alsamixer" on the terminal and follow the guide (select your DAC first)
2. modify the `start.sh` under the `Pianoteq 7` installation folder, and adjust the launch arguments to change the normalization level:
    - append "--normalize-db -6"  to `base_args`; "-6" is the new level, you can change it as you want
    - for more available launch arguments, you can find the Pianoteq 7 executable and use "--help" the find out

I used to use a DAC hat similar to Hifiberry DAC+, and had the same problem. What I did is to change the DAC output level via alsamixer.

Reference:
https://www.hifiberry.com/docs/archive/...ry-boards/

kingfisher wrote:

Update
The Hifiberry dac+ pro xlr has very high internal levels, so I had to set the volume level in Pianoteq to -20dB to avoid distortion. Unfortunately while listening to an extremely loud portion of Beethovens Sonata No. 14 C# minor (Moonlight) , Opus 27/2 (1801) I inadvertently switched presets to compare the difference.
Unfortunately the volume in the new preset was set to 0dB and in the few seconds before I could stop the playback, HIFIBerry hat seems to have been fried. No matter what level I play back now it crackles, so lesson learned.

I should have set a global freeze on the volume level
http://catchlight.se/pianoteq_volume_freeze.jpg

Next test will have to be with an external DAC.

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

youfou wrote:

Hello again!

You can reduce the output level in 2 ways:
1. use `alsamixer` (a built-in utility) to adjust the output level of your Hifiberry DAC:
    - just type "alsamixer" on the terminal and follow the guide (select your DAC first)
2. modify the `start.sh` under the `Pianoteq 7` installation folder, and adjust the launch arguments to change the normalization level:
    - append "--normalize-db -6"  to `base_args`; "-6" is the new level, you can change it as you want
    - for more available launch arguments, you can find the Pianoteq 7 executable and use "--help" the find out

I used to use a DAC hat similar to Hifiberry DAC+, and had the same problem. What I did is to change the DAC output level via alsamixer.

Reference:
https://www.hifiberry.com/docs/archive/...ry-boards/

Thank you Youfou! That was exactly what I needed. Now I can keep the Pianoteq volume at 0dB and the alsamixer setting is persistent after reboot.
http://www.catchlight.se/alsamixer.jpg

Photographer, cyclist (and now self-made livestream and audio tech for small church in Lund Sweden) , ex-pat American from San Diego living in southern Sweden. IG:catchlight.se

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

Thank you for this guide! As a noob in audio setup, I was wondering if a simple HIFIBERRY DAC+ Standard - Phone jack version (https://www.hifiberry.com/shop/boards/h...lus-phone/) would be sufficient to get good audio with pianoteq on a raspberry pi 4?

Last edited by leleogere (09-09-2023 23:52)

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

Are you overclocking? I am very surprised at how hot your temps are. I use a simple metal case with no fan and practically no air circulation. I don't think it ever got that hot.

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

I have a raspberry pi 400 with a pisound.

The beauty of it is that it includes midi so no fiddling with usb latency issues.

My keyboard is a Kawai VCP-1 which I´ve built for my daughter to learn piano . She started at 9,5 years old.

For output I'm hooking it up to an ESI Moco and a pair of ESI Unik 05 plus, with some roland black xlr cables - All in all lovely sound.

I also added a mackie hm-4 amp for the headphones on the 2nd moco output.

It´s all a bit of a mess of cables atm, but I have on backlog to design and print a custom case to hold all the hardware in and reposition a bunch of ports, knobs and switches, and screw it on the vpc-1's underside.

RIght now looking at the new Rpi 5 for an upgrade, which will simplify my build for the custom case.

I´ve dreamed up and did a few drawings on a full enclosure that would hold everything, from sound to hardware and toughscreen, but that might take a while to find the time

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

Looking forward to see how  Pi5 performs. Thanks for the Pisound tip, never knew such a thing existed.

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

CuriousDan wrote:

Looking forward to see how  Pi5 performs. Thanks for the Pisound tip, never knew such a thing existed.

There is also the https://www.hifiberry.com/docs/data-she...-dac2-pro/ which should be pretty much identical to the Pisound in performance and capabilities (it uses the same chip)

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

dv wrote:
CuriousDan wrote:

Looking forward to see how  Pi5 performs. Thanks for the Pisound tip, never knew such a thing existed.

There is also the https://www.hifiberry.com/docs/data-she...-dac2-pro/ which should be pretty much identical to the Pisound in performance and capabilities (it uses the same chip)

I like Dacberry's products, the pisound has the advantage of having the midi port, otherwise you'll be connecting through USB which will increase latency. THis is due to the hifiberry's being built for music output rather than production like the pisound.

I also fond their Bang&Olufsen collab with beosound pretty interesting as well as the amps, which I might look at again looking at a full fiano build (taking apart the kaway and building a complete piano with integrated large touchscreen .

One can always get an additional hat just for midi, but that adds to the complexity as you're connecting multiple hats to the pi, a bit more involved for my current needs. Goes for a bit cheaper though


https://thepihut.com/products/midi-boar...spberry-pi

To be honest I don't think i've seen another audio interface for the pi with midi, other than zynthian. I may eventually build one of these in the future, but for now I'm more focused on the more classic approach.

Last edited by alfatreze (09-10-2023 11:24)

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

I've just received my RPi 5 4G and installed the std OS and an HDMI LCD screen and used the HDMI audio output.
I didn't do any optimizations.

Performance index is stable at 44 and CPU load is low  (<20% per core)

This is just an initial impression, but it looks like a good option to make my midi controller a stand-alone piano

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

Received my Raspberry Pi 5. Installed standard (64 bit) OS and Pianoteq 8.
I have used HifiBerry DAC+ Pro XLR (HW 1.0.1) on my RPi4 and it worked fine. But on the RPi5, the HifiBerry DAC was not visible in Pianoteq. After some searching, I found

https://github.com/raspberrypi/linux/issues/5724

In a nutshell:
While on the RPi4 it was enough to modify /boot/config.txt to

#dtparam=audio=on
dtoverlay=hifiberry-dacplus

for the RPi5 you have to add "slave" to get it running:

#dtparam=audio=on
dtoverlay=hifiberry-dacplus,slave

To install Pianoteq, I used the script published on

https://github.com/youfou/pianoteq-pi

First, I downloaded it using wget -qO setup.py https://git.io/JqVD6
Then, in an editor I replaced "Pianoteq 7" by "Pianoteq 8" and ran the script with
sudo python3 setup.py

The script unzips the archive and sets some parameters (no idea if they are as useful for the RPi5 as they were for the RPi4) and at the end asks if the processor should be over-clocked. Choose NOT to overclock.

I get a performance index of around 70. With internal sample rate 44100, host sample rate 44100, buffer size 192 and maximum polyphony 128 everything seems to work fine

Last edited by wild (08-12-2023 14:02)

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

Oh wow this is great. I just got a Pi4 and a HifiBerry DAC to make myself a little pipiano box.

You run headless with VNC. I assume it's not possible to run fully headless, meaning without the desktop environment installed? I've been trying to figure this out but as a relative linux noob I'm a bit lost. But I think even if I did manage to install the software on my fully headless, no desktop env pi, I realized it'd probably be impossible to activate Pianoteq on said headless install. So I think I've been barking up the wrong tree and should just try headless but with desktop env installed, then do VNC for when I need to see something. I had it working just fine with the normal version of the OS before I tried fully headless.

So when you set up this sort of headless but with VNC, it's not using resources to render the desktop environment when it's not being accessed with the VNC viewer right?

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

Finally found time to setup my Raspberry Pi 5 and also getting a performance index of 70 on the official 64bit OS. This is more than enough for Pianoteq!

I’m running mine with a small touchscreen so no experience of using headless with VNC.

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

In case of interest, here are the steps I used to get Pianoteq 8 stage running on a RPI-4B with Hifiberry DAC+. It can do full headless mode without need of any GUI even over VNC and was based on Youfou's excellent post at https://forum.modartt.com/viewtopic.php?id=8268.


1. Flash SD card
    Use RPI-Imager from Windows to flash Rasbian OS 64 bit with desktop to SD card. Configure:
    - username: user
    - hostname: pianoteq
    - wi-fi:          wifi_details
    - SSH (UN+PW)


2. System config
    - From windows command shell, connect to the RPI over ssh.
   

ssh user@pianoteq

    - Log in, and configure system options using
   

sudo raspi-config

     - System Options: (S5) Boot/Auto Login - Select B4 autologin GUI
     - Interface Options (I2): Enable VNC remote desktop
     - Localization Options (L2)
     - Reboot


3. Set audio card

sudo nano /boot/config.txt
   - Remove line   : dtparam=audio=on
   - Add ",noaudio": dtoverlay=vc4-kms-v3d,noaudio
   - Add line:       dtoverlay=hifiberry-dacplus

4. Prevent ethernet driver crashing under load

sudo nano/boot/cmdline.txt
   - Add to end of line: smsc95xx.turbo_mode=N

5. Upgrade real-time user rights

sudo nano /etc/security/limits.conf
    - Add three lines at end:
      @user    -    rtprio    90
      @user    -    nice      -10
      @user    -    memlock   500000

6. Set the correct system time to enable downloads

sudo date -s '1 Jan 2024 09:00'

7. Install Pianoteq prerequisites

sudo apt-get install p7zip-full
sudo apt-get install cpufrequtils

8. Open the GUI and download Pianoteq stage
   -  Access GUI via Windows Real VNC Viewer
   - On RPI desktop browser, open: https://www.modartt.com/user_area
   - Download pianoteq_stage_linux_v813.7z to /home/user/Downloads
   - In the GUI, unzip (double click file) to /home/user/Pianoteq 8 STAGE


9. Create shell script to run Pianoteq in the arm-64bit subdirectory
This shell script will start pianoteq with the CPUs set to their maximum speed (note not overclocked) and return them to normal on exit. Command line arguments to the shell script are passed on to Pianoteq ($@).

sudo nano /home/user/'Pianoteq 8 STAGE'/arm-64bit/start.sh

Type the following:

#!/bin/bash
sudo cpufreq-set -r -g performance
/home/user/'Pianoteq 8 STAGE'/arm-64bit/'Pianoteq 8 STAGE' --multicore max --do-not-block-screensaver $@
sudo cpufreq-set -r -g ondemand

 
10. Create desktop shell script
Elsewhere people have used desktop shortcuts (.desktop) which allows you to set an icon, but this is a bit simpler. This desktop shell script stops the background service (for headless operation) and calls the previous shell.

sudo nano /home/user/Desktop/Pianoteq.sh

Type the following:

#!/bin/bash
sudo systemctl stop pianoteq
/home/user/'Pianoteq 8 STAGE'/arm-64bit/start.sh
sudo systemctl start pianoteq

11. Make shell scripts executable

chmod +x /home/user/'Pianoteq 8 STAGE'/arm-64bit/start.sh
chmod +x /home/user/Desktop/Pianoteq.sh

12. Create a service

sudo nano /lib/systemd/system/pianoteq.service

Type the following:

[Unit]
Description=Start Pianoteq 8 STAGE
After=sound.target

[Service]
User=user
Environment=DISPLAY=:0
ExecStart=/home/user/'Pianoteq 8 STAGE'/arm-64bit/start.sh --headless
Restart=on-failure
RestartSec=2s
KillMode=control-group
TimeoutSec=infinity
LimitRTPRIO=infinity
LimitMEMLOCK=infinity
LimitRTTIME=infinity

[Install]
WantedBy=multi-user.target

13. Start service

systemctl daemon-reload
sudo systemctl enable pianoteq
sudo reboot

14. Configure pianoteq in the GUI
    - Audio output:             snd_rpi_hifiberry_dacplus... direct hardware device without conversions
    - Sample rate:              44100 Hz
    - Audio buffer:              96 samples (2.2ms)
    - Internal sample rate: 29400 Hz
    - Maximum poly:         48

Pianoteq should now run on boot with the last preset selected. You can disable the GUI through sudo raspi-config and selecting boot to terminal.

Last edited by Gungadin (03-01-2024 13:37)

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

Hello
I have Raspberry 5 only.

1. Do I need a sound card for pianoteq8.2 ?

2. Can someone put step-by-step instruction for pianoteq 8.2 installation ?

Re: Raspberry 4 Pi B 4GB 64bit OS + HIFIBerry DAC w PI of 32

tigre42 wrote:

Hello
I have Raspberry 5 only.

1. Do I need a sound card for pianoteq8.2 ?

2. Can someone put step-by-step instruction for pianoteq 8.2 installation ?

You will need either a sound card HAT (see above) or an external USB audio interface, the Raspberry Pi 5 no longer has an audio out (and the onboard audio was poor anyway).

To install pianoteq you only really need to download the Linux version and extract the relevant binary (arm64 ensure that you have a 64bit operating system installed on your Pi as this gives much better performance). There is also an installation script by youfou linked in the comments above.