-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[native_sim] Zephyr 4.1 breaks GPIO_EMUL_SDL and INPUT_SDL_TOUCH #87519
Comments
Does it work with |
Can you bisect this? |
FYI @Finomnis |
Huh? I didn't change anything regarding the input, at least not that I know of... Very weird. I'm sadly very limited on time right now, would someone else mind dissecting that change in more detail to see which line exactly broke it? |
@PetervdPerk-NXP your code does not build for me:
Is this somehow reproducible with an intree-sample? EDIT:// Hmm looking at the resulting autoconf.h tho it seems like EDIT-2:// @PetervdPerk-NXP try adding |
|
@PetervdPerk-NXP would it be possible for you to strip down that project to a minimal reproducible example? Which demonstrates the problem and works if you revert said commit? So we can argue about it more focused? |
Kinda hard to do tbh, overall a simple fb with input sample is missing unfortunately. Btw I've narrowed it down to the line causing it.
Uncommenting this gives me input again. EDIT2: @faxe1008 if you could share the cmake output showcasing the GCC version that would help me fixing the compile error you're having. |
OK wtf :D if that is true then something very weird is going on. Do we cause undefined behavior somewhere? |
@PetervdPerk-NXP are you aware that the SDL driver is not multi threading capable? If you interact with the SDL driver from multiple threads, that might cause undefined behavior. Just checking, this is an open issue at the moment if I remember right. |
I do have 2 threads but that's working since like zephyr 3.6.0, however I'm running with I'm thinking it could be perf related thing, without |
So what happens if you |
Then I don't have a screen due to multiple threads, just a gray background frames don't get updated. Hacking my code to be single threaded I get a screen again and input works. But Cpu load skyrockets to 600% (multi-core) though. So my hypothesis, SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n, is just single threaded and the alpha blending introduced #81184 eats so much cpu thus blocking input events. |
Hmm. That sucks. I think the proper fix would be to finally tackle #71410. |
Also, why do you get such a high CPU load? I'm pretty sure SDL uses OpenGL if available, there should not be much CPU involved in the SDL draw calls. |
I mean we could add a kconfig option that disables transparency, that would be another "fix". But for your case it feels more like a workaround tbh. |
I'm okay keeping this open for now and linking to #71410 when that gets fixed this one would be fixed as well. Regarding cpu load, no clue maybe due to wsl2 that does opengl software rendering in the end. |
Is it on LVGL or on the zephyr threads? Not sure this changes anything in native_sim but the input thread has a very low priority by default, maybe try
|
@fabiobaltieri No lvgl involved here, to my understanding. |
Only SDK thread I see is the one in |
That's why I feel like it's a user thread priority problem. OP states that they have two threads, so I assume one for rendering and one for input. I suspect the rendering thread has a higher priority than the input thread. |
Well this the fun thing I don't have special input thread. Main thread samples input periodically and there's an input callback for touch. No clue how zephyr handles this, but again on native hardware this works fine. I think it's more related to the sdl implementation itself not forwarding input events. |
Thank you for the suggestion, just tried this but doesn't fix the input. |
So your main thread also renders the image and draws it on screen? You mention you have two threads, what does the other thread do? |
Describe the bug
I've got this application that runs natively on the NXP FRDM-MCXN947 but also has a native/posix/64 target.
https://github.com/NXPHoverGames/Doom-MCX
When upgrading from Zephyr 4.0.0 to Zephyr 4.1.0 the input (GPIO SDL emulation and SDL touch) for native/posix/64 is not working anymore.
To Reproduce
When modifying
west.yml
to point to Zephyr v4.0.08469084dfae85f854555f0607f2c838dad097235
Then input is working again
Impact
No SDL input on native_sim
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: