dtechsrv / LibreELEC-AML

'Just enough OS' for Kodi for some Amlogic TV boxes
46 stars 9 forks source link

projects: add pre-built 9082xs kernel module to S905 #14

Closed dtechsrv closed 1 year ago

dtechsrv commented 2 years ago

There is no public source code for this wifi chip, so the pre-built module was added, which was also found in v8.2 by @kszaq.

dtechsrv commented 2 years ago

@matiasw Please test this snapshot image: http://libreelec.dtech.hu/snapshots/20220911/

matiasw commented 2 years ago

I tried updating from 9.2.5 by putting the tar file in the Update directory using Samba. After rebooting, however, I got "No Signal" on my TV. So, I tried writing a new SD card entirely using the .gz file. This, also, resulted in "No Signal". In other words, neither method yielded a booting configuration. So, unfortunately, I can not verify the working of this image one way or the other.

I appreciate the effort you're going through to get this working.

dtechsrv commented 2 years ago

Interesting, you will have some other problem here during boot. I also built the image for KI Pro and tried to load 9082xs module manually, of course without the affected wifi chip.

I didn't get any errors on the module, it just said:

[  238.411453@2] TLL901X: tll9082es v1.2.0_0046.20160328
[  238.411477@2] aml_wifi wifi.33: [extern_wifi_set_enable] WIFI  Disable! 240
[  238.919413@2] aml_wifi wifi.33: [extern_wifi_set_enable] WIFI  Enable! 240
[  239.429331@2] sdio_reset_comm():
[  239.457501@0] sdio: queuing unknown CIS tuple 0x80 (2 bytes)
[  239.462867@0] sdio: queuing unknown CIS tuple 0x80 (7 bytes)
[  239.465402@0] sdio: queuing unknown CIS tuple 0x80 (3 bytes)
[  239.559519@0] sdio: clk 200000000 SDR mode tuning start
[  239.559682@0] sdio: rx_tuning_result[0] = 10
[  239.559834@0] sdio: rx_tuning_result[1] = 10
[  239.560001@0] sdio: rx_tuning_result[3] = 10
[  239.560150@0] sdio: rx_tuning_result[4] = 10
[  239.560153@0] sdio: best_win_start =3, best_win_size =4
[  239.560156@0] sdio: sd_emmc_regs->gclock=0x1000245,sd_emmc_regs->gadjust=0x2000
[  239.560160@0] sdio: gclock =0x1000245, gdelay=0x0, gadjust=0x2000
[  239.560162@0] [sdio_reinit] finish
[  239.560369@0] TLL901X: module init ret=0

So in theory it could work. But first your boot problem should be fixed.

matiasw commented 2 years ago

Any ideas on how to debug?

dtechsrv commented 2 years ago

Actually, it would be best if you had a TTL signal level UART adapter. If you don't have one, try what I wrote as an answer on the forum first.

matiasw commented 2 years ago

I don't have a TTL UART adapter.

I am just reverting to the working version, for now.

Thanks for trying to help. I made a small donation to the project so that your time spent on this is not a complete loss.

dtechsrv commented 1 year ago

Thank you for your sponsorship.

There is one question that bothers me: If you write again v​​9.2.8.5 on the same card, does it boot again or not? If not, then something else is happened in the background.

Anyway, I tried to search, and in several forums I found that K12 would be the RESET button on the PCB, but most of the time it was not even soldered into the box: M8S_Pro_PLUS

But, if it is still soldered in, it can be found here: https://www.youtube.com/watch?v=N27pAxtcDSg&t=274s

A paper clip or a SIM pin is not the best choice for poking around in the box, because they are mostly made of non-insulated metal, so it can easily cause a short circuit on the motherboard, which can be deadly for the box. Try a non-conductive material instead.

matiasw commented 1 year ago

Yes, if I write 9.2.8.5 (sorry for mistakenly calling it 9.2.5 before; this is what I meant) on the card, it boots. So, there should be something in the diff to the snapshot besides the wifi module addition..!

Edit: I actually checked out the diff, and the only change seems to be the addition of the file /usr/lib/kernel-overlays/base/lib/modules/3.14.29/prebuilt/9082xs.ko, so it must have something to do with that, after all. I will see if I can get 9.2.8.6 to boot if I blacklist this kernel module.

matiasw commented 1 year ago

Ok, so I tried blacklisting the wifi module by following this guide.

I had to create the .config directory and ./modprobe.d/ under it as they did not exist. I added blacklist 9082xs into blacklist.conf in this directory, but I don't know if this is even a valid approach to stopping the 9082xs module from being loaded - is it loaded by modprobe?

In any case, even with this configuration in place, the 9.2.8.6 version did not boot.

dtechsrv commented 1 year ago

By blacklisting this module, you are working against yourself, because this module is supposed to start your wifi chip. However, it looks like the module itself is causing the boot problem, but we could only be sure of this if a kernel panic could be displayed on UART.

Edit: I had a possible suspicion, but now it can be ruled out that the image file is damaged during the build process, because it boots without error on a supported box without this wifi chip. This module probably no longer works under version LE9+, because it probably has a dependency that was updated in the meantime.

matiasw commented 1 year ago

I decided to try again, and got the 9.2.8.6 image to boot into the part where it resizes the file system and reboot, but it got stuck in the following boot screen with "LibreELEC (dtech): 9.2.8.6" in the upper left corner and the LibreELEC logo in the middle.

matiasw commented 1 year ago

I am still trying to get this to work, so please do not close the issue.

I tried the new snapshot in http://libreelec.dtech.hu/snapshots/20230108-ee6102d/LibreELEC-Generic_S905.arm-9.2.8.7.img.gz , but did not get it to boot, not even to the "Resizing filesystem" screen.

dtechsrv commented 1 year ago

The image you are trying now does not contain the relevant wifi driver, and I have already deleted the previous snapshot image. Because I don't have such a box in which this wifi chip is integrated, and since there is no published source for this wireless module, unfortunately I can't do anything more. But, if you have any suggestion, I would welcome it.

matiasw commented 1 year ago

Well, how about a new snapshot with the wifi driver for me to try?

dtechsrv commented 1 year ago

I think you should first find out why the image doesn't boot at all, wifi is of secondary importance until then.

dtechsrv commented 1 year ago

http://libreelec.dtech.hu/snapshots/20230112_9082xs-wifi_7c1f4df/

It also includes the wifi driver. Don't forget to replace the correct dtb.

matiasw commented 1 year ago

Ok, so I downloaded the snapshot from the link and wrote it to the micro-SD card with LibreELEC-AML.USB-SD.Creator.Win32. I replaced dtb.img with the one from the working configuration (this is what you meant by "Don't forget to replace the correct dtb", right?) and added remote.conf. I then inserted the card in my Mecool box and powered it on, whereupon it booted from internal. So, I used Reboot to LibreELEC app to boot from SD. It resized the file system, then restarted, and, once again, got stuck in the LibreELEC logo splash screen, with "LibreELEC (dtech): 9.2.8.7" in the upper left corner.

I guess to further analyze the situation, I would need something like the UART debugger we discussed earlier?

dtechsrv commented 1 year ago

Yes, you got it right. You should try this in the same way: http://libreelec.dtech.hu/snapshots/20230108_master_ee6102d/LibreELEC-Generic_S905.arm-9.2.8.7.img.gz

If your box boots with this image, then there is really nothing to do, because the error is caused by the external kernel module itself. Since there is no source code published, I can't do anything with it, unfortunately.

matiasw commented 1 year ago

I was adviced on #libreelec to use the dtb specific to the version, and not carry one over from a previous install. So, from this list I got the dtb name, and took the gxl_p212_2g.dtb to the root and renamed it dtb.img. This made the wifi-less version boot, but not the version with wifi, so I suppose wifi is a lost hope. However, I've run a wire anyway, so I will adopt the 9.2.8.7 without wifi as my daily LibreELEC. Thanks!