Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X88 King S922x Armbian support? #988

Closed
JordanPlayz158 opened this issue Feb 1, 2023 · 18 comments
Closed

X88 King S922x Armbian support? #988

JordanPlayz158 opened this issue Feb 1, 2023 · 18 comments
Labels
documentation Improvements or additions to documentation new box Research Fills in the Blanks support This need is supported

Comments

@JordanPlayz158
Copy link

JordanPlayz158 commented Feb 1, 2023

I successfully booted up Armbian on the X88 King which uses the S922x chipset, one that appears to be supported, I was wondering if it is possible to add X88 King support to this repo? (didn't see anything in the readme about how to contact or if you take requests to support more devices or anything along those lines)

The first issue appears to be that USB does not work but it does boot (using Armbian_23.02.0_amlogic_s922x_bullseye_6.1.8_server_2023.01.30.img) and gets stuck at the prompt of creating a root password (which is why usb is needed so you can plug in a keyboard and interact with the system). Although I am aware of another project called CoreELEC which specifically supports the X88 King and has it's DTB file and usb does work on that project so it could be a good starting point to see what they did to achieve that goal.

I did attempt to make my own u-boot as when I supplied the DTB from CoreELEC, it didn't seem to want to boot (assuming due to "Cannot setup simplefb: node not found") and was stuck at starting the kernel. In order to do this (get the "stuck at starting kernel" result) I added the DTB from CoreELEC to the /dtb/amlogic folder in the boot partition and changed the file path for FDT to /dtb/amlogic/g12b_s922x_x88_king_rev_a.dtb in /uEnv.txt

I will supply the files (via a ZIP as github doesn't support the raw formats) I have made so far and/or discovered that could help to getting the x88 king working on armbian, any assistance would be greatly appreciated but I will be attempting to work at this regardless.

X88-King.zip

g12b_s922x_x88_king_rev_a.dtb is the DTB file from CoreELEC, the rest of the files are from following https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/build-armbian/documents#1211-how-to-make-u-boot-file (up until 12.11.3)

@ophub
Copy link
Owner

ophub commented Feb 1, 2023

If the system flashed in the box is coreelec, you need to restore the original Android system before starting armbian.

Can you start using the default dtb in armbian?
The dtb directory is in /boot/dtb/amlogic
You can open the boot partition on the computer and modify the file /boot/uEnv.txt

You see the prompt to create a root password, indicating that it has started normally. The default account is root and the password is 1234 when you start for the first time.

You follow the prompts and create your own complex password.

If USB doesn't work, you can use ssh to access the device over the LAN to operate.

try
meson-g12b-odroid-n2.dtb
meson-g12b-ugoos-am6.dtb

@JordanPlayz158
Copy link
Author

JordanPlayz158 commented Feb 1, 2023

If the system flashed in the box is coreelec, you need to restore the original Android system before starting armbian.

I still have the original android system on the eMMC, I am booting CoreELEC from the sd card slot so that is no issue.

Can you start using the default dtb in armbian?

If the default dtb is meson-g12b-gtking-pro.dtb then I did use the default DTB to get to the point of asking to create a root password. If not, could you tell me the name of the default dtb file?

If USB doesn't work, you can use ssh to access the device over the LAN to operate.

Oh yeah, that is a good point, will need to see if networking is working.

try
meson-g12b-odroid-n2.dtb
meson-g12b-ugoos-am6.dtb

So in addtion to trying the default DTB (if I haven't already), I should try these 2 if the default does not work?

@ophub
Copy link
Owner

ophub commented Feb 1, 2023

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/documents/amlogic_model_database.md

Here is a list of devices that have been tested for support, and how to adjust from the default firmware to other devices. If you need to test other dtb, you can open /boot/uEnv.txt on the computer to modify its value, see the instructions for the specific method.

If the firmware you downloaded is named Armbian_23.02.0_amlogic_s922x_xxxxxx.tar.gz, then its corresponding configuration is 402
If you test that the default firmware can already be booted to root to change the password, then it should be the default.
If you can’t use the usb keyboard, check his ip from the LAN router, and use the ssh tool to connect to the device to continue the operation.

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/armbian-files/common-files/etc/model_database.conf#L87

@JordanPlayz158
Copy link
Author

If the firmware you downloaded is named Armbian_23.02.0_amlogic_s922x_xxxxxx.tar.gz, then its corresponding configuration is 402
If you test that the default firmware can already be booted to root to change the password, then it should be the default.
If you can’t use the usb keyboard, check his ip from the LAN router, and use the ssh tool to connect to the device to continue the operation.

Yep, can't believe I didn't think of that, checked, ethernet is working and can ssh using 402 i.e meson-g12b-gtking-pro.dtb

So it looks like X88 King is working under the default firmware but not usb but that can be bypassed by using ssh and given it has bluetooth, a bluetooth keyboard can be used just fine (tested it), while not ideal, it is partially supported, if you need any logs to figure out why usb is not working or if added to support list, there will be that caveat indicated with the support?

@d5stick
Copy link

d5stick commented Feb 1, 2023

When you have the original android rom available you could check if you can extract the DTB from it.
That DTB you can use it on Armbian with help from Ophub. That DTB will later on be uploaded to his repository.

Take some photos of the internals of the device to see what chips are in side.

@JordanPlayz158
Copy link
Author

JordanPlayz158 commented Feb 1, 2023

When you have the original android rom available you could check if you can extract the DTB from it.

I have the original android rom available, it is still on my eMMC, in addition, I provided the DTB I got from the rom in the zip file I attached when I opened the issue.

Take some photos of the internals of the device to see what chips are in side.

Will do, Also might need to jerry-rig it with a fan so it has better temperatures.

Edit: Oh yeah, also in addition, sound does not work on X88 King with the default firmware, when pulseaudio is started the console gets flooded with:


Feb 01 18:14:08 armbian kernel:  fe.dai-link-1: ASoC: no backend DAIs enabled for fe.dai-link-1
Feb 01 18:14:08 armbian kernel:  fe.dai-link-1: ASoC: error at dpcm_fe_dai_prepare on fe.dai-link-1: -22
Feb 01 18:14:08 armbian kernel:  fe.dai-link-1: ASoC: no backend DAIs enabled for fe.dai-link-1
Feb 01 18:14:08 armbian kernel:  fe.dai-link-1: ASoC: error at dpcm_fe_dai_prepare on fe.dai-link-1: -22
Feb 01 18:14:08 armbian kernel:  fe.dai-link-0: ASoC: no backend DAIs enabled for fe.dai-link-0
Feb 01 18:14:08 armbian kernel:  fe.dai-link-0: ASoC: error at dpcm_fe_dai_prepare on fe.dai-link-0: -22
Feb 01 18:14:08 armbian kernel:  fe.dai-link-0: ASoC: no backend DAIs enabled for fe.dai-link-0
Feb 01 18:14:08 armbian kernel:  fe.dai-link-0: ASoC: error at dpcm_fe_dai_prepare on fe.dai-link-0: -22
Feb 01 18:14:10 armbian pulseaudio[2436]: Failed to find a working profile.
Feb 01 18:14:10 armbian pulseaudio[2436]: Failed to load module "module-alsa-card" (argument: "device_id="0" name="platform-sound" card_name="alsa_card.platform-sound" namereg_fail=false tsched=yes fixed_late

@ophub
Copy link
Owner

ophub commented Feb 2, 2023

https://forum.armbian.com/topic/12004-x88-king-s922x-tv-box-for-armbian/

With regard to the problem that the USB keyboard of the X88 King S922x doesn't work, I have seen relevant discussions in the armbian forum and other places, but they haven't been resolved.

In the previous device, occasionally there was a problem that individual versions of the kernel could not be booted on the SD card, but they could all be used in the usb. This is the first time that X88 can use SD but not USB.

When I use armbian on a daily basis, I use remote ssh for management, and use the role of the server as the main usage scenario to run some services. For users like me, a USB keyboard may not be necessary.

So, I added x88 to the support list, and in the device information table, it will be noted that USB is not available.

@ophub
Copy link
Owner

ophub commented Feb 2, 2023

402 :Beelink-GT-King-Pro :s922x :meson-g12b-gtking-pro.dtb :u-boot-gtkingpro.bin :gtkingpro-u-boot.bin.sd.bin :NA :stable :amlogic :meson-g12b :s922x :yes

You can confirm the configuration information again. The 5.15 and 6.1 kernels can use the default configuration of 402, can boot from the SD card, the Gigabit wired network works normally, and the Bluetooth works normally.

@ophub
Copy link
Owner

ophub commented Feb 2, 2023

Share the Android system download address of this device, take photos of the model label at the bottom of the outer box, the front and back of the motherboard, and if you know the short-circuit point when the box restores the system, mark it on the photo of the motherboard. I will save a copy of this Android system so that other users can download and use it when they need to restore the Android system.

https://github.com/ophub/kernel/releases/tag/tools

@JordanPlayz158
Copy link
Author

JordanPlayz158 commented Feb 2, 2023

Take some photos of the internals of the device to see what chips are in side.

take photos of the model label at the bottom of the outer box

IMG_20230201_212820037

the front and back of the motherboard

It was hard to get good lighting as when I did it in the center, the heatsink absorbed or deflected the light (so there are 2 images for the front)
IMG_20230201_210651841
IMG_20230201_211049958
IMG_20230201_211129140

Here are extra images:
IMG_20230201_211158689
IMG_20230201_211121100

and if you know the short-circuit point when the box restores the system, mark it on the photo of the motherboard.

Unfortunately, I have not restored the system before so not sure on that one

Share the Android system download address of this device... ...I will save a copy of this Android system so that other users can download and use it when they need to restore the Android system.

Ummm.. do you mean, I should factory reset my android install and make a rip of it, I did not download the android system from any address/url, it came pre-installed on the box.

Edit: I did not get a picture with the heatsink off as I am having trouble taking it off, tried doing it cold, warmed it up with a cpu benchmark, it was quite warm and still couldn't, any suggestions, maybe I need to use isopropyl alcohol to lossen the contact between the 2?

@ophub
Copy link
Owner

ophub commented Feb 2, 2023

39999ce

Thanks for sharing, now x88-king (s922x) has been added to the supported list.

@ophub ophub added documentation Improvements or additions to documentation support This need is supported new box Research Fills in the Blanks labels Feb 2, 2023
@JordanPlayz158
Copy link
Author

Good news, I see a DTS file from https://github.com/JohnnyonFlame/linux-ogu-4.9/blob/ogu-4.9/arch/arm64/boot/dts/amlogic/g12b_s922x_x88_king_rev_a.dts through a global github search, I am unsure if this is the DTS file used by CoreELEC (as that img and/or dtb file I tested is fully working, just about everything other than IR is working but that is likely just because the remote is not standard and needs custom firmware but the remote is pretty bad anyway so I don't mind if it doesn't work anymore), I am awaiting a response at https://discourse.coreelec.org/t/s922x-x88-king/7633/256

@ophub
Copy link
Owner

ophub commented Feb 2, 2023

Coreelec is an Android system, and Armbian uses the mainline kernel. The dtb and driver of these two systems are not common.

Since the TV box provides a development interface for the Android system, it is very convenient to use in the Android system. Coreelec can use these drivers well, but armbian cannot.

@JordanPlayz158
Copy link
Author

JordanPlayz158 commented Feb 2, 2023

Coreelec is an Android system, and Armbian uses the mainline kernel.

Even though CoreELEC is a heavily stripped down Android system that can only run 1 application, it won't be of any help (I'm asking that genuinely, I feel like it is closer to stock linux than android as a result)? I mean perhaps I can take the 2 specific segments for usb and sound and see if I can mix it in with the default firmware to possibly make an x88 king dts file? (As usb and sound are only things not functioning afaik)

@ophub
Copy link
Owner

ophub commented Feb 2, 2023

https://github.com/unifreq/linux-5.15.y/tree/main/arch/arm64/boot/dts/amlogic

This is the dtb source code of the armbian kernel. You can view the related call configuration from the dtb of Android, and add the test in armbian.

@ophub ophub closed this as completed Feb 2, 2023
@JordanPlayz158
Copy link
Author

JordanPlayz158 commented Feb 2, 2023

I have been attempting at it (with the linux-6.1.y branch as I am using the image with kernel 6.1.7) but it has not detected (or ignoring) nor compiled the dts files I have put into the proper directory and using ARCH=arm64 make dtbs to build the dtb files.

And I've been researching DTS, reading this currently: https://elinux.org/Device_Tree_Usage

In other news it seems you were correct so yeah, CoreELEC might not be too helpful unfortunately:

CoreELEC uses Amlogic vendor kernel, based on Android. Android is Linux. Amlogic Android, what’s default on their boxes uses ARCH ARM, we use ARM64. So kernel modules as example just can not be used from Android on CoreELEC system as the ARCH do not match.

When Armbian uses mainline kernel I am almost sure the hardware decoder will not work for all formats as this is only supported by vendor kernel.

And you can not mix them together, it’s a complete different structure and kernel version as well. So upstream or backport will be needed, if possible…

@ophub
Copy link
Owner

ophub commented Feb 3, 2023

Kernel compilation and usage instructions

https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/compile-kernel

@JordanPlayz158
Copy link
Author

JordanPlayz158 commented Apr 23, 2023

Edit: Oh yeah, also in addition, sound does not work on X88 King with the default firmware, when pulseaudio is started the console gets flooded with:

I have now tried on latest release and audio appears to be working and this is through pulseaudio which is nice as this means it was a software bug and was fixed rather than an issue with the dtb file, unfortunately the usb is still not fixed (which is expected as this does seem to be an issue with the dtb file) but I think it does seem to provide power now but no data transfer (not sure if this was the case previously, I recall no power but I could be wrong)

Additionally as I wanted USB to be working, I took the time to catalog USB for all the meson-g12b:

meson-g12b-ali-ct2000.dtb,"Stuck on ""Starting kernel ...""",-110 USB fail,Failed to init phy@46000,,
meson-g12b-gtking-pro.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio works,
meson-g12b-gtking-oc.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio works,
meson-g12b-odroid-n2-plus.dtb,"Stuck on ""Starting kernel ...""",-110 USB fail,Failed to init phy@46000,,
meson-g12b-gsking-x.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio DOES NOT WORK,
meson-g12b-gtking-pro-rev_a.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio works,
meson-g12b-dreambox-two.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio works,
meson-g12b-a311d-khadas-vim3.dtb,"Stuck on ""Starting kernel ...""",-110 USB fail,Failed to init phy@46000,,
meson-g12b-ugoos-am6b-plus-oc.dtb,"Stuck on ""Starting kernel ...""",-110 USB fail,Failed to init phy@46000,,
meson-g12b-ugoos-am6.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio works,
meson-g12b-gtking.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio works,
meson-g12b-gtking-pro-h.dtb,"Stuck on ""Starting kernel ...""",-110 USB fail,Failed to init phy@46000,,
meson-g12b-radxa-zero2.dtb,"Stuck on ""Starting kernel ...""",-110 USB fail,Failed to init phy@46000,,
meson-g12b-dreambox-one.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio works,
meson-g12b-s922x-khadas-vim3.dtb,"Stuck on ""Starting kernel ...""",-110 USB fail,Failed to init phy@46000,,
meson-g12b-gtking-pro-h-oc.dtb,"Stuck on ""Starting kernel ...""",-110 USB fail,Failed to init phy@46000,,
meson-g12b-gtking-pro-rev_a-oc.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio works,
meson-g12b-ugoos-am6b-plus.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio DOES NOT WORK,"Only significant if spammed

fe.dai-link-0: ASoC: no backend DAIs enabled for fe.dai-link-0 Apr 24 09:13:46 armbian kernel:  fe.dai-link-0: ASoC: error at dpcm_fe_dai_prepare on fe.dai-link-0: -22 Apr 24 09:13:46 armbian pulseaudio[1627]: Failed to find a working profile. Apr 24 09:13:46 armbian pulseaudio[1627]: Failed to load module ""module-alsa-card"" (argument: ""device_id=""0"" name=""platform-sound"" card_name=""alsa_card.platform-sound"" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes"
meson-g12b-ugoos-am6-plus.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio works,
meson-g12b-ugoos-am6b1.dtb,"Stuck on ""Starting kernel …""",-110 USB fail,Failed to init phy@46000,,
meson-g12b-odroid-n2.dtb,Kernel booted,-110 USB fail,Failed to init phy@46000,Audio works,

If you want a prettier version, the original ODS is an attachment below
DTB.ods

I have also attempted getting UART working to see if the boot logs will reveal this is just a different more widely known device/variant and thus I will know the right DTB (rather than brute-forcing) or get more information on the device in general
UART
Although attempts have been weirdly unsuccessful

I have gotten a UART through the labeled Linux RX and TX (silly me, I thought it wouldn't include the early boot logs as it specifically denoted linux) and I got some more information but none helpful on getting USB working at least initially

Also UART Settings:
Baud Rate: 115200
Data Bits: 8
Stop Bits: 1
Partiy: None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation new box Research Fills in the Blanks support This need is supported
Projects
None yet
Development

No branches or pull requests

3 participants