node-openvg-canvas icon indicating copy to clipboard operation
node-openvg-canvas copied to clipboard

Raspberry Pi 2 bugs

Open sol-prog opened this issue 9 years ago • 12 comments

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 ?

sol-prog avatar Apr 03 '15 06:04 sol-prog

+1

DarylRodrigo avatar Jun 23 '15 14:06 DarylRodrigo

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]$

T4d3o avatar Jul 04 '15 11:07 T4d3o

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.

sol-prog avatar Jul 04 '15 15:07 sol-prog

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.

T4d3o avatar Jul 04 '15 16:07 T4d3o

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.

eendeego avatar Jul 05 '15 20:07 eendeego

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.

T4d3o avatar Jul 05 '15 21:07 T4d3o

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.

eendeego avatar Aug 15 '15 14:08 eendeego

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?

kevingarman avatar Sep 09 '15 13:09 kevingarman

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 avatar May 19 '16 04:05 dudewheresmycode

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

fu-raz avatar May 26 '16 18:05 fu-raz

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

dudewheresmycode avatar May 27 '16 19:05 dudewheresmycode

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

fu-raz avatar May 28 '16 08:05 fu-raz