nerves-project / nerves_system_rpi4

Base Nerves system configuration for the Raspberry Pi 4
Apache License 2.0
91 stars 49 forks source link

Use the full KMS drivers #155

Closed fhunleth closed 2 years ago

fhunleth commented 2 years ago

This switches from the older fake KMS drivers that used to be the only option. It keeps the fake KMS device tree around just in case there's an issue and someone needs to check if there's a regression. After this gets more use, the plan would be to remove the fake KMS overlay.

fhunleth commented 2 years ago

Updated to contain the 7" touchscreen drivers. This is untested.

rkenzhebekov commented 2 years ago

Tried with vc4-kms-dsi-7inch but got a black screen.

I'm not sure if this error message is related somehow:

Screen Shot 2022-06-13 at 10 38 20 PM

Otherwise it seems v3d is loading ok:

Screen Shot 2022-06-13 at 11 10 52 PM

Btw, I noticed that regular RaspberryPI OS desktop uses vc4-kms-v3d as an overlay defined in the config.txt. So, scenic app runs fine on RP 7' screen with RPI4 with default raspberry pi os settings.

Please correct me if I'm wrong. The nerves_system_rpi4 image is not stripped down version of RaspberryPI OS? Is that correct? Thanks.

fhunleth commented 2 years ago

The WiFi error message is ok. The WiFi driver first tries a board specific firmware and then falls back to the generic firmware. In your case, it loads brcmfmac43455-sdio.bin. There is a board-specific configuration file, brcmfmac43455-sdio.raspberrypi,4-model-b.txt, that it loads in a subsequent load. It's unfortunate that the success message isn't printed.

Regarding the nerves_system_rpi4 image, it uses the same Linux kernel that Raspberry Pi OS does. I try to match them up so this is really helpful information about Raspberry Pi OS using vc4-kms-v3d.

To make sure that I understand, could you post the config.txt that works for you.

Also, you're running a Scenic demo app, right? I have a 7" touchscreen and Pi4. Is it something that I could try out as well?

rkenzhebekov commented 2 years ago

aaa, got it. Thank you for the explanation.

The nerves example app can be found here: https://github.com/rkenzhebekov/hello_nerves

The default RaspberryPI OS config.txt is here config.txt

In this video https://drive.google.com/file/d/1rXSb6lNdcNF41QmmiysdM5CVc_EohSXX/view?usp=sharing I show weird behavior that happens after reboot. The initial run of nerves app shows no issue after I burn firmware to SD card. However, after reboot the touchscreen response becomes much slower. Same firmware, same code and nothing is changed between reboot.

This video shows running hello_nerves app on Raspberry PI OS desktop version. https://drive.google.com/file/d/1vjrvbDzKTgal1t6PFKaWB29NCGjkYWGD/view?usp=sharing

fhunleth commented 2 years ago

Thanks for the links. The videos were very helpful. The only difference that I can think of between the first and second runs is that the data partition is formatted on the very first run. That takes a couple seconds. I have no clue why that would make a difference, though.

I will see try to find some time to reproduce here over the next couple days. Hopefully I'll notice another clue.

rkenzhebekov commented 2 years ago

Good to know about data partition on first run. Perhaps, while partition process is running the other processes gets more time to load necessary drivers properly before nerves app starts.

ericr3r commented 2 years ago

I'm not using scenic butt another graphic library and ended up using the vc4-kms-v3d-rpi4 overlay. The normal RaspberyPI OS does refer to vc4-km3-v3d but behind the scenes it is loading vc4-kms-v3d-pi4 using the overlay_map

https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/overlays/overlay_map.dts#L150-L153

jjcarstens commented 2 years ago

I've done a little bit of testing with this, but I'm able to get the example project work. This is repeated in the logs:

11:02:37.176 [warn]  Scenic.Driver.Nerves.Touch: Device not found: "raspberrypi-ts"

I also uncommented config.txt line to use dtoverlay=vc4-kms-dsi-7inch as I'm using the official screen

It seems the full kms driver might be loaded, so I'm not sure if this is configuration issue, my connection, or something missing in this system. Below is some output from the test

dmesg ``` [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083] [ 0.000000] Linux version 5.15.32-v8 (buildroot@buildroot) (aarch64-nerves-linux-gnu-gcc (crosstool-NG 1.25.0.37_618affc) 11.3.0, GNU ld (crosstool-NG 1.25.0.37_618affc) 2.38) #1 SMP PREEMPT Mon Jun 13 16:47:32 MDT 2022 [ 0.000000] Machine model: Raspberry Pi 4 Model B Rev 1.1 [ 0.000000] Reserved memory: created CMA memory pool at 0x000000001ac00000, size 320 MiB [ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000000000000-0x000000003fffffff] [ 0.000000] DMA32 [mem 0x0000000040000000-0x000000007fffffff] [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000033ffffff] [ 0.000000] node 0: [mem 0x0000000040000000-0x000000007fffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff] [ 0.000000] percpu: Embedded 25 pages/cpu s63768 r8192 d30440 u102400 [ 0.000000] pcpu-alloc: s63768 r8192 d30440 u102400 alloc=25*4096 [ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [ 0.000000] Detected PIPT I-cache on CPU0 [ 0.000000] CPU features: detected: Spectre-v2 [ 0.000000] CPU features: detected: Spectre-v4 [ 0.000000] CPU features: detected: Spectre-BHB [ 0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 467712 [ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 smsc95xx.macaddr=DC:A6:32:05:8F:D2 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 fbcon=scrollback:1024k root=/dev/mmcblk0p2 rootfstype=squashfs rootwait consoleblank=0 quiet [ 0.000000] Ignoring scrollback size option [ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] software IO TLB: mapped [mem 0x0000000030000000-0x0000000034000000] (64MB) [ 0.000000] Memory: 1454140K/1900544K available (7616K kernel code, 1220K rwdata, 2020K rodata, 1600K init, 533K bss, 118724K reserved, 327680K cma-reserved) [ 0.000000] random: get_random_u64 called from cache_random_seq_create+0x88/0x190 with crng_init=0 [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 [ 0.000000] trace event string verifier disabled [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU event tracing is enabled. [ 0.000000] Trampoline variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] Root IRQ handler: gic_handle_irq [ 0.000000] GIC: Using split EOI/Deactivate mode [ 0.000000] irq_brcmstb_l2: registered L2 intc (/soc/interrupt-controller@7ef00100, parent irq: 10) [ 0.000000] arch_timer: cp15 timer(s) running at 54.00MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xc743ce346, max_idle_ns: 440795203123 ns [ 0.000001] sched_clock: 56 bits at 54MHz, resolution 18ns, wraps every 4398046511102ns [ 0.000159] Console: colour dummy device 80x25 [ 0.000194] printk: console [tty1] enabled [ 0.000238] Calibrating delay loop (skipped), value calculated using timer frequency.. 108.00 BogoMIPS (lpj=216000) [ 0.000254] pid_max: default: 32768 minimum: 301 [ 0.000441] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.000471] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.001317] cgroup: Disabling memory control group subsystem [ 0.002481] rcu: Hierarchical SRCU implementation. [ 0.003489] smp: Bringing up secondary CPUs ... [ 0.004119] Detected PIPT I-cache on CPU1 [ 0.004185] CPU1: Booted secondary processor 0x0000000001 [0x410fd083] [ 0.004842] Detected PIPT I-cache on CPU2 [ 0.004892] CPU2: Booted secondary processor 0x0000000002 [0x410fd083] [ 0.005500] Detected PIPT I-cache on CPU3 [ 0.005546] CPU3: Booted secondary processor 0x0000000003 [0x410fd083] [ 0.005638] smp: Brought up 1 node, 4 CPUs [ 0.005653] SMP: Total of 4 processors activated. [ 0.005660] CPU features: detected: 32-bit EL0 Support [ 0.005667] CPU features: detected: CRC32 instructions [ 0.016759] CPU: All CPU(s) started at EL2 [ 0.016794] alternatives: patching kernel code [ 0.017751] devtmpfs: initialized [ 0.027163] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.027200] futex hash table entries: 1024 (order: 4, 65536 bytes, linear) [ 0.037393] pinctrl core: initialized pinctrl subsystem [ 0.038272] NET: Registered PF_NETLINK/PF_ROUTE protocol family [ 0.040366] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations [ 0.040620] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 0.041119] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.041536] thermal_sys: Registered thermal governor 'step_wise' [ 0.041710] cpuidle: using governor menu [ 0.041870] ASID allocator initialised with 65536 entries [ 0.041953] Serial: AMBA PL011 UART driver [ 0.042874] printk: console [ramoops-1] enabled [ 0.043079] pstore: Registered ramoops as persistent store backend [ 0.043088] ramoops: using 0x100000@0xf000000, ecc: 16 [ 0.051541] bcm2835-mbox fe00b880.mailbox: mailbox enabled [ 0.057109] platform fe700000.dsi: Fixing up cyclic dependency with fe101000.cprman [ 0.072164] raspberrypi-firmware soc:firmware: Attached to firmware from 2022-03-24T13:20:19, variant start_x [ 0.076186] raspberrypi-firmware soc:firmware: Firmware hash is e5a963efa66a1974127860b42e913d2374139ff5 [ 0.110096] bcm2835-dma fe007000.dma: DMA legacy API manager, dmachans=0x1 [ 0.112589] vgaarb: loaded [ 0.112857] SCSI subsystem initialized [ 0.113012] usbcore: registered new interface driver usbfs [ 0.113060] usbcore: registered new interface driver hub [ 0.113102] usbcore: registered new device driver usb [ 0.113307] usb_phy_generic phy: supply vcc not found, using dummy regulator [ 0.113554] pps_core: LinuxPPS API ver. 1 registered [ 0.113562] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti [ 0.113579] PTP clock support registered [ 0.114653] clocksource: Switched to clocksource arch_sys_counter [ 0.162775] NET: Registered PF_INET protocol family [ 0.163063] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear) [ 0.164907] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear) [ 0.164943] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear) [ 0.165037] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear) [ 0.165290] TCP: Hash tables configured (established 16384 bind 16384) [ 0.165450] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear) [ 0.165483] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear) [ 0.165638] NET: Registered PF_UNIX/PF_LOCAL protocol family [ 0.165675] PCI: CLS 0 bytes, default 64 [ 0.166765] Initialise system trusted keyrings [ 0.166954] workingset: timestamp_bits=46 max_order=19 bucket_order=0 [ 0.172430] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.173706] Key type asymmetric registered [ 0.173716] Asymmetric key parser 'x509' registered [ 0.173789] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248) [ 0.178972] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges: [ 0.179007] brcm-pcie fd500000.pcie: No bus range found for /scb/pcie@7d500000, using [bus 00-ff] [ 0.179055] brcm-pcie fd500000.pcie: MEM 0x0600000000..0x063fffffff -> 0x00c0000000 [ 0.179096] brcm-pcie fd500000.pcie: IB MEM 0x0000000000..0x007fffffff -> 0x0400000000 [ 0.228732] brcm-pcie fd500000.pcie: link up, 5.0 GT/s PCIe x1 (SSC) [ 0.228947] brcm-pcie fd500000.pcie: PCI host bridge to bus 0000:00 [ 0.228961] pci_bus 0000:00: root bus resource [bus 00-ff] [ 0.228975] pci_bus 0000:00: root bus resource [mem 0x600000000-0x63fffffff] (bus address [0xc0000000-0xffffffff]) [ 0.229025] pci 0000:00:00.0: [14e4:2711] type 01 class 0x060400 [ 0.229134] pci 0000:00:00.0: PME# supported from D0 D3hot [ 0.232775] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring [ 0.232945] pci 0000:01:00.0: [1106:3483] type 00 class 0x0c0330 [ 0.232985] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit] [ 0.233118] pci 0000:01:00.0: PME# supported from D0 D3cold [ 0.236678] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01 [ 0.236713] pci 0000:00:00.0: BAR 8: assigned [mem 0x600000000-0x6000fffff] [ 0.236731] pci 0000:01:00.0: BAR 0: assigned [mem 0x600000000-0x600000fff 64bit] [ 0.236756] pci 0000:00:00.0: PCI bridge to [bus 01] [ 0.236768] pci 0000:00:00.0: bridge window [mem 0x600000000-0x6000fffff] [ 0.240454] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled [ 0.242051] iproc-rng200 fe104000.rng: hwrng registered [ 0.242394] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB) [ 0.243247] gpiomem-bcm2835 fe200000.gpiomem: Initialised: Registers at 0xfe200000 [ 0.243515] cacheinfo: Unable to detect cache hierarchy for CPU 0 [ 0.250938] brd: module loaded [ 0.254844] loop: module loaded [ 0.255142] Loading iSCSI transport class v2.0-870. [ 0.258000] bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000 [ 0.322737] unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus [ 0.324837] pci 0000:00:00.0: enabling device (0000 -> 0002) [ 0.324862] xhci_hcd 0000:01:00.0: enabling device (0000 -> 0002) [ 0.324929] xhci_hcd 0000:01:00.0: xHCI Host Controller [ 0.324961] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 1 [ 0.325553] xhci_hcd 0000:01:00.0: hcc params 0x002841eb hci version 0x100 quirks 0x00003c0000000890 [ 0.325938] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15 [ 0.325955] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.325966] usb usb1: Product: xHCI Host Controller [ 0.325976] usb usb1: Manufacturer: Linux 5.15.32-v8 xhci-hcd [ 0.325985] usb usb1: SerialNumber: 0000:01:00.0 [ 0.326485] hub 1-0:1.0: USB hub found [ 0.326532] hub 1-0:1.0: 1 port detected [ 0.326956] xhci_hcd 0000:01:00.0: xHCI Host Controller [ 0.326973] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2 [ 0.326995] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed [ 0.327241] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15 [ 0.327256] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.327266] usb usb2: Product: xHCI Host Controller [ 0.327275] usb usb2: Manufacturer: Linux 5.15.32-v8 xhci-hcd [ 0.327283] usb usb2: SerialNumber: 0000:01:00.0 [ 0.327732] hub 2-0:1.0: USB hub found [ 0.327772] hub 2-0:1.0: 4 ports detected [ 0.328845] dwc_otg: version 3.00a 10-AUG-2012 (platform bus) [ 0.329013] dwc_otg: FIQ enabled [ 0.329020] dwc_otg: NAK holdoff enabled [ 0.329025] dwc_otg: FIQ split-transaction FSM enabled [ 0.329033] Module dwc_common_port init [ 0.329267] usbcore: registered new interface driver usb-storage [ 0.329357] udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers [ 0.329368] i2c_dev: i2c /dev entries driver [ 0.330234] brcmstb-i2c fef04500.i2c: @97500hz registered in polling mode [ 0.330665] brcmstb-i2c fef09500.i2c: @97500hz registered in polling mode [ 0.332540] sdhci: Secure Digital Host Controller Interface driver [ 0.332549] sdhci: Copyright(c) Pierre Ossman [ 0.332889] sdhci-pltfm: SDHCI platform and OF driver helper [ 0.335313] ledtrig-cpu: registered to indicate activity on CPUs [ 0.335443] hid: raw HID events driver (C) Jiri Kosina [ 0.335572] usbcore: registered new interface driver usbhid [ 0.335579] usbhid: USB HID core driver [ 0.340749] NET: Registered PF_INET6 protocol family [ 0.341858] Segment Routing with IPv6 [ 0.341888] In-situ OAM (IOAM) with IPv6 [ 0.341961] NET: Registered PF_PACKET protocol family [ 0.342218] Loading compiled-in X.509 certificates [ 0.342556] pstore: Using crash dump compression: deflate [ 0.344897] uart-pl011 fe201000.serial: there is not valid maps for state default [ 0.345059] uart-pl011 fe201000.serial: cts_event_workaround enabled [ 0.345160] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 19, base_baud = 0) is a PL011 rev2 [ 0.351298] bcm2835-aux-uart fe215040.serial: there is not valid maps for state default [ 0.351683] printk: console [ttyS0] disabled [ 0.351759] fe215040.serial: ttyS0 at MMIO 0xfe215040 (irq = 22, base_baud = 62500000) is a 16550 [ 0.351875] printk: console [ttyS0] enabled [ 0.352614] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer [ 0.352898] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver [ 0.356486] mmc-bcm2835 fe300000.mmcnr: mmc_debug:0 mmc_debug2:0 [ 0.356505] mmc-bcm2835 fe300000.mmcnr: DMA channel allocated [ 0.382244] of_cfs_init [ 0.382286] of_cfs_init: OK [ 0.419580] mmc0: SDHCI controller on fe340000.mmc [fe340000.mmc] using ADMA [ 0.419760] Waiting for root device /dev/mmcblk0p2... [ 0.442642] random: fast init done [ 0.466484] mmc1: new high speed SDIO card at address 0001 [ 0.517009] mmc0: new ultra high speed DDR50 SDHC card at address 5048 [ 0.517530] mmcblk0: mmc0:5048 SD16G 14.4 GiB [ 0.518213] mmcblk0: p1 p2 p3 [ 0.518553] mmcblk0: mmc0:5048 SD16G 14.4 GiB [ 0.533739] VFS: Mounted root (squashfs filesystem) readonly on device 179:2. [ 0.535020] devtmpfs: mounted [ 0.536095] Freeing unused kernel memory: 1600K [ 0.546754] Run /sbin/init as init process [ 0.546762] with arguments: [ 0.546765] /sbin/init [ 0.546769] with environment: [ 0.546772] HOME=/ [ 0.546775] TERM=linux [ 0.582682] usb 1-1: new high-speed USB device number 2 using xhci_hcd [ 0.673073] F2FS-fs (mmcblk0p3): Mounted with checkpoint version = 47db4e76 [ 0.731784] usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.20 [ 0.731803] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 0.731811] usb 1-1: Product: USB2.0 Hub [ 0.732952] hub 1-1:1.0: USB hub found [ 0.733254] hub 1-1:1.0: 4 ports detected [ 0.819813] random: crng init done [ 3.059663] heart: nerves_heart v1.1.0 started. [ 3.059899] heart: kernel watchdog activated (interval 5s) [ 3.655459] bcmgenet fd580000.ethernet: configuring instance for external RGMII (RX delay) [ 3.655670] bcmgenet fd580000.ethernet eth0: Link is Down [ 3.736410] rpivid-mem feb00000.hevc-decoder: rpivid-hevcmem initialised: Registers at 0xfeb00000 length 0x00010000 [ 3.736598] rpivid-mem feb10000.rpivid-local-intc: rpivid-intcmem initialised: Registers at 0xfeb10000 length 0x00001000 [ 3.736752] rpivid-mem feb20000.h264-decoder: rpivid-h264mem initialised: Registers at 0xfeb20000 length 0x00010000 [ 3.736892] rpivid-mem feb30000.vp9-decoder: rpivid-vp9mem initialised: Registers at 0xfeb30000 length 0x00010000 [ 3.740439] mc: Linux media interface: v0.10 [ 3.750950] videodev: Linux video capture interface: v2.00 [ 3.759465] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned. [ 3.759960] bcm2835_vc_sm_cma_probe: Videocore shared memory driver [ 3.759969] [vc_sm_connected_init]: start [ 3.760282] [vc_sm_connected_init]: installed successfully [ 3.760636] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned. [ 3.763509] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned. [ 4.396230] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned. [ 4.399339] bcm2835-codec bcm2835-codec: Device registered as /dev/video10 [ 4.399368] bcm2835-codec bcm2835-codec: Loaded V4L2 decode [ 4.401011] bcm2835-codec bcm2835-codec: Device registered as /dev/video11 [ 4.401030] bcm2835-codec bcm2835-codec: Loaded V4L2 encode [ 4.403336] bcm2835-codec bcm2835-codec: Device registered as /dev/video12 [ 4.403355] bcm2835-codec bcm2835-codec: Loaded V4L2 isp [ 4.404862] bcm2835-codec bcm2835-codec: Device registered as /dev/video18 [ 4.404876] bcm2835-codec bcm2835-codec: Loaded V4L2 image_fx [ 4.406548] bcm2835-codec bcm2835-codec: Device registered as /dev/video31 [ 4.406566] bcm2835-codec bcm2835-codec: Loaded V4L2 encode_image [ 4.407435] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned. [ 4.410523] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13 [ 4.410770] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14 [ 4.410962] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15 [ 4.411114] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16 [ 4.411130] bcm2835-isp bcm2835-isp: Register output node 0 with media controller [ 4.411141] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller [ 4.411148] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller [ 4.411158] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller [ 4.413232] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video20 [ 4.413440] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video21 [ 4.413613] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video22 [ 4.413757] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video23 [ 4.413770] bcm2835-isp bcm2835-isp: Register output node 0 with media controller [ 4.413779] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller [ 4.413785] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller [ 4.413792] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller [ 4.413880] bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp [ 4.417620] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned. [ 4.419601] bcm2835_audio bcm2835_audio: card created with 8 channels [ 4.473358] cfg80211: Loading compiled-in X.509 certificates for regulatory database [ 4.496751] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' [ 4.515146] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6 [ 4.515278] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.bin failed with error -2 [ 4.558584] dwc2 fe980000.usb: supply vusb_d not found, using dummy regulator [ 4.558816] dwc2 fe980000.usb: supply vusb_a not found, using dummy regulator [ 4.684090] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6 [ 4.684231] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6 [ 4.688091] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Nov 1 2021 00:37:25 version 7.45.241 (1a2f2fa CY) FWID 01-703fd60 [ 4.762409] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled [ 4.766812] dwc2 fe980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM [ 4.767127] dwc2 fe980000.usb: DWC OTG Controller [ 4.767157] dwc2 fe980000.usb: new USB bus registered, assigned bus number 3 [ 4.767196] dwc2 fe980000.usb: irq 25, io mem 0xfe980000 [ 4.767448] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15 [ 4.767466] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 4.767477] usb usb3: Product: DWC OTG Controller [ 4.767486] usb usb3: Manufacturer: Linux 5.15.32-v8 dwc2_hsotg [ 4.767495] usb usb3: SerialNumber: fe980000.usb [ 4.768068] hub 3-0:1.0: USB hub found [ 4.768121] hub 3-0:1.0: 1 port detected [ 4.768700] using random self ethernet address [ 4.768712] using random host ethernet address [ 4.769293] usb0: HOST MAC 62:8f:ee:07:77:aa [ 4.769305] usb0: MAC 86:eb:66:27:09:21 [ 4.769334] using random self ethernet address [ 4.769343] using random host ethernet address [ 4.769451] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008 [ 4.769463] g_ether gadget: g_ether ready [ 4.769475] dwc2 fe980000.usb: bound driver g_ether [ 4.811014] [drm] Initialized v3d 1.0.0 20180419 for fec00000.v3d on minor 0 [ 11.761022] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 31.713861] cam-dummy-reg: disabling ```
fhunleth commented 2 years ago

The Crosshair demo is working for me now and it's responsive! The light mode/dark mode switch works, but I can't change the demo.

I want to review my changes to get rid of extraneous settings, but the branch should work with changes to the demo app:

  1. In config/target.exs, change the touchscreen driver name from raspberrypi-ts to "generic ft5x06"
  2. Add a Process.sleep(5000) to the children function in application.ex. This hack is needed since the Scenic driver tries to open the GPU driver too quickly and gives up rather than retrying.
  3. Edit ./deps/scenic_driver_local/c_src/device/drm.c and change /dev/dri/card0 to /dev/dri/card1

Here are the main things that I did in the commits:

  1. Switch the config.txt to autodetect the display like Raspberry Pi OS does. This just seems easier going forward anyway.
  2. Add the overlap_map.dtb file to the overlays directory. Without this, the RPi was applying the non-rpi4 overlays.
  3. I added all of the modules referenced by /sys/firmware/fdt. This was a bit tedious, but the process was to sftp it to my laptop, run dtc -O dts on it, look at all of the "compatible" attributes, search them in the Linux tree and enable the kernel modules associated with them.

I compared the device tree that we're getting to the one that you get with Raspberry Pi OS and it's the same now for the 7" touchscreen.

rkenzhebekov commented 2 years ago

Thank you Frank for making this work!!! I would immediately test this out on my devices but unfortunately I'm currently out of town and don't have access to the devices. Otherwise, I would contribute at least with the testing

fhunleth commented 2 years ago

Hi @rkenzhebekov! Thanks for the update. Definitely no rush - just let me know when you're back and have time. We can pick up testing then.

rkenzhebekov commented 2 years ago

@fhunleth the issue with 'dropdown' selection is related to Scenic.Driver.Nerves.Touch. After I commented out Scenic.Driver.Nerves.Touch the dropdown works fine and I can change demo scenes. I think this issue is unrelated to your changes.

I ran the demo app with your suggestions and with full-kms branch and the screen is responsive!!! :100: Tried to reproduce w/ multiple reboot but problem is no longer reproducible. I guess it is due to additional 5 seconds sleep :)

I think the change in ./deps/scenic_driver_local/c_src/device/drm.c should be discussed with the scenic_driver_local team to see if possible to make it configurable or auto-detectable somehow.

axelson commented 2 years ago

@rkenzhebekov this is very exciting! How is the performance on the screen with this setup? Does it feel generally performant? (I know that previous versions felt extremely laggy)

fhunleth commented 2 years ago

I'm going to go ahead and merge this since it seems like it works good enough. We're planning a minor version bump to nerves_system_rpi4 soon, so this is a good time for a bigger change like this.

fhunleth commented 2 years ago

@rkenzhebekov Thank you for testing and the feedback!

rkenzhebekov commented 2 years ago

@rkenzhebekov this is very exciting! How is the performance on the screen with this setup? Does it feel generally performant? (I know that previous versions felt extremely laggy)

@axelson it feels performant to me. The noticeable lag is gone. Also, tried with Boyd's Transform example and it is also fast.

axelson commented 2 years ago

That's great to hear!