I am new to the LVGL library and forum, so please bear with me in case of incomplete details in my question.
Basically, I am trying to stream a video on the display with a raspberry pi 4, but with the current approach/configuration I am able to render only ~5-6 FPS, which adds lagging as time increases.
Here is the setup and implementation:
- I am using RPi 4, 4 GB variant and using Frame buffer for rending on the HDMI display.
- I have created two threads, 1st for receiving the RTSP frame and pushing it into the queue.
- The second thread has the below tasks in the main loop
- It polls the queue, copies the frame, and updates the image source
- calls lv_timer_handler
- sleep for 1 millisecond
Problem and Observations so far:
- lv_timer_handler() takes around 200-400 msec random delay in each iteration after updating the image source. Due to this thread 2 is not able to read at the required FPS.
- Polling, copying, and updating lv_img_set_src is taking around 4 msec (based on the lv_log time difference) in thread 2. After this event lv_timer_handler takes a lot of time to render the new image on the screen.
- I have removed the polling call and tested thread two without updating any image, in that case, lv_timer_handler() is taking 20-25 msec.
- Checked the flush_cb time as well, it is taking 3-4 msec
Firstly, is it an expected delay in lv_timer_handler?
Has anyone faced similar latency in rending, if not please suggest how to reduce the delay.
Has anyone already tried video streaming?
Thanks in advance,