njk1961
Posts: 20
Joined: Mon Jun 15, 2015 5:05 am

pngview

Mon Jun 15, 2015 5:16 am

Hi all,

I am trying to use pngview, an excelent tool to view png files. Unfortunately, I cant use more than 2 layers at the same time. Is there a way to use more than 2 layers? The images are 1920x1080 with transparent background

Thanks in advance
N

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: pngview

Mon Jun 15, 2015 8:38 pm

Do you mean this pngview? If so I will have a look. One note, make sure you give different layer numbers for each image using the -l (that is a lower case L) command line option.

njk1961
Posts: 20
Joined: Mon Jun 15, 2015 5:05 am

Re: pngview

Tue Jun 16, 2015 1:51 am

AndyD wrote:Do you mean this pngview? If so I will have a look. One note, make sure you give different layer numbers for each image using the -l (that is a lower case L) command line option.
AndyD, I downloaded pngview from your excellent library. I don't know what is the problem, I was just beginning to look at your code. And yes, I used different layer numbers. It always works for the first 2 images, when I insert a third image, the screen goes blank as if there were no signal. Killing the "third layer" returns the "old 2 layers".

Thanks in advance for your help
N

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: pngview

Tue Jun 16, 2015 4:55 am

OK, I will try to reproduce it.

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: pngview

Wed Jun 17, 2015 2:22 pm

I have had time to look at it. Unfortunately, I believe that this is a limitation of using the DispmanX interface. A solution would be to modify pngview so that it could display more than one image. I am not going to promise anything as I am pretty busy at the moment.

njk1961
Posts: 20
Joined: Mon Jun 15, 2015 5:05 am

Re: pngview

Sun Jun 28, 2015 5:33 am

AndyD wrote:I have had time to look at it. Unfortunately, I believe that this is a limitation of using the DispmanX interface. A solution would be to modify pngview so that it could display more than one image. I am not going to promise anything as I am pretty busy at the moment.
Hi AndyD,

Did you have any success?
I did some more testing, and it seems that the problem is associated with memory allocation. For example, I can put more layers if the images have a lower resolution. I managed to put several smaller layers over a video being shown by omxplayer. I think the maximum dispmanx accepts is 2 layers in FullHD (1920x1080). Do you have any hint where I should look in the code?

Once again, thanks for your help
N

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: pngview

Mon Jun 29, 2015 2:56 am

njk1961 wrote:Did you have any success?
Hi, no I haven't had any time to look at this or any other Raspberry Pi related things. Very busy as the moment, may have some time next week.

tvjon
Posts: 710
Joined: Mon Jan 07, 2013 9:11 am

Re: pngview

Tue Jun 30, 2015 2:35 pm

Hello Andy, njk1961.

I doubled gpu_mem to 256, which allowed me to display 3 png's for a few seconds, then the display lost sync'.

I could just make out the content of the first png under the mass of horizontal lines.

Actually Andy, even with just 2 png's, there's a hint of sync' loss, with minor tearing of the bottom half of the first png, every now & then.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23708
Joined: Sat Jul 30, 2011 7:41 pm

Re: pngview

Tue Jun 30, 2015 4:17 pm

Sounds like you are hitting a limitation in the HVS hardware or perhaps hitting the memory bandwidth. Are the images actually 1080p or are you scaling down from another size?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

tvjon
Posts: 710
Joined: Mon Jan 07, 2013 9:11 am

Re: pngview

Tue Jun 30, 2015 6:08 pm

jamesh wrote:Are the images actually 1080p or are you scaling down from another size?
No, they were 2 medium size & 1 very small.
Since reading your post I've tried 1080p png's, but it will actually only manage one! Opening a second 1080p png causes the "sync' loss".

I was going to take a dispmanx snapshot to show the result then realised that would fail, obviously. So, took a shot via an external camera.
Quality is clearly poor owing to 64k forum limit, but you get the idea I think.

2png@1080p.jpg
[email protected] (63.31 KiB) Viewed 2704 times

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: pngview

Wed Jul 01, 2015 9:12 pm

I will have a look. Probably next week.

njk1961
Posts: 20
Joined: Mon Jun 15, 2015 5:05 am

Re: pngview

Fri Jul 03, 2015 5:25 am

Hi all,

I am using gpu_mem=256, too. Tvjon, I cant reproduce your sync' loss, it never happened to me.

When I tried the extra level, my screen just went blank, but no sync loss. All images are 1920x1080 here

N

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: pngview

Fri Jul 03, 2015 12:27 pm

The HVS has a limit of being about to composite about three 1080p images that involve vertical resizing.
This is because images are fetched from sdram, format converted, resized and alpha blended in real time.
Any vertical resize requires a number of lines of context - too many and we exceed the LBM memory (48K).

If you add "dispmanx_offline=1" to config.txt the resizing will use an offscreen buffer and can handle more complicated displays.

However for a png (which I assume is unchanging), the best solution is to resize and composite it before displaying with dispmanx.

njk1961
Posts: 20
Joined: Mon Jun 15, 2015 5:05 am

Re: pngview

Fri Jul 03, 2015 12:57 pm

Thanks for all replies

Dom, I forgot to say that I already set dispmanx_offline to 1, and it didnt work. Same restrictions...

The .png files have the same background image resolution, so it would be possible to "position" the overlayed information over the right place without many calculations. Besides this, my next step is to try to move this png picture around over the background image or even video, so I couldnt composite before displaying.

Do you have any suggestion to achieve this?

I am a newbie with Raspberry Architecture or its GPU. Still trying to understand the underlying code.

Thanks again,
N

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: pngview

Fri Jul 03, 2015 2:43 pm

Can you describe the formats/sizes (src and dest rects) of the dispmanx layers you need?
Do all the layers overlap? Are any of the layers static?

tvjon
Posts: 710
Joined: Mon Jan 07, 2013 9:11 am

Re: pngview

Fri Jul 03, 2015 6:05 pm

njk1961 wrote:...
Dom, I forgot to say that I already set dispmanx_offline to 1, and it didnt work. Same restrictions...
..

N
I've just tried dispmanx_offline to 1, & can now have 3 layers active, with no display tearing.

That's with:

gpu_mem 128

njk1961, when you get your desired result it'll be interesting to compare with the same code here.
3png.jpg
3png.jpg (57.14 KiB) Viewed 2589 times

Return to “Media centres”