node-openvg-canvas
node-openvg-canvas copied to clipboard
Raspberry Pi 2 bugs
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 ?
+1
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]$
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.
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.
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.
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.
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.
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?
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.
@dudewheresmycode Any luck on making this work on a Pi 2?
@fu-raz PR created. Let me know if this works for the others experiencing the issue. Fork available at dudewheresmycode/node-openvg-canvas
@dudewheresmycode You sir are my hero. Yes, it is working!