Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 14-04-2014, 22:15   #136
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: OpenCPN Runs on Embedded ARM

I think you also must be using the accelerated xorg driver on the cubie for opengl to play nicely.

https://github.com/ssvb/xf86-video-f...i/Installation
seandepagnier is offline   Reply With Quote
Old 05-05-2014, 06:01   #137
Registered User
 
it-slav's Avatar

Join Date: May 2014
Posts: 46
Re: OpenCPN Runs on Embedded ARM

Quote:
Originally Posted by boat_alexandra View Post
I got bored with the cubie truck since it's basically working perfectly and really fast.

So.. I got it working, with hardware acceleration on the raspberry pi. Unfortunately the driver is a bit lacking, so can only render opengl in full screen. I then keep using x for input (keyboard and mouse) This works, but there is no toolbar or chart piano or any other dialog windows etc... Using top, I can see opencpn only gets about 25% of the cpu, and xorg and other stuff uses the rest, so this can't be a very ideal. Perhaps running in wayland would give better results, or playing around with it could help a lot. In any case, it's running about 3 times faster than before without any hardware acceleration. I think it could be around 10 times faster with more playing around which would make it quite usable.

Since I have no display, I don't _really_ know what is going on, but I have generally an idea. My setup is a bit contrived, and I am relying on I have two utilities, one that can grab screenshots, and also using x11vnc (which is not helping performance any) to control it for keyboard and mouse input.

It is not possible to see the toolbar or chart piano, or anything else for that matter that is not on the main canvas. I think the easiest way around this is with a simple hot-key which toggles opengl, so when you need to use the tool bar, or configure or use a plugin etc, you can, but switch back for viewing the charts. Then the chart piano (and eventually toolbar and context menus) should be implemented to render to the main canvas. I don't really have too much time to deal with raspberry pi, and without a display to plug into it, I doubt I will get too serious about this one, but I can say it is working.

For anyone who wants to try, first ensure you have libGLESv1_CM.so installed and working. Then you can install glxinfo and glxgears with
Code:
apt-get install mesa-utils
Then build glshim
Code:
git clone github.com/seandepagnier/glshim
cd glshim
mkdir build
cd build
cmake .. -DBCMHOST=1
make GL
sudo cp lib/libGL* /usr/lib
Now, in .bashrc add this line to the bottom:
Code:
export LIBGL_FB=1
restart the shell or manually type this line, and run glxgears. You should get 60fps (limited only by refresh rate I believe)

You may have to move libGL* files from /usr/lib/arm-linux-gnueabihf to somewhere else

Once glxgears is working (glxinfo should work too)

you can compile glues
Code:
git clone github.com/ssvb/glues.git
cd glues
mkdir build
cd build
cmake ..
make
cp libGLU.so.1 /usr/lib/libGLU.so
Now you can compile opencpn, use optimum branch
Code:
git clone -b optimum github.com/seandepagnier/OpenCPN
See instructions for building opencpn (and apt-get any packages needed)
It must detect opengles when running cmake. To get this, you must have /usr/include/GLES/gl.h, if you don't you can copy it from somewhere else.

Finally run opencpn, but you might have to switch between two ways of running.

To configure and verify it is works:
Code:
opengl -fullscreen
then you can switch on opengl mode if all is well. If there is some failure, then run with -no_opengl to compare.

To generate the compressed cache (etc1 compression is working great) it is a little tricky because you must navigate the setup without being able to see it. I think for this one, run x11vnc on the raspberry, connect from another computer, and then you can rebuild the chart database while opengl and texture compression caching are all enabled. At this point it should be able to run quite fast.

Tried
Code:
$ git clone github.com/seandepagnier/glshim
fatal: repository 'github.com/seandepagnier/glshim' does not exist
regards
Peter
it-slav is offline   Reply With Quote
Old 05-05-2014, 06:38   #138
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: OpenCPN Runs on Embedded ARM

Quote:
Originally Posted by it-slav View Post
Tried
Code:
$ git clone github.com/seandepagnier/glshim
fatal: repository 'github.com/seandepagnier/glshim' does not exist
regards
Peter
Try
Code:
https://github.com/seandepagnier/glshim.git
seandepagnier is offline   Reply With Quote
Old 05-05-2014, 11:23   #139
Registered User
 
it-slav's Avatar

Join Date: May 2014
Posts: 46
Re: OpenCPN Runs on Embedded ARM

Quote:
Originally Posted by boat_alexandra View Post
So.. I got it working, with hardware acceleration on the raspberry pi. Unfortunately the driver is a bit lacking, so can only render opengl in full screen. I then keep using x for input (keyboard and mouse) This works, but there is no toolbar or chart piano or any other dialog windows etc... Using top, I can see opencpn only gets about 25% of the cpu, and xorg and other stuff uses the rest, so this can't be a very ideal. Perhaps running in wayland would give better results, or playing around with it could help a lot. In any case, it's running about 3 times faster than before without any hardware acceleration. I think it could be around 10 times faster with more playing around which would make it quite usable.

Since I have no display, I don't _really_ know what is going on, but I have generally an idea. My setup is a bit contrived, and I am relying on I have two utilities, one that can grab screenshots, and also using x11vnc (which is not helping performance any) to control it for keyboard and mouse input.

It is not possible to see the toolbar or chart piano, or anything else for that matter that is not on the main canvas. I think the easiest way around this is with a simple hot-key which toggles opengl, so when you need to use the tool bar, or configure or use a plugin etc, you can, but switch back for viewing the charts. Then the chart piano (and eventually toolbar and context menus) should be implemented to render to the main canvas. I don't really have too much time to deal with raspberry pi, and without a display to plug into it, I doubt I will get too serious about this one, but I can say it is working.

For anyone who wants to try, first ensure you have libGLESv1_CM.so installed and working. Then you can install glxinfo and glxgears with
Code:
apt-get install mesa-utils
Then build glshim
Code:
git clone github.com/seandepagnier/glshim
cd glshim
mkdir build
cd build
cmake .. -DBCMHOST=1
make GL
sudo cp lib/libGL* /usr/lib
Now, in .bashrc add this line to the bottom:
Code:
export LIBGL_FB=1
restart the shell or manually type this line, and run glxgears. You should get 60fps (limited only by refresh rate I believe)

You may have to move libGL* files from /usr/lib/arm-linux-gnueabihf to somewhere else

Once glxgears is working (glxinfo should work too)
I did, as root:
Code:
apt-get install mesa-utils
git clone https://github.com/seandepagnier/glshim.git
cd glshim
mkdir build
cd build
cmake .. -DBCMHOST=1
make GL
sudo cp lib/libGL* /usr/lib
In .bashrc add this line to the bottom, as pi:
Code:
export LIBGL_FB=1
Restarted the shell
Code:
$ glxgears
Error: couldn't get an RGB, Double-buffered visual
If I understand it correctly, if glxinfo or glxgears does not work it is no use to continue.

Any ideas howto proceed?
/Peter
it-slav is offline   Reply With Quote
Old 05-05-2014, 15:53   #140
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: OpenCPN Runs on Embedded ARM

and you are running this from an xterm?
seandepagnier is offline   Reply With Quote
Old 05-05-2014, 15:55   #141
Registered User

Join Date: Sep 2011
Posts: 208
Re: OpenCPN Runs on Embedded ARM

I don't know if this will work, but after messing with GL drivers in general, it's often useful to restart, at least restart X . When you do, check the X logs in /var/logs for gl related INFO and ERROR messages.
monstads is offline   Reply With Quote
Old 05-05-2014, 22:02   #142
Registered User
 
it-slav's Avatar

Join Date: May 2014
Posts: 46
Re: OpenCPN Runs on Embedded ARM

Quote:
Originally Posted by boat_alexandra View Post
and you are running this from an xterm?
yes

Regards
Peter
it-slav is offline   Reply With Quote
Old 05-05-2014, 22:52   #143
Registered User
 
it-slav's Avatar

Join Date: May 2014
Posts: 46
Re: OpenCPN Runs on Embedded ARM

Quote:
Originally Posted by monstads View Post
I don't know if this will work, but after messing with GL drivers in general, it's often useful to restart, at least restart X . When you do, check the X logs in /var/logs for gl related INFO and ERROR messages.
Thanks for your hint.
Found an error message in /var/log/Xorg.log

Googled and found a hint:
Code:
sudo apt-get install xorg xutils xserver-xorg xterm xserver-xorg-video-fbdev xserver-xorg-video-vesa
Restarted and now glxgears runs!
But only with 19FPS, so my guess there is no hw acceleration.

Regards

Peter
it-slav is offline   Reply With Quote
Old 06-05-2014, 04:05   #144
Registered User

Join Date: Sep 2011
Posts: 208
Re: OpenCPN Runs on Embedded ARM

It might be useful to others to post the error message you got. Installing the above likely wiped out the files you compiled. I'd run through the steps again from above, copy in the new GL libs, restart X and see if that works.
monstads is offline   Reply With Quote
Old 06-05-2014, 10:23   #145
Registered User
 
it-slav's Avatar

Join Date: May 2014
Posts: 46
Re: OpenCPN Runs on Embedded ARM

Quote:
Originally Posted by monstads View Post
It might be useful to others to post the error message you got. Installing the above likely wiped out the files you compiled. I'd run through the steps again from above, copy in the new GL libs, restart X and see if that works.
I did another try
Code:
git clone https://github.com/seandepagnier/glshim.git
cd glshim
mkdir build
cd build
cmake .. -DBCMHOST=1
make GL
sudo cp lib/libGL* /usr/lib
sudo reboot
Same result, glxgear gives approx 19 FPS

/Peter
it-slav is offline   Reply With Quote
Old 06-05-2014, 11:59   #146
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: OpenCPN Runs on Embedded ARM

You should get way over 100 fps from glxgears.

Make sure it is using the libGL you built from glshim, and that must be using the bcmhost drivers which (should already be installed)

Try also:
https://github.com/nfz/RPIGears‎

Which doesn't need xorg.. when this works, then try glxgears.. if success you can finally try opencpn.
seandepagnier is offline   Reply With Quote
Old 06-05-2014, 12:42   #147
Registered User
 
it-slav's Avatar

Join Date: May 2014
Posts: 46
Re: OpenCPN Runs on Embedded ARM

Quote:
Originally Posted by boat_alexandra View Post
You should get way over 100 fps from glxgears.

Make sure it is using the libGL you built from glshim, and that must be using the bcmhost drivers which (should already be installed)

Try also:
https://github.com/nfz/RPIGears‎

Which doesn't need xorg.. when this works, then try glxgears.. if success you can finally try opencpn.
Thanks,

With RPIGears I did get 350FPS, and 60% idle cpu, cool!

I have no idea howto make sure that it is using the libGL I just built, but 350 FPS tells me that it is hw accelerated anyway. I suppose it is good enough.

I'll try to continue with glues and optimized opencpn, will report back after hours of compiling

Regards
Peter
it-slav is offline   Reply With Quote
Old 06-05-2014, 12:58   #148
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 309
Re: OpenCPN Runs on Embedded ARM

Peter,

please, please continue to document exactly the commands you use for us ignorantes... :-)

Which distro for the Pi did you start with? Raspian?

/Jonas
jonasaberg is offline   Reply With Quote
Old 06-05-2014, 13:28   #149
Registered User
 
it-slav's Avatar

Join Date: May 2014
Posts: 46
Re: OpenCPN Runs on Embedded ARM

Quote:
Originally Posted by boat_alexandra View Post
You should get way over 100 fps from glxgears.

Make sure it is using the libGL you built from glshim, and that must be using the bcmhost drivers which (should already be installed)

Try also:
https://github.com/nfz/RPIGears‎

Which doesn't need xorg.. when this works, then try glxgears.. if success you can finally try opencpn.
Now I read it again and realized that you wrote:
--cut--
when this works, then try glxgears..
--endcut--
I tried glxgears, still 19 FPS

Should I continue with glues and opencpn or try to figure out howto get glxgears working?
If glxgears need to work with accelerated hw, I have no idea and google does not help me.

/Peter
it-slav is offline   Reply With Quote
Old 06-05-2014, 13:39   #150
Registered User
 
it-slav's Avatar

Join Date: May 2014
Posts: 46
Re: OpenCPN Runs on Embedded ARM

Quote:
Originally Posted by jonasaberg View Post
Peter,

please, please continue to document exactly the commands you use for us ignorantes... :-)

Which distro for the Pi did you start with? Raspian?

/Jonas
I'll do my very best to document.
So far:
Starting with latest raspbian

As root
Code:
apt-get install xorg xutils xserver-xorg xterm xserver-xorg-video-fbdev xserver-xorg-video-vesa
apt-get install mesa-utils
git clone https://github.com/seandepagnier/glshim.git
cd glshim
mkdir build
cd build
cmake .. -DBCMHOST=1
make GL
sudo cp lib/libGL* /usr/lib
Now, in .bashrc add this line to the bottom, as pi:
Code:
export LIBGL_FB=1
As pi
Code:
cd
git clone https://github.com/nfz/RPIGears
cd RPIGears/
make
RPIGears.bin
Get 350 FPS with RPIGears.bin
Get 19 FPS with glxgears

/Peter
it-slav is offline   Reply With Quote
Reply

Tags
opencpn


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open CPN and Google Earth bgrimwade OpenCPN 19 09-12-2011 15:32
OpenCPN Version 2.5 Release bdbcat OpenCPN 86 02-09-2011 18:14
OpenCPN Stops Running BobLarkin OpenCPN 2 30-08-2011 23:38
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 04:31

Advertise Here


All times are GMT -7. The time now is 04:09.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.