[MPlayer-users] mplayer R24920 - Increasing filtered audio buffer size from 65536 to 67584

Raymond Yau superquad.vortex2 at gmail.com
Tue Feb 1 02:05:22 CET 2011


I also get shuttering and choppy audio with mplayer SVN-r32829-4.3.2

after mplayer display

"Increasing filtered audio buffer size from 65536 to 67584" using oss
or alsa with sound card which has max buffer bytes 65536 bytes ,

but it does not happen with "pulse" or hda driver with max buffer
bytes > 65536 bytes

dec_audio: Allocating 2048 + 65536 = 67584 bytes for output buffer.

audio_setup: frags:  16/16  (4096 bytes/frag)  free:  65536

2048 bytes is only half of the frag size 4096 bytes

why mplayer increasing filtered audio buffer size by half frag or half
period size ?

it look like related to R24920

Change decode_audio() interface

Rewrite decode_audio to better deal with filters that handle input in
large blocks. It now always places output in sh_audio->a_out_buffer
(which was always given as a parameter before) and reallocates the

buffer if needed. After the changes filters can return arbitrarily
large blocks of data without some of it being lost. The new version
also allows simplifying some code.



mplayer -ao oss stereo.wav


======= WAVE Format =======
Format Tag: 1 (0x1)
Channels: 2
Samplerate: 44100
avg byte/sec: 176400
Block align: 4
bits/sample: 16
cbSize: 0
==========================================================================

demux_audio: audio data 0x2C - 0x308002C
Audio only file format detected.
Load subtitles in ./
get_path('sub/') -> '/home/raymond/.mplayer/sub/'
==========================================================================

Opening audio decoder: [pcm] Uncompressed PCM audio decoder
dec_audio: Allocating 2048 + 65536 = 67584 bytes for output buffer.
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)

==========================================================================
Building audio filter chain for 44100Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 44100Hz/2ch/s16le

[dummy] Was reinitialized: 44100Hz/2ch/s16le
Trying preferred audio driver 'oss', options '[none]'
ao2: 44100 Hz  2 chans  s16le
audio_setup: using '/dev/dsp' dsp device
audio_setup: using '/dev/mixer' mixer device

audio_setup: using 'pcm' mixer device
audio_setup: sample format: s16le (requested: s16le)
audio_setup: using 2 channels (requested: 2)
audio_setup: using 44100 Hz samplerate (requested: 44100)
audio_setup: frags:  16/16  (4096 bytes/frag)  free:  65536

AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)
AO: Description: OSS/ioctl audio output
AO: Author: A'rpi
Building audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le...
[dummy] Was reinitialized: 44100Hz/2ch/s16le

[dummy] Was reinitialized: 44100Hz/2ch/s16le
Video: no video
Freeing 0 unused video chunks.
Starting playback...
Increasing filtered audio buffer size from 0 to 65536
A: 127.7 (02:07.6) of 288.0 (04:48.0)  0.1%

Increasing filtered audio buffer size from 65536 to 67584
A: 287.9 (04:47.9) of 288.0 (04:48.0)  0.1%
ds_fill_buffer: EOF reached (stream: audio)
ds_fill_buffer: EOF reached (stream: audio)
A: 287.9 (04:47.9) of 288.0 (04:48.0)  0.1%

ds_fill_buffer: EOF reached (stream: audio)
A: 288.0 (04:47.9) of 288.0 (04:48.0)  0.1%
EOF code: 1

Uninit audio filters...
[libaf] Removing filter dummy
Uninit audio: pcm



mplayer -ao alsa:device=hw=0 stereo.wav



======= WAVE Format =======
Format Tag: 1 (0x1)
Channels: 2
Samplerate: 44100
avg byte/sec: 176400
Block align: 4
bits/sample: 16
cbSize: 0
==========================================================================

demux_audio: audio data 0x2C - 0x308002C
Audio only file format detected.
Load subtitles in ./
get_path('sub/') -> '/home/raymond/.mplayer/sub/'
==========================================================================

Opening audio decoder: [pcm] Uncompressed PCM audio decoder
dec_audio: Allocating 2048 + 65536 = 67584 bytes for output buffer.
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)

==========================================================================
Building audio filter chain for 44100Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 44100Hz/2ch/s16le

[dummy] Was reinitialized: 44100Hz/2ch/s16le
Trying preferred audio driver 'alsa', options 'device=hw=0'
alsa-init: requested format: 44100 Hz, 2 channels, 9
alsa-init: using ALSA 1.0.23
alsa-init: setup for 1/2 channel(s)

alsa-init: using device hw:0
alsa-init: pcm opened in blocking mode
alsa-init: got buffersize=65536
alsa-init: got period size 1024
alsa: 44100 Hz/2 channels/4 bpf/65536 bytes buffer/Signed 16 bit Little Endian

AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
AO: Description: ALSA-0.9.x-1.x audio output
AO: Author: Alex Beregszaszi, Zsolt Barat <joy at streamminister.de>

AO: Comment: under development

Building audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le...
[dummy] Was reinitialized: 44100Hz/2ch/s16le
[dummy] Was reinitialized: 44100Hz/2ch/s16le
Video: no video

Freeing 0 unused video chunks.

Starting playback...
Increasing filtered audio buffer size from 0 to 65536
A:   3.0 (02.9) of 288.0 (04:48.0)  0.1%
Increasing filtered audio buffer size from 65536 to 67584

A: 287.9 (04:47.9) of 288.0 (04:48.0)  0.1%

ds_fill_buffer: EOF reached (stream: audio)
ds_fill_buffer: EOF reached (stream: audio)
A: 287.9 (04:47.9) of 288.0 (04:48.0)  0.1%
ds_fill_buffer: EOF reached (stream: audio)

A: 288.0 (04:47.9) of 288.0 (04:48.0)  0.1%

EOF code: 1

Uninit audio filters...
[libaf] Removing filter dummy
Uninit audio: pcm
alsa-uninit: pcm closed


mplayer -ao alsa:device=pulse stereo.wav

======= WAVE Format =======
Format Tag: 1 (0x1)

Channels: 2
Samplerate: 44100
avg byte/sec: 176400
Block align: 4
bits/sample: 16
cbSize: 0
==========================================================================

demux_audio: audio data 0x2C - 0x308002C

Audio only file format detected.
Load subtitles in ./
get_path('sub/') -> '/home/raymond/.mplayer/sub/'
==========================================================================

Opening audio decoder: [pcm] Uncompressed PCM audio decoder

dec_audio: Allocating 2048 + 65536 = 67584 bytes for output buffer.
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)

==========================================================================

Building audio filter chain for 44100Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 44100Hz/2ch/s16le

[dummy] Was reinitialized: 44100Hz/2ch/s16le
Trying preferred audio driver 'alsa', options 'device=pulse'

alsa-init: requested format: 44100 Hz, 2 channels, 9
alsa-init: using ALSA 1.0.23
alsa-init: setup for 1/2 channel(s)

alsa-init: using device pulse
alsa-init: pcm opened in blocking mode
alsa-init: got buffersize=88200

alsa-init: got period size 1378
alsa: 44100 Hz/2 channels/4 bpf/88200 bytes buffer/Signed 16 bit Little Endian

AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
AO: Description: ALSA-0.9.x-1.x audio output
AO: Author: Alex Beregszaszi, Zsolt Barat <joy at streamminister.de>

AO: Comment: under development
Building audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le...
[dummy] Was reinitialized: 44100Hz/2ch/s16le
[dummy] Was reinitialized: 44100Hz/2ch/s16le
Video: no video

Freeing 0 unused video chunks.
Starting playback...
Increasing filtered audio buffer size from 0 to 65536
A: 287.7 (04:47.7) of 288.0 (04:48.0)  0.1%
ds_fill_buffer: EOF reached (stream: audio)
ds_fill_buffer: EOF reached (stream: audio)

A: 287.7 (04:47.7) of 288.0 (04:48.0)  0.1%
ds_fill_buffer: EOF reached (stream: audio)
A: 287.8 (04:47.7) of 288.0 (04:48.0)  0.1%
EOF code: 1

Uninit audio filters...
[libaf] Removing filter dummy

Uninit audio: pcm
alsa-uninit: pcm closed


More information about the MPlayer-users mailing list