Matrix - wrong output mode set on boot

because of several factors my coreelec box (s905x) boots before the TV or the projector. therefore it cannot get the correct EDID. this is what disp_cap is for and it used to work.

I actually think it still works. I can change resolutions after boot.

but with Matrix CE boots to 576cvbs and I only get a dark green screen on TV/projector. this is, until I change the output mode with echo … > /sys/class/display/mode. but only if I change it to another resolution, otherwise the system thinks it’s already set right.

at least I think this is the problem, because if I revert (echo 576cvbs > /sys/class/display/mode) I lose the picture again.

dispinfo before manual change:
dispinfo after manual change:
dmesg showing how it doesn’t change to 60 Hz because it thinks it already is, but changes to 50 Hz, hopefully helpful in other respects too:

There is no problem on CE 9.2.5 (ng). there I get a picture under the same circumstances and dispinfo of course shows the right outputmode under vinfo.

what I already tried without success:

fw_setenv outputmode and hdmimode 1080p60hz
fw_setenv outputmode doesn’t stick btw, it always reverts to 576cvbs after reboot. but I don’t think that’s the problem, because it’s the same under 9.2.5. as it must, if I understand correctly, because this is uboot, right?

config.ini, I uncommented the hdmimode line.
doesn’t change anything.
(also it says “(null)” under preferred mode. do you know why? I already removed the leading space still visible in the linked logs, no change,

deleted all the “<resolutions” section of guisettings.xml

any ideas? anything else I can try, logs to provide?

thanks in advance!

Update to nightly build. It has HDMI fixes.

1 Like

ok, I will try it. but how can I easily do it? can I drop the img.gz in the update folder? or can I somehow set a custom channel in CE settings?

edit: nvm, found the tar on the end of the list

1 Like

tried but no change in the problem, sadly.

in that case start projector before coreelec once to receive correct edid
after that execute command:

cat /sys/class/amhdmitx/amhdmitx0/disp_cap > /storage/.kodi/userdata/disp_cap

check that all needed resolutions in this file cat /storage/.kodi/userdata/disp_cap and reboot

thank you, but that I already did (see OP). I always needed it, also on Krypton and Leia. anyway, I just tried again to prevent any corruption of the disp_cap file. no change.

and it seems to me from the logs, that disp_cap is correctly read in. System and Kodi have no problem “seeing” all the correct resolutions. and as I wrote above, I can also switch to them with “echo …”. It also works if I switch to another refresh rate by playing a file (starting by remote control via web or app).

the problem doesn’t seem to be that CE/Kodi doesn’t read the EDID, but that depending on connected devices it chooses another output mode. and it didn’t in 9.2.5.

Give me a link on command output
cat /flash/resolution.ini|paste

looks ok to me

Please collect full log after kodi started.
I don’t understand that is wrong on your system
Does it connected via hdmi-hdmi or some other connection?

this is from before. I switched refresh rate by playing a file. after that switch, the picture is there.

it seems ok from my limited understanding. kodi can see that the system is capable of all the resolutions. it can even see that it’s not capable of 576cvbs (I’ve never used cvbs, the box does have a port for a av-cable).

why would it boot up in that mode if it doesn’t find a HDMI sink?

as for the connection, it’s a convoluted setup:

all sources go into a “dumb” old AVR, that just electrically switches HDMI sources without doing anything to it (transparent passthrough). the HDMI output goes into a splitter. from the splitter one cable goes to the projector. the other goes to an HDMI audio extractor, its HDMI out connected to the TV and the Toslink out back to the AVR.

on boot the AVR is off. when it’s off, HDMI doesnt get passed through, so the HDMI cable from the box is “not connected”. as everything gets switched on, the box connects.

anyway, all of that doesn’t bother the old version.

2021-03-19 16:50:57.217 T:4935 INFO <general>: Found (1920x1080@60.000000) at 16, setting to RES_DESKTOP at 16
2021-03-19 16:51:01.503 T:4935 INFO <general>: GUI format 1920x1080, Display 1920x1080 @ 60.00 - Full Screen
From this log all looks ok and it started with 1080p60p resolution

yeah, I know. this is also why “echo 1080p60hz > /sys/class/display/mode” doesn’t do anything (see dmesg). but the screen is dark green. and dispinfo says the output is 576cvbs:
“------------ /sys/class/display/vinfo ------------
current vinfo:
name: 576cvbs”

if I switch refresh rates all is good again and dispinfo has changed to:
“------------ /sys/class/display/vinfo ------------
current vinfo:
name: 1080p50hz”

if I switch back to 60hz all stays good and dispinfo changes accordingly.

edit: so in summary I don’t think the problem is with kodi but with the underlying system.

for comparison, here is a dmesg from my 9.2.5 setup where there is no problem:
I’m not knowledgeable enough to spot the important differences, there is too much different for me to comprehend.

ok, after thinking through what I wrote, I have a working workaround:

created with
echo 1080p50hz > /sys/class/display/mode
echo 1080p60hz > /sys/class/display/mode

effectively letting the script do what I knew helped when done manually. interestingly enough it helps even though it is run before the HDMI connection is established. I don’t complain.

(I have tried to do only “echo 1080p60hz > /sys/class/display/mode” and unsurprisingly this did not work, because the system thinks it already outputs 1080p60hz and therefore doesn’t do anything.)

here is a dmesg with the workaround:
please note how on 0.455282@1 the system already wants to change to 1080p60hz but doesn’t because it thinks it already is there.
the workaround starts much later on 10.899305@1
and right on the next line it says:
[ 10.899411@1] fb: current vmode=576cvbs, cmd: 0x10000

so. this is not a solution but a workaround.

I will therefore not mark it as the solution and will reply and try to help with testing whatever ideas you might have. it is a regression from 9.2.5. (don’t know about the later 9.2. versions).


I don’t have ideas about correct solution right now.
But if something change I’ll inform you

1 Like

Great work, mate. This solves my problem with green, mint, pink colored screens, when I start my box before my TV ist started fully. It’s always a different color.

I was thinking that its strange this is happening. I mean the box booting before tv is too “normal” of an occurence to have all of CE end up in an unworkable state.

Ok, so CE needs to read the EMID data (or whatever its called) from the TV but the TV is off. I dont undestand whyin the absence of that data, why doesnt CE default to whatever is set by the GUI resolution setting.

I’m curious, so when the resolution data is missing what weird resolution does CE try on boot which causes these strange pink screens?

Default GUI resolution is set by Kodi, when it starts, and is not used by CE during boot. To set CE resolution options look into “config.ini” on root partition and there you can set your needed resolution in “HDMI custom mode” section.

correct. unfortunately this does not seem to work with Matrix when there is no HDMI connection established on boot, at least it doesn’t for me.

on 9.2.5-ng I didn’t even need the config.ini, it worked without it. just having a correct /storage/.kodi/userdata/disp_cap was enough.

as for the pink/green colours, from what I know about these things it could be a ycbcr/rgb issue. colour-coding is probably also embedded in the HDMI handshake and as that doesn’t take place properly when CE starts before the display something goes awry. why my workaround helps with that (changing refresh rate forth and back before the HDMI handshake) I don’t understand. but nice!

so I agree with Sholander in the other thread that your problem is probably something that cannot be fixed with my workaround.

more generally I wonder if CE does not use the hot-pluggability of HDMI.