Raspberry Pi?

Chrome / HTML+JS / Kindle / Blackberry

Moderators: ezraanderson, halfnelson

Re: Raspberry Pi?

Postby woyaru » Thu Mar 28, 2013 3:34 pm

I have just successfully built MOAI from spacepluk moai-dev branch on the github. To check if MOAI is using supplied OpenGLES library I have read CMakeCache file. And there are four lines for OpenGL:

OPENGL_INCLUDE_DIR:PATH=/usr/include
OPENGL_gl_LIBRARY:FILEPATH=/usr/lib/arm-linux-gnueabihf/libGL.so
OPENGL_glu_LIBRARY:FILEPATH=/usr/lib/arm-linux-gnueabihf/libGLU.so
OPENGL_xmesa_INCLUDE_DIR:PATH=OPENGL_xmesa_INCLUDE_DIR-NOTFOUND


So MOAI has static linking to the the OpenGL on the Raspbian, am I correct? LD_PRELOAD, as ibisum has suggested isn't necessary, is it? I am quite new in Linux but I am still learning.
I have checked out some samples attached to Moai and frame rate is too low unfortunately. On the Rasspberry PI I have found out that MOAI propably need some adjustments for the Broadcom SoC. Is this possible? How?

The message I have received is:

You have at least to initialize the VideoCore before making OpenGL ES calls , and that is not directly in conformance with the spec IIRC.
Anything fast you want to use on the Pi must support OpenGL ES on Linux (!) and be adjusted to the Broadcom implementation (if you're lucky, that might be only two lines of additional code)


Could you give me some information in which way I can adjust MOAI to the Broadcom implementation?
woyaru
 
Posts: 21
Joined: Mon Mar 25, 2013 9:29 am

Re: Raspberry Pi?

Postby ibisum » Fri Mar 29, 2013 4:21 am

I used LD_PRELOAD to ensure that my build of MOAI was using real hardware-accelerated GLES and not the MESA version of it ..
;
--
Email: ibisum@gmail.com
IRC: torpor on FreeNode, see you in the #moai channel
Got a MOAI snippet? Please consider adding it to http://moaisnippets.info/
User avatar
ibisum
 
Posts: 1501
Joined: Mon Oct 17, 2011 1:11 am
Location: Vienna, Austria

Re: Raspberry Pi?

Postby woyaru » Fri Mar 29, 2013 4:56 am

But ibisum, what is result of your tries? In your case you also have very low frame rate on MOAI samples? I will try with LD_PRELOAD.
woyaru
 
Posts: 21
Joined: Mon Mar 25, 2013 9:29 am

Re: Raspberry Pi?

Postby woyaru » Sat Mar 30, 2013 3:30 am

I have just tried with defining LD_PRELOAD. I have MOAI build from the spacepluk moai-deb branch so I have typed something like that:

Code: Select all
  1. LD_PRELOAD=/opt/vc/lib/libGLESv2.so /home/pi/moai-dev/build/src/hosts/moai-untz



And after starting a sample frame ratio is still too low. I am getting something like that in console:

Code: Select all
  1. Initializing Chipmunk v5.3.4 (Debiug Enabled)

  2. Compiled with -DNDEBUG defined to disable debug mode and runtime assertion checks



So as jgroman has typed MOAI:

needs to include Broadcom specific libraries into source code and explicitly call some proprietary initialisation and other stuff. Also currently there is no X driver for Pi and calls for getting display surface need to be changed to not use X and go straight to EGL.


I don't know how to resolve such issues. Do you have any suggests how to include Broadcom libraries into MOAI source code?
woyaru
 
Posts: 21
Joined: Mon Mar 25, 2013 9:29 am

Re: Raspberry Pi?

Postby RurouniGPL » Thu Apr 10, 2014 8:43 am

Any news about Raspberry Pi support?

Thanks!
RurouniGPL
 
Posts: 242
Joined: Wed Jun 27, 2012 11:54 am

Re: Raspberry Pi?

Postby ezraanderson » Thu Apr 10, 2014 11:12 am

~
Do you have one?

It should be quite easy to get MOAI to work on it, If I ever have free time, I would help figure this out.
Dead Dark: A roguelike, zombie apocalypse survival game
My Website | My Facebook | My Twitter | My Games on Itunes | My Games on Android
User avatar
ezraanderson
 
Posts: 1094
Joined: Wed Nov 21, 2012 2:24 pm
Location: Canada

Re: Raspberry Pi?

Postby RurouniGPL » Wed Apr 16, 2014 7:48 am

Yes, I have one. Do you think that the current version will work without problem? I thought that there were problems with de GPU drivers.

If I have time this weekend I will check it.

Thanks!
RurouniGPL
 
Posts: 242
Joined: Wed Jun 27, 2012 11:54 am

Re: Raspberry Pi?

Postby telarium » Tue Aug 18, 2015 8:27 pm

Did anyone ever get this working? I get errors about cmake being an older version.
telarium
 
Posts: 18
Joined: Mon Jun 04, 2012 1:55 pm

Re: Raspberry Pi?

Postby ibisum » Wed Sep 02, 2015 4:22 am

It can be done, but you need to deal with building your own cmake, etc. I haven't done it in a year or so, but I might give it a try some time soon ..
;
--
Email: ibisum@gmail.com
IRC: torpor on FreeNode, see you in the #moai channel
Got a MOAI snippet? Please consider adding it to http://moaisnippets.info/
User avatar
ibisum
 
Posts: 1501
Joined: Mon Oct 17, 2011 1:11 am
Location: Vienna, Austria

Re: Raspberry Pi?

Postby ezraanderson » Wed Sep 02, 2015 12:25 pm

~
This really intrigues me, but i just don't have the time to muck around with it currently. I am a big fan of android mini-consoles, and would love moai working on all of them. My moai games run great on the OUYA. so raspberry pie and all the other console are within scope.
Dead Dark: A roguelike, zombie apocalypse survival game
My Website | My Facebook | My Twitter | My Games on Itunes | My Games on Android
User avatar
ezraanderson
 
Posts: 1094
Joined: Wed Nov 21, 2012 2:24 pm
Location: Canada

Re: Raspberry Pi?

Postby ibisum » Wed Sep 23, 2015 1:21 am

In case anyone is interested in playing with this - Here is a package of the MOAI binary and libs I built for the Raspberry Pi (Raspian) OS:

http://primitur.at/rpi_moai.tar.gz

This is based on the 1.6-stable branch from the current moai-dev repo.

Details about my rpi environment:

Code: Select all
  1.  

  2. pi@rpi-c ~ $ uname -a && lsb_release -ds

  3. Linux rpi-c 4.1.7-v7+ #815 SMP PREEMPT Thu Sep 17 18:34:33 BST 2015 armv7l GNU/Linux

  4. Debian GNU/Linux 7.8 (wheezy)

  5.  



My motivation: I recently got an rpi2+LCD/Touchscreeen setup (which was recently released) and wanted to try MOAI on it .. after some hours of building, I finally got a binary that works.

The challenge involved:

1. Updating rpi2 to latest version of everything.
2. Installing the required dependencies (same as for Ubuntu build, basically)
3. Installing CMAKE 2.8.11 from sources on the rpi, into a local prefix (i.e. ~pi/bin)
4. Installing gcc-4.8 from the standard repositories (MOAI requires -std=c++11, provided by gcc-4.8)
5. Building MOAI normally - this took 2.5 hours.

And now it seems to work - that is, MOAI runs the samples, and so on. The only issue is, of course as has been noted already - no GL acceleration .. only software GL. So this is not exactly *great* news for everyone following this thread, but I thought I'd at least make the binary available for anyone who wants to play with it ..

I will next spend some time getting acceleration working - either using LD_PRELOAD, as I have done with other Debian-Arm environments (Open Pandora) in the past, or by writing the required shim code to get the rpi's GL environment behaving nicely with MOAI ..

Anyway, hopefully the end result will be that the rpi+touchscreen can be considered a viable target for MOAI games too.. lets see.
;
--
Email: ibisum@gmail.com
IRC: torpor on FreeNode, see you in the #moai channel
Got a MOAI snippet? Please consider adding it to http://moaisnippets.info/
User avatar
ibisum
 
Posts: 1501
Joined: Mon Oct 17, 2011 1:11 am
Location: Vienna, Austria

Re: Raspberry Pi?

Postby RurouniGPL » Sun Oct 25, 2015 3:44 am

Hi!

Any body knows how to activate OpenGL acceleration? It's extremely slow :(

If I use this:

Code: Select all
  1.  

  2. LD_PRELOAD=/opt/vc/lib/libGLESv2.so

  3.  



It throws this error:

terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid


This happens on "MOAISim.openWindow("Title", window_w, window_h)"

I use Ubuntu Mate and Raspberry PI 2.
RurouniGPL
 
Posts: 242
Joined: Wed Jun 27, 2012 11:54 am

Re: Raspberry Pi?

Postby RurouniGPL » Sun Oct 25, 2015 5:36 am

On Raspbian it throws, directly:

terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid


Also:

Unable to open audio: No such audio device
RurouniGPL
 
Posts: 242
Joined: Wed Jun 27, 2012 11:54 am

Re: Raspberry Pi?

Postby RurouniGPL » Sun Oct 25, 2015 10:56 am

The last lines from "strace moai":

Code: Select all
  1.  

  2. brk(0x1a95000)                          = 0x1a95000

  3. socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0) = 4

  4. connect(4, {sa_family=AF_LOCAL, sun_path=@"/tmp/.X11-unix/X0"}, 20) = 0

  5. getpeername(4, {sa_family=AF_LOCAL, sun_path=@"/tmp/.X11-unix/X0"...}, [20]) = 0

  6. uname({sys="Linux", node="raspberrypi", ...}) = 0

  7. access("/home/pi/.Xauthority", R_OK)    = 0

  8. open("/home/pi/.Xauthority", O_RDONLY)  = 5

  9. fstat64(5, {st_mode=S_IFREG|0600, st_size=161, ...}) = 0

  10. mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76eb4000

  11. read(5, "\1\0\0\vraspberrypi\0\0010\0\22MIT-MAGIC-CO"..., 4096) = 161

  12. read(5, "", 4096)                       = 0

  13. close(5)                                = 0

  14. munmap(0x76eb4000, 4096)                = 0

  15. getsockname(4, {sa_family=AF_LOCAL, NULL}, [2]) = 0

  16. fcntl64(4, F_GETFL)                     = 0x2 (flags O_RDWR)

  17. fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK)  = 0

  18. fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0

  19. poll([{fd=4, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])

  20. writev(4, &#91;{"l\0\v\0\0\0\22\0\20\0\0\0", 12}, {"", 0}, {"MIT-MAGIC-COOKIE-1", 18}, {"\0\0", 2}, {"\342\317\372\323\6<\265\373\333\4\207z\316n\356H", 16}, {"", 0}&#93;, 6) = 48

  21. recv(4, "\1\0\v\0\0\0?\0", 8, 0)        = 8

  22. recv(4, " \20\261\0\0\0\300\1\377\377\37\0\0\1\0\0\24\0\377\377\1\7\0\0  \10\377\0\0\0\0"..., 252, 0) = 252

  23. shutdown(4, SHUT_RDWR)                  = 0

  24. close(4)                                = 0

  25. stat64("/home/pi/moai-sdk-1.6_admob/samples/anim-basic/main.lua", {st_mode=S_IFREG|0664, st_size=696, ...}) = 0

  26. open("/home/pi/moai-sdk-1.6_admob/samples/anim-basic/main.lua", O_RDONLY) = 4

  27. fstat64(4, {st_mode=S_IFREG|0664, st_size=696, ...}) = 0

  28. mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76eb4000

  29. read(4, "--------------------------------"..., 4096) = 696

  30. read(4, "", 4096)                       = 0

  31. close(4)                                = 0

  32. munmap(0x76eb4000, 4096)                = 0

  33. write(2, "terminate called after throwing "..., 48terminate called after throwing an instance of ') = 48

  34. write(2, "std::logic_error", 16std::logic_error)        = 16

  35. write(2, "'\n", 2'

  36. )                      = 2

  37. write(2, "  what():  ", 11  what():  )             = 11

  38. write(2, "basic_string::_S_construct null "..., 41basic_string::_S_construct null not valid) = 41

  39. write(2, "\n", 1

  40. )                       = 1

  41. rt_sigprocmask(SIG_UNBLOCK, &#91;ABRT&#93;, NULL, 8) = 0

  42. tgkill(10017, 10017, SIGABRT)           = 0

  43. --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=10017, si_uid=1000} ---

  44. +++ killed by SIGABRT +++

  45.  

RurouniGPL
 
Posts: 242
Joined: Wed Jun 27, 2012 11:54 am

Re: Raspberry Pi?

Postby RurouniGPL » Sun Oct 25, 2015 11:22 am

Maybe has something in common with this post:

https://github.com/Aloshi/EmulationStat ... t-49781523
RurouniGPL
 
Posts: 242
Joined: Wed Jun 27, 2012 11:54 am

Re: Raspberry Pi?

Postby telarium » Thu Nov 05, 2015 11:22 am

I get this error when trying to build from the Spacepluk fork:

Code: Select all
  1. /moai-dev.spacepluk/src/moaicore/MOAICpConstraint.cpp: In static member function 'static int MOAICpConstraint::_getBiasCoef(lua_State*)':

  2. /moai-dev.spacepluk/src/moaicore/MOAICpConstraint.cpp:27:42: error: 'cpConstraint' has no member named 'biasCoef'

  3.    lua_pushnumber ( L, self->mConstraint->biasCoef );

  4.                                           ^

telarium
 
Posts: 18
Joined: Mon Jun 04, 2012 1:55 pm

Re: Raspberry Pi?

Postby RurouniGPL » Fri Nov 06, 2015 1:03 pm

I use moai-forge fork, it compiles without problems but... it doesn't work :(
RurouniGPL
 
Posts: 242
Joined: Wed Jun 27, 2012 11:54 am

Re: Raspberry Pi?

Postby telarium » Thu Nov 12, 2015 2:58 pm

moai-forge gives me this error when compiling:

#error MDC2 is disabled
telarium
 
Posts: 18
Joined: Mon Jun 04, 2012 1:55 pm

Re: Raspberry Pi?

Postby RurouniGPL » Thu Nov 26, 2015 2:05 am

It's OpenSSL. I think you have to install "libssl-dev"... but I don't know exactly.
RurouniGPL
 
Posts: 242
Joined: Wed Jun 27, 2012 11:54 am

Previous

Return to Browser + Other

Who is online

Users browsing this forum: No registered users and 0 guests

cron

x