Two sound files at the same time - problem with crontab

Hi all, :wave:

in the meantime I tried to get some help form the folks at MPlayer-users mailing-list.

I thought I´d share some of their findings here, in case anyone is interested. :wink:

Alexander Strasser wrote:

You can’t easily just share one sound hardware with many users. So
there is software on top that allows you to do this. E.g pulse audio
is one such solution.

[…] I infer, that when all the processes use pulse audio
for output it works for you. When your mplayer is started by cron,
it can’t connect to pulse audio for some reason. Then it tries to use
alsa which fails because it can’t get the audio device for itself.

and Roger Heflin wrote:

To run audio from another session (ie cron or an ssh login) you need to set
all sorts of stuff for pulseaudio to work even if it is the same user.
Cron has none of that environment set. There may be something else in
addition to the environment, or it may simply be just environment vars.
[…]
Without that it does not know where the sound goes, nor where the video
goes if something has video.

You might be better off making a shell script to do the same thing and
starting it up from the interactive session.

So it seems things are a bit more complex than I expected them to be. :blush:

Well, I´ll try investigating a bit further but I doubt I will be successful in the end.

Many greetings.
Rosika :slightly_smiling_face: