Huafu

Members
  • Posts

    10
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Huafu reacted to intikallpa in CSC Armbian for RK3318/RK3328 TV box boards   
    Maskrom mode: shortcircuit between points B and C. This works perfect for My X88Pro 10.
  2. Like
    Huafu got a reaction from jock in CSC Armbian for RK3318/RK3328 TV box boards   
    @markst I have the same wifi chip on my 2 boards and here is part of my armbianEnv.txt if it can help:
     
    overlay_prefix=rockchip fdtfile=rockchip/rk3318-box.dtb [...] overlays=rk3318-box-wlan-ext rk3318-box-led-conf2 rk3318-box-wlan-ap6330
     
  3. Like
    Huafu reacted to jock in Testing hardware video decoding (rockchip, allwinner?)   
    Hello, recent upgrades to armbian are regarding kernel 5.15.
    I noticed that many v4l2 fixes and enhancements went into this release, so I decided to compile ffmpeg using LibreELEC patched version and mpv over it.
    mpv turns out to be statically linked with ffmpeg, so I propose it here for people who is interested in cutting edge kernel and wants to do some tests.
     
    This has been tested on Debian Bullseye and Ubuntu Hirsute on following platforms:
    Rockchip RK3228/9 (kernel 5.10, 5.14) Rockchip RK3288 (kernel 5.14) Rockchip RK3318/28 (kernel 5.15)  
    It should work on allwinner platforms too, but I didn't test it there.
    Binaries are built by me on developing boards.
     
    The binary for armhf is available here
    The binary for aarch64 is available here
     
    Dependencies for Debian Bullseye and Ubuntu Hirsute:
    apt install libass9 libbluray2 librubberband2 libsdl2-2.0-0 libva-drm2 libva-wayland2 libva-x11-2 libva2 libvdpau1 libx264-160 libx265-192 libxss1 libxv1 libfdk-aac2  
    I have had issues with dependencies on Debian Buster/Ubuntu Focal, in particular libx264-160 and libx265-192 are not available there.
    I Solved the issue downloading the packages from Debian Bullseye web page and manually installing them.
    There may be the need for some other dependency depending upon your actual installation.
     
    Run mpv in a virtual terminal (videos up to 4K) with this CLI:
    mpv --vo=gpu --hwdec=drm --gpu-hwdec-interop=drmprime-drm --drm-draw-plane=overlay --drm-drmprime-video-plane=primary <video.mp4>  
    Mpv can be run in X11 with this other CLI, but due to buffer copying it requires a good CPU - rk3228 and rk3328 won't even play 720p, rk3288 do 720p fine:
    mpv --vo=gpu --hwdec=auto-copy --gpu-context=x11egl --gpu-hwdec-interop=drmprime-drm <video.mp4>  
    This is an experiment and your mileage may vary a lot:
    H.264 codec should be well supported around the boards; H.265 has more limited support VP8 should be generally supported VP9 seems to still require some work.
  4. Like
    Huafu reacted to jock in CSC Armbian for RK3318/RK3328 TV box boards   
    Well I would try to guess what's wrong with that.
    I just checked the ddrbin and it the very exact same ddrbin that is currently shipped along the current images, so all the things I said in the previous post should not apply to your case.
     
    You must see something intelligible from the serial, be sure to put it at 1,500,000 bps (1.5 mbps), otherwise you only get garbage.
     
    About the overscan, I never faced such issue with the board. Had to fix that on my monitor/TVs usually setting the right option in the menu (some call it "16:9", some "Just Scan", "PC mode" or other fantasy names...), but never had to handle it at board level.
    It happened to me that some older TVs just don't have the feature to remove overscan
  5. Like
    Huafu reacted to fabiobassa in CSC Armbian for RK3318/RK3328 TV box boards   
    @chinhhut

    Try these steps:
    1) push the little switch inside the hole while inserting a male-male cable into the otg
    2) on another linux machine you should have now a new device (lsusb will help you) and you can run rkdeveloptool
    3) rkdeveloptool ld should List Device
    4) rkdeveloptool rd 3 should Reset Device into mode 3  ( maskrom )
    5) rkdeveloptool db MiniLoaderAll.bin ( of course from your path) should upload a temporary loader to recognize the internal emmc
    6) if all is successfull until now you can rkdeveloptool wl 0X0 yourimage.img . This should flash the internal emmc .

    DISCLAIMER: very " dangerous" approach , be ready to have the opportunity to short the emmc clock pin to ground to go back into mask rom
     
    MiniLoaderAll.zip
  6. Like
    Huafu reacted to enigmasphinx in CSC Armbian for RK3318/RK3328 TV box boards   
    Thanks jock for this post. I was able to unbrick my device. I now have successfully installed Armbian on my device and loves its performance by following this post.
     
    My device is called Ninkbox N1 Max RK3318. I was trying to look for a firmware suitable for my device but I am unable to find the exact one. I tried asking support from their main website but to no avail. So I tried installing different firmware on my device with almost the same chips until I ended up bricking the device. Unfortunately I already bricked the device before landing into this post so I was not able to backup my original firmware. For some unfortunate twist of fate I also have those BGA chips with no exposed pins. Upon further examination there are two round copper at the back of the board where the BGA chip sits. After burning the image on an SD card I tried shorting the round coppers with a piece of staple wire and it gave me the Multiboot window.
     
    I am writing this for those other people who may have the same device as mine and is looking to setup Armbian or probably trying to unbrick their device.
     
    This is my EMMC Chip
    https://drive.google.com/file/d/1J5E8OGBUOV_sdQ0VF0glIt4t6yhRKxrr/view?usp=sharing
     
    The picture of my device
    https://drive.google.com/file/d/1J2Ha8nUhA5hhXne_vqHdyzLBOlxCWcMV/view?usp=sharing
     
    The round copper at the back of the board to short
    https://drive.google.com/file/d/1J-X_9Y4jKr8u87lEosGkBmtpwjdxGsFb/view?usp=sharing
     
    My device desktop after successful install
    https://drive.google.com/file/d/1J5hkfP7A4U5r6xO7P9Zgv8ArpjUmZJ0g/view?usp=sharing
     
  7. Like
    Huafu reacted to jock in CSC Armbian for RK3318/RK3328 TV box boards   
    ­DISCLAIMER (PLEASE READ): everything you can find in this thread (binaries, texts, code snippets, etc...) are provided AS-IS and are not part of official Armbian project. For this reason not people from Armbian project nor myself are responsible for misuse or loss of functionality of hardware.

    Please don't ask about support or assistance in other non-community forums nor in the official Armbian github repository, instead post your questions in this thread, in the TV Boxes forum section (hardware related) or in the Peer-to-peer support section (general linux/software related).

    Thank you!
     
    This thread is to give stable and mature long-term range support to rk3318/rk3328 found in many tv boxes in Armbian project as Community Supported Configuration (CSC).
    The current work is in early stages, it may or may not work for you; if and when it will be considered mature enough, it will be hopefully merged into Armbian master, but in the meantime it lives on my personal fork on github -> here <-
     
    Important notes: is just a personal opinion, but apparently widely supported, that rk3318 chip is not an official rockchip part. They probably are scrap rk3328 parts which have not passed conformance tests but are sold anyway to tv boxes manufacturers. They don’t reach the same operating frequency of the rk3328, have much higher leakage currents (and thus higher temperatures) and often the boards they are installed on are low quality with low quality components, in fact a very very common issue is the eMMC failure due to bad parts and bad soldering. So said, I personally suggest not to buy any rk3318 tv box, but instead find a properly supported SBC (Single Board Computer) if you need a reliable product. In the unfortunate case you already have such product, this thread may help you have some fun with them.
     
    What works:
        • Works on RK3318 and RK3328 TV boxes with DDR3 memories
        • Mainline u-boot
        • Mainline ATF provided as Trusted Execution Environment
        • All 4 cores are working
        • Ethernet
        • Serial UART (configured at stock 1.5Mbps)
        • Thermals and frequency scaling
        • OTG USB 2.0 port (also as boot device!)
        • EHCI/OHCI USB 2.0 ports
        • MMC subsystem (including , SD and sdio devices)
        • Hardware video acceleration (fully supported via RKMPP on legacy kernel, support via hantro and rkvdec kernel driver on mainline)
        • Various WIFI over SDIO are supported
        • Full acceleration on legacy kernel and mainline kernel
        • U-boot boot order priority: first the sdcard, then the USB OTG port and eventually the internal ; you can install u-boot (and the whole system) in the internal and u-boot will always check for images on external sdcard/USB first.
     
    Unbrick:
    Technically, rockchip devices cannot be bricked. If the internal flash does not contain a bootable system, they will always boot from the sdcard. If, for a reason, the bootable system on the internal flash is corrupted or is unable to boot correctly, you can always force the maskrom mode shorting the clock pin on the PCB. The procedure is explained here for rk322x, but for rk3318/28 is the same.

    In most of the rk3318/28 boards, shorting the clock pin is difficult or impossible because eMMC are BGA chips with no exposed pins. Pay double attention when burning something on the internal flash memory and always test first the image booting from the sdcard to be sure it works before burning anything in internal flash.
     
    This is a list of posts where forum users have been able to spot the eMMC clock pin to trigger the maskrom mode:
    H96 Max+ (board signature: RK3318_V1.4) by @Gausus Ninkbox N1 Max RK3318 by @enigmasphinx  
     
    Partecipation and debugging:
    If you want to partecipate or need help debugging issues, do not hesitate to share your experience with the installation procedure of the boxes.
    In case of issues and missed support, provide as many as possible of these things is very useful to try and bring support for an unsupported board:
     
    some photos of both sides of the board. Details of the eMMC, DDR and Wifi chips are very useful! upload the device tree binary (dtb) of your device. We can understand a lot of things of the hardware from that small piece of data; and alternative is a link to the original firmware (you can do a full backup with the Multitool); dmesg and other logs (use armbianmonitor -u that automatically collects and uploads the logs online) attach a serial converter to the device and provide the output of the serial port;  
    Multimedia:
    Mainline kernel: 3D acceleration is provided by Lima driver and is already enabled. Hardware video decoding: https://forum.armbian.com/topic/19258-testing-hardware-video-decoding-rockchip-allwinner/ Legacy kernel: If you need multimedia features, like OpenGL/OpenGL ES acceleration, hardware accelerated Kodi, ffmpeg and mpv you can take a look to this post  
    Installation (via SD card):
    Building:
    You can build your own image follow the common steps to build armbian for other tv boxes devices: when you are in the moment to choose the target board, switch to /TVB/ boards and select "rk3318-box" from the list.
       
    Development images:
    Armbian 22.05 - Debian Bullseye minimal - mainline kernel 5.15.35 - Download from here - Build date: 2022-04-23 Armbian 22.05 - Ubuntu Jammy desktop [xfce] - mainline kernel 5.15.35 - Download from here - Build date: 2022-04-23  
    Manual kernel upgrade:
    In case you want to upgrade to the latest kernel on a existing installation, deb packages are available here.
    Download all the deb packages in an empty directory and then install with the following command:
    sudo apt install ./*.deb  
    Multitool:
    Multitool - A small but powerful image for RK3318/RK3328 TV Box maintenance. Download it from here  
    Quick installation instructions on eMMC:
    Build or download your preferred Armbian image and a copy of the Multitool; Burn the Multitool on an SD card; once done, place the Armbian image in images folder of the SD card FAT partition; Plug the SD card in the TV box and plug in the power cord. After some seconds the blue led starts blinking and the Multitool appears; OPTIONAL: you can do a backup of the existing firmware with "Backup flash" menu option; Choose "Burn image to flash" from the menu, then select the destination device (usually mmcblk2) and the image to burn; Wait for the process to complete, then choose "Shutdown" from main menu; Unplug the power cord and the SD card, then replug the power cord; Wait for 10 seconds, then the led should start blinking and HDMI will turn on. The first time the boot process will take a couple of minutes or more because the filesystem is going to be resized, so be patient and wait for the login prompt. On first boot you will be asked for entering a password for root user of your choice and the name and password for a regular user Run rk3318-config to configure the board specific options Run armbian-config to configure timezone, locales and other personal options Run apt-mark hold linux-image-*-rockchip64 linux-dtb-*-rockchip64 to avoid the upgrade of kernel with the armbian official one, since it still does not contain rk3318 Congratulations, Armbian is now installed!  
    Despite the procedure above is simple and reliable, I always recommend to first test that your device boots Armbian images from SD Card.
    Due to the really large hardware variety, there is the rare chance that the images proposed here may not boot. If a bad image is burned in , the box may not boot anymore forcing you to follow the unbrick section at the top of this post.
     
    Quick installation instructions to boot from SD Card:
    If you are already running Armbian from eMMC, skip to the next step. Instead if you are running the original firmware you need to first erase the internal; to do so download the Multitool, burn it on an SD Card, plug the SD Card and power the TV Box. Use "Backup flash" if you want to do a backup of the existing firmware, then choose "Erase flash" menu option. Build or download your preferred Armbian image; Uncompress and burn the Armbian image on the SD Card; Plug the SD Card in the TV Box and power it on; Wait for 10 seconds, then the led should start blinking and HDMI will turn on. The first time the boot process will take a couple of minutes or more because the filesystem is going to be resized, so be patient and wait for the login prompt; On first boot you will be asked for entering a password for root user of your choice and the name and password for a regular user Run rk3318-config to configure the board specific options Run armbian-config to configure timezone, locales and other personal options, or also to transfer the SD Card installation to internal ; Run apt-mark hold linux-image-*-rockchip64 linux-dtb-*-rockchip64 to avoid the upgrade of kernel with the armbian official one, since it still does not contain rk3318 Congratulations, Armbian is running from SD Card!  
    Tutorial - How to install Armbian on your TV Box (by @awawa😞
    https://www.hyperhdr.eu/2022/01/tv-box-mania-i-part-x88-pro-10.html
    A note about boot device order:
    With Armbian also comes mainline U-boot. If you install Armbian, the bootloader will look for valid bootable images in this order:
    External SD Card External USB Stick in OTG Port Internal  
    The Multitool does not boot / How to burn image directly on eMMC:
     
    Some boards have the sdcard attached to an auxiliary (called also sdmmc_ext or external) controller which is not the common one.
    Forum findings declare that those boards are not able to boot from sdcard with stock firmware and they neither do in maskrom mode: the stock firmware always boots even if you put the multitool on sdcard.
     
    In such case, burning images directly on eMMC is the only way to have a working Armbian installation.
    You can follow these instructions by @fabiobassa to burn images directly on eMMC:
     
    https://forum.armbian.com/topic/17597-csc-armbian-for-rk3318rk3328-tv-box-boards/?do=findComment&comment=130453
     
     
    Critics, suggestions and contributions are welcome!
     
    Credits:
    @fabiobassa for his ideas, inspiration, great generosity in giving the boards for development and testing. The project of bringing rk3318 into armbian would not have begun without his support! @hexdump for his precious support in early testing, ideas and suggestions
    @MX10.AC2Nfor his patience in testing mxq-rk3328-d4 board support
    All the rockhip64 maintainers at Armbian project who have done and do most of the work to support the platform
     
     
  8. Like
    Huafu reacted to jock in CSC Armbian for RK3318/RK3328 TV box boards   
    Hello @Huafu, the memory amount is normally autodetected: first by the rockchip blob (the ddrbin) that does the very first SDRAM initialization and then by u-boot.
    Now I didn't change any bits in the u-boot code, but it may be that, for a reason or another, the rockchip blob is not able to detect the whole amount of memory.
     
    The only way to know if the memory is correctly detected is read the serial output with a serial adapter.
    You can however post a dmesg log here, but I guess it will just say that you have 2gb of ram and that's all.
     
    Another thing that could be useful is the first megabyte of the original firmware, where the ddrbin is stored. Now we are using version v1.15 which turned out to be stable and compatible, but it could be that your board has a different memory arrangement that require a different version (I think it is a remote chance, but never say never ...)
  9. Like
    Huafu reacted to lucky62 in CSC Armbian for RK3318/RK3328 TV box boards   
    Hi @Huafu, there is not much more to share than what was already published in this thread... I was trying to compile kernel, but in the end I am using the kernel from @jock. Also I did nothing with HW acceleration...
    WiFi is working, just needs to be enabled by rk3318-config. IR is working also, just you need the toml file (attached) and register it - described here.
     
    Regarding the LCD, I compiled the driver from Arthur - without changes. For this you need to install kernel headers into box, download and unpack the driver sources, switch to the driver directory. In the MakeFile you need to change the path to the kernel - in my case it was:
    KERNELDIR = /lib/modules/5.10.37-rockchip64/build  
    and you need to create the symlinks to the System.map in the driver directory and in the kernel directory:
    ln -sf /boot/System.map-$(uname -r) System.map # in the driver directory ln -sf /boot/System.map-$(uname -r) /lib/modules/$(uname -r)/build/System.map  
    then compile and install:
    make make modules_install  
    Finally you need DT overlay file - just make a copy from here and install it by armbian-add-overlay. DTS will be automatically compiled and installed. After reboot driver should be loaded. To work with it you need to start OpenVFDService. I am using the version compiled by @jock.
     
    Last point - I was not happy with cooling - box was very hot even when idle... So I ordered fan and regulator from Aliexpress, I did a big hole to the top cover and mounted together. Fan is powered from the adapter. No big current. Temperature sensor is glued to the heatsink:
     

     
    Soldering - thick wires are for fan (red = + positive). On the left side are the wires of serial interface:
     

     
    x88pro10.toml
  10. Like
    Huafu reacted to lucky62 in CSC Armbian for RK3318/RK3328 TV box boards   
    good news, today I succesfuly compiled the openvfd driver.
    This is my DT Overlay:
    /dts-v1/; /plugin/; / { fragment@0 { target-path = "/"; __overlay__ { openvfd { compatible = "open,vfd"; dev_name = "openvfd"; openvfd_gpio_clk = <&gpio2 0x13 0x00>; openvfd_gpio_dat = <&gpio2 0x16 0x00>; openvfd_gpio_stb = <&gpio2 0x12 0x00>; openvfd_chars = [04 00 01 02 03]; openvfd_dot_bits = [00 01 02 03 04 05 06]; openvfd_display_type = <0x03>; status = "okay"; }; }; }; }; Driver is working without any changes.