Commit Graph

3 Commits

Author SHA1 Message Date
Kiwy Player
a825d299bf CRITICAL FIX: Use Clock.schedule_once for thread-safe player state updates
BUG: Background upload thread was crashing the app

Problem:
  - _upload_to_server() runs in daemon thread
  - Was directly setting self.player.should_refresh_playlist from thread
  - Kivy is NOT thread-safe for direct state modifications
  - App crashed after 2-3 minutes during editing

Root cause:
  Line 503: self.player.should_refresh_playlist = True
  This directly modified Kivy object state from non-main thread
  Caused race conditions and memory corruption

Solution:
  - Use Clock.schedule_once() to schedule flag update on main thread
  - Ensures all Kivy state modifications happen on main thread
  - Thread-safe and proper Kivy API usage
  - No more app crashes during editing

This was causing the app to crash every 10-20 seconds during edits.
Should now be stable!
2026-01-17 22:05:56 +02:00
Kiwy Player
8703350b23 Add screen activity signaler to prevent display sleep
- Added signal_screen_activity() method to SignagePlayer class
- Runs every 20 seconds automatically
- Also triggered on any touch/user input events

Multiple methods used to keep display awake:
- xset s reset - Resets screensaver timer
- xset dpms force on - Forces display on
- xdotool - Subtle mouse movement to trigger activity

This complements the system-level power management:
- Works alongside display power management settings
- Non-blocking and non-critical (fails gracefully)
- Signals every 20 seconds + on user input
- Prevents display from sleeping during playback

Screen should now remain active throughout media playback.
2026-01-17 19:23:15 +02:00
Kiwy Player
81432ac832 Add autostart functionality and power management for Raspberry Pi
- Enhanced install.sh with comprehensive autostart workflow:
  * XDG autostart entry (desktop environment)
  * systemd user service (most reliable)
  * LXDE autostart support (Raspberry Pi OS)
  * Cron fallback (@reboot)
  * Terminal mode enabled for debugging

- Added Raspberry Pi power management features:
  * Disable HDMI screen blanking
  * Prevent CPU power saving (performance mode)
  * Disable system sleep/suspend
  * X11 screensaver disabled
  * Display power management (DPMS) disabled

- Fixed sudo compatibility:
  * Properly detects actual user when run with sudo
  * Correct file ownership for user configs
  * systemctl --user works correctly

- Player launches in terminal for error visibility
- Autostart configured to use start.sh (watchdog with auto-restart)
2026-01-17 18:50:47 +02:00