Latency spike on special button (lenovo T530)

More
06 Aug 2023 11:58 #277104 by mwidlok
Hello,
I'm tuning lenovo T530 notebook for lowest possible latency and got rather interesting results. The system is gentoo with locally compiled linux-6.1.33-rt11 kernel from gentoo repositories with isolcpus=3. Bios was extensively modified with "1vyrain" jailbreak, disabled ME, hyperthreading, virtualization and turbo mode.
During normal usage (opengl, kicad, firefox, solvespace, compilation) latency is down to ~7us with 100us base thread (computer will be used with mesa card, no base thread), but it sometimes jumps to ~100/200us when I press any of lenovo "special buttons": thinkvatage, volume +/-, or mute. In theory I can just not press these buttons while running linuxcnc, but wonder if anyone has similar issues. Is this embedded controller issue? Do You have any idea to fix this?
Thanks, Michael Widlok

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

More
06 Aug 2023 12:58 #277108 by tommylight
Those are BIOS controlled buttons, so nothing in software will help.
Short of making a custom firmware with whatever might change that behaviour, i do not think it can be fixed. Most probably even that will not help, if all of those call reads from EEPROM, they are slow, usually.
Having said that, did you try to change the setting for FN key where it changes the F button function?
The following user(s) said Thank You: seuchato, mwidlok

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

More
06 Aug 2023 14:41 #277113 by PCW
Also as long as you do not suffer real time errors or Ethernet timeouts the latency is largely irrelevant.
The following user(s) said Thank You: seuchato, tommylight

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

More
07 Aug 2023 13:44 #277238 by mwidlok
Thank You for replays.
I've already modified the laptop a bit, but working on EC firmware is out of my reach. Anyway I don't think that we can do anything to fix this.
I am also not sure if there is any way to change handling of FN-keys - in gentoo these are handled as normal keys (tested in xev) or as acpid events. Both ways works in user space. The only kernel option that might has something to do with the FN key is "Thinkpad extracts", but I would like to leave that ON, to keep monitoring, fan, battery working. For now I will just not press FN while linuxcnc is running :-).

PCW: Mesa works beautifully in this setup, even on USB->Etherent interface with 1ms base thread, maybe I will reduce it to 1.5ms (my Emco is very slow, entry-level machine, mostly for learning). I've just wanted to test how far I can push this old laptop (and it exceeds my expectations I must say).
The following user(s) said Thank You: tommylight

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

More
13 Aug 2023 21:07 #277873 by seuchato

Also as long as you do not suffer real time errors or Ethernet timeouts the latency is largely irrelevant.
 

PCW
sure, and I do no want to come over disrespectful, rather :
  • "as you do not suffer real time errors", no problem,
    agreed
  • no " Ethernet timeouts "
    agreed
  • "Also as long as you do not ... latency is largely irrelevant."
    Okidoki and what if I do get real time errors and/or Ethernet timeouts?


@ mwidlok allow me a remark regarding laptops:
  • T530: If it is to control a small 3d-Printer or some smallish router that you want to cut a few parts with: might be OK, but
  • There has not been ONE SINGLE Laptop that I had under my fingers so far (believe me, there were many, really many, from consumer to business to pro cad workstations, including recent models like Lenovo P15 G1 and G2 - just to name a few), I would have wanted to do serious cnc controlling with. I found all of them just too unreliable!
    In my tests, ALL/some would:
    • show real time errors
    • have Ethernet timeouts
    • erratically pause
    • erratically show some weird errors like in one case stop spindle while still moving the cutter head!
  • Imho: Laptops are designed to be energy efficient - good for the intended purpose. Machine controllers should be designed for reliability. We run LCNC to control a (ehem) few dollars worth machines, that run (partially) multi kW spindles, cutting parts that are (ehem) sometimes quite some dollars worth. So, what I want: A totally reliable controller dot period. I know: that's a tempt for perfection, and nothing man made is. But laptops - including the many years used by myself and appreciated T530 - juuuust do not fit in this category.
  • In short: forget about laptops as of to date: 2023.08.13.        sorry

Greez
chris

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

More
13 Aug 2023 21:39 #277878 by tommylight
I have always refrained from advising laptops for machine control, despite having several that are really good, including the one i am typing this on, a Lenovo T470 with i5 6300U and touchscreen, a Lenovo Yoga Y700 with i5 6300Q, a Lenovo 14 G3 with Ryzen 5 5500U, a Fujitsu with i5 something, an old Acer, etc etc.
The Acer was very good and ran a machine for months without a single issue, so i found another one, same model, same everything, and had terrible latency, utterly useless.
T470 will drop the link to Mesa when switching to/from batteries.
Y700 and 14 G3 never dropped the link for the short amount of time i tested.
Fujitsu had the screen broken while it was running a machine daily for several months.
Acer plays music in the shop and is on always, and used for testing on occasions
None are used to run machines.

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

More
16 Aug 2023 15:30 #278176 by mwidlok
I totally agree Yours comments about laptops, however I am clearly fall into entry level / learning machining. I don't mind if loose a part (once in a year/month?) and I don't think that improper control can damage my machine anyway (to small and to slow steppers). This is old emco PC with a few home-made modifications and 300mm/min max speed, that You can carry yourself form desk to desk - how this compares to seuchato machines :-)?
Maybe when I finally learn something more about CNC machining I will re-think these assumptions.

Some more free comments about laptops and T530:
- I also detected latency spike whenever I am connecting / disconnecting power supply, most likely from the same source as FN-keys. It all points EC for now.
- It is quite sensitive to BIOS settings (hyper-threading mostly).
- I think that 1vyrain mod (jailbreak) and possibility to switch OFF intel ME, and tune some more "factory" settings also helped a bit.
- I use my own RT kernel compiled specially for this laptop + linux compiled with CFLAGS specific to a processor.

- I really tired to cause some real failure with 1.5ms servo thread and Mesa on USB->ethernet converter - no "luck" for now. Biggest noticed spike is ~300us, and no connections problems. Of curse do not take this as recommendation - these are just mine tests on specific setup.
The following user(s) said Thank You: tommylight

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

Time to create page: 0.075 seconds
Powered by Kunena Forum