Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi 2 bugs #26

Open
sol-prog opened this issue Apr 3, 2015 · 12 comments
Open

Raspberry Pi 2 bugs #26

sol-prog opened this issue Apr 3, 2015 · 12 comments

Comments

@sol-prog
Copy link

sol-prog commented Apr 3, 2015

Hello,

currently we can use 2 versions of node.js for Raspberry Pi 2 v0.12 and v0.10. openvg-canvas can't be built with v0.12 probably because of API changes in the new V8 version. What I find interesting is that v0.10 of node.js can build openvg-canvas but none of the examples will run on Raspberry Pi 2.

I also have a Raspberry Pi 1 B+, on this device node 0.10 can build openvg-canvas and all examples seems to work properly.

Any idea how to make openvg-canvas usable on Raspberry Pi 2 ?

@DarylRodrigo
Copy link

+1

@T4d3o
Copy link

T4d3o commented Jul 4, 2015

What error message?
I'm trying to make it work in raspberry 2, but I get this error:
[test@alarmpi node-openvg-canvas]$ examples/swissClock.js
Loading typeface file: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
/home/test/node-openvg-canvas/node_modules/openvg/bin/node-openvg: line 14: 969 Segmentation fault (core dumped) LD_PRELOAD=$MODULE_DIR/build/Release/init-egl.node node "$@"
[test@alarmpi node-openvg-canvas]$

@sol-prog
Copy link
Author

sol-prog commented Jul 4, 2015

Same error. I've sent the author an email with a complete bug report in April and he advised me to open an issue on Github. He is probably busy with other projects.

@T4d3o
Copy link

T4d3o commented Jul 4, 2015

I think that I found the bug, can you try to change DejaVuSans to another font? you can change in lib/text/text.js
If i change 'sans-serif' : '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf',
to
'sans-serif' : '/usr/share/fonts/TTF/Vera.ttf'
Runs OK.

@eendeego
Copy link
Owner

eendeego commented Jul 5, 2015

Sorry, I really need to get more time for this project.

Is it possible that the DejaVuSans font is now installed on a different path ? It was chosen because it was part of the standard install on Raspbian releases.

@T4d3o
Copy link

T4d3o commented Jul 5, 2015

No. The load process starts Ok, with some fonts load Ok,
Other fonts generate a seg fault in this call FT_Get_Char_Index()
Other fonts generate a error 0x14 in this call FT_Load_Glyph(). 0x14 in "fterrdef.h" -> FT_ERRORDEF_(Invalid_Outline, 0x14, "invalid outline" )

If you want mode info plz tell me, I have time and desire to help, but I lack skill as a programmer.

@eendeego
Copy link
Owner

Had some time to go through this. Seems like a problem with libfreetype that is specific to the Pi 2.

I'll get back as soon as I have more news.

OT: Most probably next supported node version will be 1.0 / iojs 3.0.

@kevingarman
Copy link

If I run an example (textAlign for instance), I get the SegFault as described above. If I run the same example in debug mode (node debug ...), everything works fine.

Any idea why this might be?

@dudewheresmycode
Copy link

dudewheresmycode commented May 19, 2016

So with a little digging I'm thinking the issue actually speed of execution of the glyph loading functions in freetype. The Raspberry Pi 2 is simply put, much faster. I accidentally got it to work, albeit inconsistently, by actually slowing down the function using a console.log in the for() loop of lib/text/loading.js#L118.

Ultimately I rewrote the for loop using the async library's forEachOf and it's working great. I'll try and fork and post a pull request soon.

@fu-raz
Copy link

fu-raz commented May 26, 2016

@dudewheresmycode Any luck on making this work on a Pi 2?

@dudewheresmycode
Copy link

dudewheresmycode commented May 27, 2016

@fu-raz PR created. Let me know if this works for the others experiencing the issue. Fork available at dudewheresmycode/node-openvg-canvas

@fu-raz
Copy link

fu-raz commented May 28, 2016

@dudewheresmycode You sir are my hero. Yes, it is working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants