interval_check_status = 19 memory_usage_check = True cache_next_screen = True #Detect resolution resolution = get_resolution() screens_cfg = cfg['essentials']['screens'] #Timers for statistics uniqid = stats.generate_uniqid() start_time = stats.start_timer() loop_counter = 0 screen_manager_main = ScreenManager('screen_manager_main', resolution, screens_cfg, fixed_width, fixed_height, cache_next_screen) #First rotate to init first run screen_manager_main.rotate_next() logger.debug("MAIN: bootstrap update_active_screen") screen_manager_main.update_active_screen() while True: #Handle stats handle_stats(loop_counter) loop_counter += 1 #Handle keypresses handle_keypresses() #Check free mem and log warning
if len(displays) > 1: logger.info( "Globally force disable caching screen if more than one display is detected, since this takes too much resources for the pi on dual hdmi screen" ) enable_opportunistic_caching_next_screen = False screenmanagers = [] count = 0 for display in displays: disable_pygame = True # Only one screenmanager may be the master of the pygame in the case we have multiple instances. choose the first screen detected if count == 0: disable_pygame = False screen_manager = ScreenManager( f'screen_manager_{count}', display, enable_opportunistic_caching_next_screen, disable_pygame) screenmanagers.append(screen_manager) count = count + 1 #First rotate to init first run for screenmanager in screenmanagers: screenmanager.rotate_next() logger.debug( f"MAIN {screenmanager.name}: bootstrap update_active_screen") screenmanager.update_active_screen() while True: #Handle stats handle_stats(loop_counter) loop_counter += 1