Enable realtime kernel

Hi,

I am trying to enable the realtime kernel but it returns error and I can not switch (not at the rpi atm and I forgot the error message). Is it know to work?
I had one fail when trying to switch kernel and the downloading timed out. After that my usb sound card went silent. After restarting jack and the rpi and such I got it to work again but it was not selectable/visible in the task bar icon. After more restarting of jack and the os it is now back and visible again.
Should I be in a specific boot mode when switching? I have been trying while using puredata module desktop environment.

I am not experienced with kernels so I am not sure where to start to look for the cause of error. As may be obvious. :confused:

Thankful for help.

I am using an RPI3 B+

What are the things/commands you are doing exactly? Patchbox OS comes with realtime kernel enabled already.

Terminal:

patchbox / kernel

Then it says:

You are using a normal kernel. Do you want to use the realtime one? Y/n

What version is displayed? I see this:

What is the output of:

apt list --installed | grep kernel

patch@patchbox:~ $ apt list --installed | grep kernel

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

raspberrypi-kernel-rt/rpi,now 1:2.20220510-1 armhf [installed]
patch@patchbox:~ $

You may have installed your current kernel through some non-apt method. Try doing this:

sudo apt install --reinstall raspberrypi-kernel-rt

it returns this (excerpt):

/.../

Adding 'diversion of /boot/overlays/wm8960-soundcard.dtbo to /usr/share/rpikerne
lhack/overlays/wm8960-soundcard.dtbo by rpikernelhack'
Unpacking raspberrypi-kernel-rt (1:2.20220510-1) over (1:2.20220510-1) ...
dpkg: error processing archive /var/cache/apt/archives/raspberrypi-kernel-rt_1%3
a2.20220510-1_armhf.deb (--unpack):
 unable to make backup link of './boot/kernel8.img' before installing new versio
n: Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.15.36-rt41+ /boot/ke
rnel.img
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.15.36-rt41-v7+ /boot
/kernel7.img
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.15.36-rt41-v7l+ /boo
t/kernel7l.img
Removing 'diversion of /boot/kernel.img to /usr/share/rpikernelhack/kernel.img b
y rpikernelhack'

/.../

run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.15.36-rt41-v7l+ /b
oot/kernel7l.img
Errors were encountered while processing:
 /var/cache/apt/archives/raspberrypi-kernel-rt_1%3a2.20220510-1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
patch@patchbox:~ $

What is the output of:

ls -la /boot

And:

df -h
patch@patchbox:~ $ ls -la /boot
total 50798
drwxr-xr-x  7 root root    6144 Jan  1  1970 .
drwxr-xr-x 22 root root    4096 May 31 13:35 ..
drwxr-xr-x  3 root root    3584 Jul 28 22:02 backup
-rwxr-xr-x  1 root root   28912 Aug  1 13:37 bcm2708-rpi-b.dtb
-rwxr-xr-x  1 root root   29231 Aug  1 13:37 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x  1 root root   28579 Aug  1 13:37 bcm2708-rpi-b-rev1.dtb
-rwxr-xr-x  1 root root   28655 Aug  1 13:37 bcm2708-rpi-cm.dtb
-rwxr-xr-x  1 root root   28537 Aug  1 13:37 bcm2708-rpi-zero.dtb
-rwxr-xr-x  1 root root   30408 Aug  1 13:37 bcm2708-rpi-zero-w.dtb
-rwxr-xr-x  1 root root   30879 Aug  1 13:37 bcm2709-rpi-2-b.dtb
-rwxr-xr-x  1 root root   30786 May 31 13:37 bcm2709-rpi-cm2.dtb
-rwxr-xr-x  1 root root   31028 Aug  1 13:37 bcm2710-rpi-2-b.dtb
-rwxr-xr-x  1 root root   33224 Aug  1 13:37 bcm2710-rpi-3-b.dtb
-rwxr-xr-x  1 root root   33851 Aug  1 13:37 bcm2710-rpi-3-b-plus.dtb
-rwxr-xr-x  1 root root   30923 Aug  1 13:37 bcm2710-rpi-cm3.dtb
-rwxr-xr-x  1 root root   32416 Aug  1 13:37 bcm2710-rpi-zero-2.dtb
-rwxr-xr-x  1 root root   32416 Aug  1 13:37 bcm2710-rpi-zero-2-w.dtb
-rwxr-xr-x  1 root root   54477 Aug  1 13:37 bcm2711-rpi-400.dtb
-rwxr-xr-x  1 root root   54388 Aug  1 13:37 bcm2711-rpi-4-b.dtb
-rwxr-xr-x  1 root root   54997 Aug  1 13:37 bcm2711-rpi-cm4.dtb
-rwxr-xr-x  1 root root   38182 May 31 13:37 bcm2711-rpi-cm4-io.dtb
-rwxr-xr-x  1 root root   51839 Aug  1 13:37 bcm2711-rpi-cm4s.dtb
-rwxr-xr-x  1 root root   18506 Aug  1 13:37 bcm2835-rpi-a.dtb
-rwxr-xr-x  1 root root   18630 Aug  1 13:37 bcm2835-rpi-a-plus.dtb
-rwxr-xr-x  1 root root   18652 Aug  1 13:37 bcm2835-rpi-b.dtb
-rwxr-xr-x  1 root root   18917 Aug  1 13:37 bcm2835-rpi-b-plus.dtb
-rwxr-xr-x  1 root root   18785 Aug  1 13:37 bcm2835-rpi-b-rev2.dtb
-rwxr-xr-x  1 root root   18767 Aug  1 13:37 bcm2835-rpi-cm1-io1.dtb
-rwxr-xr-x  1 root root   18578 Aug  1 13:37 bcm2835-rpi-zero.dtb
-rwxr-xr-x  1 root root   19021 Aug  1 13:37 bcm2835-rpi-zero-w.dtb
-rwxr-xr-x  1 root root   19909 Aug  1 13:37 bcm2836-rpi-2-b.dtb
-rwxr-xr-x  1 root root   20912 Aug  1 13:37 bcm2837-rpi-3-a-plus.dtb
-rwxr-xr-x  1 root root   21313 Aug  1 13:37 bcm2837-rpi-3-b.dtb
-rwxr-xr-x  1 root root   21781 Aug  1 13:37 bcm2837-rpi-3-b-plus.dtb
-rwxr-xr-x  1 root root   20636 Aug  1 13:37 bcm2837-rpi-cm3-io3.dtb
-rwxr-xr-x  1 root root   52476 May 31 13:37 bootcode.bin
-rwxr-xr-x  1 root root     103 Jan  1  1980 cmdline.txt
-rwxr-xr-x  1 root root    2073 May 31 13:30 config.txt
-rwxr-xr-x  1 root root   18693 Aug  1 13:37 COPYING.linux
-rwxr-xr-x  1 root root      41 May 31 13:39 .firmware_revision
-rwxr-xr-x  1 root root    3171 May 31 13:37 fixup4cd.dat
-rwxr-xr-x  1 root root    5397 May 31 13:37 fixup4.dat
-rwxr-xr-x  1 root root    8381 May 31 13:37 fixup4db.dat
-rwxr-xr-x  1 root root    8385 May 31 13:37 fixup4x.dat
-rwxr-xr-x  1 root root    3171 May 31 13:37 fixup_cd.dat
-rwxr-xr-x  1 root root    7266 May 31 13:37 fixup.dat
-rwxr-xr-x  1 root root   10230 May 31 13:37 fixup_db.dat
-rwxr-xr-x  1 root root   10228 May 31 13:37 fixup_x.dat
drwxr-xr-x  2 root root     512 Jul 31 17:34 .fseventsd
-rwxr-xr-x  1 root root     145 May 17  2022 issue.txt
-rwxr-xr-x  1 root root 6818136 Aug  1 13:37 kernel7.img
-rwxr-xr-x  1 root root 7231096 Aug  1 13:37 kernel7l.img
-rwxr-xr-x  1 root root 8226488 May 31 13:37 kernel8.img
-rwxr-xr-x  1 root root 6471272 Aug  1 13:37 kernel.img
-rwxr-xr-x  1 root root    1594 May 31 13:14 LICENCE.broadcom
drwxr-xr-x  2 root root   25088 Aug  1 13:38 overlays
drwxr-xr-x  4 root root     512 May 30 23:47 .Spotlight-V100
-rwxr-xr-x  1 root root  806492 May 31 13:37 start4cd.elf
-rwxr-xr-x  1 root root 3749544 May 31 13:37 start4db.elf
-rwxr-xr-x  1 root root 2253088 May 31 13:37 start4.elf
-rwxr-xr-x  1 root root 3000552 May 31 13:37 start4x.elf
-rwxr-xr-x  1 root root  806492 May 31 13:37 start_cd.elf
-rwxr-xr-x  1 root root 4821448 May 31 13:37 start_db.elf
-rwxr-xr-x  1 root root 2977280 May 31 13:37 start.elf
-rwxr-xr-x  1 root root 3724200 May 31 13:37 start_x.elf
-rwxr-xr-x  1 root root    4096 May 30 23:47 ._.Trashes
drwxr-xr-x  2 root root     512 May 30 23:47 .Trashes
patch@patchbox:~ $
 patch@patchbox:~ $ df -h
df: /run/user/1000/doc: Operation not permitted
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        29G  6.4G   22G  23% /
devtmpfs        333M     0  333M   0% /dev
tmpfs           461M  119M  342M  26% /dev/shm
tmpfs           185M  948K  184M   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
/dev/mmcblk0p1  253M   81M  172M  33% /boot
tmpfs            93M   32K   93M   1% /run/user/1000
patch@patchbox:~ $

Try renaming kernel8.img:

sudo mv /boot/kernel8.img /boot/kernel8.img.bak

And then try reinstalling again:

sudo apt install --reinstall raspberrypi-kernel-rt
1 Like

It worked, now it says real-time kernel. Thanks!