Docs on low-latency preconfigurations/is any of this necessary?

Hi folks,

I’m moving a Python script using Jack over to my Raspberry Pi and so trying Patchbox OS for the first time. On my Lenovo Thinkpad using Manjaro, I have the following configurations to improve audio performance:

  • Setting higher resource usage limits in /etc/security/limits.conf - my user account gets a soft lock, audio group (of which user is a part) gets a hard lock:
    [user] soft rtprio 90
    [user] soft memlock unlimited
    @audio hard rtprio 90
    @audio hard memlock unlimited

  • The following with a sudo shell script:
    systemctl start cpupower.service
    sudo sysctl vm.swappiness=10
    sudo sysctl fs.inotify.max_user_watches=600000

I’m wondering if any of this is necessary within Patchbox OS, or even already done. I can’t see any documentation on what the low-latency preconfigurations are. If I don’t need to do the shell script, this would make it easier as I’d avoid having to set up a cron job or similar. I plan to run my music Python script automatically on startup so would need to have this shell script run first.

I am not sure if I will use a Pisound. Probably will. Right now I’m using a USB audio interface.

Many thanks,
Paul

Patchbox OS has some preconfiguration done, the main configuration steps happen in this part of the OS image generation: patchbox-os-gen/stage3 at patchbox-2024-01 · BlokasLabs/patchbox-os-gen · GitHub

You may give ‘stock’ image a try and then apply your optimizations and see if you get a measurable improvement in performance.

Btw, using a dedicated sound card such as Pisound gets lower latencies compared to USB audio cards.

Thank you - I will see how it’s going when I get it running. And I do think I will use Pisound if Patchbox works for me. Even just not having to lug around the USB interface (many times bigger than the Pi) will be a big improvement.

1 Like