[MPlayer-users] Vidix driver color depth initialization

Emiel Neggers emiel at neggers.net
Fri Aug 16 02:02:02 CEST 2002


Hello all,

The vidix driver doesn't seem to work for me. When I use vesa:vidix as video
output, mplayer exits after displaying:
vosub_vidix: video server has unsupported color depth by vidix (0)

The bugreport appendix in the mplayer documentation made it clear that it's
best to fix the bug yourself - which I did. Well.. at least it works for me.
The part about sending patches scared me enough not to submit this patch to
the development list. I don't really know whether this patch breaks
something else or not, as I am not an experienced developer. However, I read
that I am not the only one with this problem, so I figure it's best to at
least mail the patch somewhere.

If I understand it right, the supported color depth of the *_vid vidix
driver is initialized in vidix/drivers/*_vid.c:vixQueryFourcc(). It's
never executed though, and libvo/vosub_vidix.c:vidix_init() will print
an error about unsupported color depth and exit. I added a call to
vidix_query_fourcc() in vosub_vidix.c, which solved my problems. I took
special care to preserve the indentation of the whole code, and I made a
diff with 'cvs diff -u' against the current cvs version, as described in
the part about sending patches. Of course I am not sure if this patch is
any good. I tested my patch on the brand new ATI Radeon 8500LE in my
desktop and on the ATI MACH64 in my laptop today; both worked. I don't
think it's ATI specific though.

The patch is really small, so I attached it to this email. I hope it helps
someone.

While I was at it, I noticed that I got a purple border left of the video
image with xvidix, and that there was a small part left out on the right. I
found out that vidix/drivers/radeon_vid.c defines X_ADJUST to be set at 8
for all radeon cards. This was not necessary on my PowerColor/VGA #1 ATI
Radeon 8500LE Evil Master 2 250/250MHz 64MB edition. I won't include a patch
for that because someone obviously put that in there for a reason. I would
like it if there would be some sort of fix for this though, like some more
advanded auto_offset_correction_detection, or even a config option in worst
case... (is there, btw?)

I should mention that, for me the vesa:vidix output works only on some
files. I couldn't find enough files to determine why that is, but so far
i can tell that divx files with Planar YV12 colorspace work (at least in
resolutions below 640x480, I couldn't find any in higher res), and all
MPEG files I tried don't (both VCDs and SVCDs). MPlayer doesn't crash,
and it doesn't generate warnings or error messages (as far as I could
tell from the -v output), but it only displays a few colorful lines on
random places on my monitor. I tried scaling the MPEG's to 640x480 and
that actually worked, because I got recognizable output. That output
though, wasn't any better then the xvidix scaled output. It's really
green and stretches the left half of the movie to the complete scaled
size. For what it's worth, I included some info I could think of about
my current system at the bottom of this email.

Also, in libvo/vo_vesa.c, on line 704, some info on the selected VESA mode
is printed, including the BitsPerPixel. The uint32_t dstBpp get's it's value
right after that printf though, so (at least in my case) it always prints
the value 0 (zero) to the screen. Someone might want to switch those two
statements.

Having said all that, I would like to add that MPlayer rules and it's
the only thing that makes all my ms windows-using friends jealous ;)
Thanks to everyone who helped to develop it, great job :)

I hope this was usefull, best regards,
Emiel

System Information
==================
Linux distribution: Debian GNU/Linux unstable, with XFree86 4.2.0-0pre1v2
kernel version: Linux 2.4.18
libc version: 2.2.5
X version: 4.2.0
gcc version 2.95.4 20011002 (Debian prerelease)
GNU ld version 2.12.90.0.15 20020717 Debian GNU/Linux
GNU assembler 2.12.90.0.15 20020717 Debian GNU/Linux
Window manager: Enlightenment
Enlightenment Version: 0.16.5
X Video Driver: good question.. I think I currently use the DRI r200 cvs
  branch, but the kernel module isn't loaded. I am sure the problem was
  with multiple drivers though, I also tried gatos and radeon cvs branch.
  (vidix is independant anyway, right?)
MPlayer CVS version of 2002-08-15

Intel(R) Pentium(R) 4 CPU 1700MHz with 256 KB cache
Host bridge: Intel Corp. 82850 850 (Tehama) Chipset Host Bridge (MCH)
  (rev 02)
Video card: PowerColor ATI Radeon 8500LE Evil Master 2 250/250MHz 64MB
Sound card: Intel Corp. 82801BA/BAM AC'97 Audio (rev 04)
-------------- next part --------------
Index: libvo/vosub_vidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vosub_vidix.c,v
retrieving revision 1.51
diff -u -r1.51 vosub_vidix.c
--- libvo/vosub_vidix.c	25 Jul 2002 22:54:03 -0000	1.51
+++ libvo/vosub_vidix.c	15 Aug 2002 22:57:58 -0000
@@ -460,6 +460,13 @@
 	    ,src_width,src_height,x_org,y_org,dst_width,dst_height
 	    ,vo_format_name(format),dest_bpp,vid_w,vid_h);
 
+	if(vidix_query_fourcc(format) == 0)
+	{
+	  printf("vosub_vidix: unsupported fourcc for this vidix driver: %x (%s)\n",
+	    format,vo_format_name(format));
+	  return -1;
+	} 
+
 	if(((vidix_cap.maxwidth != -1) && (vid_w > vidix_cap.maxwidth)) ||
 	    ((vidix_cap.minwidth != -1) && (vid_w < vidix_cap.minwidth)) ||
 	    ((vidix_cap.maxheight != -1) && (vid_h > vidix_cap.maxheight)) ||


More information about the MPlayer-users mailing list