Thanks for the suggestions.
- With the mainline kernel and just a DSI monitor connected when booting, there are no
/dev/fb*devices. - With the mainline kernel and just an HDMI monitor connected when booting, there is just
/dev/fb0. (The HDMI monitor works in this scenario and displays a desktop.) - With the Raspberry Pi 4 kernel provided by NixOS I am always seeing
/dev/fb0and/dev/fb1as long as one type of display is plugged in when booting. I can successfully display images on the touchscreen usingnix-shell -p fbidaand then a command likefbi -d /dev/fb1 image.jpg. When the touchscreen display is connected,fb0andfb1both correspond to it, but usingfb0makes the red and blue channels get swapped.
So this is some good progress!
Given the results above, I think the most promising path is to use the Raspberry Pi 4 kernel provided in NixOS (i.e. boot.kernelPackages = pkgs.linuxPackages_rpi4;). However, I’ve never gotten that kernel to display any kind of graphical desktop. In my latest attempt, I looked at the link you sent, and I converted it to this config fragment:
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
drivers = [
{
name = "myfb";
driverName = "fbdev";
deviceSection = ''
Option "fbdev" "/dev/fb1"
'';
display = true;
}
];
};
By looking in /etc/systemd/system/display-manager.service, I can tell that these new lines of Nix code were converted to the following lines in the generated xorg.conf file:
Section "Device"
Identifier "Device-myfb[0]"
Driver "fbdev"
Option "fbdev" "/dev/fb1"
EndSection
I also tried display = false;.
But still, all I can see on the touchscreen is a text console, even if I try pressing Ctrl+Shift+Fx for every x from 1 to 12.
According to systemctl status display-manager, the display manager service is running, but its log has warnings in it according to journalctl -xu display-manager:
-- Boot 5a1ebe0249244df0ba86f844d8c93e18 --
May 07 19:48:11 pololupi3 systemd[1]: Starting Display Manager...
░░ Subject: A start job for unit display-manager.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit display-manager.service has begun execution.
░░
░░ The job identifier is 97.
May 07 19:48:11 pololupi3 systemd[1]: Started Display Manager.
░░ Subject: A start job for unit display-manager.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit display-manager.service has finished successfully.
░░
░░ The job identifier is 97.
May 07 19:48:51 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 19:48:51 pololupi3 gdm[903]: Gdm: Child process -1000 was already dead.
May 07 19:48:51 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 19:48:51 pololupi3 gdm[903]: Gdm: Child process -1000 was already dead.
May 07 19:48:51 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 19:48:51 pololupi3 gdm[903]: Gdm: Child process -1011 was already dead.
May 07 19:48:51 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 19:48:51 pololupi3 gdm[903]: Gdm: Child process -1011 was already dead.
May 07 19:48:51 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 19:48:51 pololupi3 gdm[903]: Gdm: Child process -1022 was already dead.
May 07 19:48:51 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 19:48:51 pololupi3 gdm[903]: Gdm: Child process -1022 was already dead.
May 07 19:48:52 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 19:48:52 pololupi3 gdm[903]: Gdm: Child process -1033 was already dead.
May 07 19:48:52 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 19:48:52 pololupi3 gdm[903]: Gdm: Child process -1033 was already dead.
May 07 19:48:52 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 19:48:52 pololupi3 gdm[903]: Gdm: Child process -1044 was already dead.
May 07 19:48:52 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 19:48:52 pololupi3 gdm[903]: Gdm: Child process -1044 was already dead.
May 07 19:48:52 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 19:48:52 pololupi3 gdm[903]: Gdm: GdmLocalDisplayFactory: maximum number of X display failures reached: ch>
May 07 19:48:52 pololupi3 gdm[903]: Gdm: Child process -1055 was already dead.
May 07 20:04:35 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 20:04:35 pololupi3 gdm[903]: Gdm: GdmLocalDisplayFactory: maximum number of X display failures reached: ch>
May 07 20:04:35 pololupi3 gdm[903]: Gdm: Child process -1186 was already dead.
May 07 20:04:44 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 20:04:44 pololupi3 gdm[903]: Gdm: GdmLocalDisplayFactory: maximum number of X display failures reached: ch>
May 07 20:04:44 pololupi3 gdm[903]: Gdm: Child process -1198 was already dead.
May 07 20:05:02 pololupi3 gdm[903]: Gdm: GdmDisplay: Session never registered, failing
May 07 20:05:02 pololupi3 gdm[903]: Gdm: GdmLocalDisplayFactory: maximum number of X display failures reached: ch>
May 07 20:05:02 pololupi3 gdm[903]: Gdm: Child process -1227 was already dead.
–David