[MPlayer-users] two sound files at the same time - problem with crontab (mplayer involved)

Roger Heflin rogerheflin at gmail.com
Sun May 16 00:22:46 EEST 2021


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.

I cannot tell you what you have to set as I have not wanted it to work bad
enough to sort it out.

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.



On Sat, May 15, 2021 at 11:21 AM Christian <abelschreck3 at freenet.de> wrote:

> Hi Alexander,
>
>
> thanks a lot for your answer.
>
> Good idea.
>
> *_1.) mplayer messages - when _**_not_*_*working - i.e. issued by cron:*
>
> _
>
> MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team
> do_connect: could not connect to socket
> connect: No such file or directory
> Failed to open LIRC support. You will not be able to use your remote
> control.
> Terminal type `unknown' is not defined.
>
> Playing
>
> /media/rosika/f14a27c2-0b49-4607-94ea-2e56bbf76fe1/DATEN-PARTITION/Dokumente/Pausenzeichen/Big_Ben_chimes/Big_Ben_three_quarters_of_the_hour.
> libavformat version 58.29.100 (external)
> Audio only file format detected.
> Load subtitles in
>
> /media/rosika/f14a27c2-0b49-4607-94ea-2e56bbf76fe1/DATEN-PARTITION/Dokumente/Pausenzeichen/Big_Ben_chimes/
> ==========================================================================
> Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
> AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
> Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I,
> II, III)
> ==========================================================================
> AO: [pulse] Init failed: Connection refused
> Failed to initialize audio driver 'pulse'
> [AO_ALSA] alsa-lib: pcm_hw.c:1715:(snd_pcm_hw_open) open
> '/dev/snd/pcmC0D0p' failed (-16): Device or resource busy
> [AO_ALSA] alsa-lib: pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open
> slave
> [AO_ALSA] Playback open error: Device or resource busy
> Failed to initialize audio driver 'alsa'
> [AO SDL] Samplerate: 44100Hz Channels: Stereo Format s16le
> [AO SDL] using aalib audio driver.
> [AO SDL] Unable to open audio: No available audio device
> Failed to initialize audio driver 'sdl:aalib'
> Could not open/initialize audio device -> no sound.
> Audio: no sound
> Video: no video
>
>
> *_2.) mplayer messages - when working - i.e. manually issued from
> command line:
>
>
> _*MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team
> do_connect: could not connect to socket
> connect: No such file or directory
> Failed to open LIRC support. You will not be able to use your remote
> control.
>
> Playing
>
> /media/rosika/f14a27c2-0b49-4607-94ea-2e56bbf76fe1/DATEN-PARTITION/Dokumente/Pausenzeichen/Big_Ben_chimes/Big_Ben_three_quarters_of_the_hour.
> libavformat version 58.29.100 (external)
> Audio only file format detected.
> Load subtitles in
>
> /media/rosika/f14a27c2-0b49-4607-94ea-2e56bbf76fe1/DATEN-PARTITION/Dokumente/Pausenzeichen/Big_Ben_chimes/
> ==========================================================================
> Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
> AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
> Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I,
> II, III)
> ==========================================================================
> AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
> Video: no video
> Starting playback...
> A:  22.3 (22.3) of 22.0 (22.0)  0.2% *_
>
> _*Exiting... (End of file)*_
>
>
> _*Yet I´m not sure what to make of it.
>
> Thanks Alexander.
>
> Many greetings.
> Rosika
> *_
>
> _*
> Am 15.05.21 um 18:03 schrieb Alexander Strasser:
> >
> > You could maybe compare the output messages of mplayer when it
> > works in the console against the ones that are produced when it
> > is run by cron.
> >
> >
> >    Alexander
>
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
>


More information about the MPlayer-users mailing list