Bad display on TFT screen (hktft9340)

Test and fix the Kernel 4.14 features
Post Reply
littlebalup
Posts: 3
Joined: Wed Feb 27, 2019 5:48 am
languages_spoken: english french
ODROIDs: XU4Q, OGST case
Has thanked: 0
Been thanked: 0
Contact:

Bad display on TFT screen (hktft9340)

Post by littlebalup »

Hi,

I'm trying to play some videos on my XU4 console case screen from Ubuntu 18.04lts (kernel 4.14.102-156) but I'm facing a weird issue. (For that example I use the SNES mp4 video provided in the OGST distribution)
Using the commands:

Code: Select all

# init screen
[ `/sbin/lsmod | grep -c spi_s3c64xx` -ge 1 ] && rmmod spi_s3c64xx
modprobe spi_s3c64xx force32b=1
modprobe fbtft_device name=hktft9340 busnum=1 rotate=270
then:

Code: Select all

# draw
ffmpeg -re -i logo.mp4 -c:v rawvideo -pix_fmt rgb565le -f fbdev /dev/fb1
Side note, I have the same result using mplayer:

Code: Select all

# draw
mplayer -nolirc -vo fbdev2:/dev/fb1 logo.mp4
It displays:
Image
Video frame rate is fine but as you can see there is an issue with the colors... seems RGB are swapped to something like BRG.

I saved the framebuffer data to check it:

Code: Select all

cat /dev/fb1 > fb1.raw
file: fb1.raw

and displayed it using gimp (320x240, RGB565 raw image). Here the result converted to png:
Image

So, data in the framebuffer seems fine.

I made another test without to set the 'force32b' flag:

Code: Select all

# init screen
modprobe fbtft_device name=hktft9340 busnum=1 rotate=270
then:

Code: Select all

# draw
ffmpeg -re -i logo.mp4 -c:v rawvideo -pix_fmt rgb565le -f fbdev /dev/fb1
It displays:
Image
That time the colors are fine but the video is very laggy (2 or 3 frames per sec...).

No issue on old kernels used by OGST, batocera or recalbox (3.xx If I remember well).

Do you have any idea what's going wrong?

Thanks

User avatar
odroid
Site Admin
Posts: 35871
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 910 times
Contact:

Re: Bad display on TFT screen (hktft9340)

Post by odroid »

Old 3.10 kernel had a very different SPI driver which was faster.
So we added a 32bit transfer mode(force32b=1) option in Kernel 4.9/4.14 to overcome the slowness and we could have over 10fps with 320x240 LCD.
Anyway, we will try to reproduce the problem early next week since we have some other urgent issue.

User avatar
odroid
Site Admin
Posts: 35871
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 910 times
Contact:

Re: Bad display on TFT screen (hktft9340)

Post by odroid »

Try to add "force32b=1" parameter when you load fbtft_device driver module too.

littlebalup
Posts: 3
Joined: Wed Feb 27, 2019 5:48 am
languages_spoken: english french
ODROIDs: XU4Q, OGST case
Has thanked: 0
Been thanked: 0
Contact:

Re: Bad display on TFT screen (hktft9340)

Post by littlebalup »

odroid wrote:
Wed Feb 27, 2019 12:13 pm
Try to add "force32b=1" parameter when you load fbtft_device driver module too.
It works like a charm :)
Thank you a lot.

User avatar
odroid
Site Admin
Posts: 35871
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 910 times
Contact:

Re: Bad display on TFT screen (hktft9340)

Post by odroid »

Thank you for the confirmation.
I've added a note on the wiki page.
https://wiki.odroid.com/odroid-xu4/soft ... _or_higher

reanimator
Posts: 1
Joined: Mon Nov 02, 2020 3:40 am
languages_spoken: english
ODROIDs: ODROID-XU4, ODROID-H2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Bad display on TFT screen (hktft9340)

Post by reanimator »

Finally it working for me!!

Pass bgr=1 parameter to fbtft_device kernel module.

Code: Select all

#!/bin/bash
sudo rmmod fbtft_device
sudo rmmod spi_s3c64xx

sudo modprobe spi_s3c64xx force32b=1
sudo modprobe fbtft_device name=hktft9340 busnum=1 rotate=270 force32b=1 bgr=1
/usr/local/bin/Shader2LCD /home/odroid/Build/Shader2LCD-master/shaders/digitalclock.f.glsl
Tested with

Code: Select all

Linux odroid 4.14.180-178 #1 SMP PREEMPT Wed Sep 2 12:39:45 -03 2020 armv7l armv7l armv7l GNU/Linux
These users thanked the author reanimator for the post:
odroid (Mon Nov 02, 2020 10:31 am)

Post Reply

Return to “Linux Kernel 4.14 Debugging Party”

Who is online

Users browsing this forum: No registered users and 1 guest