Hi
I've raised this issue before and Colin very kindly found a resolution. I've now completely rebuilt my PI4 around "Bookworm" and problem has arisen again. Using ssh to the PI if I enter:
mpg123 /home/pi/recordings/testFile.mp3 ... it plays without error.
If I run same command in an node red exec I get this:
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
I've tried the old solution "DISPLAY=:1 mpg123 /home/pi/recordings/testFile.mp3" and it still fails.
Similar to before if I node-red-stop and then node-red, then it works.
Further to this:
node-red-contrib-play-audio-file also won't play files unless I stop node red and start it again using "node-red" instead of "node-red-start"
I don't know what is the difference between the 2 methods of starting node red. Is it possible to auto start it in the mode "node-red"
Open a CLI to the Pi running NR and then run this command: cat /lib/systemd/system/nodered.service
look at the first couple lines and find the [Service] section. Is the user named there the same user name you are using when you use 'node-red' to start?
If they are different run groups xx (replacing 'xx' with the user id) and compare the output of the two.
Are there any differences? (like one has sudo and the other doesn't)
There are multiple differences. For a start, when you run node-red the command is associated with a display. The environment variables (PATH etc) are also going to be different. Didn't we go over all this the first time round?
Colin
Yes I have referred back to our previous posts. On that occasion DISPLAY=:0 sorted it.
Yes I have tried DISPLAY=:1 to no avail.
It seems strange (to me) that the well tested "node-red-contrib-play-audio-file" also won't play. Am I the only one having this issue? This is a completely fresh Bookworm os.
Part of the issue may be that audio and the display system changed with bookworm. Prior to this it used ASLA and X1, with Bookworm it uses PulseAudio an Wayland.
Probably explains why I cannot seem to find anything that will play mp3 files from the Bookworm PI.
I've spent a lot of time on this so probably best to go back to Bullseye for now.
Thanks for your help.
Actually before I give up I would be very appreciative of anyone who can tell me how to play locally stored mp3 files out of the headphone socket via Node red Bookworm.
Hi
Bookworm was released 7 months ago and I, like lots of others was keen to not let my install get stale. I would be surprised if I am the only one trying to play audio files from my PI. Is it the case that most people just stick with their older working OS when it is stable. Was I wrong to upgrade?
thanks.