Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40616 - Mplayer needs patch for Matrox MGA Driver
Summary: Mplayer needs patch for Matrox MGA Driver
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo Media-video project
URL: http://forums.gentoo.org/viewtopic.ph...
Whiteboard:
Keywords:
: 26552 52971 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-06 10:00 UTC by Brian Nickeson
Modified: 2004-06-04 13:57 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
the mga_vid patch worx with mplayer source v1.0pre3try2 for 2.6.5-rc3-mm4 kernel (mga_vid-2.6.patch,16.22 KB, patch)
2004-04-07 15:36 UTC, K. Posern
Details | Diff
patch to apply after the patch for mplayer 1.0pre3try2 on 2.6er kernel (mga_vid-2.6-fred.patch,952 bytes, patch)
2004-04-07 15:39 UTC, K. Posern
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Nickeson 2004-02-06 10:00:39 UTC
When trying to emerge MPlayer (with USE="matrox") when using the 2.6.x kernel, it complains about not having the correct drivers for mga (matrox). This is a known bug by the mplayer dev team, and they have provided a patch, which can be found here: http://mplayerhq.hu/pipermail/mplayer-dev-eng/2003-July/019775.html
Can you please add it so it patches automatically when you try to emerge mplayer with the matrox use flag?

Reproducible: Always
Steps to Reproduce:
1. Have a 2.6.x kernel
2. Emerge Mplayer with USE="matrox" flag
3.

Actual Results:  
fails to emerge complaining about mga driver missing. 

Expected Results:  
emerged successfully

Applying this patch fixes the problem. So please, just add it to the patch list
for the matrox USE flag.
http://mplayerhq.hu/pipermail/mplayer-dev-eng/2003-July/019775.html
Comment 1 Marcus Fihlon 2004-03-31 06:43:18 UTC
This bug is still in mplayer-1.0_pre3-r5. Why isn't the patch included in the mplayer ebuild?
Comment 2 Patrick Kursawe (RETIRED) gentoo-dev 2004-03-31 06:56:00 UTC
because this was just a security update, nothing else was changed.
Comment 3 K. Posern 2004-04-07 02:29:34 UTC
Please!

WHY takes it *2* month to include this patch???

If this patch really solves the problem - PLEASE INCLUDE IT
or
change USE-FLAG to matrox_2.4!!!

You may also tell me how to do and I WILL HELP YOU BY DOING IT!!!
Comment 4 Patrick Kursawe (RETIRED) gentoo-dev 2004-04-07 03:19:36 UTC
First, PLEASE STOP SHOUTING since this does not help anyone. Thanks.

For the case you didn't notice, there are more open bugs for media-video than this one, and nearly 30 of them are older than this report.

If there's a patch for mplayer-1.0_pre3 that solves your problem, it would be very kind of you to attach it here. Copy+paste from the page you mentioned gives 

patching file drivers/mga_vid.c
Hunk #1 succeeded at 147 (offset -1 lines).
Hunk #2 FAILED at 287.
Hunk #3 succeeded at 1401 with fuzz 2 (offset 93 lines).
Hunk #4 FAILED at 1437.
Hunk #5 FAILED at 1452.
Hunk #6 succeeded at 1500 with fuzz 2 (offset -55 lines).
Hunk #7 FAILED at 1528.
Hunk #8 FAILED at 1581.
Hunk #9 FAILED at 1589.
Hunk #10 FAILED at 1600.
Hunk #11 succeeded at 1808 (offset 94 lines).
7 out of 11 hunks FAILED

Thank you very much in advance!
Comment 5 K. Posern 2004-04-07 15:33:09 UTC
Hi.

I didn't want to shout... (I was not aware that people interpret it as shouting...  I use big capitals just for more expression but not in an agressive or offending way...) so its no prob that I stop 'shouting'... :-)

O.k. so for the mga problem:

I found what you asked for at the following site:
http://zebra.fh-weingarten.de/~maxi/html/mplayer-dev-eng/2004-02/msg00402.html

I tested the second patch-link:
http://www.linuxops.net/~pw/mga_vid/mga_vid-2.6.patch

and it works (! :-) with or without the addition of Fr
Comment 6 K. Posern 2004-04-07 15:33:09 UTC
Hi.

I didn't want to shout... (I was not aware that people interpret it as shouting...  I use big capitals just for more expression but not in an agressive or offending way...) so its no prob that I stop 'shouting'... :-)

O.k. so for the mga problem:

I found what you asked for at the following site:
http://zebra.fh-weingarten.de/~maxi/html/mplayer-dev-eng/2004-02/msg00402.html

I tested the second patch-link:
http://www.linuxops.net/~pw/mga_vid/mga_vid-2.6.patch

and it works (! :-) with or without the addition of Frédéric LESPEZ: mga_vid-2.6-fred.patch:
http://zebra.fh-weingarten.de/~maxi/html/mplayer-dev-eng/2004-02/txt00038.txt

I used the original source file for MPlayer-1.0pre3try2 from the mplayer website.

So long.

Hope this helps and hope the patch can be included though... ?!
Comment 7 K. Posern 2004-04-07 15:36:14 UTC
Created attachment 28863 [details, diff]
the mga_vid patch worx with mplayer source v1.0pre3try2 for  2.6.5-rc3-mm4 kernel

the mga_vid patch worx with mplayer source v1.0pre3try2 for  2.6.5-rc3-mm4
kernel
Comment 8 K. Posern 2004-04-07 15:39:18 UTC
Created attachment 28864 [details, diff]
patch to apply after the patch for mplayer 1.0pre3try2 on 2.6er kernel

Fr
Comment 9 K. Posern 2004-04-07 15:39:18 UTC
Created attachment 28864 [details, diff]
patch to apply after the patch for mplayer 1.0pre3try2 on 2.6er kernel

Frédéric LESPEZ added a patch:

I have just made a little modification so that the module doesn't
allocate automatically a major number for the device (See the attached
file which is a patch to be applied after the mga_vid-2.6.patch above).

Hope it helps.

Regards,
Fred.
Comment 10 Patrick Kursawe (RETIRED) gentoo-dev 2004-05-11 09:48:08 UTC
mplayer-1.0_pre4-r2.ebuild should fix this... was quite some fight, the patch needed to be modified slightly to make sure we get the right kernel version and I had to learn that cd has options in order to stop the sandbox violations.
Give it a try when it hits your rsync mirrors.
Comment 11 Patrick Kursawe (RETIRED) gentoo-dev 2004-05-11 09:51:57 UTC
*** Bug 26552 has been marked as a duplicate of this bug. ***
Comment 12 Stefan Sperling 2004-05-18 16:04:15 UTC
It's been a week now, and mplayer-1.0_pre4-r2.ebuild does not seem to be in cvs yet.
Is this still going to happen? I just got a G550 so I am eagerly waiting for 
the -r2 ebuild.
Comment 13 Patrick Kursawe (RETIRED) gentoo-dev 2004-05-18 23:35:02 UTC
You see me quite ashamed... I had everything ready, just forgot to commit.
Comment 14 Stefan Sperling 2004-05-19 10:25:41 UTC
I reckoned. Still, I did not dare to tap you on the nose and ask "have you simply forgotten to commit?". Developers are usually very busy and have very good reasons 
for everything :) 
Anyway, it's there now, and it works. Thanks :)
Comment 15 Matthias Muthmann 2004-05-19 11:15:52 UTC
The patch also worked for me!
Thanks.
Comment 16 gtaluvit 2004-05-20 11:23:12 UTC
Not fixed for me.  Output below:

gcc -shared -Wl,-soname,libpostproc.so.0 \
-o libpostproc.so postprocess_pic.o
make mga_vid.ko mga_vid_test
make[1]: Entering directory `/var/tmp/portage/mplayer-1.0_pre4-r2/work/MPlayer-1.0pre4/drivers'
make -C /lib/modules/2.6.5/build SUBDIRS=/var/tmp/portage/mplayer-1.0_pre4-r2/work/MPlayer-1.0pre4/drivers modules
make[2]: Entering directory `/usr/src/linux-2.6.5'
*** Warning: Overriding SUBDIRS on the command line can cause
***          inconsistencies
  MKELF   scripts/elfconfig.h
ACCESS DENIED  open_wr:   /usr/src/linux-2.6.5/scripts/elfconfig.h
/bin/sh: line 1: scripts/elfconfig.h: Permission denied
make[3]: *** [scripts/elfconfig.h] Error 1
make[2]: *** [scripts] Error 2
make[2]: Leaving directory `/usr/src/linux-2.6.5'
make[1]: *** [mga_vid.ko] Error 2
make[1]: Leaving directory `/var/tmp/portage/mplayer-1.0_pre4-r2/work/MPlayer-1.0pre4/drivers'
make: *** [all] Error 2

!!! ERROR: media-video/mplayer-1.0_pre4-r2 failed.
!!! Function src_compile, Line 282, Exitcode 2
!!! Failed to build matrox driver!

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/tmp/sandbox-media-video_-_mplayer-1.0_pre4-r2-13445.log"

open_wr:   /usr/src/linux-2.6.5/scripts/elfconfig.h
--------------------------------------------------------------------------------
Comment 17 Patrick Kursawe (RETIRED) gentoo-dev 2004-05-23 23:51:49 UTC
gtaluvit: I'd really like to find out why this happens on your system since I'd rather prefer not to make the whole kernel tree writable from the mplayer build process. Did you compile your kernel/kernel modules before trying to emerge mplayer?
Comment 18 gtaluvit 2004-05-24 04:51:01 UTC
Yes.  /usr/src/linux points to /usr/src/linux-2.6.5 and its the currently active and last built kernel.  I ran make just to make sure that hadn't run make clean or anything like that in the meantime and get this:

gtaluvit linux # make
  MKELF   scripts/elfconfig.h
  HOSTCC  scripts/file2alias.o
  HOSTCC  scripts/modpost.o
  HOSTCC  scripts/sumversion.o
  HOSTLD  scripts/modpost
  CC      arch/i386/kernel/asm-offsets.s
  CHK     include/asm-i386/asm_offsets.h
  CHK     include/linux/compile.h
Kernel: arch/i386/boot/bzImage is ready
  Building modules, stage 2.
  MODPOST

So it looks like something internally MAY have changed though I don't know what.  I'm going to retry mplayer when I get to work.  Also, to date I have been using the manual process with mplayer to get this to work by manually patching the ebuild with the source patch, and symlinking x86 and i386 directories, and running with FEATURES=-sandbox.  Since those symlinks still exist, i'm wondering if a past run borked my kernel tree.  If mplayer doesn't compile when I try at work, I'll destroy my kernel tree, reemerge it, rebuild, and see if it works then.
Comment 19 gtaluvit 2004-05-24 06:12:20 UTC
OK, failed again in a different place.  I'm going to have to rebuild my kernel tree and give that a shot.

make[2]: Entering directory `/usr/src/linux-2.6.5'
*** Warning: Overriding SUBDIRS on the command line can cause
***          inconsistencies
make[3]: `arch/i386/kernel/asm-offsets.s' is up to date.
  CHK     include/asm-i386/asm_offsets.h
ACCESS DENIED  open_wr:   /usr/src/linux-2.6.5/include/asm-i386/asm_offsets.h.tmp
/bin/sh: line 1: include/asm-i386/asm_offsets.h.tmp: Permission denied
  UPD     include/asm-i386/asm_offsets.h
mv: cannot stat `include/asm-i386/asm_offsets.h.tmp': No such file or directory
make[2]: *** [include/asm-i386/asm_offsets.h] Error 1
make[2]: Leaving directory `/usr/src/linux-2.6.5'
make[1]: *** [mga_vid.ko] Error 2
make[1]: Leaving directory `/var/tmp/portage/mplayer-1.0_pre4-r2/work/MPlayer-1.0pre4/drivers'
make: *** [all] Error 2

!!! ERROR: media-video/mplayer-1.0_pre4-r2 failed.
!!! Function src_compile, Line 282, Exitcode 2
!!! Failed to build matrox driver!

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/tmp/sandbox-media-video_-_mplayer-1.0_pre4-r2-18673.log"

open_wr:   /usr/src/linux-2.6.5/include/asm-i386/asm_offsets.h.tmp
--------------------------------------------------------------------------------
Comment 20 gtaluvit 2004-05-24 07:31:57 UTC
YAY!  Reemerge dev sources, made the kernel, and then reemerge mplayer and this time it worked.  Looks like the old patch with FEATURES=-sandbox borked my kernel for the newer version.  You might want to put a note about that in the ebuild if someone has matrox enabled.
Comment 21 Patrick Kursawe (RETIRED) gentoo-dev 2004-05-26 00:28:33 UTC
There seems to be a cleaner solution, I just didn't get it working yet - see bug #51903
Comment 22 gtaluvit 2004-05-27 12:53:31 UTC
Gack!  Looks like -r3 broke things again.

-o libpostproc.so postprocess_pic.o
matrox
make mga_vid.ko mga_vid_test
make[1]: Entering directory `/var/tmp/portage/mplayer-1.0_pre4-r3/work/MPlayer-1.0pre4/drivers'
make -C /lib/modules/2.6.5/build O=/var/tmp/portage/mplayer-1.0_pre4-r3/temp SUBDIRS=/var/tmp/portage/mplayer-1.0_pre4-r3/work/MPlayer-1.0pre4/drivers modules
make[2]: Entering directory `/usr/src/linux-2.6.5'
  Using /usr/src/linux-2.6.5 as source for kernel
  /usr/src/linux-2.6.5 is not clean, please run 'make mrproper'
  in the '/usr/src/linux-2.6.5' directory.
make[3]: *** [prepare1] Error 1
make[2]: *** [modules] Error 2
make[2]: Leaving directory `/usr/src/linux-2.6.5'
make[1]: *** [mga_vid.ko] Error 2
make[1]: Leaving directory `/var/tmp/portage/mplayer-1.0_pre4-r3/work/MPlayer-1.0pre4/drivers'
make: *** [all] Error 2

!!! ERROR: media-video/mplayer-1.0_pre4-r3 failed.
!!! Function src_compile, Line 283, Exitcode 2
!!! Failed to build matrox driver!

Now it said to make mrproper, so I did, and it still broke.  I deleted all the sources and reemerged, remade, still have the same issue.
Comment 23 Patrick Kursawe (RETIRED) gentoo-dev 2004-05-28 00:00:44 UTC
Hmpf. This works fine for 2.6.6 and I can reproduce your problem with 2.6.5 - this is really annoying. Investigating...
Comment 24 Patrick Kursawe (RETIRED) gentoo-dev 2004-05-28 02:44:03 UTC
There's an explicit check in the 2.6.5 Makefile in line 591+ which causes this problem and which was removed in 2.6.6...

I've added a workaround to CVS. Let's see where it breaks with untested versions :-/
Comment 25 Patrick Kursawe (RETIRED) gentoo-dev 2004-06-04 13:57:26 UTC
*** Bug 52971 has been marked as a duplicate of this bug. ***