[MPlayer-users] MMX-SSE bugs

Dimitris Stasinopoulos dimitris at linea.gr
Sun May 26 18:41:02 CEST 2002


Hello_all()

I've been using a dual P3 system to encode my DVD discs, all very 
successfully. I've recently acquired a Compaq 1722EA notebook. It has an 
Intel Mobile P3 at 113MHz, a DVD Rom and a CD-RW, so it is an ideal solution 
as a fast, portable DVD copier :-)

However, eversince I've tried (encoding, using anything up to post 0.90-pre 
CVS), I've been getting various problems. From SIGSEGVs to SIGFPEs, and very 
bad picture quality problems. By enabling debugging and backtracing, I've 
seen that most problems where due to divx4. I moved to divx5, but the 
problems persisted. I then switched to lavc.  More problems:

Baaaad picture quality and regular SIGSEGVs. Again by debugging, the SIGSEGVs 
where due to libmp3lame crashes, so I copied the audio stream instead of 
encoding it. That was the end of SIGSEGVs.

But the bad picture problems persisted. Sometimes the picture was all very 
well, sometimes it was really messed up. Using divx4 or divx5 for encoding, 
the picture was fine (but mencoder would crash after a while).

By carefully reading through the mails, it seemed that many people had 
problems related to MMX. So I disabled MMX, MMX2, SSE1 and the fast memcpy() 
in config.h and config.mak.

Recompiled, encoded, and voila! The picture is PERFECT. However, the 8fps for 
DVD encoding a full window is far from acceptable (normally about 25-28fps).

So there is obviously something wrong (not with mencoder) but with either:

* The hardware (CPU)
* The kernel (MMX support)
* The compiler (GCC)
* Binutils?

From previous debugging, I saw that libmp3lame would also crash in some MMX 
related function. The question is:

How can we find out the root of the problem? Using the same settings (MMX:1, 
MMX2:1, SSE1:1, SSE2:0) on my desktop machine, there were no problems 
whatsoever, using the same versions of:

* distribution (SuSE 7.1)
* kernel 2.4.18
* libc (libc.so.6)
* binutils (GNU assembler 2.10.91)
* gcc (2.95.2 19991024)
* ld (2.10.91 (with BFD 2.10.0.33))

Here's the /proc/cpuinfo for the Compaq machine:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 11
model name      : Intel(R) Pentium(R) III Mobile CPU      1133MHz
stepping        : 1
cpu MHz         : 1132.395
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 mmx fxsr sse
bogomips        : 2260.99

I've attached a sample session of mencoder encoding a DVD to divx using 
lavcs's mpeg4 codec. The MMX and SSE optimizations are all enabled, and thus, 
picture quality problems were present. Also, attached is an mplayer session 
of playing the badly encoded file.

Should I upload a small video with the described picture problems?

Thanks for everything...

-- 
Dimitris Stasinopoulos

I am but a small signature
At the down down of the writing
If you don't read me
It will become the come and see.
-------------- next part --------------
reverant at Demos:/usr/local/share/MPlayer-20020512 > ./encode-lavc-dvd


MEncoder CVS-020512-07:00-2.95.2 (C) 2000-2002 Arpad Gereoffy (see DOCS!)

CPU vendor name: GenuineIntel  max cpuid level: 2
CPU: Intel Celeron 2/Pentium III Tualatin (Type: 6, Stepping: 1)
extended cpuid-level: 4
Testing OS support for SSE... yes.
Testing OS support for SSE unmasked exceptions... yes.
Tests of OS support for SSE passed.
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Reading /home/reverant/.mplayer/codecs.conf: 34 audio & 92 video codecs
Font /home/reverant/.mplayer/font/font.desc loaded successfully! (206 chars)
File not found: 'frameno.avi'
get_path('') -> '/home/reverant/.mplayer/'
get_path('DVDKeys') -> '/home/reverant/.mplayer/DVDKeys'
libdvdcss debug: GetASF authenticated
libdvdcss debug: already authenticated
Reading disc structure, please wait...
There are 5 titles on this DVD.
There are 16 chapters in this DVD title.
There are 1 angles in this DVD title.
dvdcss: opening /home/reverant/.mplayer/DVDKeys/0000000000000000/0000000310 to look for key
DVD successfully opened!
[open] audio stream: 0 audio format: ac3 language: en aid: 128
[open] number of audio channels on disk: 1.
[open] subtitle ( sid ): 0 language: el
[open] number of subtitles on disk: 1
DVD start cell: 3  pack: 0x69A00-0x8FAC2
DVD start=432640 end=2174070
success: format: 0  data: 0x34D00000 - 0x963B000
Selected DVD audio channel: 128 language: en
Selected DVD subtitle channel: 0 language: el
DVD Seek! lba=0x69A00  cell=3  packs: 0x69A00-0x8FAC2
Angle-seek synced! skip=0  new_lba=0x69A00
Checking for YUV4MPEG2
DEMUXER: freeing demuxer at 0x82aae00
ASF_check: not ASF guid!
DEMUXER: freeing demuxer at 0x82aae00
Checking for NuppelVideo
DEMUXER: freeing demuxer at 0x82aae00
Checking for MOV
DEMUXER: freeing demuxer at 0x82aae00
Checking for VIVO
header block 1 size: 0
DEMUXER: freeing demuxer at 0x82aae00
Checking for REAL
DEMUXER: freeing demuxer at 0x82aae00
DVD Seek! lba=0x8B94  cell=0  packs: 0x8B94-0x28EC7
Angle-seek synced! skip=0  new_lba=0x8B94
DEMUXER: freeing demuxer at 0x82aae00
dvd_next_cell: next1=0x0
dvd_next_cell: next2=0x0
dvd_next_cell: next3=0x1
dvd_next_cell: next1=0x1
dvd_next_cell: next2=0x1
dvd_next_cell: next3=0x2
dvd_next_cell: next1=0x2
dvd_next_cell: next2=0x2
dvd_next_cell: next3=0x3
DVD Seek! lba=0x69A00  cell=3  packs: 0x69A00-0x8FAC2
Angle-seek synced! skip=0  new_lba=0x69A00
DEMUXER: freeing demuxer at 0x82aae00
DVD Seek! lba=0x8B94  cell=0  packs: 0x8B94-0x28EC7
Angle-seek synced! skip=0  new_lba=0x8B94
DEMUXER: freeing demuxer at 0x82aae00
dvd_next_cell: next1=0x0
dvd_next_cell: next2=0x0
dvd_next_cell: next3=0x1
dvd_next_cell: next1=0x1
dvd_next_cell: next2=0x1
dvd_next_cell: next3=0x2
dvd_next_cell: next1=0x2
dvd_next_cell: next2=0x2
dvd_next_cell: next3=0x3
DVD Seek! lba=0x69A00  cell=3  packs: 0x69A00-0x8FAC2
Angle-seek synced! skip=0  new_lba=0x69A00
DVD Seek! lba=0x8B94  cell=0  packs: 0x8B94-0x28EC7
Angle-seek synced! skip=0  new_lba=0x8B94
DEMUXER: freeing demuxer at 0x82aae00
dvd_next_cell: next1=0x0
dvd_next_cell: next2=0x0
dvd_next_cell: next3=0x1
dvd_next_cell: next1=0x1
dvd_next_cell: next2=0x1
dvd_next_cell: next3=0x2
dvd_next_cell: next1=0x2
dvd_next_cell: next2=0x2
dvd_next_cell: next3=0x3
DVD Seek! lba=0x69A00  cell=3  packs: 0x69A00-0x8FAC2
Angle-seek synced! skip=0  new_lba=0x69A00
DEMUXER: freeing demuxer at 0x82aae00
system stream synced at 0x34D0000D (0)!
==> Found audio stream: 128
==> Found video stream: 0
Detected MPEG-PS file format!
Searching for sequence header... OK!
VIDEO:  MPEG2  720x576  (aspect 3)  25.00 fps  7500.0 kbps (937.5 kbyte/s)
[V] filefmt:2  fourcc:0x10000002  size:720x576  fps:25.00  ftime:=0.0400
Detected audio codec: [a52] drv:14 (AC3-liba52)
Initializing audio codec...
Selecting Audio Decoder: [liba52] AC3-liba52
dec_audio: Allocating 3840 bytes for input buffer
dec_audio: Allocating 6144 + 65536 = 71680 bytes for output buffer
Using SSE optimized IMDCT transform
AC3: 2.0 (stereo)  48000 Hz  256.0 kbit/s
A52 flags before a52_frame: 0x2A
A52 flags after a52_frame: 0x2
Using MMX optimized resampler
AUDIO: srate=48000  chans=2  bps=2  sfmt=0x10  ratio: 32000->192000
libavcodec: CPU flags: mmx mmxext sse
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
==========================================================================
Opening Video Decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 576, Mpeg PES
[PP] Sorry, postprocessing is not available
vo_debug: query(Mpeg PES) returned 0x0 (i=0)
Couldn't find matching colorspace - retrying with -vop scale...
SwScale: -1 x -1 (-1=no scaling)
vo_debug: query(Mpeg PES) returned 0x0 (i=0)
Sorry, selected video_out device is incompatible with this codec.
VDecoder init failed :(
Opening Video Decoder: [libmpeg2] MPEG 1/2 Video decoder v2.0
libmpeg2: Using MMXEXT for IDCT transform
libmpeg2: Using MMXEXT for motion compensation
VDec: vo config request - 720 x 576, Planar YV12
[PP] Sorry, postprocessing is not available
vo_debug: query(Planar YV12) returned 0x401 (i=0)
vo_debug: query(Planar I420) returned 0x401 (i=1)
vo_debug: query(Planar IYUV) returned 0x401 (i=2)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
video_out->init(720x576->1024x576,flags=0,'MPlayer',0x32315659)
REQ: flags=0x401  req=0x0
videocodec: libavcodec (720x576 fourcc=58564944 [DIVX])
High quality encoding selected (non real time)!
Detected video codec: [mpeg12] drv:1 prio:0 (MPEG 1 or 2)
==========================================================================
audiocodec: framecopy (format=2000 chans=2 rate=48000 bits=16 bps=32000 sample=1)
Writing AVI header...
*** [expand] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes
*** [expand] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes 118/6 D/S 0/0
*** [lavc] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes
*** [expand] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytess 130/16 D/S 0/0
==> Found subtitle: 2 0%)  17fps Trem: 103min 551mb  A-V:-0.031 [786:256] A/Vms 36/52 D/S 1/0
==> Found subtitle: 1
Pos:  40.1s   1002f ( 0%)  17fps Trem: 101min 515mb  A-V:-0.044 [724:256] A/Vms 37/52 D/S 1/0
Writing AVI index...
Fixup AVI header...

Video stream:  724.072 kbit/s  (90508 bps)  size: 3631221 bytes  40.120 secs  1002 frames

Audio stream:  256.000 kbit/s  (32000 bps)  size: 1312000 bytes  41.000 secs

*** free_stream() called ***
-------------- next part --------------
reverant at Demos:/usr/local/share/MPlayer-20020512 > ./mplayer -v /home/reverant/test.avi


MPlayer CVS-020512-07:00-2.95.2 (C) 2000-2002 Arpad Gereoffy (see DOCS!)

CPU vendor name: GenuineIntel  max cpuid level: 2
CPU: Intel Celeron 2/Pentium III Tualatin (Type: 6, Stepping: 1)
extended cpuid-level: 4
Testing OS support for SSE... yes.
Testing OS support for SSE unmasked exceptions... yes.
Tests of OS support for SSE passed.
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Compiled for x86 CPU with features: MMX MMX2 SSE
Reading /home/reverant/.mplayer/codecs.conf: 34 audio & 92 video codecs
CommandLine: '-v' '/home/reverant/test.avi'
get_path('font/font.desc') -> '/home/reverant/.mplayer/font/font.desc'
Font /home/reverant/.mplayer/font/font.desc loaded successfully! (206 chars)
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
Linux RTC init error: Permission denied
Using usleep() timing
get_path('input.conf') -> '/home/reverant/.mplayer/input.conf'
Parsing input config file /home/reverant/.mplayer/input.conf
Input config file /home/reverant/.mplayer/input.conf parsed : 50 binds
Playing /home/reverant/test.avi
Not an URL!
File size is 4971828 bytes
Detected AVI file format!
list_end=0x13C
======= AVI Header =======
us/frame: 40000  (fps=25.000)
max bytes/sec: 0
padding: 0
MainAVIHeader.dwFlags: (2320) HAS_INDEX IS_INTERLEAVED TRUST_CKTYPE
frames  total: 1003   initial: 0
streams: 2
Suggested BufferSize: 0
Size:  720 x 576
list_end=0xD4
==> Found video stream: 0
======= STREAM Header =======
Type: vids   FCC:  (0)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 250000/10000 = 25.000
Start: 0   Len: 1003
Suggested BufferSize: 32878
Quality 0
Sample size: 0
found 'bih', 40 bytes of 40
======= VIDEO Format ======
  biSize 40
  biWidth 720
  biHeight 576
  biPlanes 1
  biBitCount 24
  biCompression 1482049860='DIVX'
  biSizeImage 1244160
===========================
Regenerating keyframe table for DIVX 4 video
list_end=0x13C
==> Found audio stream: 1
======= STREAM Header =======
Type: auds   FCC:  (0)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 32000/1 = 32000.000
Start: 0   Len: 1312000
Suggested BufferSize: 16000
Quality 0
Sample size: 1
found 'wf', 20 bytes of 20
======= WAVE Format =======
Format Tag: 8192 (0x2000)
Channels: 2
Samplerate: 48000
avg byte/sec: 32000
Block align: 1
bits/sample: 16
cbSize: 0
Broken chunk?  chunksize=1724  (id=JUNK)
list_end=0x4B995C
Found movie at 0x80C - 0x4B995C
Reading INDEX block, 1085 chunks for 1003 frames
Broken chunk?  chunksize=0  (id=idx1)
Reading INDEX block, 1085 chunks for 1003 frames
AVI index offset: 0x808 (movi=0x80C idx0=0x4 idx1=0x3E8C)
Auto-selected AVI audio ID = 1
Auto-selected AVI video ID = 0
AVI: Searching for audio stream (id:1)
AVI video length=3631728
VIDEO:  [DIVX]  720x576  24bpp  25.00 fps  724.2 kbps (88.4 kbyte/s)
[V] filefmt:3  fourcc:0x58564944  size:720x576  fps:25.00  ftime:=0.0400
get_path('sub/') -> '/home/reverant/.mplayer/sub/'
Detected audio codec: [a52] drv:14 (AC3-liba52)
Initializing audio codec...
Selecting Audio Decoder: [liba52] AC3-liba52
dec_audio: Allocating 3840 bytes for input buffer
dec_audio: Allocating 6144 + 65536 = 71680 bytes for output buffer
Using SSE optimized IMDCT transform
AC3: 2.0 (stereo)  48000 Hz  256.0 kbit/s
A52 flags before a52_frame: 0x2A
A52 flags after a52_frame: 0x2
Using MMX optimized resampler
AUDIO: srate=48000  chans=2  bps=2  sfmt=0x10  ratio: 32000->192000
X11 opening display: :0.0
vo: X11 color mask:  FFFFFF  (R:FF0000 G:FF00 B:FF)
vo: X11 running at 1024x768 with depth 24 and 32 bits/pixel (":0.0" => local display)
==========================================================================
Opening Video Decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec: CPU flags: mmx mmxext sse
INFO: libavcodec init OK!
Detected video codec: [ffodivx] drv:5 prio:0 (FFmpeg MPEG-4)
==========================================================================
vo_xv: get: XV_COLORKEY = 0
vo_xv: assume: XV_COLORKEY = 24
vo_xv: get: XV_BRIGHTNESS = 0
vo_xv: assume: XV_BRIGHTNESS = 0
vo_xv: get: XV_SATURATION = 16
vo_xv: assume: XV_SATURATION = 64
vo_xv: get: XV_DOUBLE_BUFFER = 1
vo_xv: assume: XV_DOUBLE_BUFFER = 2000
AO: [oss] 48000Hz Stereo Signed 16-bit (Little-Endian)
AO: Description: OSS/ioctl audio output
AO: Author: A'rpi
ao2: 48000 Hz  2 chans  Signed 16-bit (Little-Endian)
audio_setup: using '/dev/dsp' dsp device
audio_setup: sample format: Signed 16-bit (Little-Endian) (requested: Signed 16-bit (Little-Endian))
audio_setup: using 2 channels (requested: 2)
audio_setup: using 48000 Hz samplerate (requested: 48000)
audio_setup: frags:   4/4  (16384 bytes/frag)  free:  65536
Start playing...
XXX initial  v_pts=0.000  a_pos=16000 (0.500)
VDec: vo config request - 720 x 576, Planar YV12    0%  0%  0.0% 0 0 0%
[PP] Sorry, postprocessing is not available
vo_debug: query(Planar YV12) returned 0x437 (i=0)
Movie-Aspect is undefined - no prescaling applied.
video_out->init(720x576->720x576,flags=0,'MPlayer',0x32315659)
VO: [xv] 720x576 => 720x576 Planar YV12
VO: Description: X11/Xv
VO: Author: Gerd Knorr <kraxel at goldbach.in-berlin.de>
Xvideo image format: 0x32595559 (YUY2) packed
Xvideo image format: 0x59565955 (UYVY) packed
Xvideo image format: 0x32315659 (YV12) planar
Xvideo image format: 0x30323449 (I420) planar
using Xvideo port 51 for hw scaling
[xv] dx: 0 dy: 0 dw: 720 dh: 576
*** [vo] Exporting mp_image_t, 720x576x12bpp YUV planar, 622080 bytes
[xv] dx: 0 dy: 0 dw: 720 dh: 576
A:   0.1 V:   0.2 A-V: -0.036 ct: -0.002    4/  4   0%  0%  0.0% 0 0 0%
Error at MB: 197
Error while decoding frame!
A:   0.4 V:   0.4 A-V: -0.023 ct: -0.019   10/ 10   0%  0%  0.0% 0 0 0%
Error at MB: 1578
Error while decoding frame!
A:   2.6 V:   2.6 A-V: -0.003 ct: -0.037   66/ 66  15% 12%  0.8% 0 0 0%
Error at MB: 1609
Error while decoding frame!
A:   2.8 V:   2.8 A-V: -0.002 ct: -0.036   71/ 71  15% 12%  0.8% 0 0 0%
Error at MB: 299
Error while decoding frame!
A:   3.0 V:   3.0 A-V: -0.002 ct: -0.036   74/ 74  15% 12%  0.8% 0 0 0%
Error at MB: 1615
Error while decoding frame!
A:   3.6 V:   3.6 A-V: -0.003 ct: -0.037   91/ 91  14% 12%  0.8% 0 0 0%
Error at MB: 351
Error while decoding frame!
A:   5.7 V:   5.7 A-V:  0.002 ct: -0.038  142/142  14%  8%  0.7% 0 0 0%
Error at MB: 1607
Error while decoding frame!
A:   6.0 V:   6.0 A-V:  0.003 ct: -0.038  151/151  15%  8%  0.7% 0 0 0%
Error at MB: 1525
Error while decoding frame!
A:   6.2 V:   6.2 A-V:  0.002 ct: -0.038  154/154  15%  8%  0.7% 0 0 0%
Error at MB: 1619
Error while decoding frame!
A:   8.4 V:   8.4 A-V: -0.007 ct: -0.039  210/210  16%  6%  0.7% 0 0 0%

MPlayer interrupted by signal 2 in module: sleep_usleep

*** free_stream() called ***
vo: uninit ...


More information about the MPlayer-users mailing list