Commit Graph

5 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
Kivy Signage Player
a2fddfa312 updated view 2025-10-27 16:46:08 +02:00
Kivy Signage Player
04d4ea5916 Initial commit: Kivy Signage Player
- Complete Kivy-based signage player application
- Fetches playlists from DigiServer via REST API
- Supports images (JPG, PNG, GIF, BMP) and videos (MP4, AVI, MKV, MOV, WEBM)
- Modern UI with touch controls and settings popup
- Separated UI (KV file) from business logic (Python)
- Fullscreen media display with proper scaling
- Server feedback system for player status reporting
- Auto-hide controls with mouse/touch activation
- Virtual environment setup with requirements.txt
- Installation and run scripts included

Features:
 Cross-platform Kivy framework
 Server integration with DigiServer
 Media playback with duration control
 Player feedback and status reporting
 Settings management with persistent config
 Error handling and recovery
 Clean architecture with KV file separation
2025-09-26 16:48:26 +03:00