mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Pi3d: how can pi3d be setup to work within weston?

Wed May 29, 2013 8:14 pm

As the latest raspbian has weston installed I have been messing around with it and compiled the weston clients etc...

Looks okay so far, then I decide to try pi3d.

It will not display anything :(

Anyone have any ideas how to integrate pi3d into weston so it will display or even better display in a window...

There are no errors on dmesg, the pi3d demos run and respond to keyboard input when the 'weston-terminal' that they are executed from has focus, but no sign of any display.

Once weston is exited the pi3d demos run as normal.

Anyone have any ideas about integration?

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

Re: Pi3d: how can pi3d be setup to work within weston?

Wed May 29, 2013 8:26 pm

mung wrote:As the latest raspbian has weston installed I have been messing around with it and compiled the weston clients etc...

Looks okay so far, then I decide to try pi3d.

It will not display anything :(

Anyone have any ideas how to integrate pi3d into weston so it will display or even better display in a window...

There are no errors on dmesg, the pi3d demos run and respond to keyboard input when the 'weston-terminal' that they are executed from has focus, but no sign of any display.

Once weston is exited the pi3d demos run as normal.

Anyone have any ideas about integration?
Just a guess, but the layer number given to dispman for pi3d is probably less that the layer numbers used by weston (hence it is rendered behind and you don't see it).
Can you increase the layer number? (I think it is a signed 32-bit integer).

I'd leave getting it to run nicely in a window for a bit. The guys who did weston are going to work on getting 3d in a window working nicely.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: Pi3d: how can pi3d be setup to work within weston?

Wed May 29, 2013 9:39 pm

dom wrote: Just a guess, but the layer number given to dispman for pi3d is probably less that the layer numbers used by weston (hence it is rendered behind and you don't see it).
Can you increase the layer number? (I think it is a signed 32-bit integer).

I'd leave getting it to run nicely in a window for a bit. The guys who did weston are going to work on getting 3d in a window working nicely.
I really know nothing about the internals of pi3d, I have not found any mention of layer numbers in the pi3d code, I am guessing something around line 77 of https://github.com/tipam/pi3d/blob/mast ... yOpenGL.py (bcm.vc_dispmanx_element_add) and what parameters it requires????

Is there any documentation about 'bcm.vc_dispmanx_element_add' ?

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: Pi3d: how can pi3d be setup to work within weston?

Wed May 29, 2013 9:59 pm

I just found some code that seems to comment the call:

http://benosteen.wordpress.com/2012/04/ ... x-windows/

vc_dispmanx_element_add ( dispman_update,
dispman_display, 0/*layer*/, &dst_rect, 0/*src*/,
&src_rect, DISPMANX_PROTECTION_NONE, 0 /*alpha*/,
0/*clamp*/, 0/*transform*/);

WELL DONE SOMEONE ACTUALLY COMMENTS THEIR CODE :D

I maybe try editing the pi3d class code tomorrow if I get time.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: Pi3d: how can pi3d be setup to work within weston?

Thu May 30, 2013 9:12 pm

dom wrote: Just a guess, but the layer number given to dispman for pi3d is probably less that the layer numbers used by weston (hence it is rendered behind and you don't see it).
Can you increase the layer number? (I think it is a signed 32-bit integer).

I'd leave getting it to run nicely in a window for a bit. The guys who did weston are going to work on getting 3d in a window working nicely.
Thanks for the tip,
vc_dispmanx_element_add ( dispman_update,
dispman_display, 0/*layer*/, &dst_rect, 0/*src*/,
&src_rect, DISPMANX_PROTECTION_NONE, 0 /*alpha*/,
0/*clamp*/, 0/*transform*/);

Yep changing the layer to 5 or greater gets pi3d visible, or on top of stack depending how many windows are open in weston, of course now I have other problems with compiling weston-terminal.

How long before weston will get pi3d in a window?
I am considering having a hack at it myself, looks like it could be a fairly simple hack to the weston-terminal required with a call to dispmanx to update layer/geometry inserted in the callbacks?

Where are the dispmanx docs?

User avatar
paddyg
Posts: 2495
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Pi3d: how can pi3d be setup to work within weston?

Thu May 30, 2013 10:51 pm

Thanks for this input. I will add something to the pi3d FAQ tomorrow (and put a docstring in DisplayOpenGL.py!)
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
dliloch
Posts: 168
Joined: Wed Jun 27, 2012 6:28 pm
Location: cleveland, ohio usa

Re: Pi3d: how can pi3d be setup to work within weston?

Fri Jun 07, 2013 5:40 pm

mung -- how diid you get the clients to compile? .. I've been having a hard time due to it not finding the header files..
I am down to /share/os-compatabilty.h which is there but ../config.h no such file or directory ..
I am using the package that came with raspbian .. I don't know why they did not package the clients as well?

any pointers in this area would be appreciated ..
-don

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: Pi3d: how can pi3d be setup to work within weston?

Mon Jun 10, 2013 12:01 pm

dliloch wrote:mung -- how diid you get the clients to compile? .. I've been having a hard time due to it not finding the header files..
I am down to /share/os-compatabilty.h which is there but ../config.h no such file or directory ..
I am using the package that came with raspbian .. I don't know why they did not package the clients as well?

any pointers in this area would be appreciated ..
-don
My pointer would be do not bother wasting your time :lol:

I will qualify this by saying that there are experts working on weston that should (hopefully) provide a full distro that works 'soon'. Getting the clients to compile will take you at least 2 hours follow the freedesktop instructions but you must get the git repo from collabora (cannot remember which but first link in my browser history shows http://cgit.collabora.com/git/user/dani ... xwayland-1. you may need to search around their git repo for another version though?).

Also I have not found any dispmanx docs that give any hints about reparenting surfaces and the wayland protocol does not even support global screen coordinates for clients, so putting pi3d in a weston window is not going to be simple hack.

I have wasted about 10 hours web browsing and 10 hours messing with the source and feel very dissatisfied as it seems badly organised and almost impossible to build the xserver required for xwayland to run xapps (huge list of dependencies for pkg-config and uncertainty about versioning). Strange considering demo videos show xapps running on weston?

Take the easy route and wait until they make a full distro which works with xwayland, the clients are not very interesting and I don't think anyone needs to start thinking about reading the code unless they are working on toolkits.

User avatar
dliloch
Posts: 168
Joined: Wed Jun 27, 2012 6:28 pm
Location: cleveland, ohio usa

Re: Pi3d: how can pi3d be setup to work within weston?

Mon Jun 10, 2013 12:26 pm

Thanks.. I will wait @63 time is getting to be a scarce resource to waste!

Return to “Python”