Best solution for raspberry pi audio output from node-red?

1,117 views
Skip to first unread message

Matt

unread,
Sep 4, 2016, 9:40:41 PM9/4/16
to Node-RED
Currently I'm using an exec node to play an mp3 file using omxplayer when my doorbell is pressed, but it is slow and unreliable.
There is a noticeable delay before playback, even when running omxplayer from the commandline, which is frustrating for the user experience.
I also find that the exec node stops being able to successfully execute omxplayer after some time. Today I found the doorbell was no longer responding, and the debug message I had in node-red said "ENOMEM". It also seems that omxplayer leaves a bunch of processes running when I check using ps.

Does anyone have a better solution? Or some tips on improving omxplayer performance?

sebasti...@gmail.com

unread,
Sep 5, 2016, 11:06:14 AM9/5/16
to Node-RED
Maybe try another player like mpg321 ?

check memory consumption of processes with 
sudo top -n 5 -o '+%MEM'

Greg Gorman

unread,
Sep 6, 2016, 8:37:11 AM9/6/16
to Node-RED
I use 'aplay' through an exec node and it seems to run pretty quickly. Here's the flow:

----
[{"id":"69b9bfed.8fafc8","type":"file","z":"85c5838.a7ff2","name":"Playme","filename":"/tmp/playme.wav","appendNewline":false,"createDir":false,"overwriteFile":"true","x":757,"y":180,"wires":[]},{"id":"94f721ba.a9f7f","type":"exec","z":"85c5838.a7ff2","command":"aplay","addpay":false,"append":"/tmp/playme.wav","useSpawn":"","name":"aplay","x":741,"y":239,"wires":[[],[],[]]},{"id":"caa5b911.055ba","type":"function","z":"85c5838.a7ff2","name":"Decode Speech","func":"msg.payload = msg.speech;\nreturn msg;","outputs":1,"noerr":0,"x":587,"y":188.5,"wires":[["69b9bfed.8fafc8","94f721ba.a9f7f","6eb44d4.d1c07b4"]]}]
----
Reply all
Reply to author
Forward
0 new messages