Odroid C2, no desktop

And with the second/alternative config?

cat << '_EOF_' > /etc/X11/xorg.conf/99-modesetting.conf
Section "Device"
    Identifier "Mali Graphics"
    Driver     "modesetting"
    Option     "AccelMethod"   "glamor"
    Option     "kmsdev"        "/dev/dri/card1"
EndSection
_EOF_

I thought I had included it in the last post, but I just did it again. No improvement, unfortunately

root@DietPi:~# cat << '_EOF_' > /etc/X11/xorg.conf.d/99-modesetting.conf
Section "Device"
    Identifier "Mali Graphics"
    Driver     "modesetting"
    Option     "AccelMethod"   "glamor"
    Option     "kmsdev"        "/dev/dri/card1"
EndSection
_EOF_
root@DietPi:~# startx


X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
Build Operating System: linux Debian
Current Operating System: Linux DietPi 5.10.81-meson64 #21.08.6 SMP PREEMPT Mon Nov 22 11:21:51 UTC 2021 aarch64
Kernel command line: root=UUID=467a02df-3af4-4309-acd8-4d78ffe91171 rootwait rootfstype=ext4 console=ttyAML0,115200 console=tty1 consoleblank=0 coherent_pool=2M loglevel=4 ubootpart=28120000-01 libata.force=noncq usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u "net.ifnames=0"
Build Date: 16 December 2021  05:08:23PM
xorg-server 2:1.20.11-1+deb11u1 (https://www.debian.org/support)
Current version of pixman: 0.40.0
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Tue Feb 22 15:54:05 2022
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
root@DietPi:~#

Can you show cat /var/log/Xorg.0.log as well?

Seems like nothing is there

root@DietPi:~# cat /var/log/Xorg.0.log
root@DietPi:~#

Try running startx again and check for the log. It might be cleaned up in meantime.

OK, I got this

root@DietPi:~# cat /var/log/Xorg.0.log
[  9781.897]
X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
[  9781.897] Build Operating System: linux Debian
[  9781.898] Current Operating System: Linux DietPi 5.10.81-meson64 #21.08.6 SMP PREEMPT Mon Nov 22 11:21:51 UTC 2021 aarch64
[  9781.898] Kernel command line: root=UUID=467a02df-3af4-4309-acd8-4d78ffe91171 rootwait rootfstype=ext4 console=ttyAML0,115200 console=tty1 consoleblank=0 coherent_pool=2M loglevel=4 ubootpart=28120000-01 libata.force=noncq usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u "net.ifnames=0"
[  9781.898] Build Date: 16 December 2021  05:08:23PM
[  9781.898] xorg-server 2:1.20.11-1+deb11u1 (https://www.debian.org/support)
[  9781.898] Current version of pixman: 0.40.0
[  9781.898]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[  9781.898] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  9781.898] (==) Log file: "/var/log/Xorg.0.log", Time: Tue Feb 22 18:30:57 2022
[  9781.899] (==) Using config file: "/etc/X11/xorg.conf"
[  9781.899] (==) Using config directory: "/etc/X11/xorg.conf.d"
[  9781.899] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[  9781.899] (==) No Layout section.  Using the first Screen section.
[  9781.899] (==) No screen section available. Using defaults.
[  9781.899] (**) |-->Screen "Default Screen Section" (0)
[  9781.899] (**) |   |-->Monitor "<default monitor>"
[  9781.900] (==) No device specified for screen "Default Screen Section".
        Using the first device section listed.
[  9781.900] (**) |   |-->Device "Mali Graphics"
[  9781.900] (==) No monitor specified for screen "Default Screen Section".
        Using a default monitor configuration.
[  9781.900] (**) Option "BlankTime" "0"
[  9781.900] (==) Automatically adding devices
[  9781.900] (==) Automatically enabling devices
[  9781.900] (==) Automatically adding GPU devices
[  9781.900] (==) Max clients allowed: 256, resource mask: 0x1fffff
[  9781.901] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[  9781.901]    Entry deleted from font path.
[  9781.901] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[  9781.901]    Entry deleted from font path.
[  9781.901] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[  9781.901]    Entry deleted from font path.
[  9781.901] (WW) The directory "/usr/share/fonts/X11/Type1" does not exist.
[  9781.901]    Entry deleted from font path.
[  9781.901] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[  9781.901]    Entry deleted from font path.
[  9781.901] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[  9781.901]    Entry deleted from font path.
[  9781.901] (==) FontPath set to:
        /usr/share/fonts/X11/misc,
        built-ins
[  9781.901] (==) ModulePath set to "/usr/lib/xorg/modules"
[  9781.901] (**) Extension "DPMS" is disabled
[  9781.901] (II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
[  9781.901] (II) Loader magic: 0xaaaad2671e28
[  9781.901] (II) Module ABI versions:
[  9781.901]    X.Org ANSI C Emulation: 0.4
[  9781.901]    X.Org Video Driver: 24.1
[  9781.901]    X.Org XInput driver : 24.1
[  9781.901]    X.Org Server Extension : 10.0
[  9781.903] (--) using VT number 2

[  9781.903] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[  9781.905] (II) xfree86: Adding drm device (/dev/dri/card1)
[  9781.907] (II) xfree86: Adding drm device (/dev/dri/card0)
[  9781.923] (II) no primary bus or device found
[  9781.923]    falling back to /sys/devices/platform/soc/d0000000.apb/d00c0000.gpu/drm/card1
[  9781.923] (II) LoadModule: "glx"
[  9781.924] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[  9781.928] (II) Module glx: vendor="X.Org Foundation"
[  9781.928]    compiled for 1.20.11, module version = 1.0.0
[  9781.928]    ABI class: X.Org Server Extension, version 10.0
[  9781.928] (II) LoadModule: "modesetting"
[  9781.928] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[  9781.928] (II) Module modesetting: vendor="X.Org Foundation"
[  9781.928]    compiled for 1.20.11, module version = 1.20.11
[  9781.929]    Module class: X.Org Video Driver
[  9781.929]    ABI class: X.Org Video Driver, version 24.1
[  9781.929] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[  9781.967] (WW) Falling back to old probe method for modesetting
[  9781.973] (II) modeset(0): using default device
[  9781.989] (II) modeset(G0): using drv /dev/dri/card0
[  9781.989] (EE)
Fatal server error:
[  9781.990] (EE) Cannot run in framebuffer mode. Please specify busIDs        for all framebuffer devices
[  9781.990] (EE)
[  9781.990] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[  9781.990] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[  9781.990] (EE)
[  9782.120] (EE) Server terminated with error (1). Closing log file.
root@DietPi:~#

Okay, still the same, even card 0 is still used, despite that we defined card 1 explicitly :thinking:.

Let’s try with the edge kernel:

rm /etc/X11/xorg.conf.d/99-modesetting.conf
apt install linux-{image,dtb}-edge-meson64 linux-u-boot-odroidc2-edge
. /usr/lib/u-boot/platform_install.sh
write_uboot_platform "$DIR" "$(lsblk -npo PKNAME "$G_ROOTFS_DEV")"

Reboot required for this to take effect.

This edge kernel does work either and you find time, could you test the Armbian image and see whether its the same? https://dl.armbian.com/odroidc2/Bullseye_current

Unfortunately, after reboot it still returns the same errors with xinit

I have tried Armbian on the same SBC, and its desktop works fine. (Overall DietPi does feel quicker)

Seems not many people are using DietPi on Odroid C2, if you think it will take a long time to fix the issue in DietPi, I will just install Armbian and call it a day.

I think I found something. Can you try:

cat << '_EOF_' > /etc/X11/xorg.conf.d/02-dietpi-aml-s905.conf
Section "OutputClass"
    Identifier "Amlogic"
    MatchDriver "meson"
    Driver "modesetting"
    Option "PrimaryGPU" "true"
EndSection
Section "Screen"
    Identifier "Default Screen"
    Device "Meson"
    Monitor "foo"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "1920x1080" "1440x900" "1280x720" "1280x1024" "1280x960" "1024x768" "800x600" "640x480" "720x400"
    EndSubSection
EndSection
_EOF_

Well, something happened, but now the C2 is hung-up - meaning it is not returning to “root@dietpi:~#”

root@DietPi:~# cat << '_EOF_' > /etc/X11/xorg.conf.d/02-odroidc2.conf
Section "OutputClass"
    Identifier "Amlogic"
    MatchDriver "meson"
    Driver "modesetting"
    Option "PrimaryGPU" "true"
EndSection
Section "Screen"
    Identifier "Default Screen"
    Device "Meson"
    Monitor "foo"
    DefaultDepth 24
    SubSection "Display"
       Depth 24
       Modes "1920x1080" "1440x900" "1280x720" "1280x1024" "1280x960" "1024x768" "800x600" "640x480" "720x400"
    EndSubSection
EndSection
_EOF_
root@DietPi:~# startx


X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
Build Operating System: linux Debian
Current Operating System: Linux DietPi 5.15.18-meson64 #trunk.0023 SMP PREEMPT Sat Jan 29 16:01:32 UTC 2022 aarch64
Kernel command line: root=UUID=467a02df-3af4-4309-acd8-4d78ffe91171 rootwait rootfstype=ext4 console=ttyAML0,115200 console=tty1 consoleblank=0 coherent_pool=2M loglevel=4 ubootpart=28120000-01 libata.force=noncq usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u "net.ifnames=0"
Build Date: 16 December 2021  05:08:23PM
xorg-server 2:1.20.11-1+deb11u1 (https://www.debian.org/support)
Current version of pixman: 0.40.0
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Feb 24 15:07:52 2022
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.

Sorry, spoke too soon!

I rebooted the C2 and logged on directly (not through SSH) and the desktop came up.

Good work!

Let me have a closer look and I will give my feedback.

yes this is as expected if you start the desktop from a SSH session. It will looks like your system is hanging, but a desktop should be started on a connected physical screen.

To start it from SSH without blocking the console:

startx &

Solution implemented with: https://github.com/MichaIng/DietPi/pull/5291/commits/572d1b3