fps
Posts: 6
Joined: Fri Sep 14, 2012 7:39 am

rt-preempt kernel for raspberry pi 4 [raspbian buster] including usb-lowlatency patch

Thu Sep 05, 2019 8:42 pm

Hi,

i built a kernel for the rpi4 on raspbian buster that includes the rt-preempt patches [1] (setup as fully preemptible) and the usb lowlatency patch [2]. You can find it here:

http://fps.io/raspberrypi4-linux-4.19.6 ... ncy.tar.gz

I hope I included all the nessecary things. This was my tar command for gathering the parts of the installed kernel:

sudo tar czvf linux-4.19.65-rt24-v7l+-usb-lowlatency.tar.gz lib/modules/4.19.65-rt24-v7l+/ boot/*.dtb /boot/overlays/ /boot/kernel7l.img

To install it you should be able to just change to the root directory of your filesystem and just untar it:

cd /
sudo tar xzf raspberrypi4-linux-4.19.65-rt24-v7l+-usb-lowlatency.tar.gz

and then reboot [possibly you need to run a depmod, not sure].

With this kernel I am running a Focusrite 2i2 (a usb 2.0 class audio device) succesfully with zero x-runs for the last couple of hours with a period size of 64 frames at 48khz sampling rate on a tuned system [3] and running a guitar effects patch in mod-host.

[1] https://mirrors.edge.kernel.org/pub/lin ... 4.patch.xz
[2] https://aur.archlinux.org/cgit/aur.git/ ... tency-dkms
[3] using the rtirq package with:

RTIRQ_NAME_LIST="snd usb i8042"
RTIRQ_PRIO_HIGH=90
RTIRQ_PRIO_DECR=5
RTIRQ_RESET_ALL=0
RTIRQ_NON_THREADED="rtc snd"

in /etc/defaults/rtirq to setup the prioritoes. jackd is running at prio 80. I hope this is useful for any other people that finally get to use a raspberry pi4 as realtime audio effects processor using a USB sound card..
Last edited by fps on Thu Sep 05, 2019 8:47 pm, edited 3 times in total.

fps
Posts: 6
Joined: Fri Sep 14, 2012 7:39 am

Re: A full rt-preempt kernel for raspberry pi 4 [raspbian buster] including usb-lowlatency patch

Thu Sep 05, 2019 8:44 pm

Oh, I should add that I give big shoutouts and thank yous to Robin Gareus (rgareus) and Filipe Coelho (FalkTX) from the linux audio developer's channel #lad on irc.freenode.net. They helped a lot!

cimd
Posts: 1
Joined: Fri Nov 22, 2019 11:04 pm

Re: rt-preempt kernel for raspberry pi 4 [raspbian buster] including usb-lowlatency patch

Fri Nov 22, 2019 11:06 pm

Hi,
Thanks for this patch. I have successfully installed it on a Rpi4 2G. How do I install the RTIRQ package though?

naamir
Posts: 1
Joined: Fri Nov 29, 2019 8:22 am

Re: rt-preempt kernel for raspberry pi 4 [raspbian buster] including usb-lowlatency patch

Fri Nov 29, 2019 8:36 am

Hello,

I am trying to find the patched RT version for the latest linux kernel 4.19.75 being used by raspbian. Could you please provide any guidance in how you did that in your case?

I was able to find the HowTO https://wiki.linuxfoundation.org/realti ... ptrt_setup but the listed kernels supported don't list 4.19.75 and the closest is patches-4.19.72-rt26.tar.xz.

Are there any more resources for this?

Thank you for the help in advance.

fps
Posts: 6
Joined: Fri Sep 14, 2012 7:39 am

Re: rt-preempt kernel for raspberry pi 4 [raspbian buster] including usb-lowlatency patch

Fri Nov 29, 2019 12:49 pm

You can always try applying a "very close" RT-preempt patchset. If you check my original post you might notice that the versions of the kernel and the RT-preempt patchset are different.

Using "patch --dry-run" is very helpful to see if a patch applies without errors before doing it for real..

fps
Posts: 6
Joined: Fri Sep 14, 2012 7:39 am

Re: rt-preempt kernel for raspberry pi 4 [raspbian buster] including usb-lowlatency patch

Fri Nov 29, 2019 12:52 pm

About installing rtirq: try

apt-cache search rtirq

And if my memory serves correctly the installation is just:

apt-get install rtirq

Then head over to /etc/defaults/rtirq

or something similar (I'm not at a linux computer right now) and change the settings...

Finally

systemctl enable rtirq
systemctl start rtirq

and you should be set..

Avio
Posts: 2
Joined: Sun Jul 28, 2013 4:11 pm

Re: rt-preempt kernel for raspberry pi 4 [raspbian buster] including usb-lowlatency patch

Sun Dec 01, 2019 9:33 am

fps wrote:
Thu Sep 05, 2019 8:42 pm
Hi,

i built a kernel for the rpi4 on raspbian buster that includes the rt-preempt patches [1] (setup as fully preemptible) and the usb lowlatency patch [2]. You can find it here:

http://fps.io/raspberrypi4-linux-4.19.6 ... ncy.tar.gz

I hope I included all the nessecary things. This was my tar command for gathering the parts of the installed kernel:

sudo tar czvf linux-4.19.65-rt24-v7l+-usb-lowlatency.tar.gz lib/modules/4.19.65-rt24-v7l+/ boot/*.dtb /boot/overlays/ /boot/kernel7l.img

To install it you should be able to just change to the root directory of your filesystem and just untar it:

cd /
sudo tar xzf raspberrypi4-linux-4.19.65-rt24-v7l+-usb-lowlatency.tar.gz

and then reboot [possibly you need to run a depmod, not sure].

With this kernel I am running a Focusrite 2i2 (a usb 2.0 class audio device) succesfully with zero x-runs for the last couple of hours with a period size of 64 frames at 48khz sampling rate on a tuned system [3] and running a guitar effects patch in mod-host.

[1] https://mirrors.edge.kernel.org/pub/lin ... 4.patch.xz
[2] https://aur.archlinux.org/cgit/aur.git/ ... tency-dkms
[3] using the rtirq package with:

RTIRQ_NAME_LIST="snd usb i8042"
RTIRQ_PRIO_HIGH=90
RTIRQ_PRIO_DECR=5
RTIRQ_RESET_ALL=0
RTIRQ_NON_THREADED="rtc snd"

in /etc/defaults/rtirq to setup the prioritoes. jackd is running at prio 80. I hope this is useful for any other people that finally get to use a raspberry pi4 as realtime audio effects processor using a USB sound card..
Nice feat, I'd like to try it but fps.io is down ATM. Could you share a copy on Google Drive or whatever cloud storage service you prefer, or even make it "semi-permanent" sharing it via torrent? Thanks!

fps
Posts: 6
Joined: Fri Sep 14, 2012 7:39 am

Re: rt-preempt kernel for raspberry pi 4 [raspbian buster] including usb-lowlatency patch

Wed Dec 04, 2019 8:38 am

Hi, the link should be working again..

Return to “Linux Kernel”