[MPlayer-users] Continuous "Audio device got stuck!" warnings playing audio-only files with -ao pulse

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Feb 14 21:07:16 CET 2012


On Tue, Feb 14, 2012 at 06:52:46PM +0100, Ilja Sekler wrote:
> MPlayer continuously prints "Audio device got stuck!" warnings to
> console while playing audio-only files with -ao pulse (but not with -ao
> alsa), otherwise the playback works impeccably. I use the following patch
> 
> 
> Index: mplayer.c
> ===================================================================
> --- mplayer.c	(Revision 34723)
> +++ mplayer.c	(Arbeitskopie)
> @@ -2142,8 +2142,8 @@
>          // this is where mplayer sleeps during audio-only playback
>          // to avoid 100% CPU use
>          sleep_time = (ao_data.outburst - bytes_to_write) * 1000 /
> ao_data.bps;
> -        if (sleep_time < 10)
> -            sleep_time = 10;                  // limit to 100 wakeups
> per second
> +        if (sleep_time < 20)
> +            sleep_time = 20;                  // limit to 50 wakeups
> per second
>          usec_sleep(sleep_time * 1000);
>      }
> 
> 
> as an I-don't-have-a-clue-what-I'm-doing hotfix, but a real skillful
> solution for this new annoyance would be greatly appreciated.

Thanks for the information, the issue was really in ao_pulse which did
not set the "ao_data.outburst", which caused this sleep here to be far
too short.
Should be fixed in r34726, though it is just a guess since I did not
find any pulseaudio function to get a really "correct" value as we do
for ALSA.


More information about the MPlayer-users mailing list