summershere
Posts: 25
Joined: Tue Apr 23, 2013 10:53 am

Re: OSD (on screen display) w/o X

Wed Oct 23, 2013 11:54 am

Sorry to post on such an old thread, but this is exactly what I'm looking to achieve - I'm missing this 'libvgfont' thing, and I'm trying to work out how I go about getting it (and/or any other pre-reqs for OSD/poptart)?

Chinasaur
Posts: 116
Joined: Tue Sep 11, 2012 10:15 pm

Re: OSD (on screen display) w/o X

Wed Oct 23, 2013 6:26 pm

summershere wrote:Sorry to post on such an old thread, but this is exactly what I'm looking to achieve - I'm missing this 'libvgfont' thing, and I'm trying to work out how I go about getting it (and/or any other pre-reqs for OSD/poptart)?
So, on my version of Raspbian the VideoCore demo stuff is under /opt/vc. If you do:

Code: Select all

cd /opt/vc/src/hello_pi/libs/vgfont
make
Hopefully it will build libvgfont for you. I think you can also have it rebuild all the demos by running /opt/vc/src/hello_pi/rebuild.sh
But that may take a while and builds a bunch of graphics demos that you don't need if OSD is all you're trying to get.

After that, you can pull poptart from GitHub; I believe what's up there will work on recent Raspbian but I'll test it now for you. Let me know if you need help installing git and pulling.

summershere
Posts: 25
Joined: Tue Apr 23, 2013 10:53 am

Re: OSD (on screen display) w/o X

Thu Oct 24, 2013 11:02 am

That did it, thanks :) Are there any switches to change behaviour for it at all, wondering if I could maybe change the display time? Ideally I'd like to run it from a background process, overlaying information on whatever's running on the console. It's kind of surprising (to me at least) that there aren't loads of apps that do this sort of thing....

Chinasaur
Posts: 116
Joined: Tue Sep 11, 2012 10:15 pm

Re: OSD (on screen display) w/o X

Thu Oct 24, 2013 2:42 pm

summershere wrote:That did it, thanks :) Are there any switches to change behaviour for it at all, wondering if I could maybe change the display time? Ideally I'd like to run it from a background process, overlaying information on whatever's running on the console. It's kind of surprising (to me at least) that there aren't loads of apps that do this sort of thing....
Yes, sorry for the non existent documentation. If you search the source code for "getopt" you should find many useful options including changing the display time. You can also take a look at some of the example scripts like muptart and conktart; I think those are in git; if not I'll add them.

I didn't get around to stashing display resources when the process exits, so if you keep calling poptart in a loop you'll probably see flashing. But there is another command line flag to give poptart the command string to call and the loop interval, so then poptart doesn't exit and you get no flashing.

I noticed recently that there's some bug in how it calculates the background shaded box dimensions. Let me know if you figure it out our I'll take a look soon.

summershere
Posts: 25
Joined: Tue Apr 23, 2013 10:53 am

Re: OSD (on screen display) w/o X

Thu Oct 24, 2013 3:23 pm

Thanks, I'll give that a try.

Odd issue, I seem to get an error if omxplayer is currently showing a full-HD video:

Code: Select all

assertion failure:graphics.c:269:gx_priv_restore():egl_result
Aborted
If the video's less than 1080 it displays fine. Any ideas?

Chinasaur
Posts: 116
Joined: Tue Sep 11, 2012 10:15 pm

Re: OSD (on screen display) w/o X

Fri Oct 25, 2013 2:06 am

Hmm, no idea. I've never tried it with omxplayer. Sounds like omx is claiming the whole screen resource or something. I'll let you know if I figure anything out.

Chinasaur
Posts: 116
Joined: Tue Sep 11, 2012 10:15 pm

Re: OSD (on screen display) w/o X

Wed Oct 30, 2013 5:46 am

So, the assert is failing due to failure of eglBindAPI. eglBindAPI seems to fail when trying to bind OpenVG API when omxplayer is already bound with a different API. I don't understand all the details of EGL that well, but this seems to be an issue that only comes up when both omxplayer and poptart are trying to display using close to the full screen. I didn't test this on the omxplayer side, but I'm basing that on your report that it's a problem when you go to full 1080 with your display. All my test videos are full screen and all of them cause the eglBindAPI conflict.

On the poptart side, the default behavior is to open a display window that's full screen using gx_create_window. I made this the behavior just based on the hello_font example, but it doesn't necessarily make good sense. If I change the size to be somewhat less than full screen then I don't get the conflict with omxplayer, so maybe I should change poptart to workaround the issue this way, but it will take some work to figure out how to get things positioned correctly in that case.

Since the conflict doesn't depend on it being exactly the full screen size, but only something close to full screen, I wonder if it's an issue with having enough GPU memory. I'm trying to debug that possibility a bit but haven't figured it out yet.

Chinasaur
Posts: 116
Joined: Tue Sep 11, 2012 10:15 pm

Re: OSD (on screen display) w/o X

Wed Oct 30, 2013 6:18 am

I tried increasing my GPU memory from 64 MB to 128 MB in raspi-config and that seems to get rid of the assert failure. So I think it is a memory issue. I've always thought it would be better if poptart didn't open a full screen window with transparent background just to draw in a small area of the screen, so if I can find the right way to avoid this I'll change it. Basically just need to figure out how to open a smaller display window but position it in the desired location. Plus need to calculate the display window size needed for the requested amount of text message, but I think I know where I can cannibalize this logic from.

summershere
Posts: 25
Joined: Tue Apr 23, 2013 10:53 am

Re: OSD (on screen display) w/o X

Thu Oct 31, 2013 2:46 pm

That's great - changed the GPU memory and it fixes the issue for me too, thanks for that.

Is there any way of scrolling the text? Also I notice that the background boxr only shows up if there is a lot of text (if that makes sense, and it's not just me?!).

Still trying to work out the switches, I'm not a C person unfortunately so am a little out of my depth, but can at least work out what the switches are, even if not what they do ;)

Chinasaur
Posts: 116
Joined: Tue Sep 11, 2012 10:15 pm

Re: OSD (on screen display) w/o X

Thu Oct 31, 2013 4:14 pm

Ah, yes, I finally wrote some documentation. I put the new version up on GitHub. There are some other changes, mostly around STDIN input; hopefully they won't cause you any problems.

Scrolling and other niceties not available yet. There might be another terminal command you can combine into the command string with -c?

What are you using it for? I'm game to put a bit more work into it if you think it would be useful. May take me a while to find time though.

summershere
Posts: 25
Joined: Tue Apr 23, 2013 10:53 am

Re: OSD (on screen display) w/o X

Tue Nov 05, 2013 3:18 pm

Thanks, that's a great help.

We're using it for visual displays. So, omxplayer is cycling through a directory of videos, and the idea is that poptart will add additional info (time, weather, opening hours etc) along the bottom of the screen. Hence scrolling would be awesome :) Currently I'm using a shell to manually test various outputs, but ultimately I will kick off a separate process which will work through (I guess) a series of text files and variables.

summershere
Posts: 25
Joined: Tue Apr 23, 2013 10:53 am

Re: OSD (on screen display) w/o X

Tue Nov 05, 2013 3:41 pm

Incidentally, if I use stdin or the -c flag, it seems to add a couple of carriage returns somewhere, moving the text up the screen. Also, the grey background is still only appearing on long text. So for example:

Code: Select all

poptart "hello hello hello hello hello hello hello hello hello hello hello" -s 100
Has the text perfectly in a grey box along the bottom, whereas:

Code: Select all

poptart -s 100 -c "date"
Has the date appear further up the screen, on an incomplete background. Not sure if this may further up the chain in terms of font files or something though?

Chinasaur
Posts: 116
Joined: Tue Sep 11, 2012 10:15 pm

Re: OSD (on screen display) w/o X

Tue Nov 05, 2013 5:17 pm

summershere wrote:Thanks, that's a great help.

We're using it for visual displays. So, omxplayer is cycling through a directory of videos, and the idea is that poptart will add additional info (time, weather, opening hours etc) along the bottom of the screen. Hence scrolling would be awesome :) Currently I'm using a shell to manually test various outputs, but ultimately I will kick off a separate process which will work through (I guess) a series of text files and variables.
Sounds cool. You might want to look into the subtitles functionality in omxplayer? Probably tricky to use this for dynamic information, but may be more full featured. Also there are various kiosk style apps and window-managers out there. These are much more lightweight than the standard Raspbian GUI, but might give you more flexibility.

In terms of poptart, I don't understand the background issue, but haven't had time to look into it much. I suspect, as you say, it's an upstream issue. Newlines is an interesting point; will put it on my list.

summershere
Posts: 25
Joined: Tue Apr 23, 2013 10:53 am

Re: OSD (on screen display) w/o X

Wed Nov 06, 2013 4:55 pm

I've looked briefly at subtitles, but due to the timed nature of them it doesn't really work - need something a bit more autonomous really.

I've also had a play with various kiosk apps, but haven't found one yet that A) runs on the pi, B) plays video, and C) isn't just someone else's wrapper around omxplayer anyway. As poptart and omx both run without X it's all achievable from bash scripts, which keeps things light and debuggable :) If anyone knows of any kiosk stuff that fits AB&C above though, I would love to hear about it!

Thanks again Chinasaur, much appreciated. Let me know if you add any scrolling / figure out the screen position thing....

:)

summershere
Posts: 25
Joined: Tue Apr 23, 2013 10:53 am

Re: OSD (on screen display) w/o X

Mon Nov 11, 2013 4:17 pm

Chinasaur, just sent you a PM - it seems to just sit in my outbox rather than move to sent messages though. Let me know if you don't get it as I can't tell whether it's actually gone or not... :/

drhopton
Posts: 2
Joined: Thu Jul 12, 2012 9:05 am

Re: OSD (on screen display) w/o X

Thu Apr 02, 2015 9:11 pm

Hi,

This is a really old thread, but poptart is just what I'm looking for. I just can't seem to get it working. Which is unsurprising really as my linux skills are rudimentary at best.

I'm trying to get poptart working with Volumio, an mpd based music playing distribution based on Raspbian. I've built a small music box and it has a 5 inch screen plugged in to the AV output of a RPi model A. I would like to have that screen display current track and artist (and maybe one day album art, but one step at a time!).

So i've managed to get poptart compiled with no errors given (had to install build-essential and libfreetype6-dev as Volumio does not have them by default). However when I ran ./muptart I got this:

./muptart: 12: ./muptart: poptart: not found

So I added a "./" to line 12 of muptart so that it reads:

./poptart -t1 -s30 -c"$command" -l

But now I get:

* failed to add service - already in use?

And here my knowledge ends. I don't really know what this message means. Did it not compile correctly after all? Any ideas on how to get poptart working with Volumio would be *greatly* appreciated.

Chinasaur
Posts: 116
Joined: Tue Sep 11, 2012 10:15 pm

Re: OSD (on screen display) w/o X

Thu Apr 02, 2015 9:36 pm

I haven't recompiled or run poptart in quite a while, but I can try to reproduce your error. No promises as to timing; I've moved recently and haven't reconnected any Pis.

I'm guessing you will get this same error if you just try running poptart with some test message, but would be good to verify.

Chinasaur
Posts: 116
Joined: Tue Sep 11, 2012 10:15 pm

Re: OSD (on screen display) w/o X

Thu Apr 02, 2015 9:38 pm

This thread sounds similar, although it's old enough that I doubt your issue is exactly the same:
http://www.raspberrypi.org/forums/viewt ... 28&t=12581

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

Re: OSD (on screen display) w/o X

Thu Apr 02, 2015 10:51 pm

I built poptart recently to help understand VC 4 API's.

It does work as you can see - text at bottom of screen.

I may have changed makefile slightly so it's attached too.

Screenshot is courtesy of AndyD's useful raspi2png application.

Thank you Chinasaur for a useful example.
The attachment snapshot.png is no longer available
Attachments
snapshot.png
snapshot.png (38.06 KiB) Viewed 3501 times
Makefile.tar.bz2
(957 Bytes) Downloaded 92 times

fredfs
Posts: 58
Joined: Sun Jun 07, 2015 12:22 am

Re: OSD (on screen display) w/o X

Mon Oct 30, 2017 1:15 pm

Sorry to revive this old thread.
Is it possible to update libvgfont to accept unicode characters?

Return to “General discussion”