home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.15k stars 29.82k forks source link

FFPlay Returning Exit Code 127 #110210

Open tomd-tc opened 7 months ago

tomd-tc commented 7 months ago

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

CarlesElias commented 7 months ago

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.

joostlek commented 7 months ago

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

lornemelin commented 7 months ago

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 !

arnoldxt commented 7 months ago

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

rossgk commented 7 months ago

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.

lornemelin commented 6 months ago

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.

DarkPark commented 6 months ago

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

hiagocosta commented 5 months ago

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

michaelvanham commented 5 months ago

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

hiagocosta commented 4 months ago

do we have some update about this question?

lornemelin commented 4 months ago

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).

hiagocosta commented 4 months ago

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: @.***>

arnoldxt commented 4 months ago

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

tarangill commented 2 months ago

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!

tomd-tc commented 2 months ago

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.

torce10 commented 1 month ago

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)

arnoldxt commented 2 weeks ago

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)

great workaround solution! I can finally use ffplay to play audio again! Many thanks

torce10 commented 2 weeks ago

Very nice! I'm glad it's helping you too.

I noticed that ffplay is gone again after an update. So I created an automation that executes the script after startup.