marsinstituteSC / MissionControl

Mission Control Center Application for MISC's Mars Rover, Viking III
GNU General Public License v3.0
2 stars 1 forks source link

Applying settings is slow! #13

Closed BerntA closed 5 years ago

BerntA commented 5 years ago

I think the onSettingsChanged @ the camera window is too expensive at the moment, settings window hangs for a few sec when applying no changes.

Segath commented 5 years ago

The only hanging I can see is when there is a change in settings while a video is playing. Noticed no hanging in settings window both when there were no changes and some changes was made.

Ran some profiling on the onSettingsChanged methods in camera window, but noticed no immediate problems with time, almost every operation was so fast that it didn't register the time. The only exception is on startup there were one 0.03 second operation.

BerntA commented 5 years ago

You probably got a better CPU than me.. :D It seems to only hang when there are many camera windows, we should see how slow it is on the control station PC..

Also, if you delete the .ini file, the default has no cameras, you got to set up everything yourself @settings window, is it intentional? Also, if I set a new name for some camera and apply it crashes, somehow it tries to read port0/color0 etc..

Segath commented 5 years ago

The default settings file has been changed, forgot to change it. The crash with setting a new name has been fixed, it was caused by the repopulation of the combobox activating the signal to change video. populateComboBox -> currentIndexChanged -> any changeVideo. Will push the changes soon.

Segath commented 5 years ago

Applying settings is happening on the main thread of the program, are you doing changes while running something else except video, for example the udp connection and server?

BerntA commented 5 years ago

Cheers! It hangs if I for ex run all 4 video windows, reconnect a few times, then open settings and apply. Without running udp connection server script. If I run the udp conn stuff it doesn't make anything worse at least.. It actually still hangs after I close the camera window, maybe it is a memory issue? Not cleaning up properly when the video(s) are done? Even the log viewer is much slower at this point, if I restart the app, it runs smooth again. wut

Segath commented 5 years ago

Ok... Thank you for reminding me about doing something when there are no more frames to view, added a handler for that, but this may cause problems with the livestreamed camera. Will test this later with the ip camera in my house. The handler now checks if there are no more frames and stops the loop and releases the capture. Running all four video captures does slow down my computer, but this may be a problem with it reading a video file and displaying it as fast as possible.

UPDATE: Ip camera works fine, even with the no moreframe handler, some hickups but they seem synchronous across every video.

BerntA commented 5 years ago

That's great! :D