ubuntu-rockchip icon indicating copy to clipboard operation
ubuntu-rockchip copied to clipboard

Pink display with specific HDMI monitor

Open pterodyne opened this issue 3 years ago • 25 comments

I posted this in reddit orange pi forum, but Im getting pink display with a specific HDMI monitor, unfortunately that is the monitor Im using for the project. Anyway I was using armbian jammy, so I thought Id try your image and see. It does the same thing.

Does anyone here know how to modify this image so it is outputting RGB instead of Y′CBCR? I don't know for certain that is the issue, but with other models of Orange PI this has been an issue before. The monitor works fine with a PI4 and my laptop, and conversely the OP5 works fine on other HDMI monitors.

Long shot for sure, but you don't get answers to questions not asked. I need to post on the armbian forums, but haven't created an account yet.

pterodyne avatar Apr 16 '23 18:04 pterodyne

I looked at the Rockchip rk3588 BSP Documents available here and found the document Rockchip_Developer_Guide_HDMI_CN.pdf. It has the following information. image However, the document seems outdated, or something needs to be enabled in the kernel/device tree area, as I don't see any color nodes in the sysfs.

Joshua-Riek avatar Apr 16 '23 21:04 Joshua-Riek

Just got a Waveshare 2k display and most of the time there is a pink tint over HDMI. Randomly disconnecting and reconnecting the cable after startup sometimes fixes the colors. I use the DP port most of the time and it works fine. I have tested official and Armbian images they all have the same issue.

nobara256 avatar Apr 19 '23 12:04 nobara256

Having the exact same issue and I've been pulling my hair out trying to fix this. image Any info on this would be great.

BlackIsBlack avatar Apr 30 '23 04:04 BlackIsBlack

Could you upload the dmesg logs in a text file? I'm curious to see if anything strange will be shown. You can enter dmesg > log.txt in the console to write the log to a file.

Joshua-Riek avatar Apr 30 '23 04:04 Joshua-Riek

log.txt

BlackIsBlack avatar Apr 30 '23 04:04 BlackIsBlack

Let me know if there's anything else I can provide to help debug this issue.

BlackIsBlack avatar Apr 30 '23 05:04 BlackIsBlack

I've managed to fix the issue. It was exactly as pterodyne mentioned above. My fix is as follows:

  1. Change from Wayland to X11
    • sudo nano /etc/gdm3/custom.conf
    • Update the line with “WaylandEnable=true” to “WaylandEnable=false”
    • Restart the service using sudo systemctl restart gdm3
  2. Then update the "color_format" value of the monitor using xrandr --output HDMI-1 --set "color_format" "rgb"

This command apparently fails, but the colours are now displaying as they should be

BlackIsBlack avatar Apr 30 '23 06:04 BlackIsBlack

20230430_162615.jpg

20230430_162634.jpg

BlackIsBlack avatar Apr 30 '23 06:04 BlackIsBlack

Though, I'm unable to change the colour space in wayland. Any ideas on how to do this?

BlackIsBlack avatar Apr 30 '23 06:04 BlackIsBlack

Fantastic find! However, I want to warn you about using X11. The GPU drivers work best with Wayland.

If you keep Wayland enabled and issue the xrandr command, does that work?

Joshua-Riek avatar Apr 30 '23 14:04 Joshua-Riek

Noticing some massive issues with using X11 😬. There are actually no params when running xrandr. Running xrandr --output XWAYLAND0 --set "color_format" "rgb" results in:

X Error of failed request:   BadName (named color or font does not exist) 

When I run xrandr --verbose the subpixel is listed as unknown.

I think this has to be fixed in the Wayland settings, but I've spent the entire day searching and to no luck.

BlackIsBlack avatar Apr 30 '23 14:04 BlackIsBlack

I found a website that talks about changing the color space with Wayland. No need to compile libdrm, proptest can be installed with sudo apt install libdrm-tests. This might not work.

https://www.brad-x.com/2017/08/07/quick-tip-setting-the-color-space-value-in-wayland/#:~:text=If%20you%E2%80%99re%20using%20Xorg%20this%20can%20be%20adjusted,xrandr%20--output%20HDMI-0%20--set%20%22Broadcast%20RGB%22%20%22Limited%2016%3A235%22

Joshua-Riek avatar Apr 30 '23 15:04 Joshua-Riek

Unfortunately it runs through all devices and fails before saying no device found

BlackIsBlack avatar Apr 30 '23 15:04 BlackIsBlack

Right, I saw that this will need some more research.

Joshua-Riek avatar Apr 30 '23 15:04 Joshua-Riek

Is there a way to add custom arguments to the kernel command line? I will attempt to edit the EDID. I've noticed that grub isn't accessible.

BlackIsBlack avatar Apr 30 '23 16:04 BlackIsBlack

Yes, it's a bit annoying to do so at the moment. The next release will make adding kernel command line arguments much more accessible.

You must edit the file /boot/firmware/boot.cmd with sudo. On the 6th line, you will see env set bootargs followed by a long string. Inside the quotes, you can add your arguments. After saving the file, you will need to re-compile boot.cmd like below.

sudo mkimage -A arm64 -O linux -T script -C none -n "Boot Script" -d /boot/firmware/boot.cmd /boot/firmware/boot.scr

Joshua-Riek avatar Apr 30 '23 16:04 Joshua-Riek

Managed to get it working using this guide here: https://www.wezm.net/v2/posts/2020/linux-amdgpu-pixel-format/

BlackIsBlack avatar Apr 30 '23 23:04 BlackIsBlack

Fantastic! I'm glad it's working now.

Joshua-Riek avatar Apr 30 '23 23:04 Joshua-Riek

Here's the edid for this Wisecoco OLED panel. In case anyone else stumbles across this same problem with this same monitor on this same board 😅

edid.zip

BlackIsBlack avatar Apr 30 '23 23:04 BlackIsBlack

And thanks so much for the help @Joshua-Riek !!! 😊

BlackIsBlack avatar Apr 30 '23 23:04 BlackIsBlack