From fdf09fabd29bca01b73114df05091fbfa59a1008 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Tue, 13 Jan 2026 10:55:54 -0500 Subject: [PATCH] Debug/fps logging (#183) * fix: Use plugin.modes instead of manifest.json for available modes - Display controller now checks plugin_instance.modes first before falling back to manifest - This allows plugins to dynamically provide modes based on enabled leagues - Fixes issue where disabled leagues (WNBA, NCAAW) appeared in available modes - Plugins can now control their available modes at runtime based on config * fix: Handle permission errors when removing plugin directories - Added _safe_remove_directory() method to handle permission errors gracefully - Fixes permissions on __pycache__ directories before removal - Updates uninstall_plugin() and install methods to use safe removal - Resolves [Errno 13] Permission denied errors during plugin install/uninstall * debug(display): Change FPS check logging from debug to info level - Change FPS check log from DEBUG to INFO to help diagnose scrolling FPS issues - Add active_mode to log message for clarity - Helps identify if plugins are being detected for high-FPS mode * debug(display): Add logging for display_interval in both FPS loops - Log display_interval when entering high-FPS and normal loops - Shows expected FPS for high-FPS mode - Helps diagnose why news ticker shows 50 FPS despite high-FPS detection --------- Co-authored-by: Chuck --- src/display_controller.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/display_controller.py b/src/display_controller.py index 0101b5ae..6b44ff46 100644 --- a/src/display_controller.py +++ b/src/display_controller.py @@ -1466,8 +1466,9 @@ class DisplayController: has_enable_scrolling = hasattr(manager_to_display, 'enable_scrolling') enable_scrolling_value = getattr(manager_to_display, 'enable_scrolling', False) needs_high_fps = has_enable_scrolling and enable_scrolling_value - logger.debug( - "FPS check - has_enable_scrolling: %s, enable_scrolling_value: %s, needs_high_fps: %s", + logger.info( + "FPS check for %s - has_enable_scrolling: %s, enable_scrolling_value: %s, needs_high_fps: %s", + active_mode, has_enable_scrolling, enable_scrolling_value, needs_high_fps, @@ -1513,6 +1514,12 @@ class DisplayController: if needs_high_fps: # Ultra-smooth FPS for scrolling plugins (8ms = 125 FPS) display_interval = 0.008 + logger.info( + "Entering high-FPS loop for %s with display_interval=%.3fs (%.1f FPS)", + active_mode, + display_interval, + 1.0 / display_interval + ) while True: try: @@ -1556,6 +1563,11 @@ class DisplayController: else: # Normal FPS for other plugins (1 second) display_interval = 1.0 + logger.info( + "Entering normal FPS loop for %s with display_interval=%.3fs", + active_mode, + display_interval + ) while True: time.sleep(display_interval)