Commit Graph

8 Commits

Author SHA1 Message Date
Kiwy Player
6bf4e3735a Add comprehensive video playback optimization for smooth performance
Environment variable optimizations:
- KIVY_WINDOW='pygame' - Better window backend performance
- KIVY_AUDIO='ffpyplayer' - Optimized audio playback
- KIVY_GL_BACKEND='gl' - Use OpenGL for better graphics
- FFMPEG_THREADS='4' - Multi-threaded video decoding
- LIBPLAYER_BUFFER='2048000' - 2MB buffer for smooth playback
- SDL_AUDIODRIVER='alsa' - Better audio on Raspberry Pi

Kivy configuration optimizations:
- multisampling=0 - Disable for better performance
- fast_rgba=1 - Enable fast RGBA mode
- Stereo audio (channels=2)
- Reduced logging overhead (warning level)

Video widget enhancements:
- FFmpeg buffer optimization (2MB)
- Multi-threaded decoding (4 threads)
- Ignore index for better seeking
- Allow codec fallback
- 60 FPS animation delay

New video optimization script (.video-optimization.sh):
- GPU memory increased to 256MB
- Install video codec libraries
- Optimize swappiness to 30 (better memory management)
- CPU forced to performance mode
- Filesystem cache optimization

Installation integration:
- Runs video optimization automatically on Raspberry Pi
- Configures GPU memory, libraries, and system settings
- Improves overall video playback smoothness

This addresses video stuttering, frame drops, and playback lag
by optimizing at multiple levels: environment, application, and system.
2026-01-17 20:41:31 +02:00
Kiwy Player
e735e85d3c Add Wayland display server support for power management
Added support for both X11 and Wayland environments:

Display Server Detection:
- Auto-detects Wayland via WAYLAND_DISPLAY environment variable
- Falls back to X11 commands if not Wayland
- Works seamlessly on both display servers

Wayland-specific tools:
- wlopm - Wayland output power management (keeps display on)
- wlr-randr - Output management for wlroots compositors
- ydotool - Mouse movement for Wayland (alternative to xdotool)
- systemd-inhibit integration for idle prevention

Enhanced display keep-alive script:
- Detects display server type on startup
- Uses appropriate commands based on environment
- Wayland: wlopm, wlr-randr, ydotool
- X11: xset, xdotool, xrandr
- Both: tvservice for HDMI power control

App-level improvements (main.py):
- Detects Wayland via os.environ check
- Executes Wayland-specific commands when detected
- Maintains X11 compatibility for older systems

Installation improvements:
- Auto-installs Wayland tools if Wayland is detected
- Attempts to install: wlopm, wlr-randr, ydotool
- Graceful fallback if packages unavailable

This ensures HDMI power management works correctly on:
- Raspberry Pi OS with X11 (older versions)
- Raspberry Pi OS with Wayland (Bookworm and newer)
- Any Linux system using either display server
2026-01-17 20:15:47 +02:00
Kiwy Player
72a6d7e704 Add aggressive HDMI power control to prevent display shutdown
Enhanced Raspberry Pi HDMI power management:

Boot Configuration (/boot/config.txt):
- hdmi_blanking=0 - Disable HDMI blanking
- hdmi_force_hotplug=1 - Force HDMI mode always on
- hdmi_ignore_cec_init=1 - Disable HDMI CEC interference
- hdmi_ignore_edid=0xa5000080 - Disable HDMI sleep mode

New systemd services:
- hdmi-poweron.service - Runs tvservice -p every 30 seconds
- screen-keepalive.service - Aggressive display keep-alive script

Display keep-alive script (.display-keepalive.sh):
- tvservice -p - Force HDMI to stay powered
- xset commands - Keep X11 screensaver off
- xdotool - Mouse movement for activity detection
- xrandr - Disable monitor power profile saving
- 30-second loop for continuous power signaling

Enhanced app-level control (main.py):
- DISPLAY=:0 environment variable for X11 commands
- tvservice integration in signal_screen_activity()
- xrandr power profile management
- More aggressive DPMS disabling

This addresses HDMI being powered down at multiple levels:
1. Firmware level (boot config)
2. System level (systemd services)
3. X11 level (xset, xdotool, xrandr)
4. App level (continuous signaling)

HDMI output should now remain powered throughout playback.
2026-01-17 19:59:45 +02:00
Kiwy Player
17ae5439bd Add screen keep-alive functionality to prevent display sleep
- Created .keep-screen-alive.sh wrapper script with multiple methods:
  * systemd-inhibit (primary - prevents OS-level sleep/suspend)
  * xset commands (prevents X11 screensaver)
  * Mouse movement (prevents idle timeout)

- Added screen-keepalive.service systemd unit:
  * Runs xset s reset every 30 seconds
  * Auto-restarts on failure
  * Integrated with graphical session

- Multiple layers of screen protection:
  * HDMI blanking disabled
  * CPU power saving disabled
  * System sleep/suspend disabled
  * X11 screensaver disabled
  * DPMS (Display Power Management) disabled
  * Display forced on periodically

Screen will now remain active while player is running, preventing lockups or blank screens during playback.
2026-01-17 19:02:00 +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
Kiwy Signage Player
07b7e96edd Add custom on-screen keyboard feature and fix installation
- Added custom half-width on-screen keyboard widget (keyboard_widget.py)
- Keyboard appears at bottom center when input fields are active
- Integrated keyboard in exit popup and settings popup
- Fixed install.sh: added --break-system-packages flag for pip3
- Fixed install.sh: added fallback to online installation for version mismatches
- Removed old Kivy 2.1.0 tar.gz that was causing conflicts
- Keyboard includes close button for intuitive dismissal
- All input fields trigger keyboard on touch
- Keyboard automatically cleans up on popup dismiss
2025-12-04 22:17:57 +02:00
Kivy Signage Player
4ce41b7ccc Add offline installation support with repo folder and updated dependencies
Features:
- Create repo/ folder structure for offline packages
  - python-wheels/ for Python packages (.whl files)
  - system-packages/ for APT packages and .deb files
- Add download_offline_packages.sh to populate Python wheels
- Add download_deb_packages.sh to download system .deb packages
- Update install.sh with smart online/offline detection
  - Auto-detects repo folder and uses offline packages
  - Falls back to online installation if repo is empty
  - Supports --offline flag for explicit offline mode
- Update requirements.txt with async dependencies:
  - aiohttp==3.9.1 for async HTTP client
  - asyncio==3.4.3 for async I/O framework
- Add OFFLINE_INSTALLATION.md with complete guide
- Add .gitignore to exclude downloaded packages from repo
- Document all system dependencies in apt-packages.txt

Downloaded packages:
- 18 Python wheels with all dependencies
- Total size: ~50 MB for Python packages
- Ready for offline deployment
2025-11-03 16:29:03 +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