2

If I give a command like:

$ mplayer ~/sounds/mysound.wav

then it works and plays a sound. If I sleep before playing the sound, then it also works:

$ sleep 5s && mplayer ~/sounds/mysound.wav

However, if I try to sleep and make it a background process then it gives a cannot-connect-to-socket error:

$ sleep 5s && mplayer ~/sounds/mysound.wav &

I tried setting lirc=no in the mplayer config and that just caused the background process to hang. How can I get this to work?

1 Answer 1

2

I eventually figured this out. Apparently mplayer does a bunch of interface related things that cause the process to hang waiting for input. This can be curtailed with the -noconsolecontrols switch:

$ sleep 5s && mplayer -noconsolecontrols ~/sounds/mysound.wav &

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.