Jump to content

Rockchip Rk3318 X88 pro 10 - in progress


haven

Recommended Posts

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

 

Edited by haven
Link to comment
Share on other sites

Hello, first of all I would suggest you to avoid DietPI; there have been some circumstances were has been reported that credits were not due to the big work done here by armbian maintainers and taken without proper attribution.

This is sad to say, but until I hear the opposite, I woudl stay away and don't endorse such "distribution".

 

More about the hardware decoding and rk3318: legacy kernel is now completely deprecated and not suggested to be used at all. It is old and unmaintained code, plus standard linux tools won't work because it contains vendor-specific modules and paths.

 

You would rather stay stick to a regular armbian image with recent mainline kernel.

You could also advance to edge kernel (at the moment it is 6.6), but it is not necessary.

For the hardware decoding capabilities, I recently made an apt repository for both debian bookworm and ubuntu jammy that may be helpful to you:

 

That repository provides ffmpeg compiled with the right patches to work with hardware decoding, and the player of choice is mpv which is working pretty fine.

Unfortunately there is a bug for Mali 400/450 in mpv (or mesa) that causes the video to be pink-colored when played in X11 or wayland, but when run from virtual terminal is works fine though.

Also rockchip64 does not have yet the patch to enable hevc, something which I would like to fix soon

 

Link to comment
Share on other sites

update  

 

New sd-card with Armbian Jammy 6.1.63-current-rockchip64 image with xfce desktop.

Spoiler

image.thumb.png.faf80098fbb007c20c17981097ccee68.png

 

Removed unused app, installed x11vnc and samba server - ok

 

Working on LEDS: the front LCD display remains black. Downloaded, compiled and installed OpenVfd

Controllers seems a FD628:

# xxd -g4 /proc/device-tree/fd628_dev/fd628_gpio_clk
00000000: 0000007a 00000010 00000000           ...z........
# xxd -g4 /proc/device-tree/fd628_dev/fd628_gpio_dat
00000000: 0000007a 0000000f 00000000           ...z........

In vfd.conf using:
vfd_gpio_clk='2,0x0D,0'
vfd_gpio_dat='2,0x10,0'
vfd_gpio_stb='2,0x0C,0'

vfd_display_type='0x00,0x00,0x00,0x00'

 

vfd_display_type .. don't know what to put here, i tried randomly some combination.

 

Still no result, display always black, no errors in dmesg:

[ 4588.555218] openvfd: loading out-of-tree module taints kernel.
[ 4588.557647] OpenVFD: Version: V1.4.4
[ 4588.557675] OpenVFD: vfd_gpio_clk:           #0 = 0x02; #1 = 0x0D; #2 = 0x00;
[ 4588.557683] OpenVFD: vfd_gpio_dat:           #0 = 0x02; #1 = 0x10; #2 = 0x00;
[ 4588.557690] OpenVFD: vfd_gpio_stb:           #0 = 0x02; #1 = 0x0C; #2 = 0x00;
[ 4588.557699] OpenVFD: vfd_gpio0:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 4588.557708] OpenVFD: vfd_gpio1:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 4588.557717] OpenVFD: vfd_gpio2:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 4588.557725] OpenVFD: vfd_gpio3:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 4588.557733] OpenVFD: vfd_gpio_protocol:      #0 = 0x00; #1 = 0x00;
[ 4588.557745] OpenVFD: vfd_chars:              #0 = 0x00; #1 = 0x01; #2 = 0x02; #3 = 0x03; #4 = 0x04;
[ 4588.557759] OpenVFD: vfd_dot_bits:           #0 = 0x00; #1 = 0x01; #2 = 0x02; #3 = 0x03; #4 = 0x04; #5 = 0x05; #6 = 0x06;
[ 4588.557767] OpenVFD: vfd_display_type:       #0 = 0x00; #1 = 0x00; #2 = 0x00; #3 = 0x00;
[ 4588.557782] OpenVFD: Detected gpio chips:    gpio0, gpio1, gpio2, gpio3, ff100000.syscon:gpio.
[ 4588.557789] OpenVFD: "gpio0" chip found.     base = 0, pin count = 32, pin = 13, offset = 13
[ 4588.557799] OpenVFD: "gpio0" chip found.     base = 0, pin count = 32, pin = 16, offset = 16
[ 4588.557808] OpenVFD: "gpio0" chip found.     base = 0, pin count = 32, pin = 12, offset = 12
[ 4588.557818] OpenVFD: Skipping vfd_gpio0 evaluation (0xFF)
[ 4588.557823] OpenVFD: Skipping vfd_gpio1 evaluation (0xFF)
[ 4588.557829] OpenVFD: Skipping vfd_gpio2 evaluation (0xFF)
[ 4588.557837] OpenVFD: Skipping vfd_gpio3 evaluation (0xFF)
[ 4588.558424] OpenVFD: Select FD628 controller
[ 4588.558488] OpenVFD: SW SPI 3-wire interface intialized (LSB mode)

 

I also don't know if the device has a green/red led for power on, which is not working.

 

I found also the original dts files extracted from Android X88 pro 10, but idk how to read the correct address for the vfd lcd.  

dts_3318.tgz

Edited by haven
Link to comment
Share on other sites

Installed the suggested package, and installation was flawless.

 

Now able to play hw accelerated video with mpv:

mpv --vo=gpu --hwdec=drm --gpu-context=x11egl --gpu-hwdec-interop=drmprime <your-video.mp4>

 

but confirm the bug described here:
Lima driver (Mali 400/450) shows a red/pink tint when video is played in X11/Wayland (see https://github.com/mpv-player/mpv/issues/12968) 

 

Using drm gives error

# Hardware decoded video running on bare terminal, presentation via EGL
mpv --vo=gpu --hwdec=drm --gpu-context=drm --gpu-hwdec-interop=drmprime  <your-video.mp4>

 

Able to play video with option:

--drm-atomic=no 

but too many frames dropped and video scattering

Link to comment
Share on other sites

There is a suggestion on how to modify /etc/mpv/mpv.conf in a proper way to use autodetection features by mpv that does not require you to specify everything on the command line.

In my experience, mpv 0.35.1 does a pretty good job in guessing what is the right combination if you don't force it. It always worked fine for me in X11, Wayland and virtual terminal

Link to comment
Share on other sites

8 hours ago, jock said:

There is a suggestion on how to modify /etc/mpv/mpv.conf in a proper way

FWIW
I'm keep puzzled about the options you still throw at mpv. In my Wayland environment, I only have "hwdec=auto" and "hwdec-codecs=all" to automatically enforce video hardware decoding (v4l2 via drm KMS) and take into account all possible hardware decoders. This is necessary because otherwise SW decoding is preferred by default.
I also don't understand why you insist on involving the GPU, it doesn't have any business in a video pipeline, as I just demonstrated here. The GPU is only used by the GUI and is therefore secondary. Video playback works perfectly even when no GPU driver is loaded at all.

Link to comment
Share on other sites

@usual user

 

I'm not quite sure I understand what you mean, because the only enforced flag is hwdec=drm in mpv.conf.

There are other two flags to tell mpv which plane to use for drawing and which one for video when it is run in virtual terminal (drmprime-overlay interop).

 

I'm not enforcing vo=gpu, mpv is selecting it by itself. I guess that is the only way to render frames without actively copying buffers around is to render to an EGLImage object and let the gpu do the presentation.

Link to comment
Share on other sites

Hello!

 

Question to the OP:

Is this: https://www.amazon.de/Android-Quad-Core-Cortex-A53-Enternet-Bluetooth/dp/B0BYCK85LB the type of settopbox you're using?

If so, where did you get the image you're using?

 

I'm using an Odroid C2 for my mediaserver, but with passive cooling it runs damnably hot and with active cooling it's not fit to run in my living room.

Before the C2, I had an Mecool M8S Pro W, for several years, but the S905W chipset is no longer supported and I need a series 6 kernel to run it, so I was looking what the Settop boxes offer these days and found your thread.

It reads as if the basic functionality was reached almost out of the box, what is what I am looking for.

 

Link to comment
Share on other sites

yes the box is the one linked above.

 

Now doing some test with legacy kernel on ubuntu jammy.
Used armbian-config to switch to legacy kernel:
4.4.213-legacy-rockchip64

 

Then following instructions on:
https://launchpad.net/~liujianfeng1994/+archive/ubuntu/rockchip-multimedia

 

sudo add-apt-repository ppa:liujianfeng1994/rockchip-multimedia
sudo apt update
sudo apt dist-upgrade
sudo apt install rockchip-multimedia-config

 

then installed kodi from repository, seems using HW codec RKMPP but the result is bad, many frames dropped and color drift to blue.
Will do some more tests.

 

Link to comment
Share on other sites

Good results with legacy kernel on Jammy!

 

Temporarly abandoned the mpv configuration and started working on gstreamer.

 

Now able to play and decode succesfully a 1080p video using gstreamer and hw decoder, using the following command:

//install missing gst plugin
apt-get install gstreamer1.0-plugins-bad

//play mkv h264 file
gst-launch-1.0 filesrc location=test_video.mkv ! matroskademux name=demux  demux.audio_0 ! decodebin \
! queue ! audioconvert ! pulsesink device=0 demux.video_0 ! queue ! parsebin ! mppvideodec width=1920 height=1000 ! rkximagesink

 

Note: do not install and update packages from this repository, otherwise the X11 server will not start anymore, due to a probably buggy mesa or mali driver.

sudo add-apt-repository ppa:liujianfeng1994/panfork-mesa

This would overwirte the libraries hereunder:
Setting up libgbm1:arm64 (23.0.4-0ubuntu1~22.04.1) ...
Setting up libglapi-mesa:arm64 (23.0.4-0ubuntu1~22.04.1) ...
Setting up libllvm15:arm64 (1:15.0.7-0ubuntu0.22.04.3) ...
Setting up libgl1-mesa-dri:arm64 (23.0.4-0ubuntu1~22.04.1) ...
Setting up libegl-mesa0:arm64 (23.0.4-0ubuntu1~22.04.1) ...
Setting up libglx-mesa0:arm64 (23.0.4-0ubuntu1~22.04.1) ...

 

Edited by haven
Link to comment
Share on other sites

of course you are right, as stated above I installed your repository for v4l2request hardware video decoding but I got stuck with the lima bug, and the pinkish videos do not satisfy me enough :D

 

So after having hw decode in gstreamer, still kodi not using HW codec.
The option to use DRM in settings/player is missing,so decided to rebuild kodi on my own, from repository:

https://launchpad.net/~liujianfeng1994/+archive/ubuntu/rockchip-multimedia/+packages

Edited by haven
Link to comment
Share on other sites

It would be nice to have some instructions for a gstreamer pipeline that works on v4l2request and mainline kernel also. Most probably the pink color problem is an issue from Mesa, but requires some more deep knowledge to pinpoint the problem; having alternatives to mpv (gstreamer, Kodi) to compare is indeed useful to grasp the problem.

Link to comment
Share on other sites

So after having hw decode in gstreamer, still kodi not using HW codec.
The option to use DRM in settings/player is missing,so decided to rebuild kodi on my own, from repository :

https://launchpad.net/~liujianfeng1994/+archive/ubuntu/rockchip-multimedia/+packages

 

Install the Debian SDK

sudo apt install devscripts build-essential

 

Go to page https://launchpad.net/~liujianfeng1994/+archive/ubuntu/rockchip-multimedia/+packages,

From this page, copy the url to the the changes file from the top link marked (changes file). 
https://launchpadlibrarian.net/682100344/kodi_20.2+dfsg-4+gles_source.changes

 

From a temporary working directory, run:

dget --extract --allow-unauthenticated https://launchpad.net/~liujianfeng1994/+archive/ubuntu/rockchip-multimedia/+files/kodi_20.2+dfsg-4+gles_source.changes

 

This command will download sources and create the source tree hereunder:

kodi-20.2+dfsg
├── addons
├── cmake
├── debian
├── docs
├── lib
├── libdvdnav-embedded
├── libdvdread-embedded
├── LICENSES
├── media
├── obj-aarch64-linux-gnu
├── project
├── repo-resources-embedded
├── system
├── tools
├── userdata
└── xbmc

 

Install the Package build-dependencies and Build the Package

cd kodi*
sudo mk-build-deps --install --remove

 

As long as this completed with no errors, the package is ready to build. 

dpkg-buildpackage --build=binary --no-sign


Be prepeared.. this will create a 8.5 GB folder with all kodi packages, if you are able to go to the end of Make process!
In my case, it produced the .deb packages hereunder:

kodi_20.2+dfsg-4+gles_arm64.deb
kodi-addons-dev_20.2+dfsg-4+gles_arm64.deb
kodi-addons-dev-common_20.2+dfsg-4+gles_all.deb
kodi-bin_20.2+dfsg-4+gles_arm64.deb
kodi-data_20.2+dfsg-4+gles_all.deb
kodi-eventclients-common_20.2+dfsg-4+gles_all.deb
kodi-eventclients-dev_20.2+dfsg-4+gles_arm64.deb
kodi-eventclients-dev-common_20.2+dfsg-4+gles_all.deb
kodi-eventclients-kodi-send_20.2+dfsg-4+gles_arm64.deb
kodi-eventclients-ps3_20.2+dfsg-4+gles_arm64.deb
kodi-eventclients-python_20.2+dfsg-4+gles_arm64.deb
kodi-eventclients-wiiremote_20.2+dfsg-4+gles_arm64.deb
kodi-eventclients-zeroconf_20.2+dfsg-4+gles_arm64.deb
kodi-repository-kodi_20.2+dfsg-4+gles_all.deb
kodi-tools-texturepacker_20.2+dfsg-4+gles_arm64.deb

------------------------------------------------------------


Just install created packages with dpkg -i.

Kodi starting proprely, but DRM Prime decoder option missing.

 

Studing in this problem, I suppose that kodi should run on GDM/Wayland, instead my configuration works on X11/Xfce.

 

PROBLEM

Now trying to setup wayland, i have the login screen with gdm3, but after successfull authentication nothing happens -> the systems come back to login screen.

Wayland running:

/usr/bin/Xwayland :1024 -rootless -noreset -accessx -core -auth /run/user/119/.mutter-Xwaylandauth.ZVKFG2 -listen 4 -listen 5 -displayfd 6 -initfd 7

 

See some errors here, to be investigated:

sudo service gdm3 status

● gdm.service - GNOME Display Manager
     Loaded: loaded (/lib/systemd/system/gdm.service; static)
     Active: active (running) since Fri 2023-12-22 14:00:13 CET; 9min ago
    Process: 3364 ExecStartPre=/usr/share/gdm/generate-config (code=exited, status=0/SUCCESS)
   Main PID: 3371 (gdm3)
      Tasks: 3 (limit: 4662)
     Memory: 2.5M
     CGroup: /system.slice/gdm.service
             └─3371 /usr/sbin/gdm3

Dec 22 14:00:13 rk3318-box systemd[1]: Starting GNOME Display Manager...
Dec 22 14:00:13 rk3318-box systemd[1]: Started GNOME Display Manager.
Dec 22 14:00:13 rk3318-box gdm-autologin][3375]: gkr-pam: no password is available for user
Dec 22 14:00:13 rk3318-box gdm-autologin][3375]: pam_unix(gdm-autologin:session): session opened for user ror(uid=1000)>
Dec 22 14:00:14 rk3318-box gdm-autologin][3375]: gkr-pam: gnome-keyring-daemon started properly
Dec 22 14:00:16 rk3318-box gdm3[3371]: Gdm: GdmDisplay: Session never registered, failing
Dec 22 14:00:16 rk3318-box gdm-autologin][3482]: gkr-pam: no password is available for user
Dec 22 14:00:16 rk3318-box gdm-autologin][3482]: pam_unix(gdm-autologin:session): session opened for user ror(uid=1000)>
Dec 22 14:00:16 rk3318-box gdm-autologin][3482]: gkr-pam: gnome-keyring-daemon started properly

 

Edited by haven
Link to comment
Share on other sites

So after more the one week working on legacy kernel, I decided to switch to mainline kernel (now using 6.6.2-edge-rockchip64).

Removed the liujianfeng1994 repository and installed packeges of the v4l2request repository.

 

Regarding this bug:

bug: Lima driver (Mali 400/450) shows a red/pink tint when video is played in X11/Wayland (see https://github.com/mpv-player/mpv/issues/12968)

 

I found that forcing MESA to a different GL core profile can solve the pinkish problem:

export MESA_GL_VERSION_OVERRIDE=3.2COMPAT
export MESA_GLSL_VERSION_OVERRIDE=320

mpv your-video.mkv

 

Now I have HW accelerated video with mpv :).

Still have tu study how to get Kodi acceleration working.

Edited by haven
Link to comment
Share on other sites

No way to have kodi acceleration working yet.

 

In the meanwhile I have been studying the front LCD, which was black [SOLVED]

 

1. Install OpenVFD

 

#install kernel headers (skip if already installed)
sudo apt-get install linux-headers-`uname -r`

# download the sources:
git clone https://github.com/arthur-liberman/linux_openvfd

# change the directory
cd linux_openvfd/driver

# edit the Makefile
# change the line
        KERNELDIR = ../../../
# to this:
        KERNELDIR = /lib/modules/$(shell uname -r)/build

# create a symlink to correct System.map in this KERNELDIR - in my case:
# /lib/modules/6.1.7-rockchip64/build/System.map -> /boot/System.map-6.1.7-rockchip64

# compile the driver (in openvfd/driver):
make -j4

# install module
sudo make modules_install

# load module
modprobe openvfd

 

2. Install OpenVFDService

cd linux_openvfd
make -j4 OpenVFDService
sudo cp OpenVFDService /usr/sbin/

 

3. Update dts using armbian-config 

add at the end:

       openvfd {
                compatible = "open,vfd";
                dev_name = "openvfd";
                status = "okay";
        };

reboot and you will find new device-tree in /proc/device-tree/open-vfd

 

4. Create openvfd.service in /lib/systemd/system/openvfd.service 

 or download attached file

 

[Unit]
Description=OpenVFD Service
ConditionPathExists=/proc/device-tree/openvfd/

[Service]
ExecStart=/bin/sh -c '[ `cat /proc/device-tree/openvfd/compatible` = "open,vfd" ] && /sbin/modprobe openvfd; /usr/sbin/OpenVFDService'
ExecStop=/bin/kill -TERM $MAINPID
ExecStopPost=-/usr/sbin/rmmod openvfd
RemainAfterExit=yes

[Install]
WantedBy=basic.target

 

create VFD config in /etc/modprobe.d/openvfd.conf

options openvfd vfd_gpio_clk="4,0x13,0"
options openvfd vfd_gpio_dat="4,0x16,0"
options openvfd vfd_gpio_stb="4,0x12,0"
options openvfd vfd_chars="4,0,1,2,3"
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="0x03,0x00,0x00,0x00"

 

enable service and start (this will autoload the kernel module openvfd

sudo systemctl enable openvfd
sudo systemctl start openvfd

 

After this the system clock will successfully show up on the front LCD :)

 

openvfd.service

Edited by haven
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Edited by haven
Link to comment
Share on other sites

It would be nice to have a proper kernel driver for such device. As far as I remember, it uses a i2c-like bus with some minor differences; I looked into some time ago, but had to give up due to not enough time, but a proper driver would wire the led chip hardware with the kernel led framework to exploit all the kernel triggers and goodies.

Link to comment
Share on other sites

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

image.png.283a284be57eb678d8156b77060fd224.png

 

Step 2 - Select Install Menu

image.png.4f63266de8194a7a9649dee2a241e79e.png

 

Step 3 - Select Boot from eMMC - system on eMMC

image.png.b51647e84e8d5567a7eff14ffc19ce61.png

 

Step 4 - Confirm that the process will erase data on eMMC

image.png.fdaaa894c5681ddc4dd4985e679c268c.png

 

Step 5 - Select filesystem type for eMMC

image.png.0ec7a7056e643b5d472e497b8fc49da9.png

 

Step 6 - Wait for transfer process to complete

image.png.cfec2e7a13b02036eef013b10751c028.png

 

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!

 

 

 

 

Edited by haven
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Hi @haven and everyone 

 

I've made a new kernel driver for fd628 and fs6551-like LED controllers.  I wanted it to manage the hardware on the kernel space while having an easy sysfs user space interface. It also aims to reduce the code to maintain by relaying on existing kernel features instead of recoding them.

 

It comes with a service written as a simple bash script. So it's easily customizable without having to write custom C code.

 

Could you please give it a try and report your feedback? 

 

If my understanding is correct, the X88 pro 10 uses a fd628 controller. Then DTB should be configured to use spi-gpio as well as the led-controller compatible = "titan,tm1628".

 

https://github.com/jefflessard/tm16xx-display/tree/main

 

Thank you 

Link to comment
Share on other sites

Hi, my attempt to compile using the Haven openwfd driver method leads to errors. Why is this happening?

 

make[1]: Entering directory '/usr/src/linux-headers-6.11.0-edge-rockchip64'

  CC [M]  /root/linux_openvfd/driver/openvfd_drv.o

/root/linux_openvfd/driver/openvfd_drv.c:44:7: warning: "CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND" is not defined, evaluates to 0 [-Wundef]

   44 | #elif CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND

      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/root/linux_openvfd/driver/openvfd_drv.c: In function ‘register_openvfd_driver’:

/root/linux_openvfd/driver/openvfd_drv.c:400:75: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]

  400 |                 pr_dbg("%s: Succeeded to add openvfd module \n", __func__);

      |                                                                           ^

/root/linux_openvfd/driver/openvfd_drv.c: At top level:

/root/linux_openvfd/driver/openvfd_drv.c:622:19: warning: no previous prototype for ‘gpiochip_find’ [-Wmissing-prototypes]

  622 | struct gpio_chip *gpiochip_find(void *data,

      |                   ^~~~~~~~~~~~~

/root/linux_openvfd/driver/openvfd_drv.c: In function ‘gpiochip_find’:

/root/linux_openvfd/driver/openvfd_drv.c:629:35: error: passing argument 2 of ‘gpio_device_find’ from incompatible pointer type [-Werror=incompatible-pointer-types]

  629 |     gdev = gpio_device_find(data, match);

      |                                   ^~~~~

      |                                   |

      |                                   int (*)(struct gpio_chip *, void *)

In file included from ./include/linux/of_gpio.h:14,

                 from /root/linux_openvfd/driver/openvfd_drv.c:36:

./include/linux/gpio/driver.h:641:39: note: expected ‘int (*)(struct gpio_chip *, const void *)’ but argument is of type ‘int (*)(struct gpio_chip *, void *)’

  641 |                                 int (*match)(struct gpio_chip *gc,

      |                                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

  642 |                                             const void *data));

      |                                              ~~~~~~~~~~~~~~~~~

/root/linux_openvfd/driver/openvfd_drv.c: At top level:

/root/linux_openvfd/driver/openvfd_drv.c:669:5: warning: no previous prototype for ‘evaluate_pin’ [-Wmissing-prototypes]

  669 | int evaluate_pin(const char *name, const unsigned int *vfd_arg, struct vfd_pin *pin, unsigned char enable_skip_evaluation)

      |     ^~~~~~~~~~~~

/root/linux_openvfd/driver/openvfd_drv.c:752:6: warning: no previous prototype for ‘get_pin_from_dt’ [-Wmissing-prototypes]

  752 | void get_pin_from_dt(const char *name, const struct platform_device *pdev, struct vfd_pin *pin)

      |      ^~~~~~~~~~~~~~~

/root/linux_openvfd/driver/openvfd_drv.c:763:5: warning: no previous prototype for ‘request_pin’ [-Wmissing-prototypes]

  763 | int request_pin(const char *name, struct vfd_pin *pin, unsigned char enable_skip)

      |     ^~~~~~~~~~~

/root/linux_openvfd/driver/openvfd_drv.c:1034:19: error: initialization of ‘void (*)(struct platform_device *)’ from incompatible pointer type ‘int (*)(struct platform_device *)’ [-Werror=incompatible-pointer-types]

1034 |         .remove = openvfd_driver_remove,

      |                   ^~~~~~~~~~~~~~~~~~~~~

/root/linux_openvfd/driver/openvfd_drv.c:1034:19: note: (near initialization for ‘openvfd_driver.<anonymous>.remove’)

cc1: some warnings being treated as errors

make[3]: *** [scripts/Makefile.build:244: /root/linux_openvfd/driver/openvfd_drv.o] Error 1

make[2]: *** [/usr/src/linux-headers-6.11.0-edge-rockchip64/Makefile:1926: /root/linux_openvfd/driver] Error 2

make[1]: *** [Makefile:224: __sub-make] Error 2

make[1]: Leaving directory '/usr/src/linux-headers-6.11.0-edge-rockchip64'

make: *** [Makefile:5: modules] Error 2

Link to comment
Share on other sites

@Vidhome drop the openvfd driver, recent armbian kernel have the tm16xx driver from @Jean-Francois Lessard already compiled in for rockchip64.

You have to enable the beta repository, upgrade and everything should be already set up for X88 Pro 10: https://forum.armbian.com/topic/26978-csc-armbian-for-rk3318rk3328-tv-box-boards/?do=findComment&comment=203491

Don't forget to take a backup of your installation before enabling beta repository.

 

Otherwise, you could compile the tm16xx driver it by yourself: https://forum.armbian.com/topic/43667-help-wanted-to-test-a-new-openvfd-alternative/?do=findComment&comment=202875

 

Link to comment
Share on other sites

1 hour ago, Vidhome said:

Thanks Jock! Do I have an H96Max RK3318 set-top box, will this firmware work?

Well, the X88 Pro board is supported, so you may just want to try it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines