Everything posted by haven
-
Rockchip Rk3318 X88 pro 10 - in progress
So on H96Max 3318, the working configuration file for Openvfd is: /etc/modprobe.d/openvfd.conf options openvfd vfd_gpio_clk="4,0x16,0" options openvfd vfd_gpio_dat="4,0x15,0" options openvfd vfd_gpio_stb="0,0,0xFF" options openvfd vfd_chars="0,4,3,2,1" options openvfd vfd_dot_bits="0,1,3,2,4,5,6" #ID Display type #0x03 A display like on the A95X R2 (or the Abox A1 Max). <-- #.2 Reserved - must be 0. #.3 flags #.4 0 - > FD628 and compatible controllers options openvfd vfd_display_type="0x02,0x00,0x00,0x06" But GPIO2_22 (global GPIO86) is claimed by the spi-gpio driver for the Device Tree node i2c-aux-display Device Tree │ └── /i2c-aux-display compatible = "spi-gpio" │ ▼ kernel spi_gpio driver │ ├── GPIO2_19 → SCK ├── GPIO2_22 → MOSI ← GPIO86 is claimed here └── GPIO2_18 → CS i2c-aux-display { compatible = "spi-gpio"; sck-gpios = <... 0x13 ...>; /* GPIO2_19 */ mosi-gpios = <... 0x16 ...>; /* GPIO2_22 */ cs-gpios = <... 0x12 ...>; /* GPIO2_18 */ }; So we have to unbind with: echo i2c-aux-display | sudo tee /sys/bus/platform/drivers/spi_gpio/unbind before 0x15 → GPIO2_21 → unused 0x16 → GPIO2_22 → "mosi" [used] after GPIO2_21 → unused GPIO2_22 → unused we might want to modify the DTS or just unbind it before loading the openvfd module: /lib/systemd/system/openvfd.service [Unit] Description=OpenVFD Service ConditionPathExists=/proc/device-tree/openvfd/ [Service] ExecStart=/bin/sh -c '[ `cat /proc/device-tree/openvfd/compatible` = "open,vfd" ] && echo i2c-aux-display | sudo tee /sys/bus/platform/drivers/spi_gpio/unbind; /sbin/modprobe openvfd; /usr/sbin/OpenVFDService' ExecStop=/bin/kill -TERM $MAINPID ExecStopPost=-/usr/sbin/rmmod openvfd RemainAfterExit=yes [Install] WantedBy=basic.target Attached OpenVfd.c for this box. OpenVFDService.c
-
Rockchip Rk3318 X88 pro 10 - in progress
Update on a H96 box Rk3318 and openvfd. After disassembly of the original android firmware i have: Controller/display: FD628 Interfaccia: 2-wire CLK: GPIO2_22 = GPIO86 DAT: GPIO2_21 = GPIO85 STB/CS: not used Bit order: MSB first START/STOP: type I²C Android sequence: correctly relpicated H96 Max use a protocol FD628 2-wire H96 Max RK3318 / HS2734C Controller : FD628 Bus : Proprietary 2-wire CLK : GPIO2_22 = GPIO86 DAT : GPIO2_21 = GPIO85 STB/CS : None Bit order : MSB first Digit positions: 0x6E → digit 1 0x6C → digit 2 0x6A → digit 3 0x68 → digit 4 Segments: bit0 = A bit1 = B bit2 = C bit3 = D bit4 = E bit5 = F bit6 = G Verified examples: 1 = 0x06 2 = 0x5B 3 = 0x4F 4 = 0x66 BOOT: b = 0x7C o = 0x5C t = 0x78 ``` Therefore, the GPIO pins, bit order, communication protocol, digit addresses, and segment mapping are now confirmed to be correct. continues..
-
Rockchip Rk3318 X88 pro 10 - in progress
yes, tried different tv/monitor always with the same problem, solved by disabling video driver in u-boot.
-
Rockchip Rk3318 X88 pro 10 - in progress
Modified instruction for H96 Max rk3318, with armbian installed to internal emmc (/dev/mmcblk2) kernel 6.60 current git clone --depth=1 --branch=main https://github.com/armbian/build Create patch: ./compile.sh uboot-patch BOARD=rk3318-box BRANCH=current During patch process, modify config: cd build/cache/sources/u-boot-worktree/u-boot/v2024.07/configs sudo nano rk3318-box_defconfig CONFIG_VIDEO=n After creation, move patch: mv build/output/patch/u-boot-rockchip64-current.patch build/patch/u-boot/v2024.07/ Compile u-boot: ./compile.sh uboot ARTIFACT_IGNORE_CACHE=yes BOARD=rk3318-box BRANCH=current Install with dpkg: cd output/debs sudo dpkg -i linux-u-boot-rk3318-box-current_24.11.0-trunk_arm64__2024.07-S3f77-P1c9c-H4674-Vfe58-Bda0a-R448a.deb Flash uboot to boot partition: cd /usr/lib/linux-u-boot-current-rk3318-box/ sudo dd if=idbloader.img of=/dev/mmcblk2 seek=64 conv=notrunc sudo dd if=u-boot.itb of=/dev/mmcblk2 seek=16384 conv=notrunc Done! Reboot and I see a black screen during u-boot.
-
CSC Armbian for RK3318/RK3328 TV box boards
My emmc was blown out with a power blackout during a flash process active. Very unlucky event.
-
CSC Armbian for RK3318/RK3328 TV box boards
SOLVED problem with HDMI audio! This was caused by early HDMI detection during u-boot process. Had to recompile u-boot, disabling early video display. See details hereunder.
-
Rockchip Rk3318 X88 pro 10 - in progress
The HDMI audio problem was a great opportunity to study how HDMI is detected and handled in rk3318 box! Initially I supposed it was a kernel problem and tried with many kernel version 6.1.63 - 6.2 - 6.6.2 - 6.6.39 - 6.6.47 - 6.6.60 (current or edge no matters), with poor results. Then discovered If I boot with HDMI cable disconnected and connect the cable after BOOT (15s after power-up) -> HDMI sound ok This pointed me towards the investigation of the boot process: if HDMI is connected after the u-boot process, it works like charm! How to disable HDMI detection in u-boot config? Get armbian sources and tools: git clone --depth=1 --branch=v23.11 https://github.com/armbian/build I used branch 23.11 to match kernel 6.6.2 Turned out that U-boot config can be changed only with a patch. ./compile.sh uboot-patch BOARD=rk3318-box BRANCH=edge Attached the patch I created for include/configs/evb_rk3328.h to dIsable video output in u-boot and use only console. u-boot-rockchip64-edge.patch +#define ROCKCHIP_DEVICE_SETTINGS \ + "stdin=serial,usbkbd\0" \ + "stdout=serial,vidconsole\0" \ + "stderr=serial,vidconsole\0" + Placed the patch in: build/patch/u-boot/u-boot-rockchip64 Then rebuild u-boot only: ./compile.sh uboot ARTIFACT_IGNORE_CACHE=yes BOARD=rk3318-box BRANCH=edge During the process you will see which patches are applied, hopefully without any error. This will create a deb package in build/output/debs: linux-u-boot-rk3318-box-edge_23.11.0-trunk_arm64__2022.07-Se092-P44dd-H8c72-Ve9d0-B1179-R448a.deb Install with dpkg: sudo dpkg -i linux-u-boot-rk3318-box-edge_23.11.0-trunk_arm64__2022.07-Se092-P44dd-H8c72-Ve9d0-B1179-R448a.deb This will create 2 files: ls /usr/lib/linux-u-boot-edge-rk3318-box/ idbloader.img u-boot.itb Last step - need to flash the new u-boot into boot partition ( /dev/mmcblk0 ) sudo dd if=idbloader.img of=/dev/mmcblk0 seek=64 conv=notrunc sudo dd if=u-boot.itb of=/dev/mmcblk0 seek=16384 conv=notrunc Done! Reboot and I see a black screen during u-boot. Soon after the kernel is loaded, HDMI is activated and works properly, both video and audio. u-boot-rockchip64-edge.patch
-
Rockchip Rk3318 X88 pro 10 - in progress
In the last few weeks I had problems with HDMI audio. See details here:
-
CSC Armbian for RK3318/RK3328 TV box boards
same happened to me, EMMC dead, no way to recover -> only boot from SDCARD
-
Rockchip Rk3318 X88 pro 10 - in progress
Just in case you want to build your own kernel and choose a specific version (es 23.11): git clone --depth=1 --branch=v23.11 https://github.com/armbian/build Choose edge or current ./compile.sh kernel BOARD=rk3318-box EXPERT="yes" INSTALL_HEADERS=yes RELEASE=jammy BRANCH=edge Optional you can choose specific kernel version using KERNELBRANCH: ./compile.sh kernel BOARD=rk3318-box EXPERT="yes" INSTALL_HEADERS=yes RELEASE=jammy BRANCH=edge KERNELBRANCH="tag:v6.6.2" Compile is quite fast (few minutes). In folder you will find the deb pckgs to be installed: ls output/debs/ linux-dtb-edge-rockchip64_23.11.0-trunk_arm64__6.6.2-Sa06c-Df461-P65a8-C40f3Hfe66-HK01ba-Vc222-B1743-R448a.deb linux-headers-edge-rockchip64_23.11.0-trunk_arm64__6.6.2-Sa06c-Df461-P65a8-C40f3Hfe66-HK01ba-Vc222-B1743-R448a.deb linux-image-edge-rockchip64_23.11.0-trunk_arm64__6.6.2-Sa06c-Df461-P65a8-C40f3Hfe66-HK01ba-Vc222-B1743-R448a.deb Install all and reboot: sudo dpkg -i * Optional - compile u-boot: ./compile.sh uboot BOARD=rk3318-box EXPERT="yes" BRANCH=edge
-
CSC Armbian for RK3318/RK3328 TV box boards
2. RK3318 (max 1.3Ghz) is safe enough (imho)
-
CSC Armbian for RK3318/RK3328 TV box boards
Update to hdmi no audio problem. If I boot with HDMI cable disconnected and connect the cable after BOOT (15s after power-up) -> HDMI sound ok If I boot with HDMI cable connected -> no HDMI sound tested with kernel 6.6.60 current and 6.8.11 edge, same issue. Pulseaudio not installed, only using alsa. Analog audio working ok. Monitor/tv edid detected correctly in all cases. Studing some trick to delay HDMI detection after boot. or to re-trigger o re-load hdmi kernel module afterwards. Still no results.
-
CSC Armbian for RK3318/RK3328 TV box boards
Still working on HDMI audio problem, with updates. ( v24.8.4 for RK3318 Box running Armbian Linux 6.6.47-current-rockchip64) Gdm3 + Xfce Desktop If I boot with HDMI cable disconnected and connect the cable after BOOT completed -> HDMI sound ok If I boot with HDMI cable connected -> no HDMI sound I cannot find any error, all seems ok. aplay -l **** List of PLAYBACK Hardware Devices **** card 0: HDMI [HDMI], device 0: ff000000.i2s-i2s-hifi i2s-hifi-0 [ff000000.i2s-i2s-hifi i2s-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 parse-edid < /sys/class/drm/card0-HDMI-A-1/edid Checksum Correct Section "Monitor" Identifier "Panasonic-TV" ModelName "Panasonic-TV" VendorName "MEI" # Monitor Manufactured week 1 of 2020 # EDID version 1.3 # Digital Display DisplaySize 700 390 Gamma 2.20 Option "DPMS" "false" Horizsync 15-80 VertRefresh 49-76 # Maximum pixel clock is 150MHz #Not giving standard mode: 1280x1024, 60Hz #Extension block found. Parsing... Modeline "Mode 2" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync Modeline "Mode 0" 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync Modeline "Mode 1" 85.50 1360 1424 1536 1792 768 771 777 795 +hsync +vsync Modeline "Mode 3" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync Modeline "Mode 4" 74.250 1280 1390 1420 1650 720 725 730 750 +hsync +vsync Modeline "Mode 5" 74.250 1280 1720 1760 1980 720 725 730 750 +hsync +vsync Modeline "Mode 6" 74.250 1920 2008 2052 2200 1080 1082 1087 1125 +hsync +vsync interlace Modeline "Mode 7" 74.250 1920 2448 2492 2640 1080 1082 1089 1125 +hsync +vsync interlace Modeline "Mode 8" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync Modeline "Mode 9" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync Modeline "Mode 10" 27.000 720 732 796 864 576 581 586 625 -hsync -vsync Modeline "Mode 11" 27.000 720 732 796 864 576 581 586 625 -hsync -vsync Modeline "Mode 12" 74.250 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync Modeline "Mode 13" 74.250 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync Modeline "Mode 14" 74.250 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync Modeline "Mode 15" 27.000 1440 1464 1590 1728 576 578 581 625 -hsync -vsync interlace Modeline "Mode 16" 27.000 1440 1464 1590 1728 576 578 581 625 -hsync -vsync interlace Modeline "Mode 17" 25.200 640 656 752 800 480 490 492 525 -hsync -vsync Modeline "Mode 18" 27.027 1440 1478 1602 1716 480 484 487 525 -hsync -vsync interlace Modeline "Mode 19" 27.027 1440 1478 1602 1716 480 484 487 525 -hsync -vsync interlace Modeline "Mode 20" 27.00 720 732 796 864 576 581 586 625 -hsync -vsync Option "PreferredMode" "Mode 2" EndSection Tried to include in boot.cmd extra option "hdmi.audio=1" with no results. Tried to reload all alsa modules with sudo alsa force-reload -> no results Tried to disable and re-enable hdmi with: xrandr --output HDMI-1 --off xrandr --output HDMI-1 --auto no result
-
CSC Armbian for RK3318/RK3328 TV box boards
Still working on HDMI audio, with some updates. Pulseaudio default sink set correctly. Fisrt of all the issue appears only on my home TV. Tested with other TV sound seems ok. HDMI port works with other device (my notebook) kernel 6.6.47-current Armbian v24.8.4 -> no hdmi audio kernel 6.6.2-edge Armbian v23.11.1 -> no hdmi audio kernel 6.8.11-edge Armbian v24.8.4 -> no hdmi audio kernel 6.11.0-edge Armbian v24.8.4 -> no hdmi audio kernel 6.1.63-current Armbian v23.11.1 -> hdmi audio OK still working on ..
-
CSC Armbian for RK3318/RK3328 TV box boards
Update: the error I see in dmesg are irrilevant, I checked a good working system and they are still there without any issue. Still no HDMI sound on kernel 6.6.47
-
CSC Armbian for RK3318/RK3328 TV box boards
I have been running all ok with kernel 6.6.2-edge-rockchip64 A few days ago updated to 6.6.47-current-rockchip64, now HDMI audio is not working, video is ok, Everything else works like a charm. Uboot has been also updated. I have all the output configuration well configured, but no output at all. Cards detected, output sink detected, default output points to the right ouput, not muted, volume 100%. aplay -l card 0: HDMI [HDMI], device 0: ff000000.i2s-i2s-hifi i2s-hifi-0 [ff000000.i2s-i2s-hifi i2s-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: ANALOG [ANALOG], device 0: ff010000.i2s-rk3328-hifi rk3328-hifi-0 [ff010000.i2s-rk3328-hifi rk3328-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: SPDIF [SPDIF], device 0: ff030000.spdif-dit-hifi dit-hifi-0 [ff030000.spdif-dit-hifi dit-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 In dmseg I see this error (maybe related): [ 69.740081] hdmi-audio-codec hdmi-audio-codec.3.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -22 [ 69.769681] hdmi-audio-codec hdmi-audio-codec.3.auto: ASoC: error at snd_soc_dai_hw_params on i2s-hifi: -22 Any idea how to get HDMI audio working?
-
Rockchip Rk3318 X88 pro 10 - in progress
Working on CPU frequencies, the armbian image limit max cpu freq to 1.3 GHz. Neverthless the box has been sold as 1.5Ghz, so I was asking myself why should I lose some calculation power. After few serching around I found that the box can run stable at 1.4GHz with 1.35V voltage. Using armbian-config, the dtc can be modifed: opp-1200000000 { opp-hz = <0x00 0x47868c00>; opp-microvolt = <0x124f80>; clock-latency-ns = <0x9c40>; status = "okay"; }; opp-1296000000 { opp-hz = <0x00 0x4d3f6400>; opp-microvolt = <0x137478>; clock-latency-ns = <0x9c40>; status = "okay"; }; opp-1392000000 { opp-hz = <0x00 0x52f83c00>; opp-microvolt = <0x149970>; clock-latency-ns = <0x9c40>; status = "okay"; }; I also tested 1.5GHz but temperature raise wuickly when stressed (up to 90°C) and started to have some unstable unexpected behaviour, so I stick to 1392 MHz with good results.
-
Rockchip Rk3318 X88 pro 10 - in progress
Moved the whole system from sd card to internal emmc. (* printscreen from Helios64, just for sample https://wiki.kobol.io/helios64/install/transfer/) Step 1 - Run Armbian Configuration Utility Step 2 - Select Install Menu Step 3 - Select Boot from eMMC - system on eMMC Step 4 - Confirm that the process will erase data on eMMC Step 5 - Select filesystem type for eMMC Step 6 - Wait for transfer process to complete Step 7 - Final step, install u-boot before poweroff #install u-boot for your system sudo apt install linux-u-boot-rk3318-box-edge cd /usr/lib/linux-u-boot-edge-rk3318-box/ #Write tpl+spl at 64th sector sudo dd if=idbloader.img of=/dev/sdc seek=64 #Write U-Boot proper at 16384 sector sudo dd if=u-boot.itb of=/dev/sdc seek=16384 sync Power off. Remove sd card. Boot from internal emmc successfully!
-
CSC Armbian for RK3318/RK3328 TV box boards
RK3318 board (x88 pro 10) Kernel: 6.6.2-edge-rockchip64 Ubuntu Jammy 22.04.3 LTS Vidoe hardware acceleration working. Clock and leds working using the OpenVFD service See details here if interested:
-
Rockchip Rk3318 X88 pro 10 - in progress
Updated to kernel 6.6.2-edge-rockchip64 Need to recompile openvfd driver, had to modify openvfd_drv.c. Patch attached. patch linux_openvfd/driver/openvfd_drv.c < openvfd_drv.c.patch openvfd_drv.c.patch
-
Rockchip Rk3318 X88 pro 10 - in progress
About OpenVFDService, had to study and understood that led cannot be triggerd without an userspace program with custom made functions. https://github.com/arthur-liberman/linux_openvfd/blob/master/OpenVFDService.c So decided to mod directly the OpenVFDService to include POWER, LAN and WIFI led. My setup is: POWER always on when the box is running LAN on when lan cable connected The OpenVFDService source is attached, and hereunder a short explanation of the mod. // display is controlled by just 7 words 0 -> lan, power, colon, wifi leds on/off 1 -> hour +1 2 -> hour 3 -> minute +1 4 -> minute 5 -> unused = 0 6 -> unused = 0 7 -> unused = 0 memset(wb,0x00, sz); // set all to 0 // byte 0 mapping wb[0] |= 0b01100000; // wifi wb[0] |= 0b00000100; // power wb[0] |= 0b00010000; // colon wb[0] |= 0b00001000; // lan // mod for time and colon wb[0] |= 0b00010000 & (data.colon_on << 4); // colon blink original function wb[1] = char_to_mask(data.time_date.hours/10); // hour+1 wb[2] = char_to_mask(data.time_date.hours%10); // hour wb[3] = char_to_mask(data.time_date.minutes/10); // minutes+1 wb[4] = char_to_mask(data.time_date.minutes%10); // minutes //write to display ret = write(openvfd_fd, wb, sz); LAN connected was pretty straightforward: // check ethernet char buf_eth[1]; int fd = open("/sys/class/net/eth0/carrier", O_RDONLY); if (fd < 0) { perror("Open /sys/class/net/eth0/carrier failed.\n"); return; } else{ // read from fd read(fd, buf_eth, 1); close(fd); } // set display LAN led if ( buf_eth[0]=='1' ){ wb[0] |= 0b00001000; // lan } About Wifi led, my box do not use wifi, so decided to link this function the the IR remote receiver. Led on when a IR signal is received. // create thread for LIRC dev listening in main ret = pthread_create(&lirc_id, NULL, lirc_thread_handler, &setup); //New thread - listen ot lirc device for IR signal void *lirc_thread_handler(void *arg) { lirc_loop(); pthread_exit(NULL); } // IR read loop and set flag void lirc_loop(){ char buf[8]; //printf("Start lirc wait signal:\n"); while(sync_data.isActive) { //printf("DEBUG new thread created!\n"); if ( !gotIRchar ){ // check lirc dev int fd = open("/dev/lirc0", O_RDONLY); if (fd < 0) { perror("Open /dev/lirc0 failed.\n"); return; } // read from fd read(fd, buf, sizeof(buf)); //printf("DEBUG read complete %i\r",sizeof(buf)); close(fd); if (buf[0] > 0){ //printf("Ir receive: %s\n",buf); gotIRchar = true; // set IR received FLAG } } } } // check flag and set display WIFI led if ( gotIRchar ){ wb[0] |= 0b01100000; // wifi gotIRchar = false; } OpenVFDService.c
-
Rockchip Rk3318 X88 pro 10 - in progress
Update, still wokring on OpenVFD, in armbian ubuntu jammy the front display shows only clock. Using test mode I can succesfully see all symbols lit up: OpenVFDService -t I can also manually trigger the 3 symbols with: echo eth > /sys/class/leds/openvfd/led_on echo wifi > /sys/class/leds/openvfd/led_on echo power > /sys/class/leds/openvfd/led_on Neither wifi led is linked to wifi status, nor power, nor lan.
-
Rockchip Rk3318 X88 pro 10 - in progress
Hi everyone, i am impressed by the great knowledge found in this forum. I have been playing for years with a Bealik SEA I tv box with, with great results: a rooted Android system a full Ubuntu distribution 20.04 running in chroot environment kodi v17 android verrsion Recently I bought a X88 pro 10 box (4gb ram and 64gb rom) and started playing with armbian, and I will use this thread to record my progress with this box, still not working at 100% of its capabilities. Using multitool I am able to load and start images on the box, did several install and was able to boot and run: Armbian_23.11.1_Rk3318-box_jammy_current_6.1.63 Armbian_23.11.1_Rk3318-box_bookworm_current_6.1.63_xfce_desktop DietPi_ROCK64-ARMv8-Bullseye_RK3328_RK3318 <- now I'm working on this one > The box has a Mali450 GPU but i cannot run hardware decoding neither on kodi and in Xorg server. When I play an x264 movie on kodi, I see the cpu load increasing up to 100% and the video si dropping frames and shuttering. I have gone through the whole 52 pages of this thread, but seems quite old and all the indications work on debian buster armbian img, which I was unable to find buster img all around. So I stick to my bullseye distribution. Fisrt i had to downgrade kernel to legacy, and just went with apt-get: linux-dtb-legacy-rockchip64/bullseye,now 23.8.1 arm64 [installed] linux-image-legacy-rockchip64/bullseye,now 23.8.1 arm64 [installed] xserver-xorg-legacy/oldstable-security,now 2:1.20.11-1+deb11u8 arm64 [installed] uname -r 4.4.213-legacy-rockchip64 Compiled armbian-media eollowing this github: https://github.com/teacupx/armbian-media and installed: apt-get install libdrm-dev apt-get install libgbm-dev apt-get install libegl-dev Started X11 successfully, but kodi crashes. sudo apt-get install mesa-va-drivers MESA 3D wget https://archive.mesa3d.org/mesa-18.0-0-rc1.tar.gz tar xf mesa-18.0-0-rc1.tar.gz apt-get build-dep mesa