Hi community,
this is my first thread here!
My hardware is a PI zero W + bullseye with a ugreen DABBoard (I2S) and blurtooth spekers.
The installation I use works great and using CLI commands radio is playing from the speakers.
Also setting the DABBoard active and tuning to some channel is fine using "exec"-node.
The issue comes with the command for pulseaudio I'd like to send through another "exec"-node:
arecord -D sysdefault:CARD=dabboard -c 2 -r 48000 -f S16_LE | paplay
This is the error message:
Verbindungsfehler: Verbindung verweigert
pa_context_new() fehlgeschlagen: Verbindung verweigert
Basically: connection refused...
I tried with Nodered 3 and 4, Bullseye and Bookworm all bring the same error message.
I already tried a lot of suggestions but the correct was not on the list yet
Hope to find support here, thanks.
For my purpose NR shall automatically start at boot. So I used:
...
sudo systemctl enable nodered.service
...
But if I start NR as user 'pi' there is no issue with running the exec-node.
I suspect it has to do with certain rights (root vs user)?!
It should not be running node-red as root when you run it as a service. You can check by running whoami in an exec node. The difference is probably to do with the fact that when you run node red directly from the command line you are already running in a login shell, with all the environment etc that goes with that.
Googling suggests this might work arecord -D sysdefault:CARD=dabboard -c 2 -r 48000 -f S16_LE | XDG_RUNTIME_DIR=/run/user/1000 paplay
but I won't be surprised if it is not that. It can be extremely difficult to solve this sort of problem.
Wow, very impressed!
whoami gave "pi"
Yor suggestion to add "XDG_..." was direct hit!
I tried this before but not with the uid but with username 'pi' which was not ideal ;-).
Solved, great, thank you very much!