Happy New Year, Russians! :)
I decided to make you a little present under the Christmas tree. I had to string up, but did :)
I bring to your attention an alternate kernel for consoles X96 Max.
Let me describe briefly to, so for five pages
what is it and why is it necessary
Stock nucleus of one and forever. As the experience with my previous consoles Vontar X92, despite the fact that sometimes they release a firmware update, the kernel is not changed for ever. Well, type, time, "no one complains," that strain.
Though actually complain, just do not hear us. Many problems can be solved just by making modifications to the core Android operating system, which by happy coincidence, is the core of the Linux operating system.
Another problem - not enough drivers. Linux itself has a huge number of possibilities. But only a small part of them is involved in the kernel that comes with the console. Lacks support for USB cameras, other iron, file systems (including network - NFS and Samba) and much more.
Unfortunately, Vontar not extend Linux kernel source, which they use to drain insertion. Thus, by the way, breaking the Linux license, in which the pen across the paper says that if you sell someone a program, you are required to provide the buyer with all the source code with the GNU Public License license (including Linux).
So I had to spend several weeks out to compile a kernel, that would be no less functional than the stock. Most of the problems were with the display driver source code which is absent in the public domain. Now the network is already possible to find a few drivers for similar devices, but they should be finished with a file. But a few years ago, when I took up the engine for X92 consoles, the network did not have anything at all. So I had to write your own driver, with blackjack and girls. And it turned out much better staff.
Here is a list of changes in my kernel compared to regular
(It can also be found in the CHANGES-ru.txt file from the link below):
The difference between the modified kernel and the kernel to drain X96max:
- Modified kernel based on the source code of AMLogic version 4.9.113. Stock kernel is version 9.4.76.
- LED Display Driver (entitled 'vfd') was written from scratch, because Sources from AMLogic not contain a driver for this display. This driver is much more advanced than the driver in the katabatic core.
To display information on the display is used daemon vfdd. It automatically starts when booting a modified kernel (it is in the file boot * .img).
In the current configuration vfdd demon displays on the LED display in sequence: current time (9 seconds), then the date in the format "Month Day," (for example, May 9 - May 9), then the current CPU temperature in degrees. Also to display references to storage media used indicators:
USB displays the reading from USB stick
APPS displays the record on a USB drive
CARD displays the reading with an internal memory chip
SETUP displays the record on the internal memory chip
HDMI HDMI display state
The source code of the driver and the demon can be downloaded from GitHub:https://github.com/anpaza/linux_vfd
Daemon configuration file is called vfdd /vfdd.ini. If you want to make changes to it, copy it to the / etc / and change there. On the next reboot vfdd automatically picks up the file /etc/vfdd.ini.
- Added modules to support NFS and SMB file systems. To use them, you need the appropriate tool. This work is not yet finished.
- Added kernel modules cp210x.ko, pl2303.ko, ch341.ko, ftdi_sio.ko, designed for USB-UART adapters, used to connect to simple devices, such as hand-made articles on Arduino, etc. Since udevd in Android is missing, you will have to download the appropriate driver manually, adding the script in /etc/init.d/ with modprobe cp210x.ko team (or pl2303.ko etc.)
- Added support for automatic change of the frame rate (auto framerate) when using a hardware video decoder. For this was written by a demon afrd, which is launched when the system reacts to kernel messages on the start or end of the video playback. There have also been modified in almost all of the hardware video decoders, because notification about changing the display frequency at the moment there is rigidly broken.
daemon configuration file /afrd.ini, if you want to change it - copy it to /etc/afrd.ini, if the daemon finds the file it will be used instead /afrd.ini.
Sources for this demon can be downloaded from GitHub:https://github.com/anpaza/afrd
What is vfdd and what it eats
vfdd is my program that works well with my X96 Max display driver. He is able to show all that is placed in the familiarity 4 and 6 icons on the front console. The program starts automatically when you boot the new kernel.
What exactly show is set in vfdd.ini file, which can be found in the root. Since the root directory - is a ramdisk, change it there is useless. If you want to make changes to it, copy it to / etc (or / system / etc, that one and the same). When you start looking for vfdd config file first into / etc, and only if it does not find it, read the config file from the root.
Now he shows in turn the time, date and temperature, with time shows 2 times longer than the other two readings. Also, icons are used to display the status of the device, for details see CHANGES-ru.txt.
Briefly to describe the AFR work in my kernel
In all but a few decoders malorasprostranonnyh (avs2, mjpeg, real, vp9 - could not understand the code), including the generation of the notification about the frequency of the playing video. Such a thing was at the core of 3.14 for Android 6.0.1 for X92, but in the current android AMLogic for some reason it was removed, although no alternative provided. Moreover, the entire mechanism of notification about the change of frequency is now in the kernel (or rather in Buildroot / media_modules) hard is broken because it is clear that there is a some kind of a global rewriting drivers in supporting multiple hardware decoders (believe it to be used in TVs with the picture-in-picture). Along the way, they broke everything they could, and I had to delve into it and fix :(
After that comes in afrd program that runs at boot time with my recovery.img. It monitors the kernel messages, and when he sees a message that the video is playing with a certain frequency, looking for a suitable video mode in the list of supported (/ sys / class / amhdmitx / amhdmitx0 / disp_cap) or off with a delay of 0.25 seconds (as in the time of launch video can go a few frequency switching events staff to not to blink a few times).
When the video stops play, there is a reverse command frame rate recovery. After that, I wait as much as 2 seconds (you can manage to reach the cartoon list and click on the next movie - if you have time, the screen will not switch to an extra two times).
If desired, these delays can be changed in the configuration file. If you found some cases where they are not enough, send me a PM.
In addition to integer frequency (24, 25, 30, 50, 60 frames / sec) latest version afrdalso It supports fractional refresh rate (23.976, 29.97, 59.94 Hz). This chip was not even in my kernel to X92.
To start my core does not have anything to flash. It is enough to throw the files on the link to the root of the SD card or USB flash drive (required formatted in FAT file system), plug it into the console and distort the power while holding down the button to match audio. The fact that it is booted your new kernel, you will learn on the animation word "boot" on the screen at startup. The next time you do not need to press a match, if you leave the flash drive in the socket, set-top box will be automatically shipped to her core. However, if you go to the recovery mode (recovery), will have to once again push the match to enable startup from the flash drive.
To restore the original nucleus, simply remove the flash drive from the console, and reboot.
For more information about how to run the kernel, written in the README-boot-ru.txt file from the link below.
Download the kernel at this link
- After downloading the Android will report that there was a terrible mistake, and urgently needs to run on google bow with pockets full of money. Just ignore. The reason, as far as I can tell, that I was thrown out of the nucleus support LCD panels (which is not needed in our set-top box), but Android on Vontar - it is Android for LCD TVs (see broken adjusting brightness backlight, contrast, and other garbage? This it is). Later I will think how to fix it.
- With some codecs (in particular, the well-known video jellyfish) refresh rate of the screen can not be restored after the video stops. It must be some mistake in the codec "hevc", but I have not had time to catch her. The frequency will be restored after the video playback to other codec.
- If you run a video with a frequency of 59.94 Hz, you will notice that the screen does not switch frequency (switching frequency of the screen goes blank for a few seconds). This is because the default Android puts the screen refresh rate of 60 Hz is not, but just 59.94. Therefore afrd does not switch mode - no need. But if you watch the video at a frequency of 60 Hz, then there will be mode switching (and restored by the end of the show). "It's not a bug, but a feature" (p).
- As it turned out, it does not work when using deinterlacingamcodec :-( This is due to the fact that the nucleus of the new AMLogic removed tb_detect driver, who previously was responsible for deinterlacing using amcodec. Some lumps of it remained, but they apparently do not work.
Tested only console 4/64, but should work on 4/32, and should work on 3/32.
The link choose 3G or 4G catalog depending on the amount of RAM on the console.
Version 2/16 have not worked, because of differences in hardware there is more decent work.
Post has been editedVasily_5 - 05.01.19, 20:53
Kernel source build system can be downloaded here
. Apart from them, it will take morebuildroot_openlinux_kernel_4.9_20180907.tar.gz
with amlogic site, the source code and vfdd afrd (referenced above), a lot of knowledge and patience.
Reason for editing: In the Hat