You are not logged in.

#1 2014-10-09 21:33:16

replabrobin
Member
Registered: 2010-05-06
Posts: 240

[SOLVED] espeak won't work in crontab

Espeak works fine from my command line.

But I used to use espeak in my crontab to shout at me to take my pills etc etc. However, recently espeak has been generating errors when run by cronie

Subject: Cron <robin@bunyip> sudo espeak 'robin take drugs'
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
Precedence: bulk
X-Cron-Env: <LANG=en_GB.utf8>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/robin>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=robin>
X-Cron-Env: <USER=robin>
Date: Thu,  9 Oct 2014 22:20:02 +0100 (BST)
Status: R

ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:947:(find_matching_chmap) Found no matching channel map
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection r
efused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection r
efused

ALSA lib pcm_direct.c:1703:(snd1_pcm_direct_parse_open_conf) slave is not define
d

what do I need to do to allow cronie to shout at me?

Edit: I added the sudo in the contab to try and eliminate permissions, but the same kind of errors are present for espeak hello as for sudo espeak hello.
Edit: Seems that cronie can use espeak when vlc is not running.

Last edited by replabrobin (2014-10-11 10:31:40)

Offline

#2 2014-10-11 10:30:56

replabrobin
Member
Registered: 2010-05-06
Posts: 240

Re: [SOLVED] espeak won't work in crontab

I managed to make this problem go away by removing pulseaudio and making VLC etc use ALSA directly. I'm not sure why pulseaudio + vlc now makes crontab espeak fail. I tried to get VLC to just use ALSA, but it seems pulseaudio runs irrespective and perhaps that's the issue. The most recent changes were to vlc on Sep 16/24 so perhaps VLC changed.

Offline

#3 2014-10-11 10:33:30

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [SOLVED] espeak won't work in crontab

Is your user in the 'audio' group? Maybe vlc is somehow claiming the entire device to prevent sounds from distracting you from a movie? FWIW; it works fine here; even with vlc running

Offline

#4 2014-10-11 15:33:20

replabrobin
Member
Registered: 2010-05-06
Posts: 240

Re: [SOLVED] espeak won't work in crontab

Spider.007 wrote:

Is your user in the 'audio' group? Maybe vlc is somehow claiming the entire device to prevent sounds from distracting you from a movie? FWIW; it works fine here; even with vlc running

Yes the user is in the audio group. I assume that vlc is somehow grabbing the device, but even when I changed to use alsa directly in the VLC audio settings this problem persisted.

Offline

Board footer

Powered by FluxBB