This happened to me as well on a RPi 4 with the latest OSMC. I found a way to get Kodi back, but then it stopped working the next day, so I edited this post with further changes. I think the easiest way for me to explain is to post what happened from start to finish, the changes I made near the end may work for you as well.
OSMC worked fine for a good couple of weeks in 1080p so I started playing with getting 4K output using the Whitelist option ([HowTo] Guide to the Kodi whitelist function and related settings). Amongst other things, I think I selected a few resolutions/refresh rates that the TV could not do. 4K playback worked fine, then I turned off the TV and when I came back to it later and turned it on the screen was black.
Things I tried that didn’t work:
-
I tried to send a 1080p YouTube file to Kodi using Yatse on my phone hoping the resolution would change to 1080p and the display would return on the TV, but no luck.
-
I rebooted using Yatse and no dice either, splash screen then black screen.
-
So I set /boot/config-user.txt to this:
[HDMI:0]
hdmi_ignore_cec=1
hdmi_group=1
hdmi_mode=16
hdmi_drive=2
After rebooting again using ssh (from this point on Yatse wouldn’t work any more) I could see the info in the corner of the TV screen showing 1080p / 60 Hz for a brief moment, then the splash screen appeared followed by the screen going black. However I left the file like that.
- I changed the following line in /boot/config.txt:
dtoverlay=vc4-kms-v3d,cma-512
to
dtoverlay=vc4-fkms-v3d,cma-512
The output was very low resolution and the GUI was slow. This wasn’t very good at all, so I didn’t even try to play anything and I changed it back.
-
I stopped Kodi using “sudo systemctl stop mediacenter”, renamed my hosed .kodi folder to something else and restored a backup taken from just after first run (I took a backup shortly after installing OSMC on the RPi 4 and before migrating RPi3 OSMC installation), rebooted, and after the splash screen Kodi appeared (with vc4-kms-v3d in /boot/config.txt).
-
So something in the hosed .kodi folder is causing problems. I checked kodi.log and found it starts going wrong here:
2022-02-05 00:34:10.705 T:605 INFO <general>: CAESinkALSA - Unable to open device "default" for playback
2022-02-05 00:34:10.728 T:605 INFO <general>: CAESinkALSA - Unable to open device "btaudio" for playback
2022-02-05 00:34:10.729 T:605 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi0" for playback
2022-02-05 00:34:10.729 T:605 INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi0,DEV=0" for playback
2022-02-05 00:34:10.730 T:605 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi1" for playback
2022-02-05 00:34:10.731 T:605 INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi1,DEV=0" for playback
2022-02-05 00:34:10.732 T:605 INFO <general>: No Devices found - retry: 4
2022-02-05 00:34:12.237 T:605 INFO <general>: CAESinkALSA - Unable to open device "default" for playback
2022-02-05 00:34:12.256 T:605 INFO <general>: CAESinkALSA - Unable to open device "btaudio" for playback
2022-02-05 00:34:12.257 T:605 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi0" for playback
2022-02-05 00:34:12.258 T:605 INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi0,DEV=0" for playback
2022-02-05 00:34:12.259 T:605 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi1" for playback
2022-02-05 00:34:12.259 T:605 INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi1,DEV=0" for playback
2022-02-05 00:34:12.259 T:605 INFO <general>: No Devices found - retry: 3
2022-02-05 00:34:29.920 T:605 INFO <general>: CAESinkALSA - Unable to open device "default" for playback
2022-02-05 00:34:29.939 T:605 INFO <general>: CAESinkALSA - Unable to open device "btaudio" for playback
2022-02-05 00:34:29.940 T:605 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi0" for playback
2022-02-05 00:34:29.940 T:605 INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi0,DEV=0" for playback
2022-02-05 00:34:29.941 T:605 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi1" for playback
2022-02-05 00:34:29.942 T:605 INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi1,DEV=0" for playback
2022-02-05 00:34:29.942 T:605 INFO <general>: No Devices found - retry: 2
2022-02-05 00:34:31.448 T:605 INFO <general>: CAESinkALSA - Unable to open device "default" for playback
2022-02-05 00:34:31.466 T:605 INFO <general>: CAESinkALSA - Unable to open device "btaudio" for playback
2022-02-05 00:34:31.467 T:605 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi0" for playback
2022-02-05 00:34:31.467 T:605 INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi0,DEV=0" for playback
2022-02-05 00:34:31.468 T:605 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi1" for playback
2022-02-05 00:34:31.469 T:605 INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi1,DEV=0" for playback
2022-02-05 00:34:31.469 T:605 INFO <general>: No Devices found - retry: 1
2022-02-05 00:34:32.975 T:605 INFO <general>: CAESinkALSA - Unable to open device "default" for playback
2022-02-05 00:34:32.993 T:605 INFO <general>: CAESinkALSA - Unable to open device "btaudio" for playback
2022-02-05 00:34:32.994 T:605 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi0" for playback
2022-02-05 00:34:32.995 T:605 INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi0,DEV=0" for playback
2022-02-05 00:34:32.995 T:605 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi1" for playback
2022-02-05 00:34:32.996 T:605 INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi1,DEV=0" for playback
2022-02-05 00:34:32.996 T:605 INFO <general>: Found 0 Lists of Devices
2022-02-05 00:34:32.996 T:606 INFO <general>: CActiveAESink::OpenSink - initialize sink
2022-02-05 00:34:32.996 T:606 ERROR <general>: CActiveAESink::OpenSink - no sink was returned
2022-02-05 00:34:32.996 T:605 ERROR <general>: ActiveAE::InitSink - returned error
And later on this gets spammed to the log repeatedly:
2022-02-05 00:34:34.498 T:606 INFO <general>: CActiveAESink::OpenSink - initialize sink
2022-02-05 00:34:34.498 T:606 ERROR <general>: CActiveAESink::OpenSink - no sink was returned
2022-02-05 00:34:34.498 T:605 ERROR <general>: ActiveAE::InitSink - returned error
Whereas the working .kodi folder has this in kodi.log:
2022-02-05 00:45:13.306 T:600 INFO <general>: CAESinkALSA::EnumerateDevice - device default description
2022-02-05 00:45:13.308 T:600 INFO <general>: CAESinkALSA::EnumerateDevice - device @ description
2022-02-05 00:45:13.308 T:600 INFO <general>: CAESinkALSA - Unable to open device "surround71" for playback
2022-02-05 00:45:13.309 T:600 INFO <general>: CAESinkALSA - Unable to open device "surround51" for playback
2022-02-05 00:45:13.309 T:600 INFO <general>: CAESinkALSA - Unable to open device "surround71" for playback
2022-02-05 00:45:13.310 T:600 INFO <general>: CAESinkALSA - Unable to open device "surround40" for playback
2022-02-05 00:45:13.310 T:600 INFO <general>: CAESinkALSA - Unable to open device "surround51" for playback
2022-02-05 00:45:13.310 T:600 INFO <general>: CAESinkALSA - Unable to open device "surround71" for playback
2022-02-05 00:45:13.335 T:600 INFO <general>: CAESinkALSA - Unable to open device "btaudio" for playback
2022-02-05 00:45:13.336 T:600 INFO <general>: CAESinkALSA::EnumerateDevice - device sysdefault:CARD=vc4hdmi0 description vc4-hdmi-0, MAI PCM i2s-hifi-0
Default Audio Device
2022-02-05 00:45:13.338 T:600 INFO <general>: CAESinkALSA::EnumerateDevice - device hdmi:CARD=vc4hdmi0,DEV=0 description vc4-hdmi-0, MAI PCM i2s-hifi-0
HDMI Audio Output
2022-02-05 00:45:13.339 T:600 INFO <general>: CAESinkALSA - Unable to open device "sysdefault:CARD=vc4hdmi1" for playback
2022-02-05 00:45:13.340 T:600 INFO <general>: CAESinkALSA - Unable to open device "hdmi:CARD=vc4hdmi1,DEV=0" for playback
2022-02-05 00:45:13.340 T:600 INFO <general>: Found 1 Lists of Devices
2022-02-05 00:45:13.340 T:600 INFO <general>: Enumerated ALSA devices:
2022-02-05 00:45:13.340 T:600 INFO <general>: Device 1
2022-02-05 00:45:13.340 T:600 INFO <general>: m_deviceName : @
2022-02-05 00:45:13.340 T:600 INFO <general>: m_displayName : Default (vc4-hdmi-0 MAI PCM i2s-hifi-0)
2022-02-05 00:45:13.340 T:600 INFO <general>: m_displayNameExtra:
2022-02-05 00:45:13.340 T:600 INFO <general>: m_deviceType : AE_DEVTYPE_PCM
2022-02-05 00:45:13.340 T:600 INFO <general>: m_channels : FL, FR
2022-02-05 00:45:13.340 T:600 INFO <general>: m_sampleRates : 32000,44100,48000
2022-02-05 00:45:13.340 T:600 INFO <general>: m_dataFormats : AE_FMT_S24NE3,AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_S16BE
2022-02-05 00:45:13.340 T:600 INFO <general>: m_streamTypes : No passthrough capabilities
2022-02-05 00:45:13.340 T:600 INFO <general>: Device 2
2022-02-05 00:45:13.340 T:600 INFO <general>: m_deviceName : sysdefault:CARD=vc4hdmi0
2022-02-05 00:45:13.340 T:600 INFO <general>: m_displayName : vc4-hdmi-0
2022-02-05 00:45:13.340 T:600 INFO <general>: m_displayNameExtra: MAI PCM i2s-hifi-0
2022-02-05 00:45:13.341 T:600 INFO <general>: m_deviceType : AE_DEVTYPE_PCM
2022-02-05 00:45:13.341 T:600 INFO <general>: m_channels : FL, FR
2022-02-05 00:45:13.341 T:600 INFO <general>: m_sampleRates : 32000,44100,48000
2022-02-05 00:45:13.341 T:600 INFO <general>: m_dataFormats : AE_FMT_S24NE3,AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_S16BE
2022-02-05 00:45:13.341 T:600 INFO <general>: m_streamTypes : No passthrough capabilities
2022-02-05 00:45:13.341 T:600 INFO <general>: Device 3
2022-02-05 00:45:13.341 T:600 INFO <general>: m_deviceName : hdmi:CARD=vc4hdmi0,DEV=0
2022-02-05 00:45:13.341 T:600 INFO <general>: m_displayName : vc4-hdmi-0
2022-02-05 00:45:13.341 T:600 INFO <general>: m_displayNameExtra: MEI Panasonic-TV on HDMI
2022-02-05 00:45:13.341 T:600 INFO <general>: m_deviceType : AE_DEVTYPE_HDMI
2022-02-05 00:45:13.341 T:600 INFO <general>: m_channels : FL, FR
2022-02-05 00:45:13.341 T:600 INFO <general>: m_sampleRates : 32000,44100,48000
2022-02-05 00:45:13.341 T:600 INFO <general>: m_dataFormats : AE_FMT_RAW,AE_FMT_S24NE3,AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_S16BE,AE_FMT_U8,AE_FMT_RAW
2022-02-05 00:45:13.341 T:600 INFO <general>: m_streamTypes : STREAM_TYPE_AC3,STREAM_TYPE_DTSHD,STREAM_TYPE_DTSHD_MA,STREAM_TYPE_DTSHD_CORE,STREAM_TYPE_DTS_1024,STREAM_TYPE_DTS_2048,STREAM_TYPE_DTS_512,STREAM_TYPE_EAC3,STREAM_TYPE_TRUEHD
2022-02-05 00:45:13.341 T:601 INFO <general>: CActiveAESink::OpenSink - initialize sink
2022-02-05 00:45:13.341 T:601 INFO <general>: CAESinkALSA::Initialize - Attempting to open device "@"
2022-02-05 00:45:13.345 T:601 INFO <general>: CAESinkALSA::Initialize - Opened device "sysdefault"
2022-02-05 00:45:13.346 T:601 INFO <general>: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
2022-02-05 00:45:13.346 T:601 INFO <general>: CAESinkALSA::InitializeHW - Using data format AE_FMT_S24NE3
Next I checked dmesg and found sound card errors - two lines matching “Could not register sound card: -517” and two lines matching “ASoC: error at snd_soc_dai_startup on i2s-hifi: -19” were highlighted in red. https://pastebin.com/BAms4HxA
Changes that nearly fixed it:
Seemed like something’s going wrong with the sound. Just to try something I set hdmi_drive=1 (disabling sound over HDMI) in /boot/config-user.txt, rebooted, and got Kodi back.
Then in Kodi I found that Settings / System / Display / Resolution was resolution was set to 4096x2160 / 30Hz with overscan, labelled by the TV as V Full for some reason (I guess it means it’s bigger than the normal 3840x2160 / 30Hz) and GUI Resolution Limit was Unlimited. So as a temporary fix I re-set Resolution to 1920x1080, GUI Resolution Limit to 1080, and made sure the Whitelist was disabled in Kodi, set hdmi_drive=2 again in /boot/config-user.txt, rebooted, Kodi appeared again with UI sounds, and now I’m back to where I was before experimenting with 4K.
It looks like a lot of the settings were reset back to defaults. Checking .kodi/userdata I saw that guisettings.xml, profiles.xml, and upnpserver.xml were all re-written. Maybe some kind of attempt from Kodi to start in a safe mode. This also stopped Yatse from working after the first reboot because I don’t use Kodi’s default settings for remote control.
But the next day it stopped working again so I made more changes:
I checked the edid and saw that somehow resolutions like 4096x2160@60Hz are there but I know for a fact the TV will only display 4K at a maximum of 30Hz (checked using an Intel NUC with HDMI output running Windows 10 - when I set the refresh rate too high the screen goes black as well, but then the display control panel restores the previous refresh rate after 15 seconds and it comes back). https://pastebin.com/rrmPXWqc
So I changed my /boot/config-user.txt to ignore the edid:
[HDMI:0]
hdmi_force_hotplug=1
hdmi_ignore_edid=0xa5000080
hdmi_group=1
hdmi_mode=16
hdmi_pixel_encoding=2
hdmi_drive=2
And I edited the whitelist and selected 1920x1080p at 24, 25, 30, 50, and 60Hz and 3840x2160p at 24, 25, and 30Hz.
Why did it happen?
I stumbled across the following issue on GitHub:
As someone says here the problem seems to be intermittent for 4K displays.
If this happens again then it seems that the next steps I could try as suggested in this issue are:
- Editing /boot/cmdline.txt and adding " video=HDMI-A-1:D video=HDMI-A-2:D" to the end. (Edit: Probably not the best choice, see post below for a better version.)
- Editing /boot/config.txt and changing “dtoverlay=vc4-kms-v3d” to “dtoverlay=vc4-kms-v3d-pi4”. (Edit: Probably won’t do anything useful, OSMC has the proper overlay files.)
If neither of these fixes is reliable or they have their own problems as well then it seems to me that a fix that could be done by OSMC in the next release is use an earlier RPi 4 firmware version without this problem.