The MZ61581 PI EXT 2015.12.12 case

Hi mates !

Let’s try to make this LCD screen working on linux raspbian wheezy. Symptoms on first tests were slow fps, or image distorsion.

First attempt : Let’s follow the official setup guide

sudo apt-get update
sudo apt-get upgrade
* coffee time *

sudo reboot
cd /boot/overlays
sudo mv mz61581-overlay.dtb old-mz61581-overlay.dtb
sudo wget http://www.itontec.com/mz61581-overlay.dtb
sudo nano /boot/config.txt

Add to the bottom :

dtparam=spi=on
dtoverlay=mz61581,debug=32

Save & reboot.
Result : slow fps. might have only 4k DMA memory  ?

Second attempt : What was that default driver ?
It seems that wheezy aldready provided us a mz61581-overlay.dtb file.
Let’s try again the official guide, but now ommit the rm / wget part.
Maybe this old driver would fit better ? (quick answer, no)
Mayber the new raspbian provided mz-overlay.dtb would be better (no again)

Third attempt : Notro our savior !

Working on the previous version of the MZ61581-PI-EXT, i had poor performance until using notro’s work. Let’s take a look on his wiki:
fbtft_device route  : tried
« sudo modprobe fbtft_device name=mz61581 » but mz61581 is only an overlay, not a fbtft official device.
« sudo modprobe fbtft_device name=tontec35_9481 » and « sudo modprobe fbtft_device name=tontec35_9486 », only get the backlight working.
Mz61581 is not one of these !

Forth attempt : woohoo!

Dtoverlay route:
To use the new spi bcm2835 with dma support, let’s disable old spi enabling in /boot/config.txt :
#dtoverlay=spi=on
dtoverlay=mz61581,speed=64000000
Be sure to use a 32Kb buffer version of mz61581-overlay.dtb !

This works !


Test protocol :

wget http://fredrik.hubbe.net/plugger/test.mpg
sudo apt-get install mencoder mplayer2
mencoder test.mpg -ovc lavc -lavcopts vcodec=mpeg4 -vf scale=480:320 -o test_480_320.mpg
mplayer -nolirc -vo fbdev2:/dev/fb1 test_480_320.mpg



 

Results :
New Tontec drivers have poor performances, but are working.
Old drivers have better performance, but are not fully compatible with the new MZ61581-PI-EXT 2015.12.12.

1) Tontec driver : With config.txt : dtparam=mz61581,debug=32
Laggy display

lsmod
Module                  Size  Used by
cfg80211              419759  0
rfkill                 16659  1 cfg80211
snd_bcm2835            19739  0
snd_pcm                74833  1 snd_bcm2835
snd_seq                53470  0
snd_seq_device          3650  1 snd_seq
snd_timer              18164  2 snd_pcm,snd_seq
snd                    52116  5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
joydev                  9047  0
fb_s6d02a1              3540  0
fbtft                  27517  1 fb_s6d02a1
syscopyarea             2789  1 fbtft
sysfillrect             3313  1 fbtft
sysimgblt               1837  1 fbtft
fb_sys_fops             1149  1 fbtft
ads7846                11340  0
hwmon                   2927  1 ads7846
spi_bcm2708             5149  0
bcm2835_gpiomem         3023  0
uio_pdrv_genirq         2966  0
evdev                  10226  2
uio                     8228  1 uio_pdrv_genirq

[    3.863542] bcm2708_spi 3f204000.spi: master is unqueued, this is deprecated
[    3.888126] bcm2708_spi 3f204000.spi: SPI Controller at 0x3f204000 (irq 80)
[    4.013842] ads7846 spi0.1: touchscreen, irq 484
[    4.027389] input: ADS7846 Touchscreen as /devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/input/input1
[    4.034035] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[    4.038912] fb_s6d02a1: module is from the staging directory, the quality is unknown, you have been warned.
[    4.076110] fbtft_of_value: width = 320
[    4.085907] fbtft_of_value: height = 480
[    4.092665] fbtft_of_value: buswidth = 8
[    4.099748] fbtft_of_value: debug = 3
[    4.105815] fbtft_of_value: rotate = 270
[    4.112181] fbtft_of_value: fps = 30
[    4.126520] fb_s6d02a1 spi0.0: fbtft_request_one_gpio: ‘reset-gpios’ = GPIO15
[    4.136612] fb_s6d02a1 spi0.0: fbtft_request_one_gpio: ‘dc-gpios’ = GPIO25
[    4.146366] fb_s6d02a1 spi0.0: fbtft_request_one_gpio: ‘led-gpios’ = GPIO18
[    4.155397] fb_s6d02a1 spi0.0: fbtft_verify_gpios()
[    4.162032] fb_s6d02a1 spi0.0: fbtft_init_display_dt()
[    4.169080] fb_s6d02a1 spi0.0: fbtft_reset()
[    4.297532] fb_s6d02a1 spi0.0: init: write_register: B0 00
[    4.304769] fb_s6d02a1 spi0.0: init: write_register: 11
[    4.311458] fb_s6d02a1 spi0.0: init: msleep(255)
[    4.582945] fb_s6d02a1 spi0.0: init: write_register: B3 02 00 00 00
[    4.590654] fb_s6d02a1 spi0.0: init: write_register: C0 13 3B 00 02 00 01 00 43
[    4.599359] fb_s6d02a1 spi0.0: init: write_register: C1 08 16 08 08
[    4.606934] fb_s6d02a1 spi0.0: init: write_register: C4 11 07 03 03
[    4.614425] fb_s6d02a1 spi0.0: init: write_register: C6 00
[    4.621006] fb_s6d02a1 spi0.0: init: write_register: C8 03 03 13 5C 03 07 14 08 00 21 08 14 07 53 0C 13 03 03 21 00
[    4.633602] fb_s6d02a1 spi0.0: init: write_register: 35 00
[    4.640307] fb_s6d02a1 spi0.0: init: write_register: 36 A0
[    4.647034] fb_s6d02a1 spi0.0: init: write_register: 3A 55
[    4.653747] fb_s6d02a1 spi0.0: init: write_register: 44 00 01
[    4.660693] fb_s6d02a1 spi0.0: init: write_register: D0 07 07 1D 03
[    4.668133] fb_s6d02a1 spi0.0: init: write_register: D1 03 30 10
[    4.675296] fb_s6d02a1 spi0.0: init: write_register: D2 03 14 04
[    4.682411] fb_s6d02a1 spi0.0: init: write_register: 29
[    4.688689] fb_s6d02a1 spi0.0: init: write_register: 2C
[    4.694942] fb_s6d02a1 spi0.0: set_var()
[    4.707942] random: nonblocking pool is initialized
[    4.901920] fb_s6d02a1 spi0.0: Display update: 1484 kB/s (202.020 ms), fps=0 (0.000 ms)
[    4.912125] fb_s6d02a1 spi0.0: fbtft_register_backlight()
[    4.919447] graphics fb1: fb_s6d02a1 frame buffer, 480×320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=33, spi0.0 at 128 MHz
[    4.933895] fb_s6d02a1 spi0.0: fbtft_backlight_update_status: polarity=0, power=0, fb_blank=0

1) Tontec driver : With config.txt : dtparam=mz61581,fps=50,debug=32
Laggy display too
[ 5.174915] graphics fb1: fb_s6d02a1 frame buffer, 480×320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=50, spi0.0 at 128 MHz
[   66.306436] fb_s6d02a1 spi0.0: Display update: 1475 kB/s (203.191 ms), fps=4 (239.998 ms)
[   66.481634] fb_s6d02a1 spi0.0: Display update: 1893 kB/s (158.398 ms), fps=4 (219.991 ms)

2) Rpi Driver : With config.txt : dtparam=mz61581,debug=32
Eurêka, we new have a good fps. Sadly,  there is some weird effect on the display, coor distorsion, strange transparent waves drawn over the image.

[ 3.809940] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f2 00000
[ 3.859648] spi spi0.1: setting up native-CS1 as GPIO 7
[ 3.953568] spi spi0.0: setting up native-CS0 as GPIO 8
[ 4.233484] ads7846 spi0.1: touchscreen, irq 484
[ 4.243750] fbtft: module is from the staging directory, the quality is unkno wn, you have been warned.
[ 4.247379] fb_s6d02a1: module is from the staging directory, the quality is unknown, you have been warned.
[ 4.278306] input: ADS7846 Touchscreen as /devices/platform/soc/3f204000.spi/ spi_master/spi0/spi0.1/input/input1
[ 4.297086] fbtft_of_value: width = 320
[ 4.308640] fbtft_of_value: height = 480
[ 4.320960] fbtft_of_value: buswidth = 8
[ 4.333180] fbtft_of_value: debug = 32
[ 4.350623] fbtft_of_value: rotate = 270
[ 4.361306] fbtft_of_value: fps = 30
[ 4.371700] fbtft_of_value: txbuflen = 32768
[ 4.797830] fb_s6d02a1 spi0.0: Display update: 12591 kB/s (23.825 ms), fps=0 (0.000 ms)
[ 4.812592] graphics fb1: fb_s6d02a1 frame buffer, 480×320, 300 KiB video mem ory, 32 KiB DMA buffer memory, fps=33, spi0.0 at 128 MHz
[ 324.706973] fb_s6d02a1 spi0.0: Display update: 12671 kB/s (23.673 ms), fps=20 (49.978 ms)
[ 324.766897] fb_s6d02a1 spi0.0: Display update: 12662 kB/s (23.692 ms), fps=16 (59.906 ms)

2) Rpi Driver : With config.txt : dtparam=mz61581,fps=50,debug=32

The FPS is better, the glitchs remains.
[ 65.625644] fb_s6d02a1 spi0.0: Display update: 13373 kB/s (22.432 ms), fps=25 (39.992 ms)
[ 65.665652] fb_s6d02a1 spi0.0: Display update: 13370 kB/s (22.438 ms), fps=24 (40.003 ms)

Tried with fps=15 in config.txt, same glitchs happens.

After update

[ 4.592106] bcm2835-rng 3f104000.rng: hwrng registered
[ 4.603414] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[ 4.630936] bcm2708_spi 3f204000.spi: master is unqueued, this is deprecated
[ 4.651956] bcm2708_spi 3f204000.spi: SPI Controller at 0x3f204000 (irq 80)
[ 4.701122] ads7846 spi0.1: touchscreen, irq 484
[ 4.706262] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[ 4.709738] fb_s6d02a1: module is from the staging directory, the quality is unknown, you have been warned.
[ 4.743410] input: ADS7846 Touchscreen as /devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/input/input1
[ 4.762299] fbtft_of_value: width = 320
[ 4.772315] fbtft_of_value: height = 480
[ 4.783039] fbtft_of_value: buswidth = 8
[ 4.792916] fbtft_of_value: debug = 32
[ 4.802531] fbtft_of_value: rotate = 270
[ 4.812214] fbtft_of_value: fps = 15
[ 5.239950] random: nonblocking pool is initialized
[ 5.452605] fb_s6d02a1 spi0.0: Display update: 1225 kB/s (244.778 ms), fps=0 (0.000 ms)
[ 5.468757] graphics fb1: fb_s6d02a1 frame buffer, 480×320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=16, spi0.0 at 128 MHz

 

 

Laisser un commentaire