View previous topic :: View next topic |
Author |
Message |
Becks Tux's lil' helper
Joined: 06 Dec 2002 Posts: 90
|
Posted: Mon Dec 09, 2002 3:53 pm Post subject: Mplayer & Matrox video output |
|
|
Some hints for those who also use a matrox card (G200, G400 f.e.) and want to be able to use the video output modus mga and/or xmga...
Step 1 - get (at least the package) for mplayer.
The easiest way is to emerge the package:
Step 2 - Make the driver for mplayer (like written in the docu of mplayer):
Find and unpack the soureccode (located in /usr/portage/distfiles) to a directory (here /usr/src):
Code: |
> cd /usr/src
> cp /usr/portage/distfiles/MPlayer-XXXXXX.tar.bz2 .
> bzip2 -d MPlayer-XXXXXX.tar.bz2
> tar -xvf MPlayer-XXXXXX.tar.bz2
|
You'll find a directory then in /usr/src named MPlayer-XXXXXX
Step 3 - Find and compile the driver:
The driver is located in MPlayer-XXXXXX/drivers and is compiled by typing make in this directory:
Code: |
> cd MPlayer-XXXXXX/drivers
> make
|
Now you'll find the driver called mga_drv.o in the same directory
Step 4 - driver installation
Copy the driver to the dir. where the other kernel-modules can be found (/lib/modules/X.Y.ZZ where X.Y.ZZ is the kernel-version - f.e. 2.4.20), edit the config-file for the modules, create a new device-entry and update the descriptions for the kernel modules.
4a - copy module:
Code: |
> cp mga_drv.o /lib/modules/X.Y.ZZ/
|
4b - configfile:
Code: |
> nano -w /etc/modules.conf
add the following line at the end of the file:
alias char-major-178 mga_vid
|
4c - the new device
Code: |
> mknod /dev/mga_vid c 178 0
|
change the permissions so any user can use the device:
Code: |
> chown -R root:users /dev/mga_vid
|
4d - Update the module descriptions:
Step 5 - Load the module and rebuild Mplayer
Code: |
> modprobe mga_vid
> lsmod
(should show you the module mga_vid.o as entry)
> emerge mplayer
|
Mplayer now finds the new device-entry and the driver for the matrox and will be built with support for those devices.
For other cards or another docu about this: read the docu
Alex |
|
Back to top |
|
|
madripper n00b
Joined: 13 Jul 2004 Posts: 6
|
Posted: Wed Jul 28, 2004 9:26 pm Post subject: |
|
|
great howto! this was the only thing that got it working for me. -ben! |
|
Back to top |
|
|
enrique Guru
Joined: 03 Sep 2002 Posts: 342 Location: Denmark
|
|
Back to top |
|
|
madripper n00b
Joined: 13 Jul 2004 Posts: 6
|
Posted: Fri Jul 30, 2004 10:05 pm Post subject: |
|
|
Thanks! Your scripts were perfect for what I need, I appreicate it. -ben! |
|
Back to top |
|
|
himasaram n00b
Joined: 28 May 2004 Posts: 28 Location: Gbg, Sweden
|
Posted: Sat Aug 14, 2004 8:02 pm Post subject: |
|
|
Hi! I'm trying to get video playback working with my Matrox G200. The best solution I have right now is to use mplayer's x11 video output driver and change my resolution to 640x480, as this driver doesn't support fullscreen. This way I get an acceptable, but horribly rough output (especially with subs). Any other driver shows very unpleasant artifacts all over the screen (xv), chrashes the system (directfb) or plain doesn't work (the rest).
While trying to follow your steps, I get as far as step 3, where compile failes.
Code: | make mga_vid.ko mga_vid_test
make[1]: Entering directory `/usr/src/MPlayer-1.0pre5/drivers'
make -C /lib/modules/`uname -r`/build SUBDIRS=/usr/src/MPlayer-1.0pre5/drivers m odules
make[2]: Entering directory `/usr/src/linux-2.6.7-gentoo-r13'
CC [M] /usr/src/MPlayer-1.0pre5/drivers/mga_vid.o
In file included from include/asm/processor.h:18,
from include/asm/thread_info.h:16,
from include/linux/thread_info.h:21,
from include/linux/spinlock.h:12,
from include/linux/capability.h:45,
from include/linux/sched.h:7,
from include/linux/module.h:10,
from /usr/src/MPlayer-1.0pre5/drivers/mga_vid.c:38:
include/asm/system.h: In function `__set_64bit_var':
include/asm/system.h:193: warning: dereferencing type-punned pointer will break strict-aliasing rules
include/asm/system.h:193: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c: At top level:
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c:152: warning: static declaration for `simple_strtol' follows non-static
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c: In function `mga_vid_find_card':
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c:1350: error: structure has no member named `name'
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c:1355: error: structure has no member named `name'
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c:1360: error: structure has no member named `name'
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c:1365: error: structure has no member named `name'
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c:1370: error: structure has no member named `name'
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c: In function `mga_vid_release':
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c:1497: warning: `MOD_DEC_USE_COUNT' is deprecated (declared at include/linux/module.h:541)
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c: In function `mga_vid_open':
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c:1511: error: request for member `value' in something not a structure or union
/usr/src/MPlayer-1.0pre5/drivers/mga_vid.c:1542: warning: `MOD_INC_USE_COUNT' is deprecated (declared at include/linux/module.h:529)
cc1: Permission denied: opening dependency file /usr/src/MPlayer-1.0pre5/drivers/.mga_vid.o.d
make[3]: *** [/usr/src/MPlayer-1.0pre5/drivers/mga_vid.o] Error 1
make[2]: *** [_module_/usr/src/MPlayer-1.0pre5/drivers] Error 2
make[2]: Leaving directory `/usr/src/linux-2.6.7-gentoo-r13'
make[1]: *** [mga_vid.ko] Error 2
make[1]: Leaving directory `/usr/src/MPlayer-1.0pre5/drivers'
make: *** [all] Error 2
|
This is with MPlayer-1.0pre5. pre4 gave the same output.
Any hint would be hugely appreciated! |
|
Back to top |
|
|
daff Apprentice
Joined: 02 Jul 2003 Posts: 232 Location: Vienna, Austria
|
Posted: Mon Aug 16, 2004 12:56 pm Post subject: |
|
|
Appearantly the mga_vid module/driver doesn't work anymore, at least not with any 2.6.x kernel (certainly not with mine, gentoo-dev 2.6.7-r12).
Also, support for any cards of the G200/G400/G550 series seems to be pretty f*cked in 2.6, seems you're lucky if you just get matroxfb to work so it doesn't panic your kernel when booting.
That's sad, the G400/G550 are such nice cards. _________________ Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom. |
|
Back to top |
|
|
blscreen Tux's lil' helper
Joined: 04 Mar 2003 Posts: 118 Location: Innsbruck
|
Posted: Tue Aug 17, 2004 10:44 pm Post subject: |
|
|
mga and matroxfb works here with gentoo-dev-sources 2.6.8.
BTW: wouldn't it be possible to let the mplayer ebuild do the required steps for mga support? There is a matrox USE-flag which causes the mga_vid module to be built, but it is not loaded before the mplayer configure script. So there is no /dev/mga_vid on devfs systems resulting in a negative test for mga in the configure script. |
|
Back to top |
|
|
daff Apprentice
Joined: 02 Jul 2003 Posts: 232 Location: Vienna, Austria
|
Posted: Wed Aug 18, 2004 7:28 am Post subject: |
|
|
blscreen: Could you probably post the steps you took to get mga (is that mga_vid?) and matroxfb working? I am just not able to get them working (I run a gentoo-sources-2.6.7-r12 but maybe it's time to update?).
Building mga_vid fails for me with the very long error message posted above and matroxfb (lots of modules), when loaded, REALLY screws up my console (lots and lots of nice, small, colored dots and dotted lines, all over the screen, nothing readable anywhere).
I'd really appreciate it as certainly do others, too since the steps outlined in the parent post are a bit dated (Dec 2002). _________________ Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom. |
|
Back to top |
|
|
blscreen Tux's lil' helper
Joined: 04 Mar 2003 Posts: 118 Location: Innsbruck
|
Posted: Wed Aug 18, 2004 11:24 am Post subject: |
|
|
For mga I used the steps from the initial post. 4c is not required if you use devfs, instead of 4d you can then add a line in /etc/modules.d/aliases (not sure if this is really needed)
Code: | alias /dev/mga_vid mga_vid |
This are the kernel settings I used for matroxfb:
Code: | #
# Graphics support
#
CONFIG_FB=y
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
# CONFIG_FB_VGA16 is not set
CONFIG_FB_VESA=y
CONFIG_VIDEO_SELECT=y
# CONFIG_FB_HGA is not set
# CONFIG_FB_RIVA is not set
CONFIG_FB_MATROX=y
# CONFIG_FB_MATROX_MILLENIUM is not set
# CONFIG_FB_MATROX_MYSTIQUE is not set
CONFIG_FB_MATROX_G450=y
CONFIG_FB_MATROX_G100=y
CONFIG_FB_MATROX_I2C=m
CONFIG_FB_MATROX_MAVEN=m
CONFIG_FB_MATROX_MULTIHEAD=y
# CONFIG_FB_RADEON_OLD is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_VIRTUAL is not set
#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_MDA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
# CONFIG_FONT_6x11 is not set
# CONFIG_FONT_PEARL_8x8 is not set
# CONFIG_FONT_ACORN_8x8 is not set
# CONFIG_FONT_MINI_4x6 is not set
CONFIG_FONT_SUN8x16=y
# CONFIG_FONT_SUN12x22 is not set
#
# Logo configuration
#
# CONFIG_LOGO is not set
CONFIG_FB_SPLASH=y |
You don't need CONFIG_FB_VESA, it's just there to have a choice. You won't have CONFIG_FB_SPLASH until you patch your kernel as described in the gensplash-howto.
My kernel commandline option for matroxfb:
Code: | video=matroxfb:fv:75,vesa:0x1BB |
The video mode 0x1BB is 1280x1024, fv:75 gives a refresh-rate of 75 Hz. For a list of valid options have a look at Code: | /usr/src/linux/Documentation/fb/matroxfb.txt |
|
|
Back to top |
|
|
karnesky Apprentice
Joined: 18 Mar 2004 Posts: 218
|
Posted: Thu Aug 19, 2004 2:21 pm Post subject: |
|
|
In the 2.6 kernels, I have been happy using mgatv from the sourceforge CVS. It just allows watching tv in overlay mode, but it uses v4l2. I have also has excellent results using driver_fb from CVS, which has more features & is v4l1. |
|
Back to top |
|
|
karnesky Apprentice
Joined: 18 Mar 2004 Posts: 218
|
Posted: Thu Aug 19, 2004 2:26 pm Post subject: |
|
|
daff wrote: | Building mga_vid fails for me with the very long error message posted above and matroxfb (lots of modules), when loaded, REALLY screws up my console (lots and lots of nice, small, colored dots and dotted lines, all over the screen, nothing readable anywhere). | This screen corruption seems common on the matrox cards, at least with the drivers I've used and for G400s (it was in the README). The work around is to start the driver in X & switch to another virtual terminal (Ctrl-Alt-F1for example) & switching back to X (Alt-F7 for example). |
|
Back to top |
|
|
daff Apprentice
Joined: 02 Jul 2003 Posts: 232 Location: Vienna, Austria
|
Posted: Thu Aug 19, 2004 3:29 pm Post subject: |
|
|
Thanks for the information blscreen and karnesky!
Do you know if the gentoo-dev-sources are already patched for CONFIG_FB_SPLASH (I don't think so) or if it works patching them? The howto seems to describe the vanilla-dev-sources.
Unfortunately my attempts fail, as told, when I try to make the mga_vid module in /usr/src/MPlayer-1.0pre4/drivers with a message like the following (sorry for the long post). I think I'll try gentoo-dev-sources-2.6.8 and see if there's a difference.
Code: |
gcc -O2 -D__KERNEL__ -DMODULE -include /usr/src/linux/include/linux/modversions.h -Wall -I/usr/src/linux/include -c mga_vid.c
<command line>:138445173:33208: /usr/src/linux/include/linux/modversions.h: No such file or directory
In file included from /usr/src/linux/include/asm/processor.h:18,
from /usr/src/linux/include/asm/thread_info.h:16,
from /usr/src/linux/include/linux/thread_info.h:21,
from /usr/src/linux/include/linux/spinlock.h:12,
from /usr/src/linux/include/linux/capability.h:45,
from /usr/src/linux/include/linux/sched.h:7,
from /usr/src/linux/include/linux/module.h:10,
from mga_vid.c:38:
/usr/src/linux/include/asm/system.h: In function `__set_64bit_var':
/usr/src/linux/include/asm/system.h:193: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/src/linux/include/asm/system.h:193: warning: dereferencing type-punned pointer will break strict-aliasing rules
mga_vid.c: At top level:
mga_vid.c:152: warning: static declaration for `simple_strtol' follows non-static
mga_vid.c:354: error: syntax error before "dev_handle"
mga_vid.c:354: warning: type defaults to `int' in declaration of `dev_handle'
mga_vid.c:354: warning: initialization makes integer from pointer without a cast
mga_vid.c:354: warning: data definition has no type or storage class
mga_vid.c:362: error: syntax error before "devfs_handle_t"
mga_vid.c:362: warning: no semicolon at end of struct or union
mga_vid.c:398: error: syntax error before '}' token
mga_vid.c:398: warning: type defaults to `int' in declaration of `mga_card_t'
mga_vid.c:398: warning: data definition has no type or storage class
mga_vid.c:405: error: syntax error before '*' token
mga_vid.c:405: warning: type defaults to `int' in declaration of `mga_cards'
mga_vid.c:405: warning: data definition has no type or storage class
mga_vid.c:451: error: syntax error before '*' token
mga_vid.c: In function `mga_vid_frame_sel':
mga_vid.c:453: error: `card' undeclared (first use in this function)
mga_vid.c:453: error: (Each undeclared identifier is reported only once
mga_vid.c:453: error: for each function it appears in.)
mga_vid.c:454: error: `frame' undeclared (first use in this function)
mga_vid.c: At top level:
mga_vid.c:473: error: syntax error before '*' token
mga_vid.c: In function `mga_vid_write_regs':
mga_vid.c:476: error: `card' undeclared (first use in this function)
mga_vid.c:481: error: `restore' undeclared (first use in this function)
mga_vid.c: At top level:
mga_vid.c:699: error: syntax error before '*' token
mga_vid.c: In function `mga_vid_set_config':
mga_vid.c:703: error: `card' undeclared (first use in this function)
mga_vid.c: In function `mga_vid_ioctl':
mga_vid.c:1186: error: `card' undeclared (first use in this function)
mga_vid.c:1186: error: syntax error before ')' token
mga_vid.c: At top level:
mga_vid.c:1317: error: syntax error before '*' token
mga_vid.c: In function `mga_vid_find_card':
mga_vid.c:1324: error: `card' undeclared (first use in this function)
mga_vid.c:1350: error: structure has no member named `name'
mga_vid.c:1355: error: structure has no member named `name'
mga_vid.c:1360: error: structure has no member named `name'
mga_vid.c:1365: error: structure has no member named `name'
mga_vid.c:1370: error: structure has no member named `name'
mga_vid.c: At top level:
mga_vid.c:1385: error: syntax error before '*' token
mga_vid.c: In function `mga_param_buff_fill':
mga_vid.c:1388: error: `card' undeclared (first use in this function)
mga_vid.c: In function `mga_vid_read':
mga_vid.c:1407: error: `card' undeclared (first use in this function)
mga_vid.c:1407: error: syntax error before ')' token
mga_vid.c:1412: warning: type defaults to `int' in declaration of `_y'
mga_vid.c:1412: warning: comparison of distinct pointer types lacks a cast
mga_vid.c: In function `mga_vid_write':
mga_vid.c:1420: error: `card' undeclared (first use in this function)
mga_vid.c:1420: error: syntax error before ')' token
mga_vid.c: In function `mga_vid_mmap':
mga_vid.c:1452: error: `card' undeclared (first use in this function)
mga_vid.c:1452: error: syntax error before ')' token
mga_vid.c: In function `mga_vid_release':
mga_vid.c:1481: error: `card' undeclared (first use in this function)
mga_vid.c:1488: error: syntax error before ')' token
mga_vid.c:1497: warning: `MOD_DEC_USE_COUNT' is deprecated (declared at /usr/src/linux/include/linux/module.h:541)
mga_vid.c: In function `mga_vid_open':
mga_vid.c:1508: error: `card' undeclared (first use in this function)
mga_vid.c:1511: error: request for member `value' in something not a structure or union
mga_vid.c:1536: error: syntax error before ')' token
mga_vid.c:1542: warning: `MOD_INC_USE_COUNT' is deprecated (declared at /usr/src/linux/include/linux/module.h:529)
mga_vid.c: At top level:
mga_vid.c:1573: error: syntax error before '*' token
mga_vid.c: In function `cards_init':
mga_vid.c:1581: error: `card' undeclared (first use in this function)
mga_vid.c:1584: error: `dev' undeclared (first use in this function)
mga_vid.c:1591: error: `card_number' undeclared (first use in this function)
mga_vid.c:1690: warning: implicit declaration of function `devfs_register'
mga_vid.c:1690: error: `DEVFS_FL_AUTO_DEVNUM' undeclared (first use in this function)
mga_vid.c: In function `mga_vid_initialize':
mga_vid.c:1734: error: `DEVFS_FL_AUTO_DEVNUM' undeclared (first use in this function)
mga_vid.c: In function `cleanup_module':
mga_vid.c:1752: error: `card' undeclared (first use in this function)
mga_vid.c:1769: warning: implicit declaration of function `devfs_unregister'
make: *** [mga_vid.o] Error 1 |
_________________ Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom. |
|
Back to top |
|
|
blscreen Tux's lil' helper
Joined: 04 Mar 2003 Posts: 118 Location: Innsbruck
|
Posted: Fri Aug 20, 2004 5:40 am Post subject: |
|
|
This bug should be fixed in the latest ~x86 version. In your /etc/portage/package.keywords (create it if it is not there) put the line
Code: | media-video/mplayer ~x86 |
end try the steps from the initial post again.
Bootsplash works up to kernel 2.6.7, gentoo-dev-sources up to 2.6.7 have this patch already applied. But most likely there will be no bootsplash patches for newer kernels. You have to use gensplash then. I'm running gensplash on 2.6.8 gentoo sources, and though I have not tested it, I see no reason why it should not work with vanilla as well. Good luck |
|
Back to top |
|
|
himasaram n00b
Joined: 28 May 2004 Posts: 28 Location: Gbg, Sweden
|
Posted: Fri Aug 27, 2004 12:27 pm Post subject: |
|
|
I got my setup working with my Matrox card after emerging the latest directfb-drivers and running mplayer -vo directfb. It's impossible to control resolution, but otherwise a quite slick solution. Good luck! |
|
Back to top |
|
|
dmr n00b
Joined: 09 Aug 2004 Posts: 10 Location: Wroclaw, Poland
|
Posted: Fri Aug 27, 2004 12:31 pm Post subject: |
|
|
blscreen wrote: | mga and matroxfb works here with gentoo-dev-sources 2.6.8. |
Do you have any problems when switching to X?
I gave up matroxfb for Xorg's sake as I read a few comments about bad behaviour when those two work together.
As for the mga_vid. MPlayer 1.0pre5 works fine here with xmga video output. However I had to apply this one to prevent mga modules being deleted before install
This one can be useful too, but I haven't tried it. _________________ Szymon |
|
Back to top |
|
|
blscreen Tux's lil' helper
Joined: 04 Mar 2003 Posts: 118 Location: Innsbruck
|
Posted: Fri Aug 27, 2004 2:01 pm Post subject: |
|
|
dmr wrote: | Do you have any problems when switching to X?
I gave up matroxfb for Xorg's sake as I read a few comments about bad behaviour when those two work together. |
No problems, but I'm not using Xorg.
dmr wrote: | As for the mga_vid. MPlayer 1.0pre5 works fine here with xmga video output. However I had to apply this one to prevent mga modules being deleted before install |
Yes, same bug in the ebuild here. I manually installed and loaded the module to get around this. |
|
Back to top |
|
|
daff Apprentice
Joined: 02 Jul 2003 Posts: 232 Location: Vienna, Austria
|
Posted: Mon Aug 30, 2004 8:52 pm Post subject: |
|
|
Now it finally works. Finally, finally, finally.
I applied attachment 37867 (thanks dmr) to 1.0pre4-r7, rebuilt it (mplayer), and it works now with xmga.
Using Xorg, gentoo-dev-sources-2.6.8-r3 and my G400.
However building the driver from /usr/src/linux/MPlayer-1.0pre4-r7/drivers doesn't work at all. Fails with the errors I posted above. Dunno what this is.
Now to get the G400's second head working in a usable manner. _________________ Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom. |
|
Back to top |
|
|
|