Jump to content

Realtime kernel for orange pi 5


Kenny

Recommended Posts

Hey folks, im trying to compile a realtime kernel for mt orange pi 5.

I plan to use it for djing.

A fully preemptive kernel delivers better performance for this, as less xruns appear.

I am following the official dev instructions and am using the docker method, Compiling only the kernel, not the entire armbian OS.

I copied a realtime patch (actually I tried several sub versions of 5.10) from the kernel.org realtime project site into the userpatches directory (I looked up the correct orange pi 5 subfolder name but forgot it rn) but compiling throws me some errors. 
 

Has anyone succeeded in creating a kernel like this for the orange pi 5 and/or could give me any advice for doing so?

 

I actually dont care much about the kernel version, I just need it to be fully preemptive ..

 

Help is much apprecieated!

 

Kenny

Link to comment
Share on other sites

Yes I've compiled a few rt kernels and it does work pretty well. To use the legacy kernel you really don't want to patch it yourself, some parts are patched many versions ahead and some parts are left behind. But there luckily is an already by Rockchip rt patched kernel. You only need to use the right config and add the dtb to make it work. I've made a patch for it so you could make your own, a bit messy but works very well (at least for LinuxCNC).

https://mega.nz/folder/zhwVyJBK#iWqElAfYL21Rn08PmB55DA

 

You want to use it for music? DJ-ing? It depends on what you exactly need for that, the 5.10.x kernel has a lot of issues with usb audio interfaces, this seems to be fixed since 5.15 or 5.16, my Motu M4 is unusable with it but you could try yours.

If you want to use USB audio interface as input and output I recommend to use a newer kernel version, the rt patches over the 6.2 kernel from balbes150 his github did compile without problems, compare the kernel config with the 5.10.x rt kernel but keep the pancsf module. The 6.2 kernel I didn't upload but should have it somewhere laying around.

 

The armbian build system has issues with local versions, the rt patches adds that so you'll need to remove that.

 

Results with the 5.10.x kernel:

https://forum.linuxcnc.org/18-computer/48079-can-the-opi5-be-configured-to-run-lcnc?start=170#271679

 

 

Link to comment
Share on other sites

1 час назад, royk сказал:

Results with the 5.10.x kernel:

Hi. I'll try to clarify. Did you get this result by applying using remote desktop (VNC)?

 

What will be the result if you connect HDMI and the XFCE desktop is installed?

Link to comment
Share on other sites

@going TBH I don't know how he did test it, I assumed he connected a monitor via HDMI. I've never tested it with 4 cores isolated because isolating core 5 and 7 is good enough.

 

This is the result of a test I did with Wayland and xwayland and isolcpus=5,7 (connected with HDMI)

https://forum.linuxcnc.org/18-computer/48079-can-the-opi5-be-configured-to-run-lcnc?start=40#268426

 

With XFCE It shall be around the same but the graphics acceleration will be worse.

Without isolating cpus the latency will be around 20 uS

 

With the 6.2 kernel I've tried with XFCE, it worked well, but its hw support is still in progress:

https://forum.linuxcnc.org/18-computer/48079-can-the-opi5-be-configured-to-run-lcnc?start=120#270027

 

 

A bit off-topic but read someone from this forum was busy creating a rt-kernel for a s922 sbc,  the s9xx kernel did also work fine for a s912 tv-box (connected with HDMI):

https://forum.linuxcnc.org/18-computer/39371-results-of-latency-test-list-of-computers-tested-for-use-with-linuxcnc?start=330#270625

Edited by royk
Link to comment
Share on other sites

@royk I already realized that this is not your snapshot of the test. I am reading this post listed in the link.

 

Rod wrote about my repository.

This is currently in development and not finished.
In the final version, this branch will collect an image with a real-time kernel and linuxcnc + a certain number of libraries and settings necessary for work. All in one build system.
When I am ready, I will join your company on the linuxcnc forum.

 

1 час назад, royk сказал:

It looks like the truth.

Link to comment
Share on other sites

I know this post is a couple months old and on the OPI5 it says it detects the SD card and all other drivers fine but it doesnt see the system partition or a kernal (if its not already installed...?) But when i try to install it via Etcher (BelenaEtcher as recommended) it says that a file doesnt match the file required to install, what file am i missing? And how do i build it?

Link to comment
Share on other sites

@ichigonitro The easiest way will be to install the kernel deb package on a working system. Here is the latest build which work still perfectly for months with LinuxCNC. With this build I made a patch from the difference of the RT branch and rk3588 branch till the date of the latest change on the rt branch. Applied that patch to the kernel source of Xunlong (didn't work with the more updated kernels).

https://mega.nz/folder/znBVHJ4Z#69huCvInrf3tqc8I4QR-lQ

 

I don't know for what you'll use it for, but LinuxCNC seems to run best with the kernel arg: isolcpus=5,7

And had to move the ethernet irqs with the use of an ethernet controller. cat /proc/interrupts to see the irqs, then add to /etc/rc.local before 'exit 0' :

 

sleep 10 && echo 20 | tee /proc/irq/82/smp_affinity && echo 20 | tee /proc/irq/81/smp_affinity

 

20= cpu5.  cpu number binary: 00100000 (first number=cpu7 and last number= cpu0) to hex.

81 and 82 are the irq numbers of the device moved to the isolated core. 

 

You can build it yourself too if you want to with the config/patch in the zip, but you'll need to change some of the (folder) names. rk35xx

armbian-build-rt (2).zip

Edited by royk
Link to comment
Share on other sites

@johnwoo1999 I'm not an expert, and I don't know what you've already tried. But I've just been experimenting a lot until the results were good. On the GitHub of Rockchip there is a 5.10-rt53 branch which is the one with the RT patches included and a working rt config:

https://github.com/rockchip-linux/kernel/tree/develop-5.10-rt53

 

But because that branch hasn't been updated since august 2022, I made a patch out of the diff of the rt branch and develop-5.10 branch till the same date. This resulted in a RT patch set. The patch is applicable to the 5.10.110 kernel, so I used the kernel source of Xunlong for it.  So to build it with Armbian you'll need to edit the source and place the config and patch in the right directory. In the Armbian build system a few folder/file names have been changed in the meantime so you'll need to edit these accordingly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines