Screen freezing

87 views
Skip to first unread message

gorskijoza

unread,
May 31, 2021, 6:48:34 AM5/31/21
to Kivy users support
Dear all,

I have an issue - the screen freezes without any warning after using the application for a while (background processes and background communication are working fine). There is no error on the console; none of the cores is drastically occupied; even if I doubled graphical memory (to 354 MB) screen freezes after time; more than half of the memory is free, ...

About my application:
- running on RPI 3B
- display: original 7'' Touchscreen Display
- kivy  + python 2.7
In general, there are five grids (each of them represent one menu) that are loaded at the start, but only one is used simultaneously. You can switch among them and so on. On each square on this grid is max 5 labels (numbers and text) which are changing when a new value appears; otherwise, they stay the same (except one number square-id which are shaded (black-white-black) whenever it is called.

What can be a reason for this behaviour? 

I tried a lot of things in the code, but without any success. Since there are no errors in the console and no other indicator of what is happening (code in the background is working without interruption), I am without any idea. Is it exist any diagnostics tool to check any other perspective of this issue?  Can be this connected with kivy?
Is it possible that voltage 'peak' (short down) causes that screen to freeze?

Thank you for your answer in advance.

Best wishes,
Tomaz

Elliot Garbus

unread,
May 31, 2021, 10:25:37 AM5/31/21
to kivy-...@googlegroups.com

It is certainly possible that there is a hardware or power issue.  Is the freeze temporary or does it require a reboot to resolve?

 

Considering software options, here are a few ideas:

You mentioned there are some background processes and communications?  Is this part of the kivy application?  If so I would start by looking for possible race or lock up conditions.  Are you using threading or multiprocessing?  If so, pay close attention the communication between threads or processes.  If you don’t start the background process, do you get a lock up?

 

Try using a software profiler and see if you get any clue to what is going on.  See: https://kivy.org/doc/stable/api-kivy.app.html#profiling-with-on-start-and-on-stop

 

Use the logger, https://kivy.org/doc/stable/api-kivy.logger.html?highlight=logger#module-kivy.logger

Add logging statements to track to progress of the app. Start with on_enter/on_leave events for the screens.

 

Are you creating the same widgets more than once without removing them?

Any information in the log?

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/41f353c5-9514-4478-bee1-9a8c0f782cefn%40googlegroups.com.

 

gorskijoza

unread,
Jun 2, 2021, 12:59:27 AM6/2/21
to Kivy users support
Dear Elliot,

Thank you for your response. 

1) When it freezes, a reboot is needed to resolve the issue (it is not temporary). 
2) The whole thing goes something like this; I have a baseboard (self-developed) that interpret some parameters from the neighbour and then, through a serial port, send information to RPi (serial communication). This information is then collected, recalculated, etc., in python and then 'send' to Kivy to show it. So the answer is yes; I use threading and multiprocessing.  
I will first try your suggestions, and then I will see if I will find anything. 
Widgets should not be created more than once, but I will check once again.
But the things became worse when I add additional libraries and functions for WiFi support. Can be any connection here?

Best wishes.

ponedeljek, 31. maj 2021 ob 16:25:37 UTC+2 je oseba ElliotG napisala:

Elliot Garbus

unread,
Jun 2, 2021, 1:05:39 AM6/2/21
to kivy-...@googlegroups.com

But the things became worse when I add additional libraries and functions for WiFi support. Can be any connection here?

 

Are you using a Clock.schedule_interval() to pull data and display it?  If so try using a longer interval.

Robert

unread,
Jun 2, 2021, 1:36:15 AM6/2/21
to Kivy users support
>> -kivy  + python 2.7
Don't know if it is relevant but Kivy is not longer available to operate with Python 2.7. At a minimum expect the unexpected.

gorskijoza

unread,
Jun 16, 2021, 3:07:36 AM6/16/21
to Kivy users support
Thanks for suggestions. If I change the time interval is the same. I am trying to figure out what is happening with graphic when this failure happen. I do not like the information alloc_fails. Is it here any connection with freezing screen?

sreda, 02. junij 2021 ob 07:36:15 UTC+2 je oseba Robert napisala:
failure.PNG

Elliot Garbus

unread,
Jun 16, 2021, 8:42:06 AM6/16/21
to kivy-...@googlegroups.com

I’m not a raspberry Pi user.  The alloc_fails suggests you are running out of memory.  Have you tried increasing the amount of memory allocated to the graphics (vs the CPU)?

Reply all
Reply to author
Forward
0 new messages