Hello all,
I have updated my Raspi OS from Buster to Bookworm with a fresh install, and with this update, a feature in node-red has died.
The feature is quite simple. I click a button on my Node-Red Dashboard, which then triggers to play a live .mp3 file. The .mp3 file is run via mpg123 (or mplayer or mpv, same issue!).
The test flow:
[
{
"id": "ca64f76d9cc7d5ae",
"type": "ui_button",
"z": "357d40f1.45eaa",
"name": "",
"group": "fcacb831.881f68",
"order": 8,
"width": 0,
"height": 0,
"passthru": false,
"label": "Test Button 4 Audio",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 890,
"y": 660,
"wires": [
[
"8a0525c5b378d6ce"
]
]
},
{
"id": "8a0525c5b378d6ce",
"type": "exec",
"z": "357d40f1.45eaa",
"command": "mpg123 http://wdr-1live-diggi.icecast.wdr.de/wdr/1live/diggi/mp3/128/stream.mp3",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "Play Rladio Test",
"x": 1180,
"y": 660,
"wires": [
[],
[],
[
"c1285ce033814488"
]
]
},
{
"id": "c1285ce033814488",
"type": "debug",
"z": "357d40f1.45eaa",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1420,
"y": 660,
"wires": []
},
{
"id": "fcacb831.881f68",
"type": "ui_group",
"name": "Radio",
"tab": "4e926670.4a0028",
"order": 1,
"disp": false,
"width": "30",
"collapse": false,
"className": ""
},
{
"id": "4e926670.4a0028",
"type": "ui_tab",
"name": "Home",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]
Visually:
The debug error:
Now i did already some debugging and I found the issue!
Even tho the command i entered is mpg123 http://wdr-1live-diggi.icecast.wdr.de/wdr/1live/diggi/mp3/128/stream.mp3
, Node-Red EXEC Node is trying to run it as "sudo" aka root?! I am guessing this because when i run the same command with sudo on my Terminal, i get the same error:
pi@raspberrypi:~/.node-red $ sudo mpg123 http://wdr-1live-diggi.icecast.wdr.de/wdr/1live/diggi/mp3/128/stream.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.31.2; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Segmentation fault
So it looks like, Node-Red is trying to run this as sudo, which is breaking this player feature. the same case is with all mp3 players like mpv, mplayer, vlc, mpg123. So this isnt a player issue, than rather a node-red issue.
As info, im running my Node-Red as the pi user, and not ROOT user. So why is root the default case?!
node-red version: 4.0.2
npm version: 10.8.2
Thanks!