[MPlayer-dev-eng] [PATCH 0/5] various enhancements and bugfixes for the ALSA driver

Jan Knutar jknutar at nic.fi
Thu Feb 2 00:19:31 CET 2006


On Thursday 02 February 2006 01:00, Jan Knutar wrote:

> #4  0x004b52db in snd_pcm_forward () from /lib/libasound.so.2
> No symbol table info available.
> #5  0x080d6c79 in get_delay () at ao_alsa.c:844
>         delay = 0

> It's not very reproducable for me.

I hadn't gotten any further than writing up the previous email and sent it,
and was about to unpause MPlayer, when the same thing hit again. A bit
annoyed, I tried a nasty hack, inserted if(delay) before the snd_pcm_forward
in get_delay.

Well it plays now, but the sound skips a lot, several times per second. :-)

Comparing to old ao_alsa, the new one seems to abort on this assert,
while as the old one prints xruns.

Some output...

OLD:

Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter resample
[resample] Changing sample rate to 44100Hz
[resample] Using integer processing and inexact frequecy conversion.
[resample] New filter designed up: 147 down: 160
[resample] Using integer processing and inexact frequecy conversion.
alsa-init: requested format: 44100 Hz, 2 channels, 9
alsa-init: compiled for ALSA-1.0.6
alsa-init: setup for 1/2 channel(s)
alsa-init: 1 soundcard found, using: default
alsa-init: pcm opend in block-mode
alsa-init: chunksize set to 2048
alsa-init: fragcount=8
alsa-init: got buffersize=65536
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 developement
Building audio filter chain for 48000Hz/2ch/s16le -> 44100Hz/2ch/s16le...
[resample] Using integer processing and inexact frequecy conversion.
[resample] Using integer processing and inexact frequecy conversion.
Starting playback...
alsa-space: free space = 65536, prepared --
[libaf] Reallocating memory in module resample, old len = 0, new len = 60212
[ffmpeg] aspect_ratio: 1.333333
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
Trying filter chain: eq2 vo
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO Config (640x480->640x480,flags=0,'MPlayer',0x32315659)
REQ: flags=0x437  req=0x0
VO: [xmga] 640x480 => 640x480 Planar YV12
VO: Description: Matrox G200/G4x0/G550 overlay in X11 window (using /dev/mga_vid)
VO: Author: Zoltan Ponekker <pontscho at makacs.poliod.hu>
[mga] Using 3 buffers.
Using colorkey: ff00
[xmga] x: 192 y: 144 w: 640 h: 480
[xmga] dcx: 192 dcy: 144 dx: 0 dy: 0 dw: 640 dh: 480
*** [eq2] Allocating mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
[xmga] x: 0 y: 0 w: 640 h: 480
[xmga] dcx: 192 dcy: 144 dx: 0 dy: 0 dw: 640 dh: 480
alsa-space: xrun of at least 6.361 msecs. resetting stream
alsa-space: free space = 0, xrun --
XXX initial  v_pts=0.000  a_pos=8000 (0.500)
*** [eq2] Allocating mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
*** [vo] Exporting mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
get_path('subfont.ttf') -> '/home/jan/.mplayer/subfont.ttf'
Unicode font: 38910 glyphs.
alsa-space: free space = 65536, prepared --
*** [eq2] Allocating mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
alsa-pause: pause supported by hardware
alsa-resume: resume supported by hardware
alsa-space: xrun of at least 0.007 msecs. resetting stream
alsa-space: free space = 0, xrun --
alsa-space: free space = 65536, prepared --

PATCH "crash 1" ( /without/ my hack )
Crashes right at the start of playback.

Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter resample
[resample] Changing sample rate to 44100Hz
[resample] Using integer processing and inexact frequecy conversion.
[resample] New filter designed up: 147 down: 160
[resample] Using integer processing and inexact frequecy conversion.
alsa-init: requested format: 44100 Hz, 2 channels, 9
alsa-init: compiled for ALSA-1.0.6
alsa-init: setup for 1/2 channel(s)
alsa-init: 1 soundcard found, using: default
alsa-init: pcm opend in blocking mode
alsa-init: chunksize set to 2048
alsa-init: fragcount=8
alsa-init: got buffersize=65536
alsa-init: got period size 2048
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 developement
Building audio filter chain for 48000Hz/2ch/s16le -> 44100Hz/2ch/s16le...
[resample] Using integer processing and inexact frequecy conversion.
[resample] Using integer processing and inexact frequecy conversion.
Starting playback...
[libaf] Reallocating memory in module resample, old len = 0, new len = 60212
[ffmpeg] aspect_ratio: 1.333333
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
Trying filter chain: eq2 vo
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO Config (640x480->640x480,flags=0,'MPlayer',0x32315659)
REQ: flags=0x437  req=0x0
VO: [xmga] 640x480 => 640x480 Planar YV12
VO: Description: Matrox G200/G4x0/G550 overlay in X11 window (using /dev/mga_vid)
VO: Author: Zoltan Ponekker <pontscho at makacs.poliod.hu>
[mga] Using 3 buffers.
Using colorkey: ff00
[xmga] x: 192 y: 144 w: 640 h: 480
[xmga] dcx: 192 dcy: 144 dx: 0 dy: 0 dw: 640 dh: 480
*** [eq2] Allocating mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
[xmga] x: 0 y: 0 w: 640 h: 480
[xmga] dcx: 192 dcy: 144 dx: 0 dy: 0 dw: 640 dh: 480
mplayer: pcm.c:1054: __snd_pcm_forward: Assertion `frames > 0' failed.


MPlayer interrupted by signal 6 in module: av_sync


Patch "crash" 2, after pausing stream.

Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter resample
[resample] Changing sample rate to 44100Hz
[resample] Using integer processing and inexact frequecy conversion.
[resample] New filter designed up: 147 down: 160
[resample] Using integer processing and inexact frequecy conversion.
alsa-init: requested format: 44100 Hz, 2 channels, 9
alsa-init: compiled for ALSA-1.0.6
alsa-init: setup for 1/2 channel(s)
alsa-init: 1 soundcard found, using: default
alsa-init: pcm opend in blocking mode
alsa-init: chunksize set to 2048
alsa-init: fragcount=8
alsa-init: got buffersize=65536
alsa-init: got period size 2048
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 developement
Building audio filter chain for 48000Hz/2ch/s16le -> 44100Hz/2ch/s16le...
[resample] Using integer processing and inexact frequecy conversion.
[resample] Using integer processing and inexact frequecy conversion.
Starting playback...
[libaf] Reallocating memory in module resample, old len = 0, new len = 60212
[ffmpeg] aspect_ratio: 1.333333
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
Trying filter chain: eq2 vo
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO Config (640x480->640x480,flags=0,'MPlayer',0x32315659)
REQ: flags=0x437  req=0x0
VO: [xmga] 640x480 => 640x480 Planar YV12
VO: Description: Matrox G200/G4x0/G550 overlay in X11 window (using /dev/mga_vid)
VO: Author: Zoltan Ponekker <pontscho at makacs.poliod.hu>
[mga] Using 3 buffers.
Using colorkey: ff00
[xmga] x: 192 y: 144 w: 640 h: 480
[xmga] dcx: 192 dcy: 144 dx: 0 dy: 0 dw: 640 dh: 480
*** [eq2] Allocating mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
[xmga] x: 0 y: 0 w: 640 h: 480
[xmga] dcx: 192 dcy: 144 dx: 0 dy: 0 dw: 640 dh: 480
XXX initial  v_pts=0.000  a_pos=8000 (0.500)
*** [eq2] Allocating mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
*** [vo] Exporting mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
get_path('subfont.ttf') -> '/home/jan/.mplayer/subfont.ttf'
Unicode font: 38910 glyphs.
*** [eq2] Allocating mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
alsa-pause: pause supported by hardware
alsa-resume: resume supported by hardware
mplayer: pcm.c:1054: __snd_pcm_forward: Assertion `frames > 0' failed.


MPlayer interrupted by signal 6 in module: av_sync




My theory about the heisenbug sometimes crashing and sometimes not, on
startup, is because the third and fourth time, mplayer is already hot in cache,
while the first two, there's delay between audio and video as stuff gets paged
in (and paged out to make room for video frames?).







More information about the MPlayer-dev-eng mailing list