mplayer no sound from script

Bug #1654532 reported by G.M.
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mplayer (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi,

I cannot manage to get mplayer output sound when running inside a script.

I have a script:
-rwxr-xr-x ~/Softs/alarm.sh

Which contains:
#!/bin/bash
mplayer ~/.sounds/alarm.ogg -loop 3

1. If I run the script with:
. ~/Softs/alarm.sh
I can hear the sound.

2. If I run the script with:
~/Softs/alarm.sh
I hear nothing but the output of mplyer is normal, the same as when it play a sound correctly.

I've read millions of forums, tried millions of options of mplayer (DISPLAY=:0.0 mplayer, -vo null, -ao pulse, -volume, -af, -softvol/-softvolmax, -really-quiet...), still no luck

I've tried with/without the begining shebang in the script, no more luck.

I've also tried other players, like aplayer (same problem) and play (no problem).

Does anyone have an idea if this is a bug and/or where does this difference in behaviour comes from???

Revision history for this message
G.M. (sexxxenator) wrote :

Strangely, if I use "play" in my script rather than mplayer and start it with:
~/Softs/alarm.sh &
Then I have no sound until I type fg...
There MUST be some system-wide audio thing I do not understand.

Revision history for this message
G.M. (sexxxenator) wrote :

Still more strangely, if I use "play" in my script, which makes it work, but then call the script from cron, it does not work again.
[BTW, mplayer never works in cron since it does not work in a script]

description: updated
Revision history for this message
G.M. (sexxxenator) wrote :

I'm now wondering if that could be a bug in pulse, since the output of mplayer shows that it believes it plays the sound correctly, whereas there's no sound in the speaker...

Revision history for this message
G.M. (sexxxenator) wrote :

While shutting down my computer, and particularly when closing FF, I realized that sounds do indeed play!!

Could it be that flash (I always have jango.com opened in a tab) is blocking sound from mplayer/pulse ???

How could I resolve that ?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.