RPi4, black screen on boot

  • I had this issue since I bought my RPi4 for about six months ago but haven't had time to look in to it. I've found several threads on different forums that ends with the OP abandoning the thread when asked to provide further information or the issue was something else.

    Here is what happens:

    RPi power disconnected: TV OSD displays HDMI2 searching for signal.

    Powering up the RPi: TV screen flickers and displays HDMI2 as it would when detecting a signal but then it stays solid black. No cursor or anything but the OS is booting up.

    The only way I've found to get a picture on the TV is to switch input on the TV back and forth or disconnect/reconnect the HDMI cable.

    Rebooting does the same thing as a cold boot and results in a black screen.

    I have been running LE 10.0.3 and tried LibreELEC-RPi4.arm-11.0-nightly-20230102-2cfb343 now to see if it made a difference but no joy.

    Adding video=HDMI-A-1:1920x1080M@60D to cmdline.txt doesn't change anything. Reading RE: No HDMI output on RPI 4 to TV I've changed to dtoverlay=vc4-fkms-v3d,cma-512 which resulted in picture but no sound.

    I've tested with another display using the same HDMI cable and then it worked as it should. Therefore it seems like the issue is related to my RPi4/TV combination.

    As another test, I installed 2022-09-22-raspios-bullseye-armhf. The immediate difference I spotted is that the first thing displayed on the TV after the HDMI handshake is a cursor and then it continues to boot normally and I could watch a YouTube video in the browser.

    It seems like LE on RPi4 is failing to detect my TV properly very early in the boot process. Using LE on my RPi1 works and plugging in my headless Raspberry Pi OS RPi3 also gives a working console login on the TV.

    Switching from kms to fkms changed the behavior but I don't know what else to try. Maybe popcornmix have some more insights?

    My TV is an old Samsung LE32A557P2C (from 2008 I believe).

    Kodi debug log:

    http://ix.io/4kgi

    dmesg:

    http://ix.io/4kgk

    modetest:

    http://ix.io/4kgo

  • Interesting, on my RPi1 I had hdmi_group=1 and hdmi_mode=16 (1080p@60) so I had tried that on my RPi4 with no success. However, setting hdmi_mode=20 (1080i@50) and I get a picture.

    Also, hdmi_mode=20 seems to work both with and without video=HDMI-A-1:1920x1080M@60D in cmdline.txt. If I interpret the output of modetest correctly it says that 1080p@60 is the preferred resolution.

    Code
    LibreELEC:~ # modetest | grep preferred
      #0 1920x1080 60.00 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: preferred, userdef, driver
      #0 1920x1080 60.00 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: preferred, userdef, driver

    Looking at the output of edidparser http://ix.io/4ki4 it seems like 1080p@60 should work

    HDMI:EDID found CEA format: code 16, 1920x1080p @ 60Hz (native)

    I will do some more testing and report back.

  • ILooking at the output of edidparser http://ix.io/4ki4 it seems like 1080p@60 should work

    HDMI:EDID found CEA format: code 16, 1920x1080p @ 60Hz (native)

    I think the linked thread suggests some monitors don't like the switch from the firmware driving a mode (e.g. 1080p60) to the kernel driving the *same* mode - even though the monitor is happy with how each mode is driven separately.

    The workaround is to make the firmware choose a different mode for the first stage of booting, which seems to allow the kernel to drive the original mode (e.g. 1080p60) happily.

    You should find kodi is still using the preferred mode (1080p60). If it's not I suspect you can switch to it in settings.

  • It is a bit odd that Kodi detected 1080i60. I changed it to 1080p60 and it stays at that resolution even after a reboot or switching HDMI inputs.

    I didn't check what resolution I actually got when running Raspberry Pi OS but I'll boot it and see what resolution it defaults to.

    Would it make any sense to install Kodi on RaspiOS for comparison?

  • If you have a spare sdcard then installing RPiOS would be interesting.

    My guess would be that if RPiOS boots with a working display then kodi will work okay when launched.

    But RPiOS may have the same issue when booting (and probably will be fixed with the addition of the hdmi_group/hdmi_mode lines).

    At the moment any information is useful.

  • As I mentioned in the first post, RPiOS boots fine. I'll install Kodi on it and we'll see what happens.

    What info and/or logs should I provide other than kodi.log?

  • As I mentioned in the first post, RPiOS boots fine. I'll install Kodi on it and we'll see what happens.

    What info and/or logs should I provide other than kodi.log?

    I don't think logs will show this. The display gets into a bad state with a valid hdmi signal (that it is happy with after switching inputs).

    Learning what conditions cause the bad state is the useful information we want.

    LE includes disable_fw_kms_setup=1 in config.txt - might be worth adding that to RPiOS.

    Also make sure RPiOS runs in the same hdmi resolution as you get with LE (I think 1080p60).

    You can choose that with the display configuration app.

  • I have not been very successful in provoking a black screen on RPiOS.

    RPiOS display config app shows 1920x1080 (without trailing "i") and TV OSD says 1920x1080@60.

    • Booted up and added disable_fw_kms_setup=1 and rebooted -> black screen.
    • Commented out disable_fw_kms_setup=1 and rebooted -> boot to desktop.
    • Uncommented disable_fw_kms_setup=1 and shut down, power cycle -> boot to desktop!!!
    • Rebooted twice with disable_fw_kms_setup=1 -> boots to desktop every time.
    • Power off, wait one minute, power on -> boot to desktop.
    • Switched HDMI input on the TV back and forth while the RPi was running
      followed by reboot -> blinking cursor in top left corner for a couple of seconds followed by black screen.
    • Reboot -> boot to desktop.

    It seems like switching input on the TV makes it more likely to end up with a black screen after a reboot but it is not consistent.

    I've verified that the config is properly applied by running vcgencmd get_config disable_fw_kms_setup. All reboots have been clean, either by the desktop menu or via ssh.

    I'm not sure that we've gotten that much wiser. Then I come to think of it, I've been using the 32bit RPiOS so I gave the 64bit a try. The same thing happens.

    • Booted up and added disable_fw_kms_setup=1 and rebooted -> black screen.
    • Rebooted -> boot to desktop.

    I tried a couple more reboots and it seems like the 64bit OS behaves the same as the 32bit.

    Any other things I could try?