asakous / libreelec_emuelec_h5

2 stars 0 forks source link

AllWinner H5 - No 3.5mm Audio - No Wifi AP6212 #1

Closed rnadesignlab closed 2 years ago

rnadesignlab commented 2 years ago

Hi Asakous,

Many thanks for this image. I have an android TV Box which is based on Allwinner H5, however the Android OS is kind of broken. I was losing a hope until I found your Emuelec Image for Allwinner H5. Everything works fine, except for 3.5mm Audio Jack and Wifi (AP6212).

Would you please update the image to the newer version of Emuelec? Or, could you please tell me how to compile to the newest Emuelec version if you don't mind? I can compile it myself if you do not have time. But I don't know how to do it?

Many Thanks for your effort. RNA

asakous commented 2 years ago

I lost my source code and I sold my H5 board too. so no more update . for 3.5mm Audio Jack I recommend go buy a cheap USB sound card , It should work out of box. AP6212 as far as I know there is no mainline kernel driver for this chip. If you really want to compile by yourself. those are what I did. Libreelec + EmuELEC . Libreelec -> remove kodi add emuelec package, some package need add or remove config in order to compile some emuelec programs probably, ex gcc , boost.... alsa. Emuelec->copy sx05re folder to Libreelec . than compile Libreelec , you will get a lot of error . try fix one by one.

rnadesignlab commented 2 years ago

Hi, thanks for your quick reply.

That's so unfortunate to lose the source code. And sadly there will be no future update for this amazing image because you had sold your device. To be honest, I feel like your image is more stable and more robust than the RetroRangePi image. In case of RetroRangePi, the emulationstation always breaks if there's a rom failure or after crash.

I will try the workaround that you mentioned about audio jack and wifi 6212.

I just want to ask you something in regards to compilaton process that you did.

  1. Download LibreElec & Flash to SD Card (Orange Pi PC2)
  2. Plug The SD Card and Boot into LibreElec
  3. How did you remove kodi and add some package to emuelec? How did you access the terminal?
  4. What is the dependencies that is needed? Because almost in all github page, emuelec only support for Amlogic compilation process. I have no idea what is the command that you used to compile the H5 board?

Many Thanks

asakous commented 2 years ago

Hi, thanks for your quick reply.

That's so unfortunate to lose the source code. And sadly there will be no future update for this amazing image because you had sold your device. To be honest, I feel like your image is more stable and more robust than the RetroRangePi image. In case of RetroRangePi, the emulationstation always breaks if there's a rom failure or after crash.

I will try the workaround that you mentioned about audio jack and wifi 6212.

I just want to ask you something in regards to compilaton process that you did. you need to compile from source code 1.prepare a Linux machine , I use ubuntu 16 as dev environment. ubuntu 18 should work too. 2: git clone Libreelec and Emuelec 3:combine two source code . copy emuelec sx05re folder to Libreelec package folder 4:run PROJECT=Allwinner ARCH=arm DEVICE=H5 make -j4 image 5: fix error one by one.

  1. Download LibreElec & Flash to SD Card (Orange Pi PC2)

  2. Plug The SD Card and Boot into LibreElec

  3. How did you remove kodi and add some package to emuelec? How did you access the terminal?

  4. What is the dependencies that is needed? Because almost in all github page, emuelec only support for Amlogic compilation process. I have no idea what is the command that you used to compile the H5 board?

Many Thanks

rnadesignlab commented 2 years ago

Many Thanks,

I am using Linux Mint 20 (Ubuntu LTS 20.04), do you think it will be ok? I just want to confirm the "combine two source code" part. Which one to override, the EmuElec to override the LibreElec or vice versa?

asakous commented 2 years ago

Many Thanks,

I am using Linux Mint 20 (Ubuntu LTS 20.04), do you think it will be ok? I just want to confirm the "combine two source code" part. Which one to override, the EmuElec to override the LibreElec or vice versa? Linux Mint 20 -> not sure , the worst scenario is that some emulators won't compile under new gcc copy emuelec sx05re folder into Librelec package folder.

rnadesignlab commented 2 years ago

This Works for me:

  1. cd

  2. sudo apt install gcc make git unzip wget xz-utils libsdl2-dev libsdl2-mixer-dev libfreeimage-dev libfreetype6-dev libcurl4-openssl-dev rapidjson-dev libasound2-dev libgl1-mesa-dev build-essential libboost-all-dev cmake fonts-droid-fallback libvlc-dev libvlccore-dev vlc-bin texinfo premake4 golang libssl-dev curl patchelf xmlstarlet default-jre xsltproc

  3. git clone https://github.com/LibreELEC/LibreELEC.tv.git

  4. git clone https://github.com/EmuELEC/EmuELEC.git

  5. cp -r ~/EmuELEC/packages/sx05re ~/LibreELEC.tv/packages

  6. cd LibreELEC.tv

  7. PROJECT=Allwinner ARCH=arm DEVICE=H5 make -j4 image

Many Thanks @asakous for your advice, You are AWESOME :)

*Currently I am Compiling using Linux Mint 20 (Ubuntu 20.04)

asakous commented 2 years ago

I found the very last image I have. I don;t remember it's ok or not. but worth a try. https://drive.google.com/file/d/1YzFE5Yx7J3SZpvW5knwzHESYB3_B2JZf/view?usp=sharing

rnadesignlab commented 2 years ago

Hi Asakous, many thanks for your latest image, it works. I just noticed that the EmuELEC version is still the same as your previous image (EmuELEC 3.9). The problem was, I compressed my roms into the latest libretro compatible core to save space. Therefore when I open in EmuELEC 4.3 it was fine, but in EmuELEC 3.9 it gave me error.

I want to update my status, I spent 5 hours before it stopped asking more space, then another 4 hours before I got a sudden power cut. Finally I spent another 6 hours of compiling without error (from scratch) until I reached this point. Until I got error that the gnupg.org Website was offline.

Cannot get libgcrypt sources : https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.7.tar.bz2
Try later!
*********** FAILED COMMAND ***********
. "${get_handler}"
**************************************
*********** FAILED COMMAND ***********
${SCRIPTS}/get "${PKG_NAME}"
**************************************
*********** FAILED COMMAND ***********
${SCRIPTS}/unpack "${PKG_NAME}" "${PARENT_PKG}"
**************************************
*********** FAILED COMMAND ***********
${SCRIPTS}/build "${1}" "${PARENT_PKG}"
**************************************
FAILURE: scripts/install libgcrypt:target has failed!

The following log for this failure is available:
  /mnt/DATA/EmuELEC-H5/build.LibreELEC-H5.arm-11.0-devel/.threads/logs/239.log

>>> libgcrypt:target seq 239 >>>
[239/280] [FAIL] install libgcrypt:target

The following log for this failure is available:
  /mnt/DATA/EmuELEC-H5/build.LibreELEC-H5.arm-11.0-devel/.threads/logs/239.log

But when I start over the build code, it shows random error just before "239.log". Is there any command to skip these log numbers? I mean just straight to number 239 from the start?

Many Thanks for your help

asakous commented 2 years ago

you can't just ignore errors. libgcrypt is needed for some packages. as message said . Try later!.

rnadesignlab commented 2 years ago

Hi, it seems I successfully compiled the image. Haven't burned it yet to SD Card. But I am just Curious why I got Tritium H5 image instead of Orange Pi PC 2 image? I hope it can boot.

Here's the result:

image: creating sparse file for disk image LibreELEC-H5.arm-11.0-devel-20211201065137-26827ca-tritium-h5.img...
image: creating msdos partition table...
image: creating partitions...
image: creating sparse file for part2...
image: creating filesystem on part2...
image: populating filesystem on part2...
image: merging part2 into disk image...
image: creating sparse file for part1...
image: creating filesystem on part1...
image: creating bootloader configuration...
Writing U-Boot to LibreELEC-H5.arm-11.0-devel-20211201065137-26827ca-tritium-h5.img
image: copying files to part1...
image: checking filesystem on part1...
image: merging part1 into disk image...
image: compressing...
image: cleanup...

UPDATE: In the "Target" Folder I got Orange Pi PC 2 and Tritium H5 Image

asakous commented 2 years ago

there is a parameter I forgot . try add UBOOT_SYSTEM=orangepi-pc2 to make command. and . you have to add ADDITIONAL_PACKAGES="emuelec" to LibreELEC/options file in order to compile retroarch and ES and other ports. a very important note is that SDL2-git needs to enable KMSDRM . each emulator package.mk file may need to change to adopt H5 platform. some may need to create patches too.

rnadesignlab commented 2 years ago

is this command what you mean when compiling?

PROJECT=Allwinner ARCH=arm DEVICE=H5 make -j4 UBOOT_SYSTEM=orangepi-pc2 image

this is the part that I don't know. How did you add Additional Packages="emuelec" in librelec?

  1. burn libre elec to sd card
  2. add additional packages?
  3. enable KMSDRM?

it seems the image doesn't boot well, I just realized that the compiled image is smaller than your image (Almost half of your image in size).

asakous commented 2 years ago

is this command what you mean when compiling?

PROJECT=Allwinner ARCH=arm DEVICE=H5 make -j4 UBOOT_SYSTEM=orangepi-pc2 image

this is the part that I don't know. How did you add Additional Packages="emuelec" in librelec?

  1. burn libre elec to sd card

  2. add additional packages? modify file in distributions/LibreELEC/options click view

  3. enable KMSDRM? modify file in packages/sx05re/tools/SDL2-git/package.mk click view it seems the image doesn't boot well, I just realized that the compiled image is smaller than your image (Almost half of your image in size).

rnadesignlab commented 2 years ago

Thanks for your guide, at the moment I am redoing the compile process from scratch. By adding emuelec packages and enabling KMSDRM in SDL2-git.

Is there anything else to be done? Did you say earlier to remove kodi from LibreELEC etc. How to do that? which part of LibreELEC should be removed before compiling?

asakous commented 2 years ago

Thanks for your guide, at the moment I am redoing the compile process from scratch. By adding emuelec packages and enabling KMSDRM in SDL2-git.

Is there anything else to be done? Did you say earlier to remove kodi from LibreELEC etc. How to do that? which part of LibreELEC should be removed before compiling? modify file in distributions/LibreELEC/options set MEDIACENTER="no" . it will disable compiling Kodi . a lof of package.mk need to be modified in order to adopt H5 platform. some may need to read Makefie or CMakelist from source code in order to create a patch file.

rnadesignlab commented 2 years ago

modify file in distributions/LibreELEC/options set MEDIACENTER="no" . it will disable compiling Kodi .

OK, I have done that

a lof of package.mk need to be modified in order to adopt H5 platform. some may need to read Makefie or CMakelist from source code in order to create a patch file.

Do you have a link or reading for this patch?

asakous commented 2 years ago

for example mupen64plus-nx since there is no correct compile parameters for amlogic64.so usually there are two options. 1:find the compile platform similar to H5 hardware 2. create a patch file for H5 platform. above example use option 2.

rnadesignlab commented 2 years ago

Hi @asakous, I just finished the compile process without kodi and add emuelec package. but I just got 83 MB image. I am pretty sure that something must be missing, because emuELEC is not compiled.

I just want to confirm this:

3:combine two source code . copy emuelec sx05re folder to Libreelec package folder

when you said combine, does it mean that I have to override all LibreELEC package with EmuELEC, or just the sx05re folder?

asakous commented 2 years ago

copy line form 241 to 477 and paste to distributions/LibreELEC/options

rnadesignlab commented 2 years ago

Hi @asakous, It took me many hours yet the emuelec was never compiled. I think as you said earlier, Ubuntu 20 cannot compile the emulator. Finally I gave up, but I have a good news.

I can confirm that "Batocera32 Tritium H5" works best, Even N64 is running almost full speed in my TV Box.