Public bug reported:

Arrrrrrggggggg.... This is driving me crazzzzzyyyy....

Not sure this is the right place, but I can't find why pa refuses to
play my sound!!!!

I'm trying to play a sound every hour, so I added the following line to my 
/etc/crontab:
0 */1   * * *   user /home/user/Softs/alarm.sh

My alarm.sh script is:
#!/usr/bin/env bash
export DISPLAY=:0
export XAUTHORITY=/home/user/.Xauthority
/usr/bin/mplayer -ao pulse -vo null /home/user/.sounds/alarm_clock_short.ogg

When I redirect the output of mplayer, I get:
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'

I don't understand why, since cron is supposed to run the command as
"user".

I've tried millions of things:
$ env -i
$ /home/user/Softs/alarm.sh
=> works
$ env -i
$ sh
$ /home/user/Softs/alarm.sh
=> works
$ env -i
$ . /home/user/Softs/alarm.sh
=> works
$ env -i
$ sh
$ . /home/user/Softs/alarm.sh
=> works
$ env -i
$ sh
$ su user -c '/usr/bin/paplay /home/user/.sounds/alarm_clock_short.ogg
=> asks for passwd, but works

I've also changed the last line of my alarm.sh script with:
/usr/bin/paplay /home/user/.sounds/alarm_clock_short.ogg
or:
su gmuller -c '/usr/bin/paplay /home/user/.sounds/alarm_clock_short.ogg'

I get the (same) error:
Connection failure: Connection refused
pa_context_connect() failed: Connection refused

Is the problem with my knowledge of pulseaudio, with pulseaudio's right
management, or am I just crazily stupid?

** Affects: pulseaudio (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1575118

Title:
  "AO: [pulse] Init failed: Connection refused" with mplayer from cron

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1575118/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to