Jump to content


Photo

aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k

VU+ solo duo aio-grab

  • Please log in to reply
23 replies to this topic

#1 Dean

  • Member
  • 11 posts

0
Neutral

Posted 7 June 2016 - 21:00

I don't have Vu+ receiver yet but I am considering several VU+ models and I need fast frame grabbing (at least 10fps, not counting saving the file to disk) to achieve some functionality I need. So I would appreciate if I could get answer to some of these questions:
 
1) Are SE/SE2 receivers even supported? Grepping the source code for 7429 gives me no results.
 
2) How reliable is frame grabbing for VU+ Solo, Solo2, Duo2, etc and what is the frame rate (not counting time it takes to save the file to disk)? Looking at the code pointer is set to predetermined memory position and it is read directly from there. What implications does this have for reliability of the frame grabbing? Do you often  get partial frames, or two frames mixed into one?
 
2) If you have Vu+ Solo 4k what is your experience? Unlike for most other VU+ receivers for this one video is captured by reading from "/dev/dvb/adapter0/video0".
 
Here is the relevant code:
 
 
What implications does this have for speed and reliability of the frame grabbing?
 
Also unfortunately resolution is always set to 1920x1080, and this hasn't changed to this day. Is there at least a way to detect SD capture? For example are pixels outside of the SD resolution crop always black?
 
Thanks in advance


Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #2 Dean

  • Member
  • 11 posts

0
Neutral

Posted 9 June 2016 - 00:54

I would appreciate if I could get answer to any of these questions. Since likely very few people have experience with all these receivers please answer any question you know the answer to, even if it is just one. The same question applies to enigmalight plugin as well, because it is using aio-grab code for capturing current frame.


Edited by Dean, 9 June 2016 - 00:56.


Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #3 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 9 June 2016 - 06:45

Hi, I have vusolosev2

 

1.) Yes, grab utility works

2.) I just did a few tests and there looks to be no problems.

 

Here are some tests, maybe you have better idea how to test it:

 

100.sh

#!/bin/bash
for i in `seq 1 100` ; do $@ ; done

grabbing SD video only, 100 times as fast as possible:

root@vusolose:~# time ./100.sh grab -v -q
real    0m 11.00s
user    0m 8.00s
sys     0m 1.54s

grabbing HD video only, 100 times as fast as possible:

root@vusolose:~# time ./100.sh grab -v -q
real    0m 32.65s
user    0m 37.49s
sys     0m 5.70s

If you grab only video, resolution of resulting picture is same as video's, so SD video -> SD picture.


Edited by mx3L, 9 June 2016 - 06:45.


Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #4 Erik Slagter

  • PLi® Core member
  • 46,969 posts

+542
Excellent

Posted 9 June 2016 - 16:47

The frame grabbing is implemented by a very crude "peeking from memory" method that has been completely reverse-engineered. No official, open, documentation exists on this subject. So, yes, it seems to work, but zero guarantees. For one you will have tearing because there is no synchronisation with the vsync at all. And afaik none of the SoC's are fast enough to read the frame buffer in real time. Maybe the VU+ Solo4k's ARM processor, but rather not count on it.


* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #5 Dean

  • Member
  • 11 posts

0
Neutral

Posted 11 June 2016 - 16:56

Thanks to both!
 
I am not worried about tearing but only 3 fps for HD channel is a bit slow for what I wanted to do. Writing the file to disk is likely the bottleneck but hard to tell how much faster it would be without it.
 
Can someone with 4k please perform the same test? Would really appreciate it.

Edited by Dean, 11 June 2016 - 16:58.


Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #6 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 11 June 2016 - 17:09

UHD
 
root@vusolo4k:/var/volatile/tmp# time ./100.sh grab -v -q
real    0m 11.81s
user    0m 1.53s
sys     0m 6.25s
FHD

root@vusolo4k:/var/volatile/tmp# time ./100.sh grab -v -q
real 0m 11.00s
user 0m 0.76s
sys 0m 6.79s

Edited by athoik, 11 June 2016 - 17:09.

Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #7 Dean

  • Member
  • 11 posts

0
Neutral

Posted 11 June 2016 - 17:27

Wow that was fast! :) Thanks a lot. 4k is significantly faster there.

 

To eliminate writing to disk part from the benchmark do you guys mind deleting lines 638 to 768 in grab's main file and then recompiling it? Or alternatively just download the code from this post.

 

Attached Files



Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #8 MiLo

  • PLi® Core member
  • 14,055 posts

+298
Excellent

Posted 11 June 2016 - 18:24

It writes to RAM anyway... It can also write to stdout by the way, so you can use the resulting image directly.

I built a grab library for the amBX plugin a few years ago, based on aio-grab code, which was intended to be called from a plugin or so, and it's much faster because it doesn't need to allocate/deallocate resources on each call. Should still be on sourgeforge.
Real musicians never die - they just decompose

Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #9 Pr2

  • PLi® Contributor
  • 6,182 posts

+261
Excellent

Posted 11 June 2016 - 18:29

athoik can you please check the resolution of the grabbed UHD image?  Because when I grab here I only have a 1920x1080 image and not a real UHD grab.


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #10 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 11 June 2016 - 19:49

I guess it will always be 1920x1080 when grabbing video.
 
	if (stb_type == BRCM7366ARM)
	{
		int fd_video = open("/dev/dvb/adapter0/video0", O_RDONLY);
		if (fd_video < 0)
		{
			fprintf(stderr, "could not open /dev/dvb/adapter0/video0");
			return;
		}

		ssize_t r = read(fd_video, video, 1920 * 1080 * 3);
		close(fd_video);
		*xres = 1920;
		*yres = 1080;
		return;
}
Although grabbing from videoX device seems better way to me.

Attached Files


Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #11 Dean

  • Member
  • 11 posts

0
Neutral

Posted 11 June 2016 - 20:49

It writes to RAM anyway... It can also write to stdout by the way, so you can use the resulting image directly.

I built a grab library for the amBX plugin a few years ago, based on aio-grab code, which was intended to be called from a plugin or so, and it's much faster because it doesn't need to allocate/deallocate resources on each call. Should still be on sourgeforge.

 

You're right. And my goal is to write a plugin as well. Do you recall aprox. how many frames you could grab per second? And on what hardware.


Edited by Dean, 11 June 2016 - 20:49.


Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #12 Dean

  • Member
  • 11 posts

0
Neutral

Posted 11 June 2016 - 20:50

I guess it will always be 1920x1080 when grabbing video.
 

	if (stb_type == BRCM7366ARM)
	{
		int fd_video = open("/dev/dvb/adapter0/video0", O_RDONLY);
		if (fd_video < 0)
		{
			fprintf(stderr, "could not open /dev/dvb/adapter0/video0");
			return;
		}

		ssize_t r = read(fd_video, video, 1920 * 1080 * 3);
		close(fd_video);
		*xres = 1920;
		*yres = 1080;
		return;
}
Although grabbing from videoX device seems better way to me.

 

 

Yeah resolution is hardcoded for Solo 4k unlike for some other receivers.



Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #13 Dean

  • Member
  • 11 posts

0
Neutral

Posted 11 June 2016 - 21:10

I am really interested if 4k is  grabbing framebuffers faster or perhaps athoik just has a faster hard drive. It seems that accessing the video buffer directly has a potential of being faster despite overall hardware being slower.

 

Also does anyone know if it would be be possible to grab only part of the frame with Solo 4k? With other VU+ receivers that is easy since you have a pointer. On 4k one would need to use lseek/fseek, assuming stream supports that.

 

My end goal is to write a plugin that removes static parts of the video to avoid image retention/burn-in on OLED and plasma TVs. I need it for my personal use but I'll of course also share it with everyone else.


Edited by Dean, 11 June 2016 - 21:15.


Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #14 Dean

  • Member
  • 11 posts

0
Neutral

Posted 11 June 2016 - 21:52

It writes to RAM anyway... It can also write to stdout by the way, so you can use the resulting image directly.

I built a grab library for the amBX plugin a few years ago, based on aio-grab code, which was intended to be called from a plugin or so, and it's much faster because it doesn't need to allocate/deallocate resources on each call. Should still be on sourgeforge.

 

By the way allocation and deallocation shouldn't be that much of a bottle neck, malloc is probably reusing the same buffer. Writing to HDD should be a big bottle neck though, HDD and even SSD are many times slower than RAM. athoik do you have SSD by any chance?



Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #15 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 11 June 2016 - 22:00

It writes screenshot to /tmp (ram). So much faster than SSD.
Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #16 malakudi

  • Senior Member
  • 1,449 posts

+69
Good

Posted 11 June 2016 - 22:09

VU+ Solo2, HD and SD

 

root@vusolo2:~# date ; for i in {1..100} ; do grab -v -q -s >/dev/null ; done ; date
Sun Jun 12 00:06:03 EEST 2016
Sun Jun 12 00:06:42 EEST 2016
root@vusolo2:~# date ; for i in {1..100} ; do grab -v -q -s >/dev/null ; done ; date
Sun Jun 12 00:08:35 EEST 2016
Sun Jun 12 00:08:46 EEST 2016
 
39 seconds for HD, 11 for SD


Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #17 WanWizard

  • PLi® Core member
  • 70,546 posts

+1,813
Excellent

Posted 11 June 2016 - 22:17

That doesn't really work here:

root@et10000:~# date ; for i in {1..100} ; do grab -v -q -s >/dev/null ; done ; date
Sat Jun 11 22:15:30 IST 2016
Sat Jun 11 22:15:30 IST 2016
root@et10000:~# date ; for i in {1..100} ; do grab -v -q -s >/dev/null ; done ; date
Sat Jun 11 22:16:17 IST 2016
Sat Jun 11 22:16:17 IST 2016

either that, or it's lightning fast (first SD, second HD)


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #18 Dean

  • Member
  • 11 posts

0
Neutral

Posted 11 June 2016 - 22:34

It writes screenshot to /tmp (ram). So much faster than SSD.

 

Is /tmp using ram by default?



Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #19 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 12 June 2016 - 00:25

Yes, it's by default a tmpfs filesystem.
Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: aio-grab code frame rate and reliability for VU+ Solo2/Duo2/SE/SE2/4k #20 malakudi

  • Senior Member
  • 1,449 posts

+69
Good

Posted 12 June 2016 - 13:03

@WanWizard: You need to have bash installed as default shell (which I have). With busybox sh use:

 

date ; for i in `seq 1 100` ; do grab -v -q -s > /dev/null  ; done ; date

 

edit:

 

Edision OS Mini

49 seconds for HD

14 seconds for SD


Edited by malakudi, 12 June 2016 - 13:07.




Also tagged with one or more of these keywords: VU+, solo, duo, aio-grab

3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users