Repository navigation
CoreELEC: black screen / partial picture while streaming
Symptom: Moonlight stream is running (sound works, /sys/class/vdec/vdec_status shows the frame count increasing, no packet loss) but the TV is black, shows only a frozen Kodi spinner, or shows only the top-left corner of the picture.
What I observed (Amlogic, CoreELEC 21.3):
- Kodi is frozen with
SIGSTOP; its last frame stays on the OSD layer, which is above the video layer.prescript.shblanks the OSD only once. - With the stock
launch.shthe stream was black in 2 of 3 starts, even though the decoder was fine (frame count rising, no packet loss, correct bitrate) and the OSD had been blanked. The state I could read (display/mode,video/axis,screen_mode,dmesg) was identical in black and working starts, so I cannot name the exact kernel mechanism. - After a display mode change
/sys/class/video/axiscan be left at the old resolution (e.g. a 4K axis on a 1080p mode), which shows only a corner of the picture. - Changing things once in the middle of a running stream did not help; re-applying them from the start of the stream did.
Fix (launch.sh): while moonlight runs, re-apply the OSD blank (fb0), the video/axis matching the current display mode and screen_mode=normal (keeps aspect ratio) every 2 s; restore axis/screen_mode afterwards. Result: stock script 2/3 black starts, this one 0 of ~8.
Also fixes a missing space in chmod +x for create_bug_report.sh (the bug report dialog failed with PermissionError).
Install (overlay – no binaries included)
This is not a full add-on. It contains only the changed files and must be applied over an existing Luna 1.2.x install (which already has the bin/ and lib/ moonlight binaries):
# on the CoreELEC box (ssh), adjust path to the zip
unzip -o script.luna-1.2.2-coreelec-osd-fix-overlay.zip -d ~/.kodi/addons/
chmod +x ~/.kodi/addons/script.luna/resources/launchscripts/coreelec/launch.shThen restart Kodi (or disable/enable the add-on). Make sure the coreelec launch scripts are selected in Luna.
Tested on CoreELEC 21.3 (Amlogic, 4.9 kernel) with Sunshine as the host. Source: see commit on the matrix branch.