libretro / Lakka-LibreELEC

Lakka is a lightweight Linux distribution that transforms a small computer into a full blown game console.
https://www.lakka.tv
1.75k stars 289 forks source link

Retroflag GPi Raspberry pi Zero 2 W AArch64 image #1544

Closed coreybruce closed 2 years ago

coreybruce commented 3 years ago

Hi I hope this isn't the incorrect place to post and I know it is brand new but I just wanted to ask if we could get a Retroflag GPi Raspberry pi Zero 2 W AArch64 image to support the Pi Zero W in the Retroflag GPi as it also supports the new board and got the Retroflag GPi for the PI Zero 2 W. I am willing to do any testing like I have for xbox one controller bluetooth testing for the pi 4.

Thanks again guys for all your help.

Cicirifu commented 3 years ago

Ive tried implementing this but haven't gotten fully there, so Im sharing my findings

Gonna build myself a 32-bit instead and use the firmware GPU driver instead of the open source VC4 one...

SethBarberee commented 3 years ago

@Cicirifu We did try to use the VC4 driver on GPI Case 32-bit but ran into the aforementioned rotation issues...

dmrlawson commented 3 years ago
  • AArch64 requires use of the VC4 KMS drivers, unless I am mistaken. Thus, my journey began.

There's no requirement for using kms with aarch64. If you look at PiBoy and RetroDreamer we're using aarch64 with fkms for now, which allows us to set up the LCDs. I don't really know anything about the GPi case but maybe this would work?

Cicirifu commented 3 years ago

I could not get display output however until I added support for the inverted Display Enable. (For Full KMS, so vc4-kms) I began with a fairly recent kernel but perhaps I made a mistake there.

As for FKMS, yeah, thatd work, but that still leaves you with the rotation issues. Even if you rotate RetroArch, the console will still be rotated. No big deal, but still bugs me.

coreybruce commented 3 years ago

Hmm interesting findings, hopfully these issues can be resolved. Whats the difference between the arm7l 32bit pi zero and pi zero w image to the Retroflag GPi and doing a pi zero w 2 aarch64 image?

Cicirifu commented 3 years ago

The GPICase build unlike the Pi1/2/3 builds does not use vc4-kms or vc4-fkms but the firmware driver. This allows the screen to be more easily configured. Other than the display issues, it's fairly straight forward to just take the Pi3 device as a base as the Pi02 is essentially a Pi3.

Cicirifu commented 3 years ago

For the record here are the patches and overlay I needed to get it to work on vc4-kms

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 8becb0e31814..6a52110541c3 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -3015,6 +3015,32 @@ static const struct panel_desc okaya_rs800480t_7x0gp = {
    .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
 };

+static const struct drm_display_mode retroflag_gpi_mode = {
+   .clock = 6400,
+   .hdisplay = 240,
+   .hsync_start = 240 + 38,
+   .hsync_end = 240 + 38 + 10,
+   .htotal = 240 + 38 + 10 + 20,
+   .vdisplay = 320,
+   .vsync_start = 320 + 20,
+   .vsync_end = 320 + 20 + 4,
+   .vtotal = 320 + 20 + 4 + 4,
+   .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
+};
+
+static const struct panel_desc retroflag_gpi = {
+   .modes = &retroflag_gpi_mode,
+   .num_modes = 1,
+   .bpc = 8,
+   .size = {
+       .width = 30,
+       .height = 40,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI,
+   .bus_flags = DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
+   .connector_type = DRM_MODE_CONNECTOR_DPI,
+};
+
 static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
    .clock = 9000,
    .hdisplay = 480,
@@ -4243,6 +4269,9 @@ static const struct of_device_id platform_of_match[] = {
    }, {
        .compatible = "ontat,yx700wv03",
        .data = &ontat_yx700wv03,
+   }, {
+       .compatible = "retroflag_gpi",
+       .data = &retroflag_gpi,
    }, {
        .compatible = "ortustech,com37h3m05dtc",
        .data = &ortustech_com37h3m,
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index dde2c6014748..3aa326f1bce3 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -192,6 +192,8 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
        dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, DPI_FORMAT);
    }

+   dpi_c |= DPI_OUTPUT_ENABLE_INVERT | DPI_HSYNC_NEGATE | DPI_VSYNC_NEGATE;
+
    if (mode->flags & DRM_MODE_FLAG_NHSYNC)
        dpi_c |= DPI_HSYNC_INVERT;
    else if (!(mode->flags & DRM_MODE_FLAG_PHSYNC))

(I was lazy with fixing vc4_dpi)

With this being my overlay

/*
 * vc4-kms-v3d-overlay.dts
 */

/dts-v1/;
/plugin/;

#include <dt-bindings/pinctrl/bcm2835.h>

/ {
    compatible = "brcm,bcm2835";

    fragment@0 {
        target-path = "/";
        __overlay__ {
            panel: panel {
                compatible = "retroflag_gpi", "simple-panel";
                orientation = <90>;

                port {
                    panel_in: endpoint {
                        remote-endpoint = <&dpi_out>;
                    };
                };
            };
        };
    };

    fragment@1 {
        target = <&dpi>;
        __overlay__  {
            status = "okay";

            port {
                dpi_out: endpoint@0 {
                    remote-endpoint = <&panel_in>;
                };
            };
        };
    }; 

    fragment@2 {
        target = <&gpio>;
        __overlay__ {
            dpi24: dpi24 {
                brcm,pins = <0 1 2 3 4 5 6 7 8 9
                             12 13 14 15 16 17 20
                             21 22 23 24 25>;
                brcm,function = <6>;
                                brcm,pull = <0>;
            };
        };
    };

    fragment@3 {
        target = <&vc4>;
        __overlay__ {
            pinctrl-names = "default";
            pinctrl-0 = <&dpi24>;
        };
    };

    fragment@4 {
        target = <&fb>;
        __overlay__ {
            pinctrl-names = "default";
            pinctrl-0 = <&dpi24>;
        };
    };
};
coreybruce commented 3 years ago

The GPICase build unlike the Pi1/2/3 builds does not use vc4-kms or vc4-fkms but the firmware driver. This allows the screen to be more easily configured. Other than the display issues, it's fairly straight forward to just take the Pi3 device as a base as the Pi02 is essentially a Pi3.

Ahh I see

coreybruce commented 3 years ago

So how's it all going? Been any progress? 😁

Just super excited to have lakka running on the pi zero W 2 so it can work for the Retroflag GPI

Cicirifu commented 3 years ago

No luck on AArch64, but ARM should be fairly trivial for the people here to add. (Friendly reminder I'm not part of the Lakka developers)

I made a build for personal use after the AArch64 attempts failed. Dumped all the changes here: https://github.com/Cicirifu/Lakka-LibreELEC/commits/gpi-zero2 if you want to compile it for yourself. Left some AArch64 patches in there but those can be safely ignored.

coreybruce commented 3 years ago

Oh that's fine, if it's just arm7l than that doesn't matter, as long as it all works than I am happy with it :D

coreybruce commented 3 years ago

No luck on AArch64, but ARM should be fairly trivial for the people here to add. (Friendly reminder I'm not part of the Lakka developers)

I made a build for personal use after the AArch64 attempts failed. Dumped all the changes here: https://github.com/Cicirifu/Lakka-LibreELEC/commits/gpi-zero2 if you want to compile it for yourself. Left some AArch64 patches in there but those can be safely ignored.

Once I get my pi zero W 2 delivered I will test it out but like I said I don't mind if it starts off as a Arm7l build as long as it all works :)

Where do I download the image?

Cicirifu commented 3 years ago

No luck on AArch64, but ARM should be fairly trivial for the people here to add. (Friendly reminder I'm not part of the Lakka developers) I made a build for personal use after the AArch64 attempts failed. Dumped all the changes here: https://github.com/Cicirifu/Lakka-LibreELEC/commits/gpi-zero2 if you want to compile it for yourself. Left some AArch64 patches in there but those can be safely ignored.

Once I get my pi zero W 2 delivered I will test it out but like I said I don't mind if it starts off as a Arm7l build as long as it all works :)

Where do I download the image?

You build it yourself. I'm not sure if anyone here is okay with me sharing download links, and I don't want to have them floating around the internet anyway.

That, or wait for an official release.

coreybruce commented 3 years ago

Alright so do just use make to build it? what the go with the building process? :)

rudism commented 3 years ago

@coreybruce the docs are a good place to start. Personally I used docker to do it.

coreybruce commented 2 years ago

@coreybruce the docs are a good place to start. Personally I used docker to do it.

It says do

DISTRO=Lakka PROJECT=RPi DEVICE=RPi ARCH=arm make image

Do i need to change anything to make a pi zero 2 w image instead? also apparently Manjaro is a "unsupported distro" which is stupid but it seems to be working

coreybruce commented 2 years ago

Hmm ran into this error

collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:656: make] Error 1
make[3]: Leaving directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-RPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu'
make[2]: *** [Makefile:798: all-recursive] Error 1
make[2]: Leaving directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-RPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu'
make[1]: *** [Makefile:534: all] Error 2
make[1]: Leaving directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-RPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu'
FAILURE: scripts/build make:host has failed!
[001/307] [FAIL] build   make:host

The following logs for this failure are available:
  stdout: /mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-RPi.arm-3.5-devel/.threads/logs/1/stdout
  stderr: /mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-RPi.arm-3.5-devel/.threads/logs/1/stderr

parallel: This job failed:
package_worker 1 1 307 'build make:host'
Parallel build failure - see log for details. Time of failure: Thu Nov 11 14:38:04 AEST 2021
make: *** [Makefile:12: image] Error 1
duduke commented 2 years ago

@coreybruce According to @Cicirifu commits in his github, I think you should run: DISTRO=Lakka PROJECT=RPi DEVICE=Pi02GPi ARCH=arm make image Just got my 02w, gonna try it later today.

coreybruce commented 2 years ago

@coreybruce According to @Cicirifu commits in his github, I think you should run: DISTRO=Lakka PROJECT=RPi DEVICE=Pi02GPi ARCH=arm make image Just got my 02w, gonna try it later today.

Ok so I tried that but got this error

    /mnt/S/Pr/Lakka-LibreELEC    gpi-zero2  DISTRO=Lakka PROJECT=RPi DEVICE=Pi02GPi ARCH=arm make image    ✔ 
./scripts/image mkimage

 =================================================================================
 Configuration for Lakka (community)
 =================================================================================

 Buildoptions:
 ======================================================
 - CPU (ARCH):               cortex-a53 (arm)
 - FLOAT:                hard
 - FPU:                  neon-fp-armv8
 - CPU features:             32bit neon
 - LTO (Link Time Optimization) support: yes
 - GOLD (Google Linker) Support:     yes
 - LLVM support:             no
 - DEBUG:                no

 Graphic configuration:
 ======================================================
 - OpenGL (GLX) support (provider):  no (no)
 - OpenGLES support (provider):      yes (bcm2835-driver)

 Hardware decoder configuration:
 ======================================================
 - Kodi Player driver:           bcm2835-driver
 - VAAPI Support:            no
 - VDPAU Support:            no

 Input device configuration:
 ======================================================
 - Remote support:           no
 - CEC Adapter support:          
 - CEC Framework support:        no
 - Kodi Joystick support:        yes

 Misc. hardware configuration:
 ======================================================
 - ALSA support:             yes
 - Pulseaudio support:           
 - Bluetooth support:            yes
 - Include driver:           rpi-cirrus-config
 - Include driver:           bcm2835-driver
 - Include firmware:             misc-firmware
 - Include firmware:             wlan-firmware
 - Include firmware:             brcmfmac_sdio-firmware-rpi

 Network service configuration:
 ======================================================
 - Avahi (Zeroconf) support:         yes
 - NFS mounting support:         yes
 - SAMBA mounting support:       no
 - SAMBA server support:         no
 - SFTP server support:          yes
 - OpenVPN support:          no
 - WireGuard support:            yes

 OS configuration:
 ======================================================
 - OEM Support:              yes
 - Default ROOT Password:        root
 - Bootloader:               bcm2835-bootloader
 - UDevil support:           no
 - Installer support:            no
 - Include package:          rsync
 - Include package:          xpadneo
 - Include package:          python-raspberry-gpio

 Misc. Filesystems:
 ======================================================
 - Swap Support:             yes
   - Swapfile default size:      128
 - exFAT Support (via Fuse):         no
 - NTFS Support (via Fuse):      no
 - Install HFS Tools:            no

 =================================================================================
 End Configuration for Lakka
 =================================================================================

Packages loaded : 1069
Build trigger(s): 1 [image]
Package steps   : 328

BUILD      make (host)
    TOOLCHAIN      configure (auto-detect)
Executing (host): /mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain --bindir=/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain/bin --sbindir=/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain/sbin --sysconfdir=/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain/etc --libexecdir=/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain/lib --localstatedir=/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain/var --disable-static --enable-shared 
configure: WARNING: unrecognized options: --disable-static, --enable-shared
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for x86_64-pc-linux-gnu-gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking whether /usr/bin/gcc understands -c and -o together... yes
checking dependency style of /usr/bin/gcc... gcc3
checking how to run the C preprocessor... cpp
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for x86_64-pc-linux-gnu-gcc... (cached) /usr/bin/gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether /usr/bin/gcc accepts -g... (cached) yes
checking for /usr/bin/gcc option to accept ISO C89... (cached) none needed
checking whether /usr/bin/gcc understands -c and -o together... (cached) yes
checking dependency style of /usr/bin/gcc... (cached) gcc3
checking for x86_64-pc-linux-gnu-ranlib... ranlib
checking how to run the C preprocessor... cpp
checking for ar... ar
checking for perl... perl
checking for x86_64-pc-linux-gnu-ar... (cached) ar
checking the archiver (ar) interface... ar
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for library containing strerror... none required
checking for a sed that does not truncate output... /usr/bin/sed
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for ld used by /usr/bin/gcc... ld
checking if the linker (ld) is GNU ld... yes
checking for shared library run path origin... done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for library containing getpwnam... none required
checking for ANSI C header files... (cached) yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking whether stat file-mode macros are broken... no
checking whether time.h and sys/time.h may both be included... yes
checking for stdlib.h... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for string.h... (cached) yes
checking for memory.h... (cached) yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for an ANSI C-conforming const... yes
checking return type of signal handlers... void
checking for uid_t in sys/types.h... yes
checking for pid_t... yes
checking for off_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking for unsigned long long int... yes
checking for uintmax_t... yes
checking for nanoseconds field of struct stat... st_mtim.tv_nsec
checking whether to use high resolution file timestamps... yes
checking for library containing clock_gettime... none required
checking whether system uses MSDOS-style paths... no
checking for standard gettimeofday... yes
checking for strdup... yes
checking for strndup... yes
checking for mkstemp... yes
checking for mktemp... yes
checking for fdopen... yes
checking for fileno... yes
checking for dup... yes
checking for dup2... yes
checking for getcwd... yes
checking for realpath... yes
checking for sigsetmask... yes
checking for sigaction... yes
checking for getgroups... yes
checking for seteuid... yes
checking for setegid... yes
checking for setlinebuf... yes
checking for setreuid... yes
checking for setregid... yes
checking for getrlimit... yes
checking for setrlimit... yes
checking for setvbuf... yes
checking for pipe... yes
checking for strerror... yes
checking for strsignal... yes
checking for lstat... yes
checking for readlink... yes
checking for atexit... yes
checking for isatty... yes
checking for ttyname... yes
checking for pselect... yes
checking whether bsd_signal is declared... no
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for strcmpi... no
checking for strncmpi... no
checking for stricmp... no
checking for strnicmp... no
checking for working strcoll... yes
checking for working alloca.h... yes
checking for alloca... yes
checking whether closedir returns void... no
checking pkg-config is at least version 0.9.0... /mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/configure: line 9807: /mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain/bin/pkg-config: No such file or directory
no
checking for GUILE... no
checking for GUILE... no
checking for getloadavg... yes
checking for pstat_getdynamic... no
checking for kstat_open in -lkstat... no
checking for getloadavg... yes
checking whether getloadavg requires setgid... no
checking whether sys_siglist is declared... no
checking whether _sys_siglist is declared... no
checking whether __sys_siglist is declared... no
checking for sys/wait.h... yes
checking for waitpid... yes
checking for wait3... yes
checking for union wait... no
checking for SA_RESTART... yes
checking whether dlopen is declared... yes
checking whether dlsym is declared... yes
checking whether dlerror is declared... yes
checking for library containing dlopen... -ldl
checking If the linker accepts -Wl,--export-dynamic... yes
checking for location of SCCS get command... get
checking if system libc has GNU glob... no
checking if malloc debugging is wanted... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating glob/Makefile
config.status: creating po/Makefile.in
config.status: creating config/Makefile
config.status: creating doc/Makefile
config.status: creating w32/Makefile
config.status: creating tests/config-flags.pm
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
configure: WARNING: unrecognized options: --disable-static, --enable-shared
config.status: creating build.sh
Executing (host): make 
make[1]: Entering directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu'
make  all-recursive
make[2]: Entering directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu'
Making all in glob
make[3]: Entering directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu/glob'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu/glob'
Making all in config
make[3]: Entering directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu/config'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu/config'
Making all in po
make[3]: Entering directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu/po'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu/po'
Making all in doc
make[3]: Entering directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu/doc'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu/doc'
make[3]: Entering directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu'
/usr/bin/gcc  -march=native -O2 -Wall -pipe -I/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain/include -Wno-format-security -Wl,--export-dynamic -Wl,-rpath,/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain/lib -L/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain/lib -o make ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o getopt.o getopt1.o guile.o implicit.o job.o load.o loadapi.o main.o misc.o posixos.o output.o read.o remake.o rule.o signame.o strcache.o variable.o version.o vpath.o hash.o remote-stub.o glob/libglob.a   -ldl 
/usr/bin/ld: glob/libglob.a(glob.o): in function `glob_in_dir':
glob.c:(.text+0x78b): undefined reference to `__stat'
/usr/bin/ld: glob/libglob.a(glob.o): in function `glob':
glob.c:(.text+0xee8): undefined reference to `__stat'
/usr/bin/ld: glob.c:(.text+0x1437): undefined reference to `__stat'
/usr/bin/ld: glob.c:(.text+0x176e): undefined reference to `__stat'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:656: make] Error 1
make[3]: Leaving directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu'
make[2]: *** [Makefile:798: all-recursive] Error 1
make[2]: Leaving directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu'
make[1]: *** [Makefile:534: all] Error 2
make[1]: Leaving directory '/mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/make-4.2.1/.x86_64-pc-linux-gnu'
FAILURE: scripts/build make:host has failed!
[001/328] [FAIL] build   make:host

The following logs for this failure are available:
  stdout: /mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/.threads/logs/1/stdout
  stderr: /mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/.threads/logs/1/stderr

parallel: This job failed:
package_worker 1 1 328 'build make:host'
Parallel build failure - see log for details. Time of failure: Thu Nov 11 19:38:47 AEST 2021
make: *** [Makefile:12: image] Error 1
Cicirifu commented 2 years ago

Build through Docker and it'll get rid of all these annoying "it works on my machine" build errors. Some of your build tools are probably too old or too new or otherwise not compatible. Get the Windows Subsystem for Linux (WSL2) and Docker for Windows with WSL2 integration. Or just use Docker on Linux natively.

docker build -t lakka_build_env . and then my simple build helper in build.sh

coreybruce commented 2 years ago

docker build -t lakka_build_env .

Ok thanks for the help, I'll try that also I am on Manjaro Gnome

btw it seems like I need sudo for docker, is that correct?

Cicirifu commented 2 years ago

Depends entirely on your personal setup. In your case, probably a yes. I tend to leave using sudo as an exercise to the user.

coreybruce commented 2 years ago

Hmm ok it should probs should be standandazed if it does or doesn't, I had to add sudo to the script to make it work but even in docker I ran into a issue I think, it says I don't have zlib so I installed it and it still gives me the error

./build.sh                                           ✔  8s  
./scripts/image mkimage

 =================================================================================
 Configuration for Lakka (community)
 =================================================================================

 Buildoptions:
 ======================================================
 - CPU (ARCH):               cortex-a53 (arm)
 - FLOAT:                hard
 - FPU:                  neon-fp-armv8
 - CPU features:             32bit neon
 - LTO (Link Time Optimization) support: yes
 - GOLD (Google Linker) Support:     yes
 - LLVM support:             no
 - DEBUG:                no

 Graphic configuration:
 ======================================================
 - OpenGL (GLX) support (provider):  no (no)
 - OpenGLES support (provider):      yes (bcm2835-driver)

 Hardware decoder configuration:
 ======================================================
 - Kodi Player driver:           bcm2835-driver
 - VAAPI Support:            no
 - VDPAU Support:            no

 Input device configuration:
 ======================================================
 - Remote support:           no
 - CEC Adapter support:          
 - CEC Framework support:        no
 - Kodi Joystick support:        yes

 Misc. hardware configuration:
 ======================================================
 - ALSA support:             yes
 - Pulseaudio support:           
 - Bluetooth support:            yes
 - Include driver:           rpi-cirrus-config
 - Include driver:           bcm2835-driver
 - Include firmware:             misc-firmware
 - Include firmware:             wlan-firmware
 - Include firmware:             brcmfmac_sdio-firmware-rpi

 Network service configuration:
 ======================================================
 - Avahi (Zeroconf) support:         yes
 - NFS mounting support:         yes
 - SAMBA mounting support:       no
 - SAMBA server support:         no
 - SFTP server support:          yes
 - OpenVPN support:          no
 - WireGuard support:            yes

 OS configuration:
 ======================================================
 - OEM Support:              yes
 - Default ROOT Password:        root
 - Bootloader:               bcm2835-bootloader
 - UDevil support:           no
 - Installer support:            no
 - Include package:          rsync
 - Include package:          xpadneo
 - Include package:          python-raspberry-gpio

 Misc. Filesystems:
 ======================================================
 - Swap Support:             yes
   - Swapfile default size:      128
 - exFAT Support (via Fuse):         no
 - NTFS Support (via Fuse):      no
 - Install HFS Tools:            no

 =================================================================================
 End Configuration for Lakka
 =================================================================================

Packages loaded : 1069
Build trigger(s): 1 [image]
Package steps   : 328

[004/328] [DONE] build   autoconf:host
[001/328] [DONE] build   ccache:host
[002/328] [DONE] build   make:host
[003/328] [DONE] build   autoconf-archive:host
[005/328] [DONE] build   gettext:host
[006/328] [DONE] build   m4:host
[007/328] [DONE] build   automake:host
[008/328] [DONE] build   bison:host
[009/328] [DONE] build   configtools:host
[010/328] [DONE] build   openssl:host
[011/328] [DONE] build   cmake:host
[012/328] [DONE] build   intltool:host
[013/328] [DONE] build   autotools:host
[014/328] [DONE] build   libtool:host
[015/328] [DONE] build   zlib:host
[016/328] [DONE] build   flex:host
[017/328] [DONE] build   bzip2:host
[018/328] [DONE] build   sqlite:host
[019/328] [DONE] build   Python2:host
[020/328] [DONE] build   pkg-config:host
[021/328] [DONE] build   ninja:host
[022/328] [DONE] build   libffi:host
[023/328] [DONE] build   Python3:host
[024/328] [DONE] build   util-linux:host
[025/328] [DONE] build   setuptools:host
[028/328] [DONE] build   p7zip:host
[026/328] [DONE] build   meson:host
[027/328] [DONE] build   pathlib:host
[029/328] [DONE] build   pigz:host
[030/328] [DONE] build   sed:host
[031/328] [DONE] build   libxml2:host
[032/328] [DONE] build   xz:host
[033/328] [DONE] build   toolchain:host
[034/328] [DONE] build   libxslt:host
[035/328] [DONE] build   xmlstarlet:host
[036/328] [DONE] build   binutils:host
[037/328] [DONE] build   gmp:host
[038/328] [DONE] build   mpfr:host
[039/328] [DONE] build   mpc:host
[040/328] [DONE] build   gcc:host
INSTALL      gcc (bootstrap)
[041/328] [DONE] install gcc:bootstrap
[042/328] [DONE] build   linux:host
[043/328] [DONE] build   lzo:host
[044/328] [DONE] build   zstd:host
[045/328] [DONE] build   dosfstools:host
[046/328] [DONE] build   squashfs:host
[047/328] [DONE] build   libcap:host
[048/328] [DONE] build   fakeroot:host
[049/328] [DONE] build   kmod:host
[050/328] [DONE] build   mtools:host
[051/328] [DONE] build   e2fsprogs:host
[052/328] [DONE] build   populatefs:host
INSTALL      toolchain (host)
INSTALL      gcc (host)
INSTALL      toolchain (target)
[053/328] [DONE] install toolchain
INSTALL      tz (target)
[054/328] [DONE] install tz
INSTALL      arm-mem (target)
[055/328] [DONE] install arm-mem
INSTALL      gcc (target)
[056/328] [DONE] install gcc
INSTALL      ccache (host)
INSTALL      autotools (host)
INSTALL      linux (host)
INSTALL      pigz (host)
INSTALL      glibc (target)
[057/328] [DONE] install glibc
BUILD      zlib (target)
    TOOLCHAIN      cmake-make
Executing (target): cmake -DCMAKE_TOOLCHAIN_FILE=/home/ubuntu/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain/etc/cmake-armv8a-libreelec-linux-gnueabi.conf -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=MinSizeRel /home/ubuntu/build.Lakka-Pi02GPi.arm-3.5-devel/zlib-1.2.11
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:4 (project):
  The CMAKE_C_COMPILER:

    /mnt/Storage/Project/Lakka-LibreELEC/build.Lakka-Pi02GPi.arm-3.5-devel/toolchain/bin/armv8a-libreelec-linux-gnueabi-gcc

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/build.Lakka-Pi02GPi.arm-3.5-devel/zlib-1.2.11/.armv8a-libreelec-linux-gnueabi/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/build.Lakka-Pi02GPi.arm-3.5-devel/zlib-1.2.11/.armv8a-libreelec-linux-gnueabi/CMakeFiles/CMakeError.log".
FAILURE: scripts/install zlib has failed!
[058/328] [FAIL] install zlib

The following logs for this failure are available:
  stdout: /home/ubuntu/build.Lakka-Pi02GPi.arm-3.5-devel/.threads/logs/62/stdout
  stderr: /home/ubuntu/build.Lakka-Pi02GPi.arm-3.5-devel/.threads/logs/62/stderr

parallel: This job failed:
package_worker 3 62 328 'install zlib'
Parallel build failure - see log for details. Time of failure: Thu Nov 11 12:05:53 UTC 2021
make: *** [Makefile:12: image] Error 1
Cicirifu commented 2 years ago

If this were run in Docker then "/mnt/Storage/Project/..." should not be a thing that exists, so I'm not sure where that is coming from. Something to debug on your end.

And again for the sudo thing, it varies per user. Not everyone needs sudo. Better to understand when you need sudo and when you don't than blindly telling people to slap sudo in front of it.

coreybruce commented 2 years ago

If this were run in Docker then "/mnt/Storage/Project/..." should not be a thing that exists, so I'm not sure where that is coming from. Something to debug on your end.

And again for the sudo thing, it varies per user. Not everyone needs sudo. Better to understand when you need sudo and when you don't than blindly telling people to slap sudo in front of it.

It's inside /mnt/Storage/Project/Lakka-LibreELEC which is where build.sh is, I do see the projects folder there. I don't have any experience with docker so I don't know hoe to debug this and will need help if I am doing something wrong.

Cicirifu commented 2 years ago

You have it stored there, but your build inside Docker operates in a completely different filesystem. A virtual machine of sorts. Nothing inside of it should have or be given knowledge of folders outside of it, because it will never be able to find it.

But this conversation is getting tiresome so I advise you to google for "Retroflag GPi Discord" and you'll likely stumble upon one that may or may not have a link to my build that is being tested by people I know.

coreybruce commented 2 years ago

You have it stored there, but your build inside Docker operates in a completely different filesystem. A virtual machine of sorts. Nothing inside of it should have or be given knowledge of folders outside of it, because it will never be able to find it.

But this conversation is getting tiresome so I advise you to google for "Retroflag GPi Discord" and you'll likely stumble upon one that may or may not have a link to my build that is being tested by people I know.

Look you can't recommended a way to do something and than abandon a user when it's "tiresome" that's the point of support, it's a two way street of me trying to help you so you can help me and I really want to get this going properly and build the image but I need you guys help for this to happen. You didn't also tell me I needed to log out to properly take affect and work properly which is why it was asking for sudo and now it isn't.

Things need to be better documented with more support for users who do this for the first time otherwise your going to keep running into this issue, I'm not angry or anything but I am just trying to make you understand. :)

Cicirifu commented 2 years ago

I tried being helpful by falling back to a more pragmatic, faster, solution of hinting you towards the image, which is what you initially asked for, while still paying mind to my own concern of sharing random downloads. This because it was obvious the manual build route was going nowhere and would require more support than a Github Issue should be used for. (This is not a chatroom nor a helpdesk)

Furthermore, I don't owe you support in any way, shape, or form. I spent a week of evenings on this and I was kind enough to share it. I am not a Lakka developer. I am not a RetroArch developer. I am a GPi user and a software engineer with spare time. Build instructions in general aren't written with non-developers in mind either.

You didn't also tell me I needed to log out to properly take affect and work properly which is why it was asking for sudo and now it isn't.

This would be because I have no idea what you're on about and you're acting like this is something obvious, when this is something entirely specific to your situation.

This is where I'm gonna end my participation in this discussion.

coreybruce commented 2 years ago

Oh I'm very sorry, I thought thought you were a dev but didn't check, I didn't realize you weren't a developer, I still wouldn't mind downloading a image from you tho.

"This would be because I have no idea what you're on about and you're acting like this is something obvious, when this is something entirely specific to your situation."

I was talking about what was needed to make docker properly work, it's okay hopefully I will find some help to get this going, thanks very much for the help tho. :)

Feel free to continue to contribute like you have to this and again sorry for the confusion.

coreybruce commented 2 years ago

No luck on AArch64, but ARM should be fairly trivial for the people here to add. (Friendly reminder I'm not part of the Lakka developers)

I made a build for personal use after the AArch64 attempts failed. Dumped all the changes here: https://github.com/Cicirifu/Lakka-LibreELEC/commits/gpi-zero2 if you want to compile it for yourself. Left some AArch64 patches in there but those can be safely ignored.

One more thing tho, from my investigation I think there is a issue with either the docker container or the script it uses in the docker container because I figured out how to go into the container and it has the package it claims is missing which is odd..

coreybruce commented 2 years ago

@dmrlawson @SethBarberee @rudism any of you guys have a idea on whats happening? you might know more than I do and I'm willing to learn and help! :D

coreybruce commented 2 years ago

Also want to add that this is the script for the gpi case

https://github.com/RetroFlag/retroflag-picase

gouchi commented 2 years ago

You can try this testing image.

Thank you.

coreybruce commented 2 years ago

You can try this testing image.

Thank you.

Thank you very much, I will let you know how it goes when I test it later! does this come it the script for safe shutdown etc?

gouchi commented 2 years ago

No as I have just compiled Cicirifu tree.

Cicirifu commented 2 years ago

It comes with the same shutdown script as the regular GPICase / Pi0 build, and there's no reason for it not to work. Works fine on my end and the people I shared this with.

coreybruce commented 2 years ago

Awesome can't wait to try, again thank you very much and I will do what ever I can to help with any issues on my end.

duduke commented 2 years ago

I've tried the image @gouchi shared. Most of the things seem to be working. The emulation speed is much much worse compared to the RecalBox beta. I've compared aburner2 on FBNeo on both RecalBox beta and Lakka, and Lakka is much slower. I've verified that i'm not throttling:

vcgencmd get_throttled
throttled=0x0

The CPU seems to stay at 600Mhz even when the FBNeo is running:

cgencmd measure_clock arm
frequency(48)=600000000

Any ideas?

Cicirifu commented 2 years ago
Lakka:~ # vcgencmd measure_clock arm
frequency(48)=1000000000

Running at 1GHz in menu and benchmarking Golden Sun in mGBA.

coreybruce commented 2 years ago

ok so from my testing it works well, I tested GB, GBC and GBA as well as Mega drive, NES and SNES. there was a issue with aspect ration being thin and squashed but I fixed it by setting the aspect ration to 4:3 in the video settings. everything seems to all be working all at full speed but I did notice a little audio pops on SNES when testing Super Mario world.

The default rgui is ok and works fine especially after some customization but it would be nice to have a UI options similar to emulation stations UI would work well for this small resolution as this UI is the only one that work correctly and xmb looks to small on the screen.

Over all this is almost ready for people to use. :D

Cicirifu commented 2 years ago

I have gotten one additional report on my end of someone stuck on 600MHz. While I don't have the same issue, my current image is slightly different. However, before sharing links I did benchmarking as well and none of this showed, running mGBA and PCSX ReARMed at full speed in known demanding games, matching performance I expected. (I have a GPi running a Pi3A with Lakka 2.3.2)

So, anyhow, might be worth looking into. Im expecting it might be distroconfig.txt related or perhaps firmware version. I do not have the ability to investigate at this time.

-------- Original Message -------- On Nov 12, 2021, 08:39, Corey Bruce wrote:

ok so from my testing it works well, I tested GB, GBC and GBA as well as Mega drive, NES and SNES. there was a issue with aspect ration being thin and squashed but I fixed it by setting the aspect ration to 4:3 in the video settings. everything seems to all be working all at full speed but I did notice a little audio pops on SNES when testing Super Mario world.

The default rgui is ok and works fine especially after some customization but it would be nice to have a UI options similar to emulation stations UI would work well for this small resolution as this UI is the only one that work correctly and xmb looks to small on the screen.

Over all this is almost ready for people to use. :D

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

duduke commented 2 years ago

@Cicirifu can you post your config.txt and distroconfig.txt please? Thanks.

coreybruce commented 2 years ago

Yeah with the default image I didn't run into game speed issues

Cicirifu commented 2 years ago

I suspect the 600MHz thing is a red herring. Possible just the CPU scaling. Ive gotten two more confirmations of the 600MHz thing now but no performance complaints. Golden Sun on mGBA or FF7/8/9 on PCSX ReARMed working essentially flawlessly, or certainly not speeds Id expect from a single-core 600MHz. It's possibly just the CPU governor indicating it doesn't need to run all cores at full speed? I've managed to trigger this behaviour on my end as well.

duduke commented 2 years ago

I'm still getting a slowdown with LAKKA. Specifically AfterBurner 2 on FBNeo - Slow on LAKKA, Fast on the RecalBox beta. This is the clock speed on RecalBox:

# vcgencmd measure_clock arm
frequency(48)=1000104000

Maybe the difference is the version of the overlay files? I couldn't detect any noticeable difference in the .txt config files that Recalbox has.

Cicirifu commented 2 years ago

Is it possible FBNeo is compiled incorrectly / not optimally?

duduke commented 2 years ago

Could be, but i've also tested with MAME which is also slower than RecalBox. Maybe the cores are compiled with the wrong CFLAGS?

Cicirifu commented 2 years ago

Worth looking into. It should be compiling with 32-bit cortex-a53, neon-fp-armv8 and FBNeo specially with profile=performance and HAVE_NEON=1.

Ill do a CFLAGS comparison with Recalbox tomorrow

coreybruce commented 2 years ago

Hmm interesting, if that is the case and it does need to be recompiled will we get a new test image?

Is there any tests you guys want me to do?

Cicirifu commented 2 years ago

Did find some issues on the CPU speed front. Turns out cpufreq wasnt present, meaning all scaling was effectively borked. The included Linux kernel config is based on RPI2's, so this was probably a mistake. Enabling CONFIG_ARM_RASPBERRYPI_CPUFREQ didnt end up enabling cpufreq for me and since I am not knowledgeable when it comes to Linux kernel configs, I just took Recalbox's config and presto. Cpufreq was available and aburner2 bumped up from a nice 26 to 42 FPS. Unfortunately I didn't check what FPS Recalbox manages. :')