Hello.
I have opengl app (using openframeworks).
I try to solve the situation when my program receive SIGSEGV (or for debug purpose I send him SIGSEGV signal) the program do not free dispmanx layer (resource) and last state of this dispmanx layer is still present on display. When I run program again the old dispmanx layer is still present and new dispmanx layer is created. Is there any way how I can remove, delete the old unused dispmanx layer/resource ?
For list of active dispmanx layers i use command "vcgencmd dispmanx_list"
Re: How to free unused dispmanx layer (in case of SIGSEGV)
Trap the SIG, do the dispmanx deallocation in the handler?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
-
- Posts: 1009
- Joined: Mon Oct 31, 2016 10:05 am
Re: How to free unused dispmanx layer (in case of SIGSEGV)
Well, yes, but i assume the question is more: How do i do this after the fact? I.e., what if it has already happened?
Also:
Code: Select all
$ vcgencmd dispmanx_list
error=1 error_msg="Command not registered"
$
If this post appears in the wrong forums category, my apologies.
Re: How to free unused dispmanx layer (in case of SIGSEGV)
Nothing possible 'after it has happened' I suspect, without updated firmware. Big red switch time.But will double check with the dispmanx experts.Martin Frezman wrote: ↑Thu Sep 07, 2017 11:56 amWell, yes, but i assume the question is more: How do i do this after the fact? I.e., what if it has already happened?
Also:
Code: Select all
$ vcgencmd dispmanx_list error=1 error_msg="Command not registered" $
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
-
- Posts: 92
- Joined: Fri Jan 10, 2014 8:31 am
Re: How to free unused dispmanx layer (in case of SIGSEGV)
AFAIK there is no documented way for a process to get the handle to a dispmanx layer of another process, so you can't free it after the leak.
Though I never tried to store the dispmanx handles somewhere (maybe on the filesystem) and let another process pick them up and do the calls to free them. From a process separation point of view dispmanx should not allow such thing, although it should automatically clean the garbage when the process dies...
Though I never tried to store the dispmanx handles somewhere (maybe on the filesystem) and let another process pick them up and do the calls to free them. From a process separation point of view dispmanx should not allow such thing, although it should automatically clean the garbage when the process dies...

-
- Posts: 1009
- Joined: Mon Oct 31, 2016 10:05 am
Re: How to free unused dispmanx layer (in case of SIGSEGV)
This sounds like a good exercise for the OP - given that he has, in his possession, a program that can crash, leaving a layer still visible. It sounds like he has most of what he needs at his fingertips.Though I never tried to store the dispmanx handles somewhere (maybe on the filesystem) and let another process pick them up and do the calls to free them.
All you need to do is add code to write out the handle to a file before the crash.
If this post appears in the wrong forums category, my apologies.
Re: How to free unused dispmanx layer (in case of SIGSEGV)
Are you sure the process has actually died? If you check for it with "ps aux | grep <procname>" is it still alive?last state of this dispmanx layer is still present on display
It sounds like a pretty bad driver bug if somehow the OS lets resources stay allocated after a process goes away.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 10589
- Joined: Wed Dec 04, 2013 11:27 am
- Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
Re: How to free unused dispmanx layer (in case of SIGSEGV)
Checking the firmware source there is handling for the VCHIQ service closing, and it does free up all resources.
As a quick test, taking hello_dispmanx and inserting a div0 before the sleep, the overlay comes up, and is then cleared up as the app. It is going through that VCHIQ service closing handler.
"vcgencmd dispmanx_list" was added to the firmware in September 2015. Are you running very old firmware? What does "vcgencmd version" report?
"vcgencmd commands" will list all the available commands that are registered.
As a quick test, taking hello_dispmanx and inserting a div0 before the sleep, the overlay comes up, and is then cleared up as the app. It is going through that VCHIQ service closing handler.
"vcgencmd dispmanx_list" was added to the firmware in September 2015. Are you running very old firmware? What does "vcgencmd version" report?
"vcgencmd commands" will list all the available commands that are registered.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.