Latency problem after upgrading to Trixie

More
04 Sep 2026 08:02 - 04 Sep 2026 08:04 #349303 by aaron
Hi
After many happy years on Bookworm LinuxCNC I have upgraded to Trixie. I ended up installing Debian OS and then installing LCNC ( I could not get the download from LCNC website to work).  Anyway, I have the machine running again, but as soon as I start the program, I get the dreaded latency error message.  I have turned off everything that is not needed in the bios, but still get the message. I understand there are ways to manipulate how the cores work in the computer.  Can someone point me to some step-by-step instructions?
Thanks
Last edit: 04 Sep 2026 08:04 by aaron.

Please Log in or Create an account to join the conversation.

More
04 Sep 2026 08:44 #349304 by tuxcnc
Replied by tuxcnc on topic Latency problem after upgrading to Trixie
I assume you have installed the RT kernel...
As for the error message that appears immediately after starting LinuxCNC, I have been blocking it for a long time (I always compile LinuxCNC myself).
I suspect that the cause of this error is the procedure for checking it.
I reported it once, but no one was interested.
Anyway, the message was almost always displayed, but latency-test or latency-plot didn't show anything alarming...

Please Log in or Create an account to join the conversation.

More
04 Sep 2026 09:23 - 04 Sep 2026 09:26 #349306 by rodw
Its nothing to do with building LinuxCNC. As time goes on, the hardware manufactuters add more power saving features which induce latency so it takes more work to get it under control. Trixie is no worse than Bookworm. The biggest issue is not using the dkms drivers with realtek NIC's. Try to always use Intel NIC's. I've covered this and other steps in a few videos over the last 12 months or so on my YouTube channel.
Last edit: 04 Sep 2026 09:26 by rodw.

Please Log in or Create an account to join the conversation.

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
04 Sep 2026 09:38 #349307 by tommylight
Replied by tommylight on topic Latency problem after upgrading to Trixie

The biggest issue is not using the dkms drivers with realtek NIC's. Try to always use Intel NIC's.

Those will cause the "error finishing read", not latency error, so for now do not bother with it, see here:
forum.linuxcnc.org/38-general-linuxcnc-q...ead-and-irq-affinity

Please Log in or Create an account to join the conversation.

More
04 Sep 2026 09:55 #349310 by tuxcnc
Replied by tuxcnc on topic Latency problem after upgrading to Trixie
Once again.
Many times I had the problem with the "Unexpected realtime delay on task" message, which meant nothing and only annoyed the user because neither latency-test nor latency-plot showed anything wrong.
This has nothing to do with compiling LinuxCNC yourself, except that compiling it yourself allows you to disable this message.
As for the message itself, I suspect that either the procedure displaying it is bad, or it is called at the wrong moment (LinuxCNC starts and maybe something jams, but only then and only once).

Please Log in or Create an account to join the conversation.

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
04 Sep 2026 10:06 #349311 by tommylight
Replied by tommylight on topic Latency problem after upgrading to Trixie

.... or it is called at the wrong moment (LinuxCNC starts and maybe something jams, but only then and only once).

Usually the call to OpenGL subsystem used by Gremlin will do this, more often with NVIDIA graphic cards and some integrated Intel ones.
Despite bumping into this occasionally, i could never invest more time in finding the exact issue is/was.
Gremlin is the tool path preview used on some LinuxCNC GUI's

Please Log in or Create an account to join the conversation.

More
04 Sep 2026 10:16 #349313 by rodw
"Unexpected realtime delay on task" means that linuxcnc did not get everything done in the allotted 1ms time of the servo thread. This is nothing to do with the LinuxCNC application.

In kernel traces I did a long time ago on an i5 machine with Bookworm, Linuxcnc typically took 200 us to execute the servo thread and sleeps for the remaining 800 us. That 800 us is the safety buffer for real time tasks. Sometimes there is a Linux task that consumes a lot of the  CPU time which impacts on the servo thread and LinuxCNC does not have enough time to get everything done in time. Then the system reports the realtime delay and generally disables linuxcnc (so long since I have experienced this myself I can't remember). There are many possible tasks that can cause this.

One new source I found this week is that if the wifi has poor signal strength, a NetworkManager task fires looking for any stronger wifi signals every 30 seconds or so and causes a latency spike every 34-36 seconds. Because CNC machines are not generally wandering the aisles of a corpporate workspace, its a no brainer (and safe)  to disable this service. Linux obligingly provides an obscure process to do that.... Don't ask me what it is, I've forgotten already.

Please Log in or Create an account to join the conversation.

More
04 Sep 2026 10:43 #349314 by tuxcnc
Replied by tuxcnc on topic Latency problem after upgrading to Trixie
void RtapiApp::unexpected_realtime_delay(rtapi_task *task, int nperiod) {
    static int printed = 0;
    if(!printed)
    {
        rtapi_print_msg(RTAPI_MSG_ERR,
                "Unexpected realtime delay on task %d with period %ld\n"
                "This Message will only display once per session.\n"
                "Run the Latency Test and resolve before continuing.\n",
                task->id, task->period);
        printed = 1;
    }
}
The code above displays message only once.
This may mean either a serious problem or a one-off event with no impact on further work.
This, in turn, means that this message says nothing, warns against nothing and is unnecessary.
The right thing to do is to run latency-test or latency-plot for a few hours immediately after installation, which will clearly answer the question whether the hardware and software can be used safely.

Please Log in or Create an account to join the conversation.

More
04 Sep 2026 11:06 #349315 by rodw
Where is it called from and what does the code around it do? send a URL into github
I don't think it can simply be  ignored.

Please Log in or Create an account to join the conversation.

Time to create page: 0.265 seconds
Powered by Kunena Forum