Jump to content

Armbian for Amlogic S905X3


Sergey2k

Recommended Posts

Armbian & Khadas are rewarding contributors

For those that have not found a working dtb yet, you might want to give this method of extracting dtb and dts files a shot (hardware keyboard recommended or setup sshd via termux). Install termux. Open it and type:

termux-setup-storage
apt update
apt install dtc
dtc -q -I fs -O dts /sys/firmware/devicetree/base -o /sdcard/mytvbox.dts
dtc -q -I fs -O dtb /sys/firmware/devicetree/base -o /sdcard/mytvbox.dtb

I am unable to test this method presently due to other issues but I am dying to know if it works. The files generated are larger than the dtb files in the armbian images but they are similar size to the dtb files from coreelec. If the dtb file doesn't work, at least the dts file might give some clues as to why alternative dtb files have wifi or ethernet issues etc. You can also convert other dtb to dts and vice versa so you can open the dts files in a text editor and compare.

To convert dtb to dts.

dtc -O dts -o tvbox.dts tvbox.dtb

To convert dts to dtb.

dtc -O dtb -o mytvbox.dtb mybox.dts

 

Link to comment
Share on other sites

15 hours ago, 5p0ng3b0b said:

For those that have not found a working dtb yet, you might want to give this method of extracting dtb and dts files a shot (hardware keyboard recommended or setup sshd via termux). Install termux. Open it and type:


termux-setup-storage
apt update
apt install dtc
dtc -q -I fs -O dts /sys/firmware/devicetree/base -o /sdcard/mytvbox.dts
dtc -q -I fs -O dtb /sys/firmware/devicetree/base -o /sdcard/mytvbox.dtb

I am unable to test this method presently due to other issues but I am dying to know if it works. The files generated are larger than the dtb files in the armbian images but they are similar size to the dtb files from coreelec. If the dtb file doesn't work, at least the dts file might give some clues as to why alternative dtb files have wifi or ethernet issues etc. You can also convert other dtb to dts and vice versa so you can open the dts files in a text editor and compare.

To convert dtb to dts.


dtc -O dts -o tvbox.dts tvbox.dtb

To convert dts to dtb.


dtc -O dtb -o mytvbox.dtb mybox.dts

 

Cool, my dump :

sm1_ac213_4g_TranSpeed.dtb

Link to comment
Share on other sites

17 hours ago, 5p0ng3b0b said:

For those that have not found a working dtb yet, you might want to give this method of extracting dtb and dts files a shot (hardware keyboard recommended or setup sshd via termux). Install termux. Open it and type:

I am unable to test this method presently due to other issues but I am dying to know if it works. The files generated are larger than the dtb files in the armbian images but they are similar size to the dtb files from coreelec. If the dtb file doesn't work, at least the dts file might give some clues as to why alternative dtb files have wifi or ethernet issues etc. You can also convert other dtb to dts and vice versa so you can open the dts files in a text editor and compare.

To convert dtb to dts.

To convert dts to dtb.

 

How do I dump a bootloader?

Link to comment
Share on other sites

On 2/9/2020 at 11:42 PM, Povl H. Pedersen said:

H96 Max box here, S905X4, 4GB RAM, 128 (116?) GB eMMC.

Boot fine from SD card. used DTB found page 7 this thread.

Ran ./install-aml.sh - everything looks fine.

 

But, it ill not find anything to boot when I reboot / power cycle. After the flash it will not clean boot the SD card either. Only solution is pressing the reset button in the AV jack.

Any help to get it to boot from internal eMMC please. I do see the 4+0 records in/out, indicating boot sector is written. But it just gives me the spinning logo to show it is loading or looking for something. I even tried to make the eMMC FAT partition bootable in disk.

 

Just for info, my built-in eMMC is mmcblk2 while installing. Not sure if the numbering changes anything ?
root@arm:~# lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
 


mmcblk1      179:0    0  29.8G  0 disk
├─mmcblk1p1  179:1    0   256M  0 part /boot
└─mmcblk1p2  179:2    0  29.3G  0 part /
mmcblk2      179:32   0 116.5G  0 disk
├─mmcblk2p1  179:33   0   244M  0 part
└─mmcblk2p2  179:34   0 115.6G  0 part
mmcblk2boot0 179:64   0     4M  1 disk
mmcblk2boot1 179:96   0     4M  1 disk
zram0        254:0    0    50M  0 disk /var/log
zram1        254:1    0     1G  0 disk [SWAP]

 

 

Hello. I'm new to this forum, new to armbian but I just know a little Ubuntu.

For a few days, I bought a H96 Max X3 to go further in Linux.

The main problem I encounter with this box is that it does not detect Wi-Fi connections under armbian.  It's been more than 5 days that I try all the possibilities to make wifi work but without result.  

And now it's even worse. Here I just made a mistake: I ran './install-aml.sh' without having taken the necessary precautions, nor installed TWRP. And therefore the result which I did not expect: I lost Android. From now, My H96 Max X3 starts on the image 'Armbian_20.02.0-rc1.037_Aml-s9xxx_bionic_current_5.5.0-rc6_desktop_20200205.img' even if i don't put the memory card in the box. However, I wanted to keep both systems in the box.

Please Can you tell me how to recover Android Without going through TWRP and where to look for android image to install in this TV Box you know well.

Thank you for in advance for your precious help.

 

Link to comment
Share on other sites

3 minutes ago, medmouncef said:

Please Can you tell me how to recover Android Without going through TWRP and where to look for android image to install in this TV Box you know well.

Your Android image is gone, you've installed Armbian to the eMMC. Do a google search "H96 Max Android download"
You can always try using a cheap usb wifi dongle if on-board wifi doesn't work.

 

Link to comment
Share on other sites

NicoD and Jeanrhum, Thank you for your replies.

h96tvbox.com already contacted but no response so far. Their last update of the firmware list dates back to July. Weird!

Sorry, I'm going to be more direct. Has a member of this forum owner of a H96 Max X3 tv box, already made a backup of the stock ROM?
Please Can you make the link available to me so that I can download the stock ROM backup ?
Thanks for your help

Link to comment
Share on other sites

1 hour ago, medmouncef said:

Has a member of this forum owner of a H96 Max X3 tv box, already made a backup of the stock ROM?

Hi, for that type of request, you can also have a look at freaktab forum for instance: https://forum.freaktab.com/forum/tv-player-support/amlogic-based-tv-players/s905x3

Be careful to flash an original firmware if you want avoid weird issues.

Link to comment
Share on other sites

@keynote. Shame the dtb not working :(. Probably need some python/perl script to parse the dts file

 Not all boxes are equal, Is there a bootloader partition? This should list all emmc partitions

ls $(find /dev/block/platform/ -name "by-name")

 

su
dd if=$(find /dev/block/platform/ -name "by-name")/bootloader of=/sdcard/bootloader.img

 

Or try TWRP backup function. Apply zip file using update app or from recovery mode (this will not overwrite your stock recovery).

TWRP_3.2.2_Android_9.0.zip

 

Link to comment
Share on other sites

Get DTB file from recovery.PARTITION file.

 

Here is a second take a getting DTB file as extracting via /sys/firmware/devicetree/base using dtc didn't appear to work :(.

This time get DTB from recovery.PARTITION file using termux. Firstly on a PC, download and unzip stock tvbox image.

Then unpack firmware.img file with amlogic unpacker. Now transfer the recovery.PARTITION file to termux home folder.

The DTB file is embedded in this file so now just extract it. I already installed git, python, perl and wget etc to termux.

Spoiler

#Install binwalk
git clone https://github.com/ReFirmLabs/binwalk.git
cd binwalk
python setup.py install
cd ..; rm -Rf binwalk
#Get split_bootimg.pl script
wget https://gist.githubusercontent.com/jberkel/1087743/raw/45046f87176dfacdc22af4290f89a0d2e0df1dbb/split_bootimg.pl
chmod +x split_bootimg.pl
#Split recovery.PARTITION
./split_bootimg.pl recovery.PARTITION
#Unpack recovery.PARTITION-second.gz
gunzip recovery.PARTITION-second.gz
#Get offset of embedded DTB in recovery.PARTITION-second
DTBOFFSET=$(binwalk -R "\xD0\x0D\xFE\xED" recovery.PARTITION-second | awk 'NR > 3 { print $1}' | head -n 1)
#Get length of DTB in recovery.PARTITION-second
DTBLEN=$((16#$(dd if=recovery.PARTITION-second bs=1 skip=$(($DTBOFFSET + 4)) count=4 status=none | od -tx1 | head -n 1 | cut -d ' ' -f 2- | sed 's/ //g' )))
#Now extract and create dtb file
dd if=recovery.PARTITION-second of=mybox.dtb bs=1 skip=$DTBOFFSET count=$DTBLEN

 

 The resulting file was 76,302 bytes in my case from a magicsee N5 plus box. I still can't test yet because I haven't got it to boot from external storage but can confirm the dtc command worked on it.

dtc -I dtb -O dts -o mybox.dts mybox.dtb

Update:

This also worked from a recovery image file created by dd if=/dev/block/recovery of=recovery.PARTITION so this can be done completely from rooted device and without access to stock firmware. Produced an identicle DTB.

 

n5plus.dtb n5plus.dts

Link to comment
Share on other sites

On 2/24/2020 at 4:19 PM, almotra said:

Hello,
I'm looking for .dtb for x96max s905X3
I tried all the .dtb of the image, I also tried the .dtb ethfix of this post, some starts but no ethernet.

Can you supply stock recovery image from box or firmware?

Link to comment
Share on other sites

Hello.

A box H96 Max X3 has returned to normal thanks to nice people. And I come back to the starting point of my concerns: wifi and bluetooth do not work under armbian while under Android 9, everything works very well.


Under "armbian_20.02.0-rc1.037_Aml-s9xxx_bionic_current_5.5.0-rc6_desktop_20200205" installed on an SD card. I have 3 different situations: 
       1 * Basically, Wi-Fi and bluetooth do not work.

       2 * If I connect a working Wi-FI USB key + ethernet cable, restart the Android TV Box, the Wi-fi does not work.
       3 * Additional step of 2* : if I access by RDP (Remote Desktop Connection), the Wi-Fi works Automatically but not bluetooth.
I personally deduce that the automatic scan of Wi-Fi networks does not work. But this is the deduction drawn by a patient and not by a doctor. For bluetooth, I get the message 'No adapters found' and No DHCP Servers installed '(see attached screenshots)

 

 I tried several * .dtb without success.

 

Here is the information I have on Android,

Wi-Fi Info :
Manufacturer : Broadcom
Type : BCM4330 (AP6330)-802.11abgn + BT4.0+HS and FM Transceiver

 

And for medical specialists, attached 3 files dmesg, lshw et wifichek.log.

 

Please, Help me solve my problem because I would like to use my Android + Armbian TV Box on the move


Thank you

BT_No DHCP Servers.jpg

No Adapters found.jpg

dmesg.txt lshw.txt wificheck.log

Link to comment
Share on other sites

21 hours ago, almotra said:

I do not know how to do.
Can you explain to me how to do it?
 

You ask for DTB for X96 max but this is s905x2 SoC. X96 max plus however is s905x3. Maybe this is the problem.

Carefully reading the recent posts on this thread should help provide an answer to extracting a stock recovery image, eg trying TWRP and using the backup function. 'How to get stock recovery image?' is a bit off topic IMO. You could try google, or make a new thread in another section asking this question.

Link to comment
Share on other sites

Hello everyone, this is my first post.
I extracted 6 x96-max and x96-max + dts from the Android box, but I do n’t seem to have permission to upload attachments. I do n’t know how to upload?
I have one x96-max and one x96-max +, both of which have 4G memory and 64G EMMC.
Both WIFI modules are 6222B-SRB, based on RTL8822BS, so they can not work in armbian.
In addition, the x96-max + Ethernet uses meson-sm1-sei610.dts for minor modifications. The Ethernet card cannot work at Gigabit, but it can work at 100M.

total 1056
-rw-r--r-- 1 root root  77824 Feb 28 22:44 01_dtbdump_Amlogic.dtb
-rw-r--r-- 1 root root  88556 Feb  1 21:20 01.dts
-rw-r--r-- 1 root root  77824 Feb 28 22:44 02_dtbdump_Amlogic.dtb
-rw-r--r-- 1 root root  88838 Feb  1 21:20 02.dts
-rw-r--r-- 1 root root  77824 Feb 28 22:44 03_dtbdump_Amlogic.dtb
-rw-r--r-- 1 root root  88819 Feb  1 21:20 03.dts
-rw-r--r-- 1 root root  88064 Feb 28 22:44 04_dtbdump_Amlogic.dtb
-rw-r--r-- 1 root root 100983 Feb  1 21:20 04.dts
-rw-r--r-- 1 root root  88064 Feb 28 22:44 05_dtbdump_Amlogic.dtb
-rw-r--r-- 1 root root 100983 Feb  1 21:20 05.dts
-rw-r--r-- 1 root root  88064 Feb 28 22:44 06_dtbdump_Amlogic.dtb
-rw-r--r-- 1 root root 101194 Feb  1 21:20 06.dts
lrwxrwxrwx 1 root root      6 Feb  1 21:22 g12a_u212_1g.dts -> 01.dts
lrwxrwxrwx 1 root root      6 Feb  1 21:22 g12a_u212_2g.dts -> 02.dts
lrwxrwxrwx 1 root root      6 Feb  1 21:22 g12a_u212_4g.dts -> 03.dts
lrwxrwxrwx 1 root root      6 Feb  1 21:22 sm1_ac213_1g.dts -> 04.dts
lrwxrwxrwx 1 root root      6 Feb  1 21:21 sm1_ac213_2g.dts -> 05.dts
lrwxrwxrwx 1 root root      6 Feb  1 21:21 sm1_ac213_4g.dts -> 06.dts

 

aml-s905x3-x96max_and_x96maxplus-dts.tar.gz

Link to comment
Share on other sites

I wrote a bash script to extract a dtb file from a boot.img or boot.PARTITION file so no need for termux/python/perl etc. It doesn't even require busybox or root. Just run from terminal emulator app. Open terminal and type:

sh /path/to/dtb_extract.sh /path/to/boot.img

Script and resulting DTBs attached.

 

Edit: I was completely unaware that the boot image can contain multiple DTB files and I was only extracting the first one found *duh*. I amended the script and extracted 5 dtb files from my box. Also attached is a static dtc command so you can convert DTB files without termux. To get the correct DTB for your device type:

cat /proc/device-tree/amlogic-dt-id

dtb_extract.sh dtc g12a_u212_1g.dtb g12a_u212_2g.dtb g12a_u212_4g.dtb sm1_ac213_2g.dtb sm1_ac213_4g.dtb

Link to comment
Share on other sites

If anyone has a working Armbian "desktop" X96 Air P3 4/64GB box. Can you please tell me which "image + dtb + any other files" you used to get it to work.

 

The current Android build for this box is as follows if this helps.

x96Air_P3_20191204-1754 - Build Number Amlogic/franklin/franklin9/PPR1.180610.011/20191204/userdebug/test-keys/20191204/userdebug/test-keys.

 

If it helps anyone, the box does work with everything working using Coreelec nightly build and the Air96_P3 dtb file but I am seeking a desktop environment and not a Kodi environment.

 

Kind regards,

Madasafish

Link to comment
Share on other sites

3 hours ago, Madasafish said:

If anyone has a working Armbian "desktop" X96 Air P3 4/64GB box. Can you please tell me which "image + dtb + any other files" you used to get it to work.

 

The current Android build for this box is as follows if this helps.

x96Air_P3_20191204-1754 - Build Number Amlogic/franklin/franklin9/PPR1.180610.011/20191204/userdebug/test-keys/20191204/userdebug/test-keys.

 

If it helps anyone, the box does work with everything working using Coreelec nightly build and the Air96_P3 dtb file but I am seeking a desktop environment and not a Kodi environment.

 

Kind regards,

Madasafish

Armbian_20.05.0_Arm-64_bionic_current_5.6.0-rc4_desktop_20200306 with

meson-sm1-sei610-ethfix.dtb

If you are starting the system from an SD card, you need to rename u-boot.sd to u-boot.ext,

meson-sm1-sei610-ethfix.dtb

Link to comment
Share on other sites

It's great to progress and have come a lot further thanks to "ciprian28".

Having played around with the box, I notice the following components are not working.

 

1. Bluetooth

2. WiFi 2.4 and 5.0

3. HDMI sound

4. Ethernet 1GB speed (100MB speed is working well)

 

I was intrigued by  "5p0ng3b0b" posts on how to get the dtb files from your perfectly running android box.  So I copied his "dtb_extract.sh" file to the root of the Armbian_20.05.0_Arm-64_bionic_current_5.6.0-rc4_desktop_20200306 SD card on my windows laptop.

Inserted the SD card into the running android box 

Setup a ssh server on the android box (plenty in Playstore)

 

Using Putty on my windows laptop,  ssh to android box and su to root. 

Change directory to the root directory of the SD card.  Easily find the mount point by doing a "df"

 

Then run the following commands.....

1. dd if=/dev/block/recovery of=recovery.PARTITION  - This will create a file called "recovery.PARTITION"

2. cat /proc/device-tree/amlogic-dt-id   -  which returned in my case "sm1_ac213_4g" (I believe this is name of your box's dtb file)

3.  ./dtb_extract.sh ./recovery.PARTITION

 

This created the following files

g12a_u212_1g.dtb
g12a_u212_2g.dtb
g12a_u212_4g.dtb
sm1_ac213_1g.dtb
sm1_ac213_2g.dtb 
sm1_ac213_4g.dtb   - (Eureka, I have my box's dtb file which in my case is "sm1_ac213_4g")

 

mv *.dtb ./dtb/amlogic  (Move the files from the root directory to where all the other Amlogic (in my case) files are.

Edit the Uenv.txt file so that it now points to the new dtb file....

# aml s9xxx
#FDT=/dtb/amlogic/meson-g12a-x96-max-no-cvbs.dtb
#FDT=/dtb/amlogic/meson-g12b-ugoos-am6-no-cvbs.dtb
#FDT=/dtb/amlogic/meson-g12b-odroid-n2.dtb
#FDT=/dtb/amlogic/meson-sm1-sei610-ethfix.dtb
FDT=/dtb/amlogic/sm1_ac213_4g.dtb
APPEND=root=LABEL=ROOTFS rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fi
~

Save the file and reboot the box.

 

Did it work? - No - Only green screen.

 

Attached are the newly created dtb files for the "X96_Air_P3" box. Hopefully someone more learned than me can find these useful.

 

 

 

 

 

 

 

 

 

 

g12a_u212_1g.dtb g12a_u212_2g.dtb g12a_u212_4g.dtb sm1_ac213_1g.dtb sm1_ac213_2g.dtb sm1_ac213_4g.dtb

Link to comment
Share on other sites

Hi,

 

i try  to install Armbian  on  a eachlink X3mini and i have always the same error with different dtd file.

i try this for get dtb file :

termux-setup-storage
apt update
apt install dtc
dtc -q -I fs -O dts /sys/firmware/devicetree/base -o /sdcard/mytvbox.dts
dtc -q -I fs -O dtb /sys/firmware/devicetree/base -o /sdcard/mytvbox.dtb

i change uEnv.txt to add my dtb

but even with this dtb it doesn't work always the same error :

Supported API: 3
charge_status 2, charged 1, status SUCCAESS, capacity 100
Finding update package...
I:update location: @/cache/recovery.block.map
Opening update package..
no need to recovery update.zip
E: Block map file too short: 3
E: Map of '@/cache/recovery/block.map' failed
E: failed to map file
Installation aborted

any idea to resolve my problem?

 

thanks

Edited by flagadajones
add thanks
Link to comment
Share on other sites

5 hours ago, flagadajones said:

Hi,

 

i try  to install Armbian  on  a eachlink X3mini and i have always the same error with different dtd file.

i try this for get dtb file

 

It looks like you are trying to use a dtb from your android installation.  dtb's are very much tied to specific kernel versions and an android dtb based on an older android kernel will not work with a current armbian built kernel.  You need to be using one of the dtb's that are part of the armbian build you are using (or are building a dtb that will work with the armbian kernel you are using).

Link to comment
Share on other sites

13 hours ago, SteeMan said:

It looks like you are trying to use a dtb from your android installation.  dtb's are very much tied to specific kernel versions and an android dtb based on an older android kernel will not work with a current armbian built kernel.  You need to be using one of the dtb's that are part of the armbian build you are using (or are building a dtb that will work with the armbian kernel you are using).

, I've tested all dtb file in armbian and my box Never boot :-(

how Can i adapt my dts file to works with armbian ?

 

 

Link to comment
Share on other sites

17 hours ago, flagadajones said:

hi,

i've made many other tests.

I've installed Coreelec on my eachlink X3mini  ( S905X3)  with the dtb sm1_s905x3_2g. It boot and all is ok.

 

how Is  possible to adapt this dtb for armbian ?

 

regard

The short answer to your question, is you can't, or at least you can't if you are not the device manufacturer or possess skills that very few people have.

 

The longer answer is that coreelec and Armbian are very different projects with very different goals.  Coreelec's goal is to provide a basic linux environment to run kodi using the vendor supplied linux kernels.  I believe that for your device that would be a 4.9 kernel.  Armbian on the other hand provides a full linux distribution on mainline linux kernels (currently 5.6.x). 

 

So instead of using a heavily modified custom vendor supplied kernel that never gets any security updates or bugfixes (coreelec case), with Armbian you get a fully community supported kernel with the most current security and bug fixes available.  The problem is that if the device manufacturer and cpu manufacturer don't care about getting support for their devices and chips into the mainline kernel, then Armbian can't support them very well.  And if the source code isn't available to others to port to the mainline kernel it is practically impossible to ever get good support for these devices in the mainline kernel and thus armbian.

Link to comment
Share on other sites

4 hours ago, SteeMan said:

The short answer to your question, is you can't, or at least you can't if you are not the device manufacturer or possess skills that very few people have.

 

The longer answer is that coreelec and Armbian are very different projects with very different goals.  Coreelec's goal is to provide a basic linux environment to run kodi using the vendor supplied linux kernels.  I believe that for your device that would be a 4.9 kernel.  Armbian on the other hand provides a full linux distribution on mainline linux kernels (currently 5.6.x). 

 

So instead of using a heavily modified custom vendor supplied kernel that never gets any security updates or bugfixes (coreelec case), with Armbian you get a fully community supported kernel with the most current security and bug fixes available.  The problem is that if the device manufacturer and cpu manufacturer don't care about getting support for their devices and chips into the mainline kernel, then Armbian can't support them very well.  And if the source code isn't available to others to port to the mainline kernel it is practically impossible to ever get good support for these devices in the mainline kernel and thus armbian.

ok thanks for this complete answer.

then i've just need to wait and hope than armbian create the good dtb for my device.

 

Link to comment
Share on other sites

I've just installed bionic 20200306 on my x96 air p2 4/64, and it works fine for me, wonderful.

Now I'd like to install the system on the eMMC. I started to follow  the Armbian documentation, but the 'nand-sata-install' command is not recognized.

Could you please help me what to do?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines