Shift screen 5.5 HDMI Waveshare on ODROID-C2

Post Reply
dvdenis
Posts: 11
Joined: Wed Sep 18, 2019 2:58 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 2 times
Been thanked: 2 times
Contact:

Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by dvdenis » Wed Sep 18, 2019 3:29 pm

Hello!

I have a ODROID-C2 with a 5.5 HDMI AMOLED WAVESHARE display. After installing android (selfinstall-odroidc2-eng-s905_6.0.1_master-118-v5.3), in auto-configuration mode, I have the following hdmi settings:

[ 0.000000@0] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 478344
[ 0.000000@0] Kernel command line: root=/dev/mmcblk0p2 rw init=/init rootwait console=ttyS0,115200 hdmimode=custombuilt modeline=1080,1920,137520,116148,60,1080,1112,1144,1184,1920,1928,1932,1936,0,0,1 hdmitx=forcergb vout=hdmi disablehpd=true logo=osd1,loaded,0x3f800000,1080p60hz androidboot.hardware=odroidc2 androidboot.serialno=HKC213254E00A0E6 androidboot.selinux=disabled suspend_hdmiphy=0 led_onoff=on max_freq=1536 maxcpus=4 disable_vu7=false touch_invert_x=false touch_invert_y=false usbmulticam=false gpiopower= backlight_pwm=no ddrclock= test_mt_pid=0000 test_mt_vid=0000
[ 0.000000@0] logo: get hdmimode: custombuilt

The color scheme is normal, the system boots and works, but there is a screen shift, as in the photo. Changing settings through custombuilt does not help, it was only possible to manually repeat automatic settings in manual mode.
Please, advise what can be corrected in the system settings for the correct display?
Attachments
pic4.jpg
pic4.jpg (17.89 KiB) Viewed 605 times
pic1.jpg
pic1.jpg (11.88 KiB) Viewed 605 times
pic2.jpg
pic2.jpg (12.32 KiB) Viewed 605 times
pic3.jpg
pic3.jpg (8.76 KiB) Viewed 605 times

User avatar
odroid
Site Admin
Posts: 32360
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 147 times
Been thanked: 325 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by odroid » Wed Sep 18, 2019 6:31 pm

Check this thread and send a PM to @joy and she may help you within a few days probably.
viewtopic.php?f=97&t=35109

dvdenis
Posts: 11
Joined: Wed Sep 18, 2019 2:58 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by dvdenis » Wed Sep 18, 2019 6:40 pm

Thanks for the advice, but so far I can not write messages for @joy, too young))
"We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more in discussions to be able to use this feature."

User avatar
odroid
Site Admin
Posts: 32360
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 147 times
Been thanked: 325 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by odroid » Wed Sep 18, 2019 6:53 pm

Ah.. Sorry. PM permission requires 5 posts probably. :(

Reply to this post and write a short introduction on here.
viewforum.php?f=56

dvdenis
Posts: 11
Joined: Wed Sep 18, 2019 2:58 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by dvdenis » Wed Sep 18, 2019 7:03 pm


dvdenis
Posts: 11
Joined: Wed Sep 18, 2019 2:58 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by dvdenis » Wed Sep 18, 2019 7:04 pm

And I apologize, but I will write about nothing so that there are 5 messages
These users thanked the author dvdenis for the post:
odroid (Wed Sep 18, 2019 7:20 pm)

joy
Posts: 890
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 13 times
Been thanked: 49 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by joy » Wed Sep 18, 2019 8:03 pm

Hi! dvdenis,

I've checked C2 Ubuntu image and 5.5 HDMI waveshare and it works normally with "forcerfb" option,
but not tried Android yet.

I will try the Android image (selfinstall-odroidc2-eng-s905_6.0.1_master-118-v5.3) tomorrow,
so could you wait for me? :)

dvdenis
Posts: 11
Joined: Wed Sep 18, 2019 2:58 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by dvdenis » Wed Sep 18, 2019 8:16 pm

Of course yes! I will patiently wait for the result of your experiments))

joy
Posts: 890
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 13 times
Been thanked: 49 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by joy » Thu Sep 19, 2019 12:40 pm

Hi dvdenis,

It looks this issue is related to timing mismatch of display fb driver (= osd driver) between android framework and kernel driver side.
Here is my current status to share with you.

[ 1 ]
I can easily reproduce the abnormal display pattern using Android.
I use display_autodetection=true and hdmitx=forcergb option and I think it's same with yours as I checked your cmdline.
c2_waveshare_ng_0.jpg
c2_waveshare_ng_0.jpg (10.95 KiB) Viewed 494 times
c2_waveshare_ng_1.jpg
c2_waveshare_ng_1.jpg (25.64 KiB) Viewed 494 times

[ 2 ]
When I try osd driver auto test (only in kernel side) to check if related drivers bring up as normal, display recovers to normal.
You can confirm it using the following instruction.

Code: Select all

$ su
# echo t > /sys/class/graphics/fb0/debug
After the command, you will see some test patterns.
Then, please touch or do swipe actions on monitor display (to refresh display)
and now you will have normal android launcher menus.
( Please connect another USB cable to the connector, [touch] in back side. I've confirmed touch operation is OK. )
c2_waveshare_normal_1.jpg
c2_waveshare_normal_1.jpg (46.12 KiB) Viewed 494 times
c2_waveshare_normal_2.jpg
c2_waveshare_normal_2.jpg (21.3 KiB) Viewed 494 times

[ 3 ]
During boot process, android display framework sends multiple commands to fb drivers via sysfs node
and also kernel driver sets up its own initial process.
I think there is a mismatch point occurred at this step.
I need to find a root cause more :( , so could you let me look into more for a couple of days?
These users thanked the author joy for the post:
dvdenis (Thu Sep 19, 2019 12:58 pm)

dvdenis
Posts: 11
Joined: Wed Sep 18, 2019 2:58 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by dvdenis » Thu Sep 19, 2019 12:58 pm

Hello, joy!
This is unbelievable, but after the echo command, I really got a normal screen!
I would very much like to fix this situation after reboot, and of course I will wait for your results! But thank you very much for your attention to my problem

dvdenis
Posts: 11
Joined: Wed Sep 18, 2019 2:58 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by dvdenis » Thu Sep 19, 2019 1:55 pm

Temporarily I can use your hack by placing a line in the section in init.odroidc2.rc:

on property:dev.bootcomplete=1
write /sys/class/graphics/fb0/debug t
start usbpm

And after loading and a few seconds of panic on the screen, I see a normal picture)

joy
Posts: 890
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 13 times
Been thanked: 49 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by joy » Tue Sep 24, 2019 5:58 pm

dvdenis,
Thank you for sharing the way.
So far, no valuable update by my side.
Sorry.
I'm still checking and adjusting drivers.

dvdenis
Posts: 11
Joined: Wed Sep 18, 2019 2:58 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by dvdenis » Tue Sep 24, 2019 6:01 pm

I’ll hope, joy, that you can still find a better solution

joy
Posts: 890
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 13 times
Been thanked: 49 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by joy » Tue Sep 24, 2019 11:30 pm

Hi dvdenis,
I have a positive update.
I found the root cause of this issue.

[ 1 ] cause of problem
During booting, Android display framework sets osd scaler option as vertical && horizontal all enable
even though osd scaling is no needed. (source display size and destination display size are all same.)
For the other common resolution cases of C2, there is no problem with this action. all OK.
But in case of 1080x1920 case, this action makes this display-shift issue.

- When we have this issue,

Code: Select all

# cat /sys/class/graphics/fb0/free_scale                                        
free_scale_enable:[0x10001]
0x10001 means vertical scaling (0x1) and horizontal scaling (0x10000) options are all on.
- After this value is changed to 0x0 as following, display turns to normal status.

Code: Select all

# echo 0 > /sys/class/graphics/fb0/free_scale
# cat /sys/class/graphics/fb0/free_scale                                                
free_scale_enable:[0x0]
[ 2 ] a solution - kernel driver path
Still I need to discuss further with Android guys to fix a final solution,
but this kernel driver patch is available for you. ;)
I've confirmed normal android booting logo is shown.
Could you test this without your aforementioned solution using init.odroidc2.rc?

Please find the attachment of two files. (c2_test_kernel_20190924.zip)

1. Test Kernel Image
: c2_test_kernel_20190924/Image
You can update kernel image using fastboot.
This image is based on the latest C2 kernel of odroidc2-3.14.y-android-m
https://github.com/hardkernel/linux/tre ... -android-m

2. Kernel patch
: c2_test_kernel_20190924/0001_c2_android_shift_screen_waveshare.patch
Or if you want to build your kernel, please use this patch.

Code: Select all

diff --git a/drivers/amlogic/display/osd/osd_hw.c b/drivers/amlogic/display/osd/osd_hw.c
index 273ff07..c97a34d 100644
--- a/drivers/amlogic/display/osd/osd_hw.c
+++ b/drivers/amlogic/display/osd/osd_hw.c
@@ -1069,6 +1069,12 @@ static void osd_set_free_scale_enable_mode1(u32 index, u32 enable)
 
 void osd_set_free_scale_enable_hw(u32 index, u32 enable)
 {
+	if ((osd_hw.free_scale_width[index] == 0)
+		&& (osd_hw.free_scale_height[index] == 0)) {
+		osd_log_info("free_scale enable by force 0x%x -> 0x0\n", enable);
+		enable = 0x0;
+	}
+
 	if (osd_hw.free_scale_mode[index])
 		osd_set_free_scale_enable_mode1(index, enable);
 	else

Ah. one more thing...
The Hardkernel booting logo is shown as before at very early booting stage.
To fix this, I have to adjust u-boot source code, I think.
It must be a long term job. but if you need it, please let me know.

Once I have discussion with Android guys and check side effects, I will update new status here.

Before that, could you please check this test image && patch
and share your test result?
:)

Thank you.
Attachments
c2_test_kernel_20190924.zip
(5.9 MiB) Downloaded 10 times
These users thanked the author joy for the post:
dvdenis (Wed Sep 25, 2019 7:48 pm)

dvdenis
Posts: 11
Joined: Wed Sep 18, 2019 2:58 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by dvdenis » Wed Sep 25, 2019 7:48 pm

This is a wonderful decision, joy!
After witchcraft with flashtool and the last command "flashtool flash boot image.img", I got what I wanted)
Thank you very much!
I hope this did not take you much time, and this discussion may help someone else
These users thanked the author dvdenis for the post:
joy (Thu Sep 26, 2019 9:23 am)

dvdenis
Posts: 11
Joined: Wed Sep 18, 2019 2:58 pm
languages_spoken: english
ODROIDs: ODROID-C2
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by dvdenis » Wed Sep 25, 2019 7:51 pm

And a small problem with the boot image is absolutely not critical - given that my equipment will be used in a turnstile system and downloads will be very rare

joy
Posts: 890
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 13 times
Been thanked: 49 times
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by joy » Thu Sep 26, 2019 9:23 am

Yay! So glad to hear it's fixed also by your side.
Thank you for confirming it and sharing your status. :)

And on N2, there is the same issue, too,
and I got a hint during talking with you to solve that problem.
Thanks!

I'm sure this thread must be helpful for other users. ;)

About boot logo problem, let's postpone the adjustment if it's not critical one with you.
If you need it, please let me know.

damboc
Posts: 1
Joined: Thu Oct 03, 2019 2:23 am
languages_spoken: french, english
ODROIDs: C2 emmc 16gb
Has thanked: 0
Been thanked: 0
Contact:

Re: Shift screen 5.5 HDMI Waveshare on ODROID-C2

Unread post by damboc » Sun Oct 06, 2019 2:44 am

thx work great !!

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 1 guest