WebRTC lagging problem


I have two boards VIM3L and VIM3-Pro.I installed Ubuntu-gnome-focal_Linux-4.9_arm64_EMMC_V1.0.7-210625 Operating system . I am running webRTC example code on chromium-browser. I download code from https://github.com/heyletscode/webrtc-videocall-javascript. i am using webcam 1080p resolution.


i am getting lagging issue in video when i establish video call between two khadas board(vim3L and vim3-pro). i also observer that load average of board goes to 11.46 ( by typing ‘top’ command). while i run same code between two Desktop computers , i am not getting lagging in video call.

anyone can help me to solve video lagging issue

Hello, I tried to operate your webrtc-videocall-JavaScript but failed. Can you tell me how to use this webrtc- videocall -JavaScript?

yes jack.zho
Thaks for respond

you need dependency ‘nodejs and websocket and chromium browser’ to be installed .for that just run command

for chromium browser
khadas@khadas# sudo apt install chromium-browser

for nodejs
khadas@khadas# sudo apt install nodejs

for npm
khadas@khadas# sudo apt install npm

for websocket
khadas@khadas# npm install websocket

then open another terminal and start run server.js by typing command
khadas@khadas# node server.js

in sender.js and receiver.js file just change ip of computer on which server.js is running
i.e const webSocket = new WebSocket(“ws://”)

then open sender.html in chrome browser . enter username any you want and click on send button. then click on Start call button. in another chrome window open receiver.html file .and enter user name that you entered in sender.html. then click on join call. the video call will be started.

make sure you have webcame with mic plugged to the board.

Thank you,can already run normally.

Hello tushar,
Testing results:

  1. VIM3 as sender, PC as receiver, video call: the real-time performance is good, the CPU utilization rate is relatively high, because there is no hardware video decoding and using software decoding

  2. Video call test between VIM3 and VIM3L: the real-time performance is good, the CPU utilization rate is high, because there is no hardware video decoding and using software decoding

The above results are normal.

hello jack.zhao,

Thank you for reply . yes , you are ,right CPU utilization rate is high.
now the issue is how we can use hardware decoder for webrtc in chromium ?. actually i am new in webrtc. dou you have any idea to use hardware decoder.

thank again jack.zhao

hello tushar,

You can optimize the video stream on the software. Please refer to the following link to demonstrate the video demo:

Hi @jack.zhao

Thanks for this information. Kindly help me to resolve the below queries.

  1. Does “Ubuntu-gnome-focal_Linux-4.9_arm64_EMMC_V1.0.7-210625” supports Hardware decoding for the overall system or Hardware decoding is enabled only for Kodi player?
  2. Does mainline kernel version ubuntu supports Hardware decoding for overall system?
  3. Currently we are evaluating this Khadas platform, We wanted to run our WEBRTC script in a browser smoothly but our goal is to use a hardware decoder instead of a software decoder for better user experience and system performance. You can also suggest any other OS for our use cause and that will help us to conclude this platform capability.

I am asking the above queries because, in a forum, I found that Khadas doesn’t support fully hardware decoder for Ubuntu OS.

Kindly note: This video lagging is only blocker point for us to make the final decision.

Prabhunath Gupt

Hi @GuptaPrabhunath ,
1、Ubuntu-gnome-focal_ Linux-4.9_ arm64_ EMMC_ V1. 0.7-210625 supports video hardware encoding and decoding.

2、Kodi player is not supported on mainline.

3、You can refer to the following links to optimize the video:

1 Like

Hi @jack.zhao

(1) hardware decoder that you mentioned in above <Hardware Decoding | Khadas Documentation > is just library and demo application .by using that library we can develop our application.

(2) but , are there any way to use that hardware decoding for browser like chromium, firefox ?
so by using that we can play you-tube video smooth in browser.

Hi @tushar ,
I haven’t developed a web browser, but I think so: you can first optimize the obtained video stream by referring to our demo, and then upload it to the browser. Your browser code will be processed and optimized. You have to think about how to deal with the specific scheme by yourself.

@GuptaPrabhunath if I may, what is the targetted platform of your webrtc application ?,
webrtc is generally very resource intensive even on faster on x86 devices, from your previous message, you have stated 10% CPU usage as top has reported, I believe this is within the margin of average system usage


We used Manjaro KDE Plasma Os and used Wayland in VIM3-Pro board. WebRTC performance was good. there was very less lagging. Now we Exploring Majnaro OS and feasibility.

are there any manjaro os for khadas VIM3-L board ?

Hi @Electr1

Sorry for the delayed response.

Because the browser is not supported hardware encoder and decoder, We are planning to develop our own native video chat application based on WebRTC, does it feasible to use hardware encoder and decoder APPs in that.

Do you have any suggestions and experience on how we can integrate the Hardware encoder and decoder APIs in our application?

Currently, we are planning to develop QT based application do you have any other suggestions for it.

We are targeting Khadas VIM3L for our use case. We believe this platform is feasible for our use case please confirm.

The reason you had much better performance with WebRTC is due to the GPU hardware acceleration provided on the mainline linux kernel (this isn’t only Manjaro, it includes all mainline kernel linux images)

the other video encoder/decoders are only usable in BSP/4.9 kernel and are also not accessible by the browser

currently your track seems optimal to develop on Manjaro, I wouldn’t defer from it, that’s all :slightly_smiling_face: