OLIMEX / DIY-LAPTOP

Do It Yourself Open Source Hardware and Software Modular Hacker's Friendly Laptop
Apache License 2.0
489 stars 87 forks source link

Dual display #30

Closed khumarahn closed 1 month ago

khumarahn commented 5 years ago

Hi, I am trying to make the HDMI work. Can't understand some things.

khumarahn commented 5 years ago
khumarahn commented 5 years ago

EDIT: I was able to boot, not sure what the reason. But the system freezes shortly after boot. Using the old a64-olinuxino.dtb fixes this.

khumarahn commented 5 years ago

First post corrected, it had the quote from an outdated commit.

khumarahn commented 5 years ago
hehopmajieh commented 5 years ago

Hi Alexey, please take a look at rel3 branch, this issues are fixed in this branch. Please let me know what is the issue with /opt/teres/hdmi/a64-olinuxino.dtb, can you paste boot log. ~Best, Dimitar

On Thu, 6 Dec 2018, 20:29 Alexey Korepanov <notifications@github.com wrote:

  • to load modules at boot, it is easier to use a dedicated config file, e.g. /etc/modules-load.d/teres-hdmi.conf; this is easier and cleaner than editing /etc/modules

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/OLIMEX/DIY-LAPTOP/issues/30#issuecomment-444978287, or mute the thread https://github.com/notifications/unsubscribe-auth/ABrmZfWw1bRTCO85G6R5qp9TwHiPNttDks5u2WH5gaJpZM4ZHDbP .

khumarahn commented 5 years ago

Thanks! Is there a place to download new blobs for uboot and boot0?

hehopmajieh commented 5 years ago

Hi Alexei, there is no change in boot0, you can build u-boot from rel3 branch

~Dimitar

On Fri, 7 Dec 2018, 15:50 Alexey Korepanov <notifications@github.com wrote:

Thanks! Is there a place to download new blobs for uboot and boot0?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OLIMEX/DIY-LAPTOP/issues/30#issuecomment-445238184, or mute the thread https://github.com/notifications/unsubscribe-auth/ABrmZQAR96i48z5PQGKet3pp_DPnDuARks5u2nIUgaJpZM4ZHDbP .

khumarahn commented 5 years ago

ok, thanks. Unlike most of teres software, u-boot is annoying to build because the build script is ubuntu specific, and it relies on the ancient gcc-4.7. I don't have ubuntu installed. But I will install it soon.

khumarahn commented 5 years ago

looking at https://github.com/OLIMEX/DIY-LAPTOP/blob/672fff77303e2a79f900c536b460872f7a7f8d06/SOFTWARE/A64-TERES/scripts/install_kernel.sh#L89 the new uEnv.txt is very different from before. There is no root= setting any more, which is used in initrd.

khumarahn commented 5 years ago

I can't make the laptop boot from an sd card with the new uboot and uEnv.txt and other files in /boot. I see a dark screen with nothing. Boot log: https://pastebin.com/TJwbBEkN

khumarahn commented 5 years ago

Cleaner boot log: https://pastebin.com/M87YXY2z

I built the "simple image" following instructions in the rel3 branch, and compared the first 20 MiB to my image. They are only different in the first 512 bytes, the MBR, which is expected. The simple image also does not boot from the sd card.

hehopmajieh commented 5 years ago

Hi Alexey, please try binary release from https://github.com/OLIMEX/DIY-LAPTOP/releases/tag/rel3-1 you can flash it to your sd card with: dd if=boot0_teres.bin conv=notrunc bs=1k seek=8 count=32 oflag=direct of=/dev/sdx dd if=u-boot.bin conv=notrunc bs=1k seek=19096 of=/dev/sdx

Please test and let me know about result. Also can you tell me what OS and gcc version you use to build u-boot. ~Best

khumarahn commented 5 years ago

Hi, your u-boot made the difference, it boots now. I was compiling u-boot in an ubuntu chroot:

# lsb_release -a
LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:        14.04
Codename:       trusty
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

Also I have gcc-4.7-arm-linux-gnueabihf installed.

I tried building u-boot in a different linux, but the build scripts are very inflexible and adapting them was taking too much time. So I gave up and used debootstrap to get a chroot of an old ubuntu. Then I followed the instructions in the readme.

khumarahn commented 5 years ago

What is the logic for determining the root partition now? Do the scripts in initrd still make sense?

khumarahn commented 5 years ago

I managed to build a working u-boot. Not sure what was wrong the first time.

I suppose I should have hdmi working now, but I don't have a mini hdmi adapter to test.

To add to all my questions above, what could be the reason hdmi does not work with xrandr?

hehopmajieh commented 5 years ago

Hi, dual display uses Allwinner disp2 module, this module is not drm module so it does not support randr extensions. Now I am trying to make drm drivers to work , but this will take some time.

~Best

На нд, 9.12.2018 г. в 1:48 ч. Alexey Korepanov notifications@github.com написа:

I managed to build a working u-boot. Not sure what was wrong the first time.

I suppose I should have hdmi working now, but I don't have a mini hdmi adapter to test.

To add to all my questions above, what could be the reason hdmi does not work with xrandr?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OLIMEX/DIY-LAPTOP/issues/30#issuecomment-445498711, or mute the thread https://github.com/notifications/unsubscribe-auth/ABrmZRfy5Mw_8xo0RJ_SdNa0iYFQEtU8ks5u3E_NgaJpZM4ZHDbP .

khumarahn commented 5 years ago

I received a mini-hdmi adapter. But can't make hdmi work. System log shows:

Dec 13 21:42:36 teres kernel: [HDMI WRN] file:drivers/video/sunxi/disp2/hdmi/hdmi_bsp_sun50iw1p1.c,line:600:    ddc read timeout, byte cnt = 128
Dec 13 21:42:36 teres kernel: [HDMI WRN] file:drivers/video/sunxi/disp2/hdmi/hdmi_bsp_sun50iw1p1.c,line:600:    ddc read timeout, byte cnt = 127
Dec 13 21:42:36 teres kernel: [HDMI WRN] file:drivers/video/sunxi/disp2/hdmi/hdmi_bsp_sun50iw1p1.c,line:600:    ddc read timeout, byte cnt = 126
Dec 13 21:42:37 teres kernel: [HDMI WRN] file:drivers/video/sunxi/disp2/hdmi/hdmi_bsp_sun50iw1p1.c,line:600:    ddc read timeout, byte cnt = 125
Dec 13 21:42:37 teres kernel: [HDMI WRN] file:drivers/video/sunxi/disp2/hdmi/hdmi_bsp_sun50iw1p1.c,line:600:    ddc read timeout, byte cnt = 124
Dec 13 21:42:37 teres kernel: [HDMI WRN] file:drivers/video/sunxi/disp2/hdmi/hdmi_bsp_sun50iw1p1.c,line:600:    ddc read timeout, byte cnt = 123
...
Dec 13 21:42:38 teres kernel: [HDMI WRN] file:drivers/video/sunxi/disp2/hdmi/hdmi_bsp_sun50iw1p1.c,line:600:    ddc read timeout, byte cnt = 3
Dec 13 21:42:38 teres kernel: [HDMI WRN] file:drivers/video/sunxi/disp2/hdmi/hdmi_bsp_sun50iw1p1.c,line:600:    ddc read timeout, byte cnt = 2
Dec 13 21:42:38 teres kernel: [HDMI WRN] file:drivers/video/sunxi/disp2/hdmi/hdmi_bsp_sun50iw1p1.c,line:600:    ddc read timeout, byte cnt = 1
Dec 13 21:42:38 teres kernel: HDMI set ptbl: 16 2 0 96 7 5 4 1 4 0 0 128 24 88 44 56 45 1 1 
Dec 13 21:42:38 teres kernel: hdmi_clk_enable_prepare()L181
Dec 13 21:42:38 teres kernel: HDMI set ptbl: 16 2 0 96 7 5 4 1 4 0 0 128 24 88 44 56 45 1 1 
Dec 13 21:42:39 teres kernel: hdmi_clk_disable_prepare()L196

I used hdmi through the mini-hdmi to hdmi adapter and then an hdmi to dvi adapter, because I do not have an hdmi monitor.

My config for xorg.conf is basically that of the rel3 branch, only I added to xorg.conf

    Option    "ShadowFB" "false"

In the kernel, I made no related changes (I change things like cpu and io governors, f2fs, etc.)

hehopmajieh commented 5 years ago

Hi Alexei, i see this behavior with some adapters, they do not send valid DDC data, i am working on this