ddgg
Posts: 3
Joined: Wed Aug 28, 2019 10:57 am

real-time kernel on rpi 3b+ for audio application

Wed Aug 28, 2019 12:20 pm

hello everybody,

I've been reading the forum for a while and today I decided to post my first topic since I couldn't find proper answers on the web. I apologize for the length of the post, but please take it as a chance for me to understand some concepts and fulfil my curiosity...I'm just a musician :roll:

I'm setting up a rpi 3b+ (os: Raspbian buster) for live-audio application and I've been thinking about patching a rt-kernel. I found some useful guides on the web but I didn't manage to boot the pi with the new compiled kernel. I'd like to guide you into the compilation/installation process and then ask you some questions.

I followed both these guides:
https://lemariva.com/blog/2018/07/raspb ... nel-4-14-y
https://www.raspberrypi.org/documentati ... uilding.md

instead of compiling the 4.14.y-rt I downloaded the 4.19.y-rt (from here https://github.com/raspberrypi/linux/tr ... -rt/kernel)
I ran:

Code: Select all

make bcm2709_defconfig

to use a default configuration (...right?) and cross compiled it on a laptop running Debian (64bit) using the gcc-linaro-arm-linux-gnueabihf-raspbian-x64 compiler.

The compilation run smoothly but once all the files are in place the pi doesn't boot (let's say that I cannot connect via ssh nor I can find it on the newtork). Unfortunately I don't have a monitor.
A second attempt led me to compile directly on the pi. Same result.

Questions:
Well the most obvious one is: have I done something wrong? Is the pi actually booting and I simply can't find on the network?
I red that although the A53 implements the ARMv8 (64bit) since all the OS are 32bit the architecture appears to be the armv7l. Is it possible that the gcc compiler compiles for a different architecture? (btw. should the rt-kernel be compiled at 32or 64?)
Is in my case the bcm2709_defconfig the right choice? because the processor is actually a BCM2835...I was wondering if this is somehow linked to the armvX issue...

Anyhow: Would a 64 bit os be a better solution for real time audio in terms of performance on a A53? because in that case I would install a "generic" 64bit distro and download a rt kernel..would that work..?
thanks a lot!
Raspberry Pi 3 b+ | 4.19.66-v7+ | Raspbian GNU/Linux 10 (buster)

epoch1970
Posts: 3713
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: real-time kernel on rpi 3b+ for audio application

Wed Aug 28, 2019 3:30 pm

https://www.raspberrypi.org/forums/view ... 0&start=25
I’m not especially following the RT thread but 4.14 (and 32 bit of course) seems a safer choice.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

ddgg
Posts: 3
Joined: Wed Aug 28, 2019 10:57 am

Re: real-time kernel on rpi 3b+ for audio application

Thu Aug 29, 2019 11:51 am

thank you epoch
I saw that post...let's say that I was hoping for more recent news.
ok I'll stick to that.
BUT
something new came up:
using the realTimeConfigQuickScan (https://github.com/raboof/realtimeconfigquickscan) I realized that the rpi doesn't actually have an hardware real time clock (RTC) nor a High Precision Event Timer (HPET).
Does it make sense to compile a rt-kernel after all?
Raspberry Pi 3 b+ | 4.19.66-v7+ | Raspbian GNU/Linux 10 (buster)

epoch1970
Posts: 3713
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: real-time kernel on rpi 3b+ for audio application

Thu Aug 29, 2019 1:30 pm

Real time in computing means deterministic.
“After X ticks, this process is guaranteed to have finished with status 0 or 1” (and if it did not exit by then the processor itself is borked)
The tick in question is related to the CPU processing frequency, not to time of day.
PLCs you can to find on the factory floor are examples of fully deterministic, yet rather slow, machines.
Linux-RT is a set of patches to make the scheduling of running tasks more rigid. The rest of the OS, drivers, applications, is not RT in design.

Given that audio applications usually represent a light load on a dedicated machine, the applications and protocols use in general buffers of all kinds and have their own means of keeping in sync, and in accordance to every single test I have ever run on many platforms, I don’t believe running an RT kernel helps AQ in any way.
A very soft system, never running above 50% load and normally running at 25% max, works just better: I prefer an imperceptible wobble to a sharp break from time to time.

If you’re interested in keeping an accurate notion of time of day, see NTP (protocol) and ntpd or chrony (servers).
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

markkuk
Posts: 124
Joined: Thu Mar 22, 2018 1:02 pm
Location: Finland

Re: real-time kernel on rpi 3b+ for audio application

Fri Aug 30, 2019 8:45 am

ddgg wrote:
Thu Aug 29, 2019 11:51 am
I realized that the rpi doesn't actually have an hardware real time clock (RTC) nor a High Precision Event Timer (HPET).
RTC is used to keep track of the "wall-clock" time while the system is powered off. You can buy an add-on RTC like this: https://shop.pimoroni.com/products/adaf ... spberry-pi if you really want one. Despite its name RTC has nothing to do with real-time capabilities of an operating system.

HPET is specific to the x86 based PC architecture. The ARM SoCs used in the Raspberry Pi computers have equivalent timers, they just aren't called "HPET".

ddgg
Posts: 3
Joined: Wed Aug 28, 2019 10:57 am

Re: real-time kernel on rpi 3b+ for audio application

Fri Aug 30, 2019 2:40 pm

I thank you both very much for the explanations!
Raspberry Pi 3 b+ | 4.19.66-v7+ | Raspbian GNU/Linux 10 (buster)

Return to “Advanced users”