v19 Start Kodi without TV on
#1
Hi all,

I am currently using the OSMC Kodi v19 test builds for my Raspberry Pi 3B and so far they are working very well. There is just one thing left where I am stuck on how to solve it ... and as I expect it to be Kodi related instead of solely OSMC, I hope to get some inspiration here on what to try out.

I want to start Kodi without the TV (Changhong brand) being on or (ideal solution) get the TV on via the CEC init signal of the Pi. Both Pi and TV are on the same socket strip, which I turn on whenever I want to watch TV, so they get Power at the same time.
Currently, I have (as a workaround) inserted a boot delay in the config.txt which allows me to turn on the socket strip, then manually turn on the TV within the given boot delay and then use the Pi afterwards ... however, this is more of a workaround solution.
CEC init works fine, but the init signal only comes in after the boot delay ... and then the TV starts up, but in this time the Pi already seems to be too far in booting resulting that it does not start up properly (see "Situation when the Pi is on, but the TV is not").

Situation when the Pi is booting, but the TV is off:
The Pi does not give any signal to the TV, also after minutes. I also can't access it via SSH (it freezes after I have provided login details via SSH via PuTTY). I have TVHeadend running on the Pi which starts up properly and which I can reach via my browser.
Only way to get access again is to turn on the TV, then shortly take away the power from the Pi and thereby forcing a reboot.

What I have tried:
1) Used the video options described here https://www.raspberrypi.org/documentatio...t/video.md and added the following to config.txt (bit by bit to see what works) (also tried to add to config-user.txt, but no difference)
 a) hdmi_force_hotplug=1
 b) Saved EDID file to edid.dat via tvservice, moved it to \boot and added hdmi_edid_file=1
 c) hdmi_group=1
 d) hdmi_mode=16
2) Used this FAQ and guide https://kodi.wiki/view/Archive:Raspberry...d_on_first (see above)

Logs?
I would love to provide logs ... but I can't access the Pi via SSH when the issue occurs.

Anything else?
When I have the TV on and via SSH run tvservice -s, I get: state 0x120009 [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
When I run tvservice -m CEA, I get: Group CEA has 0 modes:
Which was a bit unexpected, as I have read previously that it should show all available modes.
I have been running Raspbian + Kodi 18.7 previously where I was able to turn on Pi+TV simultaneously by only adding hdmi_force_hotplug=1 to the config.txt.


If you have any hint or tip on what I could still try out to solve this issue, I would be more than happy.

Thank you very much and best regards

Korona
Reply
#2
1) You might want to bring this up on the OSMC forum
2) If your tv is not already 1000 years old, it is completely unnecessary to switch it always with the power strip. Modern TV's need less than 0.3W in standby. And if the TV is always connected to the mains, it should be switched on via CEC without any problems, At least for me it is like this
Kodi 18.6 @ openSUSE 13.1 x86_64 - Asus E35M1-I DELUXE | 8GB Ram | 240G 2.5" SSD
Kodi 20.2 on 1st Raspberry Pi B @ XBian | Kodi 20.2 on Raspberry Pi 3B+ @ XBian | Kodi 21a2 on Raspberry Pi4B @ XBian | Kodi 19.0 on SolidRun i.MX6 @ XBian
VDR 2.4.5 & Tvheadend4.3-1917 (for recording) on Cubieboard2 @ Debian Buster
Reply
#3
(2021-08-05, 20:19)Nachteule Wrote: 1) You might want to bring this up on the OSMC forum
2) If your tv is not already 1000 years old, it is completely unnecessary to switch it always with the power strip. Modern TV's need less than 0.3W in standby. And if the TV is always connected to the mains, it should be switched on via CEC without any problems, At least for me it is like this

Hi Nachteule,

thank you for your reply.
Regarding 1): I did so previously in the OSMC testing forum for Raspberry Pi. Reply from Sam Nazarko was: That’s expected with Pi and new DRM mode setting logic. Hardcode and EDID or ensure your TV equipment is on when booting.
Post: https://discourse.osmc.tv/t/testing-kodi.../89152/155
I tried to do so (also see replies to this post and description below), but unfortunately I did not succeed.

Regarding 2): Fair point and would also work for me, but I've just tested it again and it does not boot up correctly even if the TV is in standby. The TV gets the init signal (so starts up), but then does not give a picture as described in my first post ...
But thank you very much for confirming that this should actually work.

Do you have any idea on what I could else try to also narrow down the error? I usually try to find solutions myself, but on this I'm completely stuck/lost on what to try next.

Thank you and best regards

korona
Reply
#4
I can't think of much else that really makes sense either
Have you already tried with the value hdmi_ignore_cec_init=0 in config.txt? You have not mentioned this yet

And this has nothing to do with the DRM setting logic, it all happens in the Raspberry Pi firmware.

if that doesn't help either and it's really important to you, then I would try it again with PINN, so reinstall, install PINN and then install OSMC over it
PINN then boots as a quasi boot manager, turns on the TV via CEC (but that should really work) and after an adjustable wait time it then boots OSMC

HTH
Kodi 18.6 @ openSUSE 13.1 x86_64 - Asus E35M1-I DELUXE | 8GB Ram | 240G 2.5" SSD
Kodi 20.2 on 1st Raspberry Pi B @ XBian | Kodi 20.2 on Raspberry Pi 3B+ @ XBian | Kodi 21a2 on Raspberry Pi4B @ XBian | Kodi 19.0 on SolidRun i.MX6 @ XBian
VDR 2.4.5 & Tvheadend4.3-1917 (for recording) on Cubieboard2 @ Debian Buster
Reply
#5
(2021-08-06, 13:07)Nachteule Wrote: And this has nothing to do with the DRM setting logic, it all happens in the Raspberry Pi firmware.

Not on Kodi 19 with gbm/drm. The firmware isn't involved in display, that's all handled in the kernel kms driver.
So it's now standard linux mechanisms for forcing an edid. See here for example.
Reply
#6
That's clear as far as Kodi is concerned. But I meant turning on the TV via CEC when powering on the Pi's still makes the firmware. That happens long before Kodi starts
Kodi 18.6 @ openSUSE 13.1 x86_64 - Asus E35M1-I DELUXE | 8GB Ram | 240G 2.5" SSD
Kodi 20.2 on 1st Raspberry Pi B @ XBian | Kodi 20.2 on Raspberry Pi 3B+ @ XBian | Kodi 21a2 on Raspberry Pi4B @ XBian | Kodi 19.0 on SolidRun i.MX6 @ XBian
VDR 2.4.5 & Tvheadend4.3-1917 (for recording) on Cubieboard2 @ Debian Buster
Reply
#7
Note: LibreELEC contains a script getedid which works well for this situation.
(the wiki doesn't mention Pi, but it works fine).
Reply
#8
(2021-08-06, 21:15)popcornmix Wrote: Note: LibreELEC contains a script getedid which works well for this situation.
(the wiki doesn't mention Pi, but it works fine).

I think it's a rumor that this will run on a Pi:
Code:

root@kmxbilr2 /tmp # ./getedid
Usage ./getedid { create | gpu | delete | help }
root@kmxbilr2 /tmp # ./getedid create
GPU is not supported
root@kmxbilr2 /tmp # tail /sys/class/drm/*/status
connected
root@kmxbilr2 /tmp #
Kodi 18.6 @ openSUSE 13.1 x86_64 - Asus E35M1-I DELUXE | 8GB Ram | 240G 2.5" SSD
Kodi 20.2 on 1st Raspberry Pi B @ XBian | Kodi 20.2 on Raspberry Pi 3B+ @ XBian | Kodi 21a2 on Raspberry Pi4B @ XBian | Kodi 19.0 on SolidRun i.MX6 @ XBian
VDR 2.4.5 & Tvheadend4.3-1917 (for recording) on Cubieboard2 @ Debian Buster
Reply
#9
(2021-08-06, 22:21)Nachteule Wrote: I think it's a rumor that this will run on a Pi:
Code:

root@kmxbilr2 /tmp # ./getedid
Usage ./getedid { create | gpu | delete | help }
root@kmxbilr2 /tmp # ./getedid create
GPU is not supported
root@kmxbilr2 /tmp # tail /sys/class/drm/*/status
connected
root@kmxbilr2 /tmp #

Well, you'd have to use the RPi/drm version of the script that ships with LE10, not the one for x86 :-)

See https://github.com/LibreELEC/LibreELEC.tv/pull/5264 - you'd still have to modify the helper scripts to the different filesystem locations if you run them on a non-LE system, but the principle should be rather clear I hope.

so long,

Hias
Reply
#10
Hi all,

thank you very much for your valuable input, that really helped me further. I spent some hours yesterday evening to try out the suggestions, sorry for the late reply, I did not have free time earlier.
@Nachteule I have tried hdmi_ignore_cec_init=0, but this unfortunately does not change the behaviour. Thank you also for the tip with PINN, that could be something to consider if it all fails and if at one point it annoys me too much.
@popcornmix and @HiassofT that was very likely the issue but much more complex than I expected in the beginning. With the help of the scripts of HiassofT (I modified it to the OSMC file structure), I was able to run the "getedid create" command successful and it looks like all worked successful.
I after that did a reboot via SSH console and had the TV off ... and voila, TV is turned on via the CEC signal and is booted up correctly.
Unfortunately there is a BUT: It currently only works successful if the TV has power (but is not turned on) and the PI is rebooted via SSH console (i.e. not if I pull out the power supply of the Pi and put it back in again).
I'm happy to provide the changed scripts if requested, basically I only changed the folders to:
Code:
EDID_DIR="/home/osmc/firmware/edid"
EDID_CPIO="/boot/edid.cpio"
CONFIG_TXT="/boot/config.txt"
CMDLINE_TXT="/boot/cmdline.txt"
And commented out the /flash mount parts in the script

Current situation
I have it working as expected when the TV has power, but is turned off ... and the Pi is rebooted via SSH console.
When the Pi is not rebooted, but started up, I still don't get a picture nor is the TV turned on via CEC, BUT I can now access via SSH ... which allows me to also take a look into the logs.

Logs
Full log is available here https://paste.kodi.tv/ixekulugax.kodi (I have removed anything related to TVHeadend and xxx IPs and potential personal information), but I suppose the following parts to be the main issue. If it should not be okay to paste parts of the log into here, please give me a note and I will remove below:
Code:
Aug 10 22:44:49 kodipi18 kernel: brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
Aug 10 22:44:49 kodipi18 kernel: brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
Aug 10 22:44:49 kodipi18 kernel: brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 22 2019 01:59:28 version 7.45.98.94 (r723000 CY) FWID 01-3b33decd
Aug 10 22:44:49 kodipi18 systemd[1]: Started Connman connection service.
Aug 10 22:44:49 kodipi18 kernel: vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
Aug 10 22:44:49 kodipi18 kernel: [drm] forcing HDMI-A-1 connector on
Aug 10 22:44:49 kodipi18 kernel: debugfs: Directory '3f902000.hdmi' with parent 'vc4-hdmi' already present!
Aug 10 22:44:49 kodipi18 kernel: vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_hdmi_ops [vc4])
Aug 10 22:44:49 kodipi18 kernel: vc4-drm soc:gpu: bound 3f806000.vec (ops vc4_vec_ops [vc4])
Aug 10 22:44:49 kodipi18 kernel: vc4-drm soc:gpu: bound 3f004000.txp (ops vc4_txp_ops [vc4])
Aug 10 22:44:49 kodipi18 kernel: vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops vc4_crtc_ops [vc4])
Aug 10 22:44:49 kodipi18 kernel: vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops vc4_crtc_ops [vc4])
Aug 10 22:44:49 kodipi18 kernel: vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops vc4_crtc_ops [vc4])
Aug 10 22:44:49 kodipi18 kernel: vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4])
Aug 10 22:44:49 kodipi18 kernel: checking generic (3eaa9000 151800) vs hw (0 ffffffff)
Aug 10 22:44:49 kodipi18 kernel: fb0: switching to vc4drmfb from simple
Aug 10 22:44:49 kodipi18 kernel: Console: switching to colour dummy device 80x30
Aug 10 22:44:49 kodipi18 kernel: [drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 0
Aug 10 22:44:49 kodipi18 kernel: platform HDMI-A-1: Direct firmware load for edid/edid-HDMI-A-1.bin failed with error -2
Aug 10 22:44:49 kodipi18 kernel: [drm:drm_load_edid_firmware [drm]] *ERROR* Requesting EDID firmware "edid/edid-HDMI-A-1.bin" failed (err=-2)
Aug 10 22:44:49 kodipi18 kernel: vc4-drm soc:gpu: [drm] Cannot find any crtc or sizes
(...)
Code:
Aug 10 22:45:14 kodipi18 kernel: platform HDMI-A-1: Direct firmware load for edid/edid-HDMI-A-1.bin failed with error -2
Aug 10 22:45:14 kodipi18 kernel: [drm:drm_load_edid_firmware [drm]] *ERROR* Requesting EDID firmware "edid/edid-HDMI-A-1.bin" failed (err=-2)
Aug 10 22:45:14 kodipi18 kernel: vc4-drm soc:gpu: [drm] Cannot find any crtc or sizes
Aug 10 22:45:15 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:15 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:15 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:16 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:16 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:16 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:16 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:16 kodipi18 kernel: platform HDMI-A-1: Direct firmware load for edid/edid-HDMI-A-1.bin failed with error -2
Aug 10 22:45:16 kodipi18 kernel: [drm:drm_load_edid_firmware [drm]] *ERROR* Requesting EDID firmware "edid/edid-HDMI-A-1.bin" failed (err=-2)
Aug 10 22:45:16 kodipi18 kernel: platform HDMI-A-1: Direct firmware load for edid/edid-HDMI-A-1.bin failed with error -2
Aug 10 22:45:16 kodipi18 kernel: [drm:drm_load_edid_firmware [drm]] *ERROR* Requesting EDID firmware "edid/edid-HDMI-A-1.bin" failed (err=-2)
(...)
A lot of MESA warnings similar to this one:
Code:
Aug 10 22:45:17 kodipi18 mediacenter[344]: Mesa warning: failed to remap glGetMultiTexEnvfvEXT
(...)
Code:
Aug 10 22:45:23 kodipi18 kernel: cec-vc4: message f0 timed out
(I  suppose this is the reason why I don't get the TV turned on via CEC)

(...) (The log then continues with these messages every few seconds)
Code:
Aug 10 22:45:38 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:39 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:39 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:40 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:40 kodipi18 kernel: vc4_hdmi 3f902000.hdmi: ASoC: error at snd_soc_dai_startup on 3f902000.hdmi: -19
Aug 10 22:45:41 kodipi18 kernel: cec-vc4: message 10 timed out

I expect that somehow the EDID solution interferes with the specific OSMC setup ... This is my config.txt right now:
Code:
[all]
dtoverlay=vc4-kms-v3d,cma-512
disable_overscan=1
start_x=1
disable_splash=1
disable_fw_kms_setup=1
hdmi_ingore_cec_init=0
include config-user.txt
initramfs edid.cpio
config-user.txt is empty; I have removed all things like hdmi_force_hotplug as it did not make a difference whether I had it in or not. Everything until disable_fw_kms_setup=1 looks like being OSMC standard.

I have tried to remove the dtoverlay line, but then OSMC does not start up at all.

Do you have any further suggestions or is this very likely an OSMC specific issue I would need to readdress in the OSMC forum and that would require changes in the OSMC code?

From my view it now looks like I have successfully hardcoded my TV, but this inteferes with the OSMC specific boot setup ... but that could also be a wrong assumption.

Thanks once again and best regards

korona
Reply
#11
@korona you have to change EDID_DIR to "/lib/firmware/edid" - /storage/.config/firmware/edid in LE is mapped there. This should fix the "Direct firmware load for edid/edid-HDMI-A-1.bin failed" errors.

You'll also need to change the paths in create-edid-cpio from "/usr/lib/firmware" to "/lib/firmware" - LE is using unified /usr while Debian/RPiOS/... still have split /usr.

Probably you can drop the edid cpio and initrd though, IIRC OSMC doesn't use an initrd/initramfs (LE does and the initrd edid.cpio is needed to make the edid avialable there, too).

In short, it's enough to put the edid in /lib/firmware/edid and modify cmdline.txt to load the firmware and force the video output to enabled.

so long,

Hias
Reply
#12
I am in a quite similar situation. I am using OSMC and recently updated to the 19.1 release. I use OSMC/KODI just for music playback and more or less headless. One rpi3 is connected to a HDMI switch which is just enough to make it possible for KODI to start. The other rpi3 is not connected to a TV or similar and does not properly start. If I remove the HDMI cable from the one connected to the HDMI switch it will also not start KODI properly.

But I haven't had the time to dig further into this. Just wanted to leave a note that korona is not the only one with this problem.
Reply
#13
RPi3 not starting with HDMI connected is a known issue with the latest kernel (when using the kms driver). You can work around that by adding hdmi_force_hotplug=1 to config.txt.

You also have to provide edid for kms to work (as explained above) OFC.

so long,

Hias
Reply
#14
(2021-08-11, 10:35)HiassofT Wrote: @korona you have to change EDID_DIR to "/lib/firmware/edid" - /storage/.config/firmware/edid in LE is mapped there. This should fix the "Direct firmware load for edid/edid-HDMI-A-1.bin failed" errors.

You'll also need to change the paths in create-edid-cpio from "/usr/lib/firmware" to "/lib/firmware" - LE is using unified /usr while Debian/RPiOS/... still have split /usr.

Probably you can drop the edid cpio and initrd though, IIRC OSMC doesn't use an initrd/initramfs (LE does and the initrd edid.cpio is needed to make the edid avialable there, too).

In short, it's enough to put the edid in /lib/firmware/edid and modify cmdline.txt to load the firmware and force the video output to enabled.

so long,

Hias
Hi Hias,

thanks again for the support, I have now modified the scripts as suggested and also checked that the files are in the correct folders.
The err=-2 message has now disappeared, but is now an err=-22 message, see snip from the boot log below:
Code:
Aug 12 13:14:30 kodipi18 kernel: platform HDMI-A-1: loading /lib/firmware/edid/edid-HDMI-A-1.bin failed with error -22
Aug 12 13:14:30 kodipi18 kernel: platform HDMI-A-1: Direct firmware load for edid/edid-HDMI-A-1.bin failed with error -22
Aug 12 13:14:30 kodipi18 kernel: [drm:drm_load_edid_firmware [drm]] *ERROR* Requesting EDID firmware "edid/edid-HDMI-A-1.bin" failed (err=-22)

My cmdline.txt looks as following:
Code:
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait quiet osmcdev=rbp2 drm.edid_firmware=HDMI-A-1:edid/edid-HDMI-A-1.bin video=HDMI-A-1Big Grin
The last one after video=HDMI-A-1 is a : D (without brackets), not a smiley.

I hope to get it to work somehow ... once it works I will also try to make a short step-by-step guide on what I did.

Thank you very much and best regards

korona
Reply
#15
(2021-08-12, 13:23)korona Wrote: thanks again for the support, I have now modified the scripts as suggested and also checked that the files are in the correct folders.
The err=-2 message has now disappeared, but is now an err=-22 message, see snip from the boot log below:
[syntax]Aug 12 13:14:30 kodipi18 kernel: platform HDMI-A-1: loading /lib/firmware/edid/edid-HDMI-A-1.bin failed with error -22

 the edid needs to be in /lib/firmware/edid/edid-HDMI-A-1.bin (as error message says).
Are you sure you didn't put it in /lib/firmware/edid-HDMI-A-1.bin?

what does
Code:
ls -l /lib/firmware/edid/edid-HDMI-A-1.bin
show?
Reply

Logout Mark Read Team Forum Stats Members Help
Start Kodi without TV on0