Skip to content

Conversation

@joopdo
Copy link

@joopdo joopdo commented Dec 7, 2025

  • Send warm ambient color instead of the ugly 'warning' red
  • Fix DRM resource leaks causing Kodi crashes

B83C and others added 29 commits July 6, 2023 14:25
Add support for NV12, P030 and linear decimation
- Detect 4K framebuffer resolution
- Skip capture during 4K playback
- Send warm ambient color instead
- Automatically resume for HD content
@joopdo
Copy link
Author

joopdo commented Dec 7, 2025

Don´t merge yet, I'll test it for a few days if it works as expectd.

@joopdo joopdo force-pushed the feature/4k-detection-workaround branch 2 times, most recently from e6925e7 to fffd38c Compare December 9, 2025 05:41
joopdo added 2 commits December 10, 2025 13:06
- Fix GEM handle cleanup in dump_framebuffer_to_image()
- Clean up ALL GEM handles, not just handles[0]
- Add duplicate handle detection to avoid cleanup warnings
- Update deployment script for LibreELEC compatibility

Resolves critical stability issue where grabber would exhaust DRM
resources and cause Kodi video playback failures. Kodi now remains
stable during video playback with grabber running.
- Fix GEM handle cleanup in dump_framebuffer_to_image()
- Clean up ALL GEM handles, not just handles[0]
- Add duplicate handle detection to avoid cleanup warnings
- Update deployment script for LibreELEC compatibility

Resolves critical stability issue where grabber would exhaust DRM
resources and cause Kodi video playback failures. Kodi now remains
stable during video playback with grabber running.
@joopdo joopdo changed the title Add 4K detection to prevent video freezing on RPi5 Fix DRM resource leaks causing Kodi crashes Dec 10, 2025
@joopdo
Copy link
Author

joopdo commented Dec 10, 2025

drm-vc4-grabber.zip
More improvements based on my viewing experiences. I think it's more stable but will test for few more days.

joopdo added 3 commits December 10, 2025 15:13
Critical fix: Restore proper GEM handle cleanup in dump_framebuffer_to_image()

Root cause analysis:
- Branch switch via syncthing lost the working master branch structure
- P030 format (4K content) had early return that bypassed cleanup entirely
- GEM handles accumulated causing resource exhaustion and Kodi crashes

Solution:
- Restore master branch's closure-based cleanup approach
- Use if/else structure instead of early returns
- Ensure cleanup_handles() is ALWAYS called regardless of success/failure
- Proper HashSet-based duplicate handle detection

This restores the stability that was working before the branch sync issue.

Fixes: Resource leaks in 4K content processing
Prevents: Kodi crashes due to DRM handle exhaustion
Removed:
- Temporary shell scripts (apply_*, commit_*, restore_*, setup_*)
- Build artifacts (*.deb files)
- Log files and temporary files
- IDE configuration (.kiro/)
- Build cache (.cargo/)

Added comprehensive .gitignore to prevent future accidents.

Keeps only essential project files:
- Source code (src/)
- Build configuration (Cargo.toml, build.sh, deploy.sh)
- Documentation (README.md, LICENSE)
- System integration (systemd/)
@joopdo joopdo force-pushed the feature/4k-detection-workaround branch from 6408b7f to d1c8163 Compare December 10, 2025 14:53
joopdo and others added 3 commits December 10, 2025 15:55
- Document compatibility with both Hyperion and HyperHDR
- Explain shared TCP protocol and port (19400)
- Clarify technical basis for cross-compatibility
@joopdo
Copy link
Author

joopdo commented Dec 11, 2025

Seems stable for me. Closing #33

@joopdo joopdo changed the title Fix DRM resource leaks causing Kodi crashes Fix DRM resource leaks causing Kodi crashes and replace 'send_to_red' Dec 11, 2025
@joopdo joopdo changed the title Fix DRM resource leaks causing Kodi crashes and replace 'send_to_red' Fix DRM resource leaks causing Kodi crashes and replace red init colour Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants