core icon indicating copy to clipboard operation
core copied to clipboard

FFPlay Returning Exit Code 127

Open tomd-tc opened this issue 2 years ago • 4 comments

The problem

We have a door sensor that triggers an MP3 to be played via the analogue output port on system. Since upgrading to 2024.2.1, we have noticed in our logs this exit code (and obviously no sound coming out). Downgrading to 2024.1.5 appears to resolve the issue.

What version of Home Assistant Core has the issue?

core-2024-2-1

What was the last working version of Home Assistant Core?

core-2024-1-5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

shell_command

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

shell_command:
   door_open: 'ffplay -volume 5 -nodisp -vn /media/Door_Open.mp3'
   gate_open: 'ffplay -volume 5 -nodisp -vn /media/Ping.wav'
   flood_detected: 'ffplay -volume 25 -nodisp -vn /media/Water_Dripping.mp3'

Anything in the logs that might be useful for us?

2024-02-10 11:08:28.430 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: `ffplay -volume 5 -nodisp -vn /media/Door_Open.mp3`, return code: 127

Additional information

No response

tomd-tc avatar Feb 10 '24 17:02 tomd-tc

I have the same problem. I've changed the sound playback to VLC-Telnet for now (thankfully I don't have many automations), but it would be nice to get the shell_command functionality back.

CarlesElias avatar Feb 12 '24 10:02 CarlesElias

https://stackoverflow.com/questions/28804107/nodejs-dokku-docker-ffmpeg-exited-with-code-127

joostlek avatar Feb 12 '24 10:02 joostlek

I have the same problem, and I'm very leery about reverting back to a previous core version as I've made several significant and important changes recently, which I cannot risk being broken.

I'll attach relevant bits of my configuration.yaml,..
configuration.yaml.txt

and errors in logs,.. ffplay errors.txt

I tried searching for ffplay's path using a webterminal, but I cannot locate it anywhere. This however may just be because I'm not a haos command line expert. It was months ago when I set this all up, and I think ffplay is something that gets installed with the ffmpeg integration. I thought I could run it from the command line back then, but I can't make that work now either. My suspicion is not a problem with shell commands, but that ffmpeg and ffplay have gone missing.

I do hope we can fix this. Custom audio notifications are so nice !

lornemelin avatar Feb 14 '24 17:02 lornemelin

I have the same problem. I've changed the sound playback to VLC-Telnet for now (thankfully I don't have many automations), but it would be nice to get the shell_command functionality back.

shell_command itself is fine the issue is ffmpeg & ffplay command are somehow missing in core v2024.2.1

arnoldxt avatar Feb 17 '24 00:02 arnoldxt

Having the same problem! Since the update around Feb 14, all my audio chimes have stopped, and checking my logs I see FileNotFoundError: [Errno 2] No such file or directory: 'ffplay'

Hope this can be resolved soon, as this is a core element in my HA setup, and I have no idea how to install a new audio player to squirt .wav files out my RPi's audio jack. I've searched a lot and there seem to be no other options on the HASS environment.

rossgk avatar Feb 17 '24 15:02 rossgk

I suspect the dev team may not be motivated to fix this ffplay issue, as I’m not sure ffplay is even sanctioned at all. So I’ve decided to re-structure my audio messaging to use HA components that appear to be a little more mainstream.

So I’ve moved to using the “VLC” add-on, paired with the “VLC media player via Telnet” integration. Install them in that order for easiest install. Be careful not to install the wrong integration as there are two available. To follow what I did, use the integration “VLC media player via telnet”, NOT the one that just says “VLC Media Player.”

This VLC setup seems even easier to use than shell commands. With it, you can play and select your custom audio messages right in the visual editors without touching yaml.

And now I can move forward upgrading again, and use the new features in 2024.2.4 !

FYI: I’m running HAOS, on a virtual-box VM, hosted on Windows 10-pro, on a refurbished Dell Optiplex mini PC, with i5-6500 CPU, 24GB ram and 256Gib ssd. Same hardware also hosts a second VM for Zoneminder, and connects to my living room TV as my a daily driver PC and for watching netflix youtube etc. It takes a while to boot/load everything, but once running it runs all of this like a champ.

lornemelin avatar Feb 27 '24 18:02 lornemelin

It's very frustrating. Please put the binary ffplay back to the docker image.

DarkPark avatar Mar 03 '24 15:03 DarkPark

I agree with that, my automations play on my speakers via 3.5mm audio jack, i prefer to play like that because is more faster and doesn't need cloud like alexa media player

hiagocosta avatar Mar 20 '24 21:03 hiagocosta

I can confirm that this:

shell_command: play_bark: ffplay -loglevel quiet -nodisp -vn -autoexit /media/bark.mp3

was working in versions 2024.1.5 and 2024.1.6

Beginning in 2024.2.0b0 I receive this error:

Error running command: ffplay -loglevel quiet -nodisp -vn -autoexit /media/bark.mp3, return code: 127

The issue persists in the current version of 2024.3.1.

Between 2024.1.6 and 2024.2.0b0 I found these commits related to ffmpeg: #106710 #108026 #108092

michaelvanham avatar Mar 20 '24 21:03 michaelvanham

do we have some update about this question?

hiagocosta avatar May 06 '24 19:05 hiagocosta

fyi: I just switched to use VLC add on and side stepped the problem. My audio routes to my 3.5mm jack using VLC add on, just like it did with ffplay. (see my Feb 27 post).

lornemelin avatar May 07 '24 16:05 lornemelin

it works! thank you!

Em ter., 7 de mai. de 2024 às 13:18, lornemelin @.***> escreveu:

fyi: I just switched to use VLC add on and side stepped the problem. My audio routes to my 3.5mm jack using VLC add on, just like it did with ffplay. (see my Feb 27 post).

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/110210#issuecomment-2098837273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFIQOOKAGDUJKCLKQDADU4TZBD5HFAVCNFSM6AAAAABDC3KJFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYHAZTOMRXGM . You are receiving this because you commented.Message ID: @.***>

hiagocosta avatar May 10 '24 03:05 hiagocosta

fyi: I just switched to use VLC add on and side stepped the problem. My audio routes to my 3.5mm jack using VLC add on, just like it did with ffplay. (see my Feb 27 post).

the VLC workaround is broken on HA OS 12.3 the sound output is distorted just rollbacked to HA OS 12.2 and working fine again

arnoldxt avatar May 16 '24 15:05 arnoldxt

I need ffmpeg for a custom integration. Can anyone point to the exact commit that broke it? I am building a docker image from the latest code using the Dockerfile. And I have made so many changes to my custom integration keeping in mind the latest code changes. I can't just revert to an older version. This is so frustrating. Please bring back ffmpeg!

tarangill avatar Jul 15 '24 21:07 tarangill

I need ffmpeg for a custom integration. Can anyone point to the exact commit that broke it? I am building a docker image from the latest code using the Dockerfile. And I have made so many changes to my custom integration keeping in mind the latest code changes. I can't just revert to an older version. This is so frustrating. Please bring back ffmpeg!

Wow! Six moths later and they still haven't fixed what they broke.

I'm running Core 2024.1.6, so the break must have occurred in the next release package.

tomd-tc avatar Jul 16 '24 14:07 tomd-tc

my workaround:

install add-on "ssh console", start it. run "apk add ffplay" and test "ffplay test.mp3" with success.

recognize, that "shell_command.play_test" (configured with "ffplay test.mp3") does not work with error "no such file or directory ffplay"

add "shell_command.install_ffplay" with "apk add ffplay" and run it once via script/button.

run "shell_command.play_test" with success. (yay)

maybe you have to click on that install button after an hass update.


Core 2024.8.1 Supervisor 2024.08.0 Operating System 13.0 Frontend 20240809.0


my question is: why? (i have just an idea)

torce10 avatar Aug 15 '24 11:08 torce10