TooTallNate / node-lame

Node.js native bindings to libmp3lame & libmpg123
MIT License
567 stars 113 forks source link

Performance on Raspberry Pi #30

Open stephen opened 10 years ago

stephen commented 10 years ago

Am trying to use node-lame to encode on the fly with a raspberry pi, but the performance is pretty bad. It looks to be because libmpg123 is compiled with arm_nofpu optimization, and that generic_fpu could be a better option. (see this).

I made an attempt to get gyp to compile with the generic_fpu flag (https://gist.github.com/stephen/8076a9a51071dc235e30), but I'm not familiar enough with gyp and it fails to compile (Fails to compile because f_32 and f_real aren't defined.. I think I might be missing the config.h for the platform?).

Happy to help patch, but would need some direction on what's going wrong.

Current attempt at bindings file: https://gist.github.com/stephen/8076a9a51071dc235e30 (Right now I'm overriding the arm target - how would I set up a separate target for raspberry pi?)

stephen commented 10 years ago

Got it compiling by making a few changes to the config.h, but doesn't seem like there's a noticeable performance improvement, unfortunately.. Perhaps I've configured something wrong? https://github.com/stephen/node-lame/compare/naive_rpi

RobertBiehl commented 10 years ago

Thanks for trying it out. Can your run a benchmark to be sure that something changed?

There are reports of reaching a 2x playback speed for encoding with lame (not sure if they can be trusted, though). https://scruss.com/blog/2013/12/13/faster-mp3-options-for-raspberry-pi/

So if everything goes well there should be 50% cpu left for other tasks.