[MPlayer-dev-eng] [fix] ao_alsa: playing high-res audio
Clemens Ladisch
cladisch at fastmail.net
Thu Aug 20 19:58:43 CEST 2009
Shane W wrote:
> So I've been wrestling with getting Mplayer to play
> high-res audio for a while now and finally got it working.
> The problem was I was getting clicking/popping sounds when
> playing a 96khz 6channel 24 bit stream in either flac or
> wav format. Playing the same stream with aplay (wav) worked
> fine.
The default buffer length of 16384 frames result in a buffer of about
a third of a second at 48 kHz. With higher sample rates, the buffer
gets proprtionally shorter. (And at 8 kHz, the buffer is over two
seconds, which is extremely silly.)
> For these streams, I needed toenable:
> #define BUFFERTIME 1
> in ao_alsa.c which expanded the buffer sizes appropriately.
> # Is there any reason this isn't on by default?
Years ago, I had heard rumors that the A/V sync code might get into
problems if the audio output wants to prefetch too much audio data,
so I did not touch that code. However, this is probably not true
anymore, if it ever was.
In any case, using a constant buffer time, instead of buffer length in
frames, should be safe.
I will rewrite the buffer parameters selection code in the next few days.
Best regards,
Clemens
More information about the MPlayer-dev-eng
mailing list