Odd `exec` node result using `amixer -v'

Node-RED running on a Pi Zero W v1.1
Raspbian GNU/Linux 11 (bullseye) desktop version

Node-RED version: v2.2.2
Node.js version: v14.19.1
accessing NR from Mac Mini Safari

Using the exec node and sending the command 'amixer -v' the version comes back, BUT the exec node shows an error and says the command failed!

Here is the flow:
[{"disabled":false,"env":[],"id":"58ad38887591e1b1","info":"","label":"Flow 3","type":"tab"},{"active":true,"complete":"true","console":false,"id":"38409c9414d4fb0b","name":"stdout","statusType":"auto","statusVal":"","targetType":"full","tosidebar":true,"tostatus":false,"type":"debug","wires":[],"x":490,"y":80,"z":"58ad38887591e1b1"},{"active":true,"complete":"true","console":false,"id":"de852fbd07407b7a","name":"stderr","statusType":"auto","statusVal":"","targetType":"full","tosidebar":true,"tostatus":false,"type":"debug","wires":[],"x":490,"y":120,"z":"58ad38887591e1b1"},{"active":true,"complete":"true","console":false,"id":"42faac21ce0190b3","name":"return code","statusType":"auto","statusVal":"","targetType":"full","tosidebar":true,"tostatus":false,"type":"debug","wires":[],"x":510,"y":160,"z":"58ad38887591e1b1"},{"crontab":"","id":"84f238ce5b65227d","name":"","once":false,"onceDelay":0.1,"payload":"","payloadType":"date","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","topic":"","type":"inject","wires":[["17c3fba6aef9ee4f"]],"x":180,"y":120,"z":"58ad38887591e1b1"},{"addpay":"","append":"-v","command":"amixer ","id":"17c3fba6aef9ee4f","name":"","oldrc":false,"timer":"","type":"exec","useSpawn":"false","winHide":false,"wires":[["38409c9414d4fb0b"],["de852fbd07407b7a"],["42faac21ce0190b3"]],"x":330,"y":120,"z":"58ad38887591e1b1"}]```

Strangely, amixer -v does indeed give an exit value of 1 - an error indication.
amixer invalidparameter gives an error message and an exit value of 0 !

This might (or might not) have some relevance

@cymplecy Simon, It's not a path problem because it actually returns the results. But as @jbudd pointed out, it looks like amixer bug when querying the version as both amixer -v and amixer --version rerturn an error (1) but also return the results.

Off to post a bug report on amixer!

1 Like

If anyone wants to follow this, the GitHub issue is here:

1 Like

To reproduce on commandline (probably more useful for the reported issue):

pi@pi:~ $ amixer -v
amixer version 1.1.8
pi@pi:~ $ echo $?
1

@bakman2 thanks for that, I’ll add it to the GitHub issue!

@jbudd @cymplecy @bakman2
Just to let you all know that this was fixed in v1.2.5 but it's part of the asla_utils package and that will have to be updated.

1 Like