I have a Raspberry Pi 4 Model B connected to a 5-inch FREENOVE touchscreen display via the DSI cable.
When I boot it up using Raspberry Pi OS, it automatically detects the display and shows a desktop environment on it. I’m able to send clicks to the desktop by touching the screen. It looks like this:
I’d like to get the same thing working with NixOS 23.11, but I cannot figure it out. Here’s the best configuration I could come up with (with the networking and user login details elided):
{ config, pkgs, modulesPath, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
#(modulesPath + "/profiles/all-hardware.nix") # doesn't help
];
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
# Using the RPi kernel like this makes a text console show up on DSI monitor,
# but not X, and it also prevents X from showing up on an HDMI monitor.
#boot.kernelPackages = pkgs.linuxPackages_rpi4;
# [networking, SSH, and user setup omitted]
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
system.stateVersion = "23.11";
}
In case it matters, I initialied my NixOS SD card using nixos-sd-image-23.11.6708.12430e43bd9b-aarch64-linux.img.
When I use the configuration above, I can see some text while NixOS is booting, but then it just goes into a loop where the touchscreen is filled with one color, cycling between black, white, red, green, and blue. Here’s a 58-second video showing what happens:
This problem is specific to this particular type of monitor. If I boot up NixOS with an HDMI monitor attached instead of DSI, then it displays GNOME on the HDMI monitor just fine.
Additional troubleshooting info:
- Raspberry Pi OS, successfully displaying an X desktop on the DSI monitor:
- dmesg_good.txt
-
lsmod_good.txt
- The
tc358762
andpanel_simple
modules seem to be important here.
- The
- NixOS 23.11, mainline kernel, displaying a cycle of colors on the DSI monitor:
-
dmesg_bad_dsi.txt
- The error message “vc4-drm gpu: [drm] Cannot find any crtc or sizes” might be relevant here.
- lsmod_bad_dsi.txt
-
dmesg_bad_dsi.txt
- NixOS 23.11, mainline kernel, successfully displaying an X desktop on an HDMI monitor:
(This forum doesn’t let me upload a 2.2 MB mp4 video, or TXT files, but luckily I know how to host these files myself!)
So, has anyone gotten Rasbperry Pi + DSI + NixOS + X to work before? Or does anyone know how to start troubleshooting this sort of thing? What component is generating the black/white/red/green/blue cycle and what does it mean? I’m not really sure what components are responsible for making a DSI display work and how to see the error messages produced by them. Thanks!