raspberrypi / firmware

This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware.
5.11k stars 1.68k forks source link

rpi4 hdmi not working with motorola atrix lapdock #1202

Open d3xt3r01 opened 4 years ago

d3xt3r01 commented 4 years ago

3a+(hdmi works by default) vs 4b(hdmi doesn't work by default)

Docs used: https://www.raspberrypi.org/documentation/configuration/config-txt/video.md Image used: 2019-07-10-raspbian-buster-lite.img from https://www.raspberrypi.org/downloads/raspbian/ Ran: apt update && apt upgrade && apt dist-upgrade

Ran: apt install raspberrypi-ui-mods On pi4 I used the hdmi port 0 near the usb-c connector

Both report:

# uname -a
Linux pi 4.19.57-v7l+ #1244 SMP Thu Jul 4 18:48:07 BST 2019 armv7l GNU/Linux
# cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
  1. 3a+

Works just fine by default

root@pi3aplus:~# grep -vE '^(#|$)' /boot/config.txt
dtparam=audio=on
[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
root@pi3aplus:~# /opt/vc/bin/tvservice -m CEA
Group CEA has 5 modes:
mode 1: 640x480 @ 60Hz 4:3, clock:25MHz progressive
mode 2: 720x480 @ 60Hz 4:3, clock:27MHz progressive
mode 3: 720x480 @ 60Hz 16:9, clock:27MHz progressive
mode 17: 720x576 @ 50Hz 4:3, clock:27MHz progressive
mode 18: 720x576 @ 50Hz 16:9, clock:27MHz progressive
root@pi3aplus:~# /opt/vc/bin/tvservice -m DMT
Group DMT has 2 modes:
mode 4: 640x480 @ 60Hz 4:3, clock:25MHz progressive
(prefer) mode 86: 1366x768 @ 60Hz 16:9, clock:72MHz progressive
root@pi3aplus:~# /opt/vc/bin/tvservice -s
state 0xa [HDMI DMT (86) RGB full 16:9], 1366x768 @ 60.00Hz, progressive
root@pi3aplus:~# /opt/vc/bin/tvservice -d edid.dat
Written 256 bytes to edid.dat
root@pi3aplus:~# /opt/vc/bin/edidparser edid.dat
Enabling fuzzy format match...
Parsing edid.dat...
HDMI:EDID version 1.3, 1 extensions, screen size 26x14 cm
HDMI:EDID features - videodef 0x80 !standby !suspend !active off; colour encoding:RGB444|YCbCr422; sRGB is not default colourspace; preferred format is native; does not support GTF
HDMI:EDID found monitor S/N descriptor tag 0xff
HDMI:EDID found monitor range descriptor tag 0xfd
HDMI:EDID monitor range offsets: V min=0, V max=0, H min=0, H max=0
HDMI:EDID monitor range: vertical is 50-75 Hz, horizontal is 30-85 kHz, max pixel clock is 150 MHz
HDMI:EDID monitor range does not support GTF
HDMI:EDID found monitor name descriptor tag 0xfc
HDMI:EDID monitor name is MotoAttach
HDMI:EDID found preferred DMT detail timing format: 1366x768p @ 60 Hz (86)
HDMI:EDID established timing I/II bytes are 00 00 00
HDMI:EDID standard timings block x 8: 0x0101 0101 0101 0101 0101 0101 0101 0101
HDMI:EDID parsing v3 CEA extension 0
HDMI:EDID monitor support - underscan IT formats:no, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:1
HDMI:EDID found DMT detail timing format: 1366x768p @ 60 Hz (86)
HDMI:EDID found DMT detail timing format: 1366x768p @ 60 Hz (86)
HDMI:EDID failed to find a matching detail format for 0x1080i hfp:88 hs:44 hbp:-116 vfp:2 vs:5 vbp:16 pixel clock:0 MHz
HDMI:EDID calculated refresh rate is 0 Hz
HDMI:EDID guessing the format to be 0x1080i @24 Hz
HDMI:EDID found unknown detail timing format: 0x1080i hfp:88 hs:44 hbp:-116 vfp:2 vs:5 vbp:16 pixel clock:0 MHz
HDMI:EDID found CEA format: code 1, 640x480p @ 60Hz
HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz
HDMI:EDID found CEA format: code 18, 720x576p @ 50Hz
HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48|96|192 kHz, sample size: 16|20|24 bits
HDMI:EDID found HDMI VSDB length 5
HDMI:EDID HDMI VSDB has physical address 1.0.0.0
HDMI:EDID HDMI VSDB has no extension fields
HDMI:EDID adding mandatory support for DMT (4) 640x480p @ 60Hz
HDMI:EDID adding mandatory support for CEA (2) 720x480p @ 60Hz
HDMI:EDID adding mandatory support for CEA (17) 720x576p @ 50Hz
HDMI:EDID filtering formats with pixel clock unlimited MHz or h. blanking unlimited
HDMI:EDID best score mode initialised to DMT (4) 640x480p @ 60 Hz with pixel clock 25 MHz (score 0)
HDMI:EDID best score mode is now CEA (1) 640x480p @ 60 Hz with pixel clock 25 MHz (score 43432)
HDMI:EDID best score mode is now CEA (2) 720x480p @ 60 Hz with pixel clock 27 MHz (score 45736)
HDMI:EDID CEA mode (3) 720x480p @ 60 Hz with pixel clock 27 MHz has a score of 45736
HDMI:EDID DMT mode (4) 640x480p @ 60 Hz with pixel clock 25 MHz has a score of 36864
HDMI:EDID CEA mode (17) 720x576p @ 50 Hz with pixel clock 27 MHz has a score of 45736
HDMI:EDID CEA mode (18) 720x576p @ 50 Hz with pixel clock 27 MHz has a score of 45736
HDMI:EDID best score mode is now DMT (86) 1366x768p @ 60 Hz with pixel clock 72 MHz (score 5188835)
HDMI0:EDID preferred mode remained as DMT (86) 1366x768p @ 60 Hz with pixel clock 72 MHz
HDMI:EDID has HDMI support and audio support
/opt/vc/bin/edidparser exited with code 0
  1. pi4

This, by default, doesn't work. not even the colored square before the boot. So I tend to believe it's not raspbian's fault.

root@pi4b:~# grep -vE '^(#|$)' /boot/config.txt
dtparam=audio=on
[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
root@pi4b:~# /opt/vc/bin/tvservice -m CEA
Group CEA has 5 modes:
mode 1: 640x480 @ 60Hz 4:3, clock:25MHz progressive
mode 2: 720x480 @ 60Hz 4:3, clock:27MHz progressive
mode 3: 720x480 @ 60Hz 16:9, clock:27MHz progressive
mode 17: 720x576 @ 50Hz 4:3, clock:27MHz progressive
mode 18: 720x576 @ 50Hz 16:9, clock:27MHz progressive
root@pi4b:~# /opt/vc/bin/tvservice -m DMT
Group DMT has 2 modes:
mode 4: 640x480 @ 60Hz 4:3, clock:25MHz progressive
(prefer) mode 86: 1366x768 @ 60Hz 16:9, clock:72MHz progressive
root@pi4b:~# /opt/vc/bin/tvservice -s
state 0xa [HDMI CUSTOM RGB full 16:9], 1366x768 @ 60.00Hz, progressive
root@pi4b:~# /opt/vc/bin/tvservice -d edid.dat
Written 256 bytes to edid.dat
root@pi4b:~# /opt/vc/bin/edidparser edid.dat
Enabling fuzzy format match...
Parsing edid.dat...
HDMI:EDID version 1.3, 1 extensions, screen size 26x14 cm
HDMI:EDID features - videodef 0x80 !standby !suspend !active off; colour encoding:RGB444|YCbCr422; sRGB is not default colourspace; preferred format is native; does not support GTF
HDMI:EDID found monitor S/N descriptor tag 0xff
HDMI:EDID found monitor range descriptor tag 0xfd
HDMI:EDID monitor range offsets: V min=0, V max=0, H min=0, H max=0
HDMI:EDID monitor range: vertical is 50-75 Hz, horizontal is 30-85 kHz, max pixel clock is 150 MHz
HDMI:EDID monitor range does not support GTF
HDMI:EDID found monitor name descriptor tag 0xfc
HDMI:EDID monitor name is MotoAttach
HDMI:EDID found preferred DMT detail timing format: 1366x768p @ 60 Hz (86)
HDMI:EDID established timing I/II bytes are 00 00 00
HDMI:EDID standard timings block x 8: 0x0101 0101 0101 0101 0101 0101 0101 0101
HDMI:EDID parsing v3 CEA extension 0
HDMI:EDID monitor support - underscan IT formats:no, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:1
HDMI:EDID found DMT detail timing format: 1366x768p @ 60 Hz (86)
HDMI:EDID found DMT detail timing format: 1366x768p @ 60 Hz (86)
HDMI:EDID failed to find a matching detail format for 0x1080i hfp:88 hs:44 hbp:-116 vfp:2 vs:5 vbp:16 pixel clock:0 MHz
HDMI:EDID calculated refresh rate is 0 Hz
HDMI:EDID guessing the format to be 0x1080i @24 Hz
HDMI:EDID found unknown detail timing format: 0x1080i hfp:88 hs:44 hbp:-116 vfp:2 vs:5 vbp:16 pixel clock:0 MHz
HDMI:EDID found CEA format: code 1, 640x480p @ 60Hz
HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz
HDMI:EDID found CEA format: code 18, 720x576p @ 50Hz
HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48|96|192 kHz, sample size: 16|20|24 bits
HDMI:EDID found HDMI VSDB length 5
HDMI:EDID HDMI VSDB has physical address 1.0.0.0
HDMI:EDID HDMI VSDB has no extension fields
HDMI:EDID adding mandatory support for DMT (4) 640x480p @ 60Hz
HDMI:EDID adding mandatory support for CEA (2) 720x480p @ 60Hz
HDMI:EDID adding mandatory support for CEA (17) 720x576p @ 50Hz
HDMI:EDID filtering formats with pixel clock unlimited MHz or h. blanking unlimited
HDMI:EDID best score mode initialised to DMT (4) 640x480p @ 60 Hz with pixel clock 25 MHz (score 0)
HDMI:EDID best score mode is now CEA (1) 640x480p @ 60 Hz with pixel clock 25 MHz (score 43432)
HDMI:EDID best score mode is now CEA (2) 720x480p @ 60 Hz with pixel clock 27 MHz (score 45736)
HDMI:EDID CEA mode (3) 720x480p @ 60 Hz with pixel clock 27 MHz has a score of 45736
HDMI:EDID DMT mode (4) 640x480p @ 60 Hz with pixel clock 25 MHz has a score of 36864
HDMI:EDID CEA mode (17) 720x576p @ 50 Hz with pixel clock 27 MHz has a score of 45736
HDMI:EDID CEA mode (18) 720x576p @ 50 Hz with pixel clock 27 MHz has a score of 45736
HDMI:EDID best score mode is now DMT (86) 1366x768p @ 60 Hz with pixel clock 72 MHz (score 5188835)
HDMI0:EDID preferred mode remained as DMT (86) 1366x768p @ 60 Hz with pixel clock 72 MHz
HDMI:EDID has HDMI support and audio support
/opt/vc/bin/edidparser exited with code 0

So I tried messing with /boot/config.txt

This, works, even if it's 640x480, at least it works.

root@pi4b:~# grep -vE '^(#|$)' /boot/config.txt
hdmi_safe=1
dtparam=audio=on
[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
root@pi4b:~# /opt/vc/bin/tvservice -m CEA
Group CEA has 5 modes:
mode 1: 640x480 @ 60Hz 4:3, clock:25MHz progressive
mode 2: 720x480 @ 60Hz 4:3, clock:27MHz progressive
mode 3: 720x480 @ 60Hz 16:9, clock:27MHz progressive
mode 17: 720x576 @ 50Hz 4:3, clock:27MHz progressive
mode 18: 720x576 @ 50Hz 16:9, clock:27MHz progressive
root@pi4b:~# /opt/vc/bin/tvservice -m DMT
Group DMT has 2 modes:
(prefer) mode 4: 640x480 @ 60Hz 4:3, clock:25MHz progressive
mode 86: 1366x768 @ 60Hz 16:9, clock:72MHz progressive
root@pi4b:~# /opt/vc/bin/tvservice -s
state 0xa [HDMI CUSTOM RGB full 4:3], 640x480 @ 60.00Hz, progressive

So I noticed that on pi3aplus the state is set to DMT(86).... I tried forcing that too, doesn't work either

root@pi4b:~# grep -vE '^(#|$)' /boot/config.txt
hdmi_group=2
hdmi_mode=86
dtparam=audio=on
[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
root@pi4b:~# /opt/vc/bin/tvservice -m CEA
Group CEA has 5 modes:
mode 1: 640x480 @ 60Hz 4:3, clock:25MHz progressive
mode 2: 720x480 @ 60Hz 4:3, clock:27MHz progressive
mode 3: 720x480 @ 60Hz 16:9, clock:27MHz progressive
mode 17: 720x576 @ 50Hz 4:3, clock:27MHz progressive
mode 18: 720x576 @ 50Hz 16:9, clock:27MHz progressive
root@pi4b:~# /opt/vc/bin/tvservice -m DMT
Group DMT has 2 modes:
mode 4: 640x480 @ 60Hz 4:3, clock:25MHz progressive
(prefer) mode 86: 1366x768 @ 60Hz 16:9, clock:72MHz progressive
root@pi4b:~# /opt/vc/bin/tvservice -s
state 0xa [HDMI CUSTOM RGB full 16:9], 1366x768 @ 60.00Hz, progressive

I also tried with an empty config.txt file too.

Stokestack commented 3 years ago

Just ran into this issue today as well. Atrix dock worked fine with older Pis, but my 4 shows blank screen with a momentary glimpse of character output when booting latest Pi OS.

Initially I investigated because Kodi is unusable on this screen. Bummer.

6by9 commented 3 years ago

@Stokestack Whilst the Atrix dock (and many 1366x768 displays) don't work by default with the Pi4, the workaround works fine. It should work with Kodi too, although latest nightlies for LibreElec use the vc4-kms-v3d overlay which needs the mode configuring in an alternate way (same as the firmware, it'll filter out modes with an odd number of horizontal pixels in the timings from the EDID)

AltrixDock

There isn't one guaranteed solution for absolutely all displays, therefore it's not feasible to fix this up automatically.

It's a scenario that wasn't picked up during development of the hardware, but there's no way to fix these devices now.

(The bit I haven't got working is the USB, but i think that's cabling)

6by9 commented 3 years ago

@vmincev What cabling are you using? Blinking and green dots is normally down to a dodgy lead. The cable I'm using is https://www.amazon.co.uk/gp/product/B00S6IBNIQ/, although it's currently unavailable.

Stokestack commented 3 years ago

@6by9 Thanks for that info. Do you have a link to anything showing the latest LibreElec config method?

d3xt3r01 commented 2 years ago

Just an update, with 2021-05-07-raspios-buster-armhf-full.img and the above settings, CLI/X is fine! with 2021-10-30-raspios-bullseye-armhf-full.img and the above settings CLI is fine but X is messed up in a weird way.

popcornmix commented 2 years ago

with 2021-10-30-raspios-bullseye-armhf-full.img and the above settings CLI is fine but X is messed up in a weird way.

Can you provide a photo of what you are seeing?

ancient-geek commented 2 years ago

An update: With a PiTop Ceed V1, using "2021-10-30-raspios-bullseye-armhf-full.img" and the above settings in config.txt makes the command line OK, but the desktop looks like this: PiTopCeed Pi4 Bullseye

Running the following:

xrandr --newmode "Ceed" 70.01064 1368 1414 1446 1498 768 772 776 780 +hsync -vsync
xrandr --addmode HDMI-1 Ceed
xrandr --output HDMI-1 --mode Ceed

fixes the desktop.

Putting these lines into $HOME/.xprofile as suggested in various places to get the settings to persist after a reboot doesn't appear to work.

However, editing /etc/X11/xorg.conf to be as follows does make the desktop start correctly on each boot:

Section "Monitor"
    Identifier "Ceed"
    Modeline   "Ceed" 70.12 1368 1414 1446 1498 768 772 776 780 +hsync -vsync
    Option "PreferredMode" "Ceed"
EndSection 
Section "Screen"
    Identifier "Ceed"
    Device "HDMI-1"
    Monitor "Ceed"
EndSection 
bnhf commented 2 years ago

For Motorola Atrix Lapdock users that have modified config.txt with the lines (which are easily added by editing the file on the SD card right after flashing the Raspberry Pi OS -- on the same machine you used to do the flash):

hdmi_group=2
hdmi_cvt=1366 768 60
hdmi_mode=87

but are seeing a desktop as shown above by @ancient-greek, the same fix as described for the Ceed works on the Lapdock for 2021-10-30-raspios-bullseye-armhf.

The easiest way to implement it on the Lapdock is to press <ctrl><fn><alt>F1 after the RPi4 is done booting, which will get you from the unusable desktop display to the command line. From there, sudo nano /etc/X11/xorg.conf will get you into the editor with elevated privileges to add these lines (same as above substituting "Lapdock" for "Ceed"):

Section "Monitor"
    Identifier "Lapdock"
    Modeline   "Lapdock" 70.12 1368 1414 1446 1498 768 772 776 780 +hsync -vsync
    Option "PreferredMode" "Lapdock"
EndSection
Section "Screen"
    Identifier "Lapdock"
    Device "HDMI-1"
    Monitor "Lapdock"
EndSection

Save the file and reboot, and you should be in business!

bnhf commented 2 years ago

For Motorola Atrix Lapdock users that have modified config.txt with the lines (which are easily added by editing the file on the SD card right after flashing the Raspberry Pi OS -- on the same machine you used to do the flash):

hdmi_group=2
hdmi_cvt=1366 768 60
hdmi_mode=87

but are seeing a desktop as shown above by @ancient-greek, the same fix as described for the Ceed works on the Lapdock for 2021-10-30-raspios-bullseye-armhf.

The easiest way to implement it on the Lapdock is to press <ctrl><fn><alt>F1 after the RPi4 is done booting, which will get you from the unusable desktop display to the command line. From there, sudo nano /etc/X11/xorg.conf will get you into the editor with elevated privileges to add these lines (same as above substituting "Lapdock" for "Ceed"):

Section "Monitor"
    Identifier "Lapdock"
    Modeline   "Lapdock" 70.12 1368 1414 1446 1498 768 772 776 780 +hsync -vsync
    Option "PreferredMode" "Lapdock"
EndSection
Section "Screen"
    Identifier "Lapdock"
    Device "HDMI-1"
    Monitor "Lapdock"
EndSection

Save the file and reboot, and you should be in business!

A couple of things to add to the above:

First, the modifications to config.txt and creation of xorg.conf also work on the 64bit version of the Raspberry Pi OS with the Motorola Atrix Lapdock (tested on 2022-01-28-raspios-bullseye-arm64).

Second, to make creation of the xorg.conf easier, at the same time as you're modifying config.txt (on whatever system you're using to flash the OS), create an empty file in the same folder with the name "ssh". This will give you the ability to connect using ssh right from first boot, which will make it a snap to copy and paste the lines above.

Another idea, which I have not tested, is to add the xorg.conf file to the boot folder (again right after flashing the SD) and move it to the /etc/X11 folder after first boot -- and then reboot. Permissions on my functioning file are 0644, but 0755 will probably work too.

bnhf commented 2 years ago

Another idea, which I have not tested, is to add the xorg.conf file to the boot folder (again right after flashing the SD) and move it to the /etc/X11 folder after first boot -- and then reboot. Permissions on my functioning file are 0644, but 0755 will probably work too.

I had to flash another card, so I tried it -- and it works. Create an empty xorg.conf file on the SD card and copy and paste the above contents into it. Boot, use the key sequence above to get from the desktop to the command line, and execute:

sudo mv /boot/xorg.conf /etc/X11

followed by:

sudo reboot
Stokestack commented 9 months ago

If anyone tries this resolution with a Pi 5 when they're out, please let us know if it works out of the box.

Thanks to those in the thread for the extensive troubleshooting efforts!

johnkramme commented 7 months ago

If anyone tries this resolution with a Pi 5 when they're out, please let us know if it works out of the box.

Thanks to those in the thread for the extensive troubleshooting efforts!

I'm happy to announce ...64 bit bookworm os works with a RPI 5 on the Motorola Atrix Lapdock :-)

Stokestack commented 7 months ago

Great, thanks for the update! Anybody know if Bookworm works out of the box on a Pi 4?

johnkramme commented 7 months ago

Great, thanks for the update! Anybody know if Bookworm works out of the box on a Pi 4?

If you refer to bookworm working with PI 4 on Atrix Lapdock .....the answer is NO ...it is still the vanished screensolution 1366 x 768 / split picture 👎

Stokestack commented 7 months ago

That's what I meant. Thanks for your reply.

johnkramme commented 7 months ago

Another thing is ...the 8 gb PI4 ...works better than ever with bookworm as an os ...i think it's nice wayland now is doing the job.

MorfeoMatrixx commented 2 months ago

Running bookworm/wayland RPi4 and using the following in config.txt, the Motorola Lapdock display works !!! No need for me to modify wayfire.ini

disable_fw_kms_setup=1 (commented out)

hdmi_drive=2 hdmi_group=2 hdmi_cvt=1368 768 60 hdmi_mode=87

EkkeNekkepenn commented 1 week ago

@ MorfeoMatrixx: Running latest bookworm on rpi 4 8. Making above changes to /boot/firmware/config.txt and changing raspi-config to wayland still leave me with a slanted screen on the lapdock. Also tried #dtoverlay=vc4-kms-v3d - which resulted in no screen at all. Do yu have any idea/hint on how to get rid of the slanting?

popcornmix commented 1 week ago

If you don't add anything to config.txt (which only affects the deprecated firmware display driver), but add to cmdline.txt

video=HDMI-A-1:1368x768M@60D

(on existing line) what do you see?

EkkeNekkepenn commented 1 week ago

nq popcornmix: sorry for late response - should not happen when help is granted. With the addition of video=HDMI-A-1:1368x768M@60D to /boot/firmware/cmdline.txt the screen is still slanted. Tried it with wayland on and x11 on, same results: slanted. BTW tried the lapdock with DietPI - and it works like a charme. Let's save your time and go for DietPI

MorfeoMatrixx commented 6 days ago

@ MorfeoMatrixx: Running latest bookworm on rpi 4 8. Making above changes to /boot/firmware/config.txt and changing raspi-config to wayland still leave me with a slanted screen on the lapdock. Also tried #dtoverlay=vc4-kms-v3d - which resulted in no screen at all. Do yu have any idea/hint on how to get rid of the slanting?

Hi EkkeNekkepenn, sorry for this very late reply, attached are my full config files from my working setup, with my neofetch details with versions, etc. neofetch.txt config.txt wayfire.ini.txt

MorfeoMatrixx commented 6 days ago

Ah, I forgot to mention that I configured the GUI for AUTOLOGON using raspi-config, to bypass the GUI Logon window that even with these settings still appears slanted. There should be an additional file to modify (that I don't recall...) if you don't use autologon.

Let me know if you succeed, good luck ! SShot_2407001