Jump to content

armar

Members
  • Posts

    47
  • Joined

  • Last visited

Reputation Activity

  1. Like
    armar got a reaction from Willy Moto in Armbian for TV box rk3328   
    I remember trying the adb method to get the dts, but my developer options did not have "Internet/wifi debugging" checkbox.
     
    I found a release of the firmware from geekbuying for a A5X Box and used
    https://roc-rk3328-cc.readthedocs.io/en/latest/fw_pack_unpack.html
    to unpack the img into smaller img files from update.img
     
    then used
    https://github.com/PabloCastellano/extract-dtb
    to extract the dtb (try on all the smaller img files created from unpacking update.img)
     
    and then used dtc to decompile.
     
     
  2. Like
    armar got a reaction from amirul in Proper cooling system of TV boxes.   
    So I got tired of my fan platform (see above) being always on even when I did not need the cooling, so I built a  simple controller using a USB relay module.
     
    https://www.ebay.com/itm/LCUS-type-1-USB-relay-module-USB-intelligent-switch-control-Z7A9/263383167245
     
    I stripped off part of the USB cable for the fan platform, cut the red wire and connected it to the relay like this. The black wire is untouched. Connections to COM, and NO of the relay module (no soldering needed).

     
    The USB->Serial adapter showed up in lsusb but not as /dev/ttyUSB0. I needed to enable CONFIG_USB_SERIAL_CH341=m based on this post.
    I am running a version of 4.4.154 and luckily enabling this module worked.
     
    Now I can turn the fan on and off using a script as described here.
    I wrote a simple shell script wrapper around it which looks at the temperature from
    /sys/devices/virtual/thermal/thermal_zone0/temp  in a loop and turns the fan on/off based on it. By trial and error I set the limits, I turn it on at 80C and wait for the temperature to fall below 70C to turn it off.
     
    It does use an extra USB port (a USB port splitter might work) but works fine now.  Normally the fan is off. If I start the script, no fan, until I mpv the  "lubimaya lubimaya video" the temperature goes up and then the fan starts and stays on until I close mpv.  Would be good if I could tie it to the temperature trip points in the dtb, but I don't know how.
     
     
     
  3. Like
    armar reacted to hexdump in Armbian for TV box rk3328   
    @armar - yes with the -I or -O fs options you can also use a device tree structure as input or output for the dtc command - it then works exactly like a dtb file with the -I or -O dtb options.
     
    @Sico - your edited dts file looks right - the last easy option is see would be to set the dmc-opp entry (memory voltage and frequency scaling) for opp-600000000 and opp-800000000 from disabled to okay like in your dts, but i guess it will not help much neither. opp-hz should not really differ between the dts files, except for the higher disabled clocks by me.
     
    if all that does not help, i would suggest you get some pl2003 usb to serial adapter and solder a serial console to your board (only gnd, rx and tx - usually tx from the board to rx of the adapter and the other way around). this way you will be able to see the bootup messages and get an idea about what really is the problem. one thing to be aware is that the baud speed of the serial console is 1500000 for rockchip devices instead of the usual 115200.
     
    good luck - hexdump
  4. Like
    armar reacted to hexdump in Armbian for TV box rk3328   
    hi @armar - the above device-tree-copy.tar.gz is the android dtb, just in another format and read from the system in an easier way
     
    @Sico - your hardware is definitely different from the 4g/32g t9 hardware - atttached is the resulting android dts file for your box - what you can do is: take my rk3328-t9.dts file from above and change all the opp-microvolt* values in the various sections to the values in your dts file and then build your dtb from it on a linux machine with the command "dtc -I dts -O dtb your-modified-rk3328-t9.dts > rk3328-t9-2g.dtb" and try this dtb then. you might need to install the "device-tree-compiler" package on your linux system for this.
     
    good luck and let me know about the result and post the resulting rk3328-t9-2g.dts and rk3328-t9-2g.dtb files here in case it works.
     
    hexdump
    t9-2g.dts
  5. Like
    armar reacted to madmalkav in Armbian for TV box rk3328   
    Got bundled remote to work with A5X in LibreElec, @armar you were right about not using the PWM part on LE.
  6. Like
    armar reacted to madmalkav in Armbian for TV box rk3328   
    I'm working on generating an DTS file valid for LibreELEC for A5X . I don't know if this can be of help for you, but the IR part, I think where it says:
     
    compatible = "rockchip,rk3328-pwm";
     
    It should say:
     
    compatible = "rockchip,remotectl-pwm";
     
    And compile the kernel with:
     
    CONFIG_ROCKCHIP_REMOTECTL=y
    CONFIG_ROCKCHIP_REMOTECTL_PWM=y

    PS: I just saw you have status = "disabled"; on the PWM that seems linked to the IR, is that intentional?
  7. Like
    armar got a reaction from zogu in Armbian for TV box rk3328   
    Update on the A5X MAX. 
     
     I made some modifications to the dts file, mostly merging sections from android and other files. These include dram and Wifi  settings for the A5X MAX. The blue led also works now. Attached my latest dts.  Max freq is 1296, temp limits are 90C,105C and 110C.  None of the changes are very important, use at your own risk.
     
    I could get USB webcams to work by enabling some USB AUDIO and VIDEO parameters in the .config and building/installing the kernel.
     
    Got a  USB fan platform , on which you can place the A5X MAX (no modifications) and get a 15-20C reduction in temps. Details in the cooling of TV Boxes thread. The only problem is that the fan stays on after shutdown.
     
    For Bluetooth, I found there were some disconnects/reconnects of BT and Wifi sometimes. Usually would reconnect on its own. Only happened when you use BT.  So based on the lwfinger 8723bs github page, I tried the new firmware rtlbt_fw_new by renaming rtlbt_fw to rtlbt_fw_old and copying rtlbt_fw_new to rtlbt_fw in /lib/firmware/rtl_bt and the disconnect/reconnect problems seem to have gone away.
     
    I noticed that by default hdmi sound is not enabled, you have to go speaker icon on the panel and change it to hdmi, but if after booting you turn off/on the TV again, the sound through hdmi works, even though the panel Default Sink icon points to spdif. Might indicate some ordering problems during boot.
     
    IR remote still does not work.
     
     
    rk3328-a5xbt1.dts
  8. Like
    armar got a reaction from amirul in Armbian for TV box rk3328   
    It works !!
     
    thanks
  9. Like
    armar reacted to amirul in Armbian for TV box rk3328   
    IIRC, used to add "set-default-sink alsa_output.platform-hdmi-sound.stereo-fallback" in /etc/pulse/default.pa to get hdmi sound to work on boot. YMMV
  10. Like
    armar reacted to balbes150 in Proper cooling system of TV boxes.   
    Variants of alteration of the cooling system. For example, three models MVR9 (rk3328), MX10 (rk3328) x96mini (s905w).
    In the body, above the radiator of the processor, a large hole is made and on the sides of the body a large hole is made for the free passage of air.
    On x96mini had to add a new radiator.
     
    Note need necessarily two holes, one for air intake, the second for exit. This is a very common mistake TV box manufacturers, they sometimes make only one type of holes, which is not enough for the normal operation of the cooling system. The air must pass freely through the body. The direction of air supply for TV boxes is optimal from the hole on the side surface, to the exit through the hole above the radiator. This allows the most heated air from the radiator to be immediately removed from the body. Then it doesn't heat the rest of the parts. If you do the opposite, to blow air down on the radiator and then output from the side vents, the heated (from the radiator), the air will simultaneously heat the remaining elements in the housing in its path. After this alteration and the addition of a USB fan, the system began to work stably in all modes for many hours. For anyone who uses their TV boxes as a full desktop, I strongly recommend to redesign the cooling system. Pay attention to the model x96mini, it has a default motherboard and radiator located at the bottom (upside down from the correct position). When using x96mini (and other TV boxes) be sure to turn them in the correct position - radiator up. This nonsense was invented by bad engineers who do not know the basic laws of physics. Such "engineers" think that the water can flow up the mountain. 
     
    foto
     
    https://yadi.sk/d/vQw9J81koxpuHg
  11. Like
    armar got a reaction from zogu in Armbian for TV box rk3328   
    I have bluetooth working on the A5X MAX (sort of). Still flaky and turns off sometimes.
     
    Steps.
    1. Some small changes to mp16 s dts file for BT. The new file is attached.
     
    From < BT,power_gpio = <0x95 0x1a 0x0>; < BT,wake_host_irq = <0x95 0x18 0x0>; --- To > BT,power_gpio = <0x95 0x18 0x0>; > BT,reset_gpio = <0x95 0x15 0x0>; > BT,wake_host_irq = <0x95 0x1a 0x0>;  
    Found something similar at
    https://forum.pine64.org/showthread.php?tid=1392&pid=13219#pid13219
     
    2.   From https://github.com/lwfinger/rtl8723bs_bt
    Download/clone and make to create the rtk_hciattach binary. I think the firmware files are already in /lib/firmware/rtl_bt , if not copy them there.
    The trick is to call rtk_hciattach correctly. Below is a way of setting it up as a service.
     
    3. Create a service with rtk_hciattach
     
    mkdir /usr/local/sbin/bluetooth cp rtk_hciattach /usr/local/sbin/bluetooth  
     
       create  a5x_bluetooth.sh in /usr/local/sbin/
    #!/bin/bash # Shell script to install Bluetooth firmware and attach BT part of # RTL8723BS echo "Initializing Bluetooth Module." /usr/local/sbin/bluetooth/rtk_hciattach -n -s 115200 /dev/ttyS0 rtk_h5 > /usr/local/sbin/bluetooth/hciattach.txt 2>&1 & /bin/sleep 5 echo "Bluetooth Module Active"  
    The /dev/ttyS0 might be different for different boards.  Do a  "dmesg | grep tty | grep MMIO" and pick the first one.
     
    Create a bluetooth-module.service file  in /etc/systemd/system

     
    [Unit] Description=Start A5X Bluetooth Module After=systemd-modules-load.service local-fs.target [Service] Type=idle ExecStart=/usr/local/sbin/a5x_bluetooth.sh RemainAfterExit=yes [Install] WantedBy=multi-user.target  
    4. Enable service (first time)

     
    % systemctl enable bluetooth-module % systemctl start bluetooth-module For me it does not work on reboot. I have to % systemctl restart bluetooth-module to make it work. Use sudo where appropriate in the above commands.
     
    Maybe someone knows how to make it work on reboot.
     
    You should see an adapter show up in the bluetooth manager if all goes well. I was able to connect a BT mouse. If things stop working a
    systemctl restart bluetooth-module helps sometimes.
     
    All this done for my A5X MAX with a 8723bs  wifi/bt chip. Use at your own risk.
     
     
     
     
     
     
    rk3328-a5xbt.dts
  12. Like
    armar got a reaction from mb16 in Armbian for TV box rk3328   
    I have bluetooth working on the A5X MAX (sort of). Still flaky and turns off sometimes.
     
    Steps.
    1. Some small changes to mp16 s dts file for BT. The new file is attached.
     
    From < BT,power_gpio = <0x95 0x1a 0x0>; < BT,wake_host_irq = <0x95 0x18 0x0>; --- To > BT,power_gpio = <0x95 0x18 0x0>; > BT,reset_gpio = <0x95 0x15 0x0>; > BT,wake_host_irq = <0x95 0x1a 0x0>;  
    Found something similar at
    https://forum.pine64.org/showthread.php?tid=1392&pid=13219#pid13219
     
    2.   From https://github.com/lwfinger/rtl8723bs_bt
    Download/clone and make to create the rtk_hciattach binary. I think the firmware files are already in /lib/firmware/rtl_bt , if not copy them there.
    The trick is to call rtk_hciattach correctly. Below is a way of setting it up as a service.
     
    3. Create a service with rtk_hciattach
     
    mkdir /usr/local/sbin/bluetooth cp rtk_hciattach /usr/local/sbin/bluetooth  
     
       create  a5x_bluetooth.sh in /usr/local/sbin/
    #!/bin/bash # Shell script to install Bluetooth firmware and attach BT part of # RTL8723BS echo "Initializing Bluetooth Module." /usr/local/sbin/bluetooth/rtk_hciattach -n -s 115200 /dev/ttyS0 rtk_h5 > /usr/local/sbin/bluetooth/hciattach.txt 2>&1 & /bin/sleep 5 echo "Bluetooth Module Active"  
    The /dev/ttyS0 might be different for different boards.  Do a  "dmesg | grep tty | grep MMIO" and pick the first one.
     
    Create a bluetooth-module.service file  in /etc/systemd/system

     
    [Unit] Description=Start A5X Bluetooth Module After=systemd-modules-load.service local-fs.target [Service] Type=idle ExecStart=/usr/local/sbin/a5x_bluetooth.sh RemainAfterExit=yes [Install] WantedBy=multi-user.target  
    4. Enable service (first time)

     
    % systemctl enable bluetooth-module % systemctl start bluetooth-module For me it does not work on reboot. I have to % systemctl restart bluetooth-module to make it work. Use sudo where appropriate in the above commands.
     
    Maybe someone knows how to make it work on reboot.
     
    You should see an adapter show up in the bluetooth manager if all goes well. I was able to connect a BT mouse. If things stop working a
    systemctl restart bluetooth-module helps sometimes.
     
    All this done for my A5X MAX with a 8723bs  wifi/bt chip. Use at your own risk.
     
     
     
     
     
     
    rk3328-a5xbt.dts
  13. Like
    armar got a reaction from slaven in Armbian for TV box rk3328   
    I have figured out the why BT was not connecting after reboot. It looks like it conflicts with the blueman manager applet. I found that my BT mouse worked before login and stopped working after login.  Turns out that the Blueman manager powers on the adapter on start (when you login). This probably negates the rtk_hciattach effect.  So I went into the Bluetooth Manager applet (next to wifi on the panel) -> Plugins -> Power Manager -> Configuration  and turned off "Auto Power On". Now the BT mouse connects on reboot when the systemd service bluetooth-module is enabled.
     
     
    So the A5X MAX now works with Wifi and BT  (at least with Mouse, not sure  if all BT devices will work).  !!!!
  14. Like
    armar reacted to balbes150 in Armbian for TV box rk3328   
    My memory test numbers
     
    TV box MX10 in the line will indicate what dtb and what is the result
    core 4.4
    mx10  328
    a5x     576
    a5x-1300    597
    a5x-1500    621
    kernel 5.0
    there's one working dtb MX10 - 336.
     
    TV box MVR9 (adjusted for the size of the RAM test output is reduced to 500 units)
    4.4
    a5x    531
    a5x-1300    559
    a5x-1500    566
    trn9   604
    trn9-1500    619
    5.0 here is here sign in,
    mx-10     278
    rock64    280
    It is unclear what the test was measured at 5.0 MVR9
     
    Otherwise, it becomes clear why subjectively after the transition to a new DTB on MX10 was a feeling of similar work with MVR9 , memory speed is almost equal.
  15. Like
    armar got a reaction from balbes150 in Armbian for TV box rk3328   
    I remember trying the adb method to get the dts, but my developer options did not have "Internet/wifi debugging" checkbox.
     
    I found a release of the firmware from geekbuying for a A5X Box and used
    https://roc-rk3328-cc.readthedocs.io/en/latest/fw_pack_unpack.html
    to unpack the img into smaller img files from update.img
     
    then used
    https://github.com/PabloCastellano/extract-dtb
    to extract the dtb (try on all the smaller img files created from unpacking update.img)
     
    and then used dtc to decompile.
     
     
  16. Like
    armar reacted to balbes150 in Armbian for TV box rk3328   
    Yes.
     
    I am now watching YouTube with my wife on full screen TV in 1080p TV mode with fan on MVR9 without brakes and friezes. Temperature output in the range of 60-65 degrees. Video goes without brakes and friezes.
  17. Like
    armar reacted to mb16 in Armbian for TV box rk3328   
    Agree. Getting to the Android .dts took me some time, as many of the proposed procedures did not work for me.
    My workflow:
    Have Android running on the box, developper mode active. In the settings I had a strangely named checkbox like "Internet debugging", switched on Have Android studio installed Could use adb to connect to the box, even without usb, just via lan/wlan adb root worked out of the box, devices like this one seem to be rooted by default? used adb to download the device-tree directory (have android not at hand now, should not be to hard to find) used dtc to convert It took me some time to realize that dtc can handle device-tree directories (-I fs option, see manual)
     
    Starting point for documentation: https://www.kernel.org/doc/Documentation/devicetree/usage-model.txt
  18. Like
    armar reacted to balbes150 in Armbian for TV box rk3328   
    Processors rk3328 powerful and require a good cooling system. You have not changed the housing and no fan. Therefore, the system heats up very quickly and reaches the adjustment temperature (70-80 in the dtb mx10 and 75-85 files on the a5x files). Here I described the test results when playing 4K video. After the addition of a normal cooling system (and USB fan), the temperature did not exceed 50-55 degrees under maximum load.
     
     
  19. Like
    armar reacted to mb16 in Armbian for TV box rk3328   
    Glad to read I seem to have created something useful.
     
    My box is a scishion ai one alike one, MXQ pro max labeled box. The board is labeled TX-RX4B-V02.
     
    My workflow:
    Used adb to read the device tree directory from the box running android. Converted to android.dts file using dtc. For armbian used the ...box.dtb because the device could boot using that one. Converted dtb to dts using the "sorted" option of dtc for comparison (a). Converted dtb to dts without the "sorted" option for optimization (b). Used a merge utility (meld) to compare (a) against android.dts Put the found differences into (b), used dtc to compile. Too easy
     
    Now, compare and merge... Using dtc to decompile a dtb to text format means there is no symbolic info - names as found in the kernel sources .dts(i) files 
    and rockchip documentation are not available. Its just like reading and trying to understand a compiled app from a debugger listing without symbols.
    Reading the kernel documentation regarding the device tree mechanism turned out to be very helpful.
     
    I think this kind of workflow is suitable for proof of concept. It is really not suitable for anything else.
     
    Its very easy to make mistakes. Easy to detect if the device refuses to boot, but there are many more possibilities.
     
    Reading things like ... "did not work... suddenly did... then stopped to work again...":
    This can mean pin settings (called pad nowadays, ok) might be wrong.
    Reset or chip enable signals of peripheral chips are wired to soc gpios. If the mapping of those gpios to driver functions is wrong - anything can (and will) happen.
     
    Regarding dram settings
    These numbers count in pico seconds. And a pico second is a dammed short time. The right values depend on used chips and pcb layout and must be
    set very carefully. Just using the values suitable for one board with an other... might work - or not - or temporary.
     
    Regarding the wifi chip
    The soc pads wired to the 8723 on my pcb differ from the standard ones and an other mmc peripheral of the soc is used for sdio connection. 
    It might well be, that other pcb's are wired the same way and that 8723bs and 8723cs are mostly compatible.

     
  20. Like
    armar reacted to mb16 in Armbian for TV box rk3328   
    I made a few adjustments to the device tree for my XT-RX4B-V02 based box. The intermediate results look promising:
    wifi (RTL8723CS) basically works memory perf: armbian@rk3328:~$ dd if=/dev/zero of=/tmp/testfile bs=1M count=1000 1000+0 records in 1000+0 records out 1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.70386 s, 615 MB/s ... this was within an x11vnc session, on multiple tests I constantly get values greater than 550MB/s (The board has 4GB DDR3/1600 ram)
     
    Notes
    I never experienced stability issues. As the mounted "heatsink" is more than dubious, I lowered the temp limits just to stay on the safe side. Scaling down the cpu-frequency on temp limit works flawlessly.

    The voltage settings used in Android are slightly lower than the ones in use. I had no time to test, might improve temps a bit.
     
    There are still a number of issues, maybe someone around could kick in?
    Wifi client: Connect using nmtui is fine, but how to auto-connect on system start?
    The adapter chooses a random mac on boot. I think assigning a static one would help - I just did not find a proper way of doing so... dmesg tells me that there are still a number of device tree issues that might prevent the gpu from working properly. Bluetooth (RTL8723CS) does not work yet (while usb bluetooth dongle is fine). I got the impression (might be wrong) that chip support will still take some time, but I'd like to get the device tree right and don't know how to prove that I got pins/uart/device tree settings right. @balbes150 lsmod tells me 8723cs and 8723ds get loaded. Removing 8723ds.ko helps - what would be the right way of dealing with such situation? OT side notes:
    x11vnc. I had issues with disconnecting windows viewers that took me some time to resolve. I found the resolution here: https://thespecter.net/blog/technology/opensourcediy/x11vnc-stack-mashing-detected/ (just add -noxrecord to x11vnc command line) In headless mode I get 1024*786 on boot. Simply calling xrandr --fb 1920x1080 works well. Best
    rk3328-box-RX4B-V02-WIP190129.dts
  21. Like
    armar reacted to amirul in Armbian for TV box rk3328   
    Armbian_5.72_Rk3328-tv_Ubuntu_bionic_default_4.4.154_desktop_20190123
    Boots to desktop with rk3328_evb.dtb but max cpu freq only 1.30GHz
    with rk3328_evb.dtb taken from 4.4.167 image and MAX_SPEED=1512000 in /etc/default/cpufrequtils, can reach 1.51Ghz
    Further testing ongoing...
     
    Memory speed testing with
    dd if=/dev/zero of=/tmp/testfile bs=1M count=1000
    rk3328: 352 MB/s
    s912: 566 MB/s
    need to find dram speed setting
     
  22. Like
    armar reacted to CarlosPiles in Armbian for TV box rk3328   
    For those of you interested in running Armbian and compiling kernel within MX-10 TVBOX (working with cheap MX-10 4/32 Oreo 8.1)
    Step 1: Burn https://yadi.sk/d/DSO6euzB3ahemo/ARMBIAN/5.68/20190110/Armbian_5.68_Rk3328-tv_Ubuntu_bionic_default_4.4.154_desktop_20190110.img.xz into SD Step 2: Change FDT in BOOT/extlinux/extlinux.conf to FDT /dtb/rockchip/rk3328-box-mx10.dtb Step 3: Insert in TVBOX | First run | Create user | sudo apt update && sudo apt upgrade Step 4: git clone https://github.com/150balbes/rockchip-kernel.git Step 5: apt install libncurses5-dev (for make nconfig) Step 6: Use attached configXXXXXX file as .config Step 7: make nconfig (here you can adjust your kernel config) Step 8: F6 Save as .config Step 9: make all (I use make -j 4 all to launch 4 prcesses and it runs for about 1 hour) Step 10: Backup full /boot folder Step 11: sudo make install Step 12: sudo make config_install Step 13: Modify BOOT/extlinux/extlinux.conf to boot new kerner (4.1.154) LABEL Armbian LINUX /vmlinuz-4.4.154 INITRD /uInitrd FDT /dtb/rockchip/rk3328-box-mx10.dtb APPEND root=LABEL=ROOTFS rootflags=data=writeback rw console=uart8250,mmio32,0xff130000 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 Ready to reboot
    config20190113
  23. Like
    armar reacted to wdtz in Armbian for TV box rk3328   
    Well, it varies, alas. The firmware files can be bin or fw or other. Usually from /lib/firmware or a folder there BUT
    can be in /usr/somewhere, this is not common
    I don't know how the ko knows where to find the firmware
    Firmware are for the wifi chip, are version and OS independent
    It is 1 of them, there are 9 or 10 in total plus uboot and miniLoader and ?
    Maybe I'm telling you something you already know, / in Android is only in mem,
    loaded from the boot part, a gz cpio. Most of the folders in / (android ) are links to
    the appropriate partition
     
    I would guess that these are the ones you need, try copy them to lib/firmware/rtlwifi
  24. Like
    armar reacted to wdtz in Armbian for TV box rk3328   
    Dmesg , if all is well, will give a message, ie  (dmesg |grep firmw)
    usb 1-1.4.3: rtl8xxxu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
    for a usb dongle
  25. Like
    armar reacted to balbes150 in Armbian for TV box rk3328   
    Try to run the utility ddbr and create a full backup of the eMMC. If the utility can not read eMMC you need to deal with the parameters of DTB (which are responsible for eMMC).
     
    no
     
    It is similar, but different manufacturers can change the content (components) themselves.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines