[SOLVED] Pi4 - second monitor unavailable in aarch64

This is for ARMv8 based devices

[SOLVED] Pi4 - second monitor unavailable in aarch64

Postby Malvineous » Sun Jul 18, 2021 6:25 am

Has anyone gotten the second HDMI output to work in the 64-bit version of Arch Linux ARM?

It works fine for me with the 32-bit distro, but when I boot the 64-bit one both monitors are set to slightly different rainbow colours, and after that point only the first screen is used. I can load Xorg and applications on the first screen, but the second one just continues to display the rainbow colours from the boot process.

I had to install the xf86-video-fbdev module before Xorg would load, but I'm not sure if this is correct. It's supposed to use hardware accelerated VC4 graphics, but I can't find anyone who has documented how they got Xorg going on the Pi4 + aarch64.

Is the second HDMI output not supported on the 64-bit distro? It said on the Arch Linux ARM install page that the 64-bit distro supports all the hardware so I'm guessing it must just be some sort of configuration option I missed. Any pointers?
Last edited by Malvineous on Sun Aug 15, 2021 9:00 am, edited 1 time in total.
Malvineous
 
Posts: 40
Joined: Sat Mar 11, 2017 1:45 pm

Re: Pi4 - second monitor unavailable in aarch64

Postby minus » Sun Jul 18, 2021 3:17 pm

Greetings.

$this->bbcode_second_pass_quote('', '
')Has anyone gotten the second HDMI output to work in the 64-bit version of Arch Linux ARM?


It does for me, using

$this->bbcode_second_pass_code('', '
$ pacman -Q | grep raspberry
firmware-raspberrypi 20210224-1
linux-raspberrypi4 5.10.46-2
linux-raspberrypi4-headers 5.10.46-2
raspberrypi-bootloader 20210716-1
raspberrypi-bootloader-x 20210716-1
raspberrypi-firmware 20210623-1
')

The package linux-raspberrypi4 includes this confix.txt file which should make things work out of the box.

I use wayland but I don't think it's relevant, the U-Boot configuration should be more. If I were you I would do a search on the raspbian forum, for X specific configurations.
minus
 
Posts: 4
Joined: Thu Jul 15, 2021 6:41 pm

Re: Pi4 - second monitor unavailable in aarch64

Postby Malvineous » Sun Jul 18, 2021 4:11 pm

Hello, thanks for your reply, and for confirming it works!

I think the initramfs line in config.txt is not relevant here because that file is loaded via U-Boot, but I have the other line present in my config.txt already. I am booting the Pi over the network without an SD card so I am not using the default U-Boot configuration, but everything else works so I think all the proper device trees etc. are being loaded.

I see you are using an older version of linux-raspberrypi4 (5.10.46-2, latest is 5.10.50-1) so I will see if I can downgrade to your version in case it's a bug in the latest kernel.

I don't think the X configuration is the issue, as the Linux kernel itself will draw the console on all framebuffer devices by default (well before X has loaded) and indeed on the 32-bit kernel this is what happens - the boot messages appear on both screens. However under the 64-bit kernel one of the monitors never gets initialised by the kernel (still showing the rainbow colours set by the firmware) so I think the problem is with the framebuffer/KMS rather than X.

Certainly in the 32-bit environment I don't need any X configuration file at all, both monitors are brought up as a single Xinerama display, and in the correct position relative to each other.

I note you are using linux-raspberrypi4 whereas I am running linux-raspberrypi, however both packages seem to be for the Pi4:

$this->bbcode_second_pass_code('', '
$ pacman -Ss linux-raspberrypi
core/linux-raspberrypi 5.10.50-1 [installed]
The Linux Kernel and modules - Raspberry Pi 4
core/linux-raspberrypi-headers 5.10.50-1
Header files and scripts for building modules for linux kernel - Raspberry Pi 4
core/linux-raspberrypi4 5.10.50-1
The Linux Kernel and modules - Raspberry Pi 4
core/linux-raspberrypi4-headers 5.10.50-1
Header files and scripts for building modules for linux kernel - Raspberry Pi 4
')
Any idea what the difference is between the "pi4" and non-"pi4" versions, if they both say in their descriptions they are for the Pi 4?
Malvineous
 
Posts: 40
Joined: Sat Mar 11, 2017 1:45 pm

Re: Pi4 - second monitor unavailable in aarch64

Postby graysky » Sun Jul 18, 2021 4:20 pm

A few years back, RPi Foundation caused us to split the kernels due to some config changes. They are pretty similar other wise but there are differences in the configs.
graysky
Developer
 
Posts: 1723
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Pi4 - second monitor unavailable in aarch64

Postby robg » Sun Jul 18, 2021 5:27 pm

Disclaimer: I don't boot my RPI over the network, hence the following information may already be known / vacuous to you.

My guess is that using the RPI kernel (linux-raspberrypi[4]), following their instructions should work. Note that uboot is not involved.
robg
 
Posts: 185
Joined: Tue Jan 05, 2021 8:22 am

Re: Pi4 - second monitor unavailable in aarch64

Postby minus » Sun Jul 18, 2021 5:42 pm

The older version of the kernel is for a bug that I'm experiencing on wayland, I haven't seen other people complaining about it, so there is no reason to downgrade. The reason I installed the pi4 package is that in the list of packages only the one ending with 4 says is for aarch64, but I haven't compared them (and graysky explained). I haven't tried to boot from network, so that is another difference.

Can you paste the config.txt file you're using? For reference, my config.txt has the following settings for hdmi output:

$this->bbcode_second_pass_code('', '
hdmi_drive=1
disable_overscan=1
max_framebuffers=1
')

With two framebuffers (the default) it works as intended - that's just a personal preference.

You can check some configurations by running

$this->bbcode_second_pass_code('', '
$ cat /proc/cmdline
')

and also this and this are relevant (sorry if you have already gone through them, I linked them to make sure).

Another thing that I would check is the eeprom version (and changelog), if you have the raspberrypi-firmware package installed you can do it by running

$this->bbcode_second_pass_code('', '
$ vcgencmd bootloader_version

Apr 29 2021 17:11:25
version c2f8c388c4ee37ad709ace403467d163e8dd91ce (release)
timestamp 1619712685
update-time 1625945081
capabilities 0x0000001f
')
minus
 
Posts: 4
Joined: Thu Jul 15, 2021 6:41 pm

Re: Pi4 - second monitor unavailable in aarch64

Postby Malvineous » Tue Jul 20, 2021 12:56 pm

$this->bbcode_second_pass_quote('robg', 'D')isclaimer: I don't boot my RPI over the network, hence the following information may already be known / vacuous to you.

My guess is that using the RPI kernel (linux-raspberrypi[4]), following their instructions should work. Note that uboot is not involved.


Those instructions were missing information about the Pi4 until a couple of weeks ago, when I submitted a PR to get the Pi4 added. So I'm quite familiar with them :)

It seems one of my mistakes was that the official aarch64 download uses the linux-aarch64 and uboot-raspberrypi packages, which I was then net booting which is why I thought I had to use U-Boot for 64-bit on the Pi. I have now realised that replacing these with the linux-raspberrypi4 package gives me a 64-bit kernel, without U-Boot (so directly net bootable by the firmware) and it allows the official commands like vcgencmd to work.

However switching to this kernel still only leaves me with one usable HDMI monitor.

$this->bbcode_second_pass_quote('minus', '
')Can you paste the config.txt file you're using?

I have tried the following options:
  • Blank config.txt - works, one monitor
  • dtoverlay=vc4-fkms-v3d - works, one monitor
  • dtoverlay=vc4-kms-v3d - freezes just before getty user login (i.e. Xorg isn't running), both screens initialise, watchdog reboots 16 seconds later
  • dtoverlay=vc4-kms-v3d-pi4 - freezes just before getty user login, both screens initialise, watchdog reboots 16 seconds later
  • dtoverlay=vc4-kms-v3d-pi4 + gpu_mem=256 - no change, both screens initialise before getty login but the system locks (can't ping it)

I had a look through your other suggestions but couldn't see anything that seemed like it would control the two screens. I don't think the HDMI settings are at fault because both screens initialise and display a picture, it's just the picture on the second monitor doesn't update after the kernel starts loading.

The EEPROM version matches the one you have listed - I had to update it when I first started this to get network booting working as the version that shipped with the Pi had some bugs that prevented it from working.
Malvineous
 
Posts: 40
Joined: Sat Mar 11, 2017 1:45 pm
Top

Re: Pi4 - second monitor unavailable in aarch64

Postby robg » Wed Jul 21, 2021 1:12 pm

$this->bbcode_second_pass_quote('Malvineous', 'T')hose instructions were missing information about the Pi4 until a couple of weeks ago, when I submitted a PR to get the Pi4 added. So I'm quite familiar with them.


It's an interestingly small world : ) Many thanks for your contributions to the RPI community!

With regard to the monitor issue: The KMS driver is currently under heavy development and it appears that bugs are introduced and resolved with each kernel update. What helped me once in the past was disabling frequency scaling with "force_turbo=1" in /boot/config.txt. It might be worth giving it a try. Also, if you are booting into a graphical target, try if instaling xf86-video-fbdev or xf86-video-fbturbo-git helps.
robg
 
Posts: 185
Joined: Tue Jan 05, 2021 8:22 am
Top

Re: Pi4 - second monitor unavailable in aarch64

Postby Malvineous » Sun Aug 15, 2021 8:59 am

I ended up getting this working. I'm not entirely sure what worked, but it seems that you have to specify "dtoverlay=vc4-fkms-v3d" to get a "fake" KMS. This gives you one framebuffer across both monitors, but if you use the non-fake KMS (dtoverlay=vc4-kms-v3d) then you instead get two framebuffers (/dev/fb0 and /dev/fb1) which means you end up with two Xorg screens. You may be able to combine them into one display with Xinerama but you lose OpenGL support then.

Sticking with the "fake" KMS one gives you both screens, xrandr shows them correctly, and hardware-accelerated OpenGL works. I also found I had to add "max_framebuffers=2" to get both screens on even though it's supposed to be the default.

At any rate, here is my whole working config, which also includes options that attempt to hard-code the connected monitors so they both come up in the event that the Pi boots while the screens are switched off (since I switch them off overnight but leave the Pi running.)

$this->bbcode_second_pass_code('', '
initramfs initramfs-linux.img followkernel

# This works and gives dual-monitors and OpenGL
dtoverlay=vc4-fkms-v3d
gpu_mem=256

# Also CMA is needed for something - worked with, haven't tested without
cma=300M

# Two displays (default on Pi4)
max_framebuffers=2

# Force monitors to be detected as present even if they are off
hdmi_force_hotplug=1:0
hdmi_force_hotplug=1:1

# Use monitor timings (rather than TV)
hdmi_group=2

# 1920x1200 @ 60 Hz w/ reduced blanking
hdmi_mode=68:0
hdmi_mode=68:1
')
Malvineous
 
Posts: 40
Joined: Sat Mar 11, 2017 1:45 pm


Return to ARMv8 Devices

Who is online

Users browsing this forum: No registered users and 3 guests