Log in Register FAQ Memberlist Search pcHDTV Forum Index
pcHDTV Forum

pcHDTV Forum Index -> General pcHDTV topics -> Getting MPEG acceleration to work on Geforce 4 cards.
Post new topic  This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic 
Getting MPEG acceleration to work on Geforce 4 cards.
PostPosted: Fri Oct 17, 2003 9:55 am Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




I figured out all the things that were preventing the XvMC extensions from working (except for one last problem). Here are some tips that boarder on common sense but I'll mention them anyway:

1. Make sure you have the latest Nvidia drivers. Nvidia added the XvMC sometime after I last downloaded the driver. If you don't have /usr/X11R6/lib/libXvMCNVIDIA.so then you need to get the latest driver off their site.

2. Make sure that your XF86Config has Driver "nvidia" instead of Driver "nv". Yes the README file says this too but it's easy to overlook.

3. If you're using mplayer, make sure you've compiled the latest version with XvMC extensions enabled. If configure still refuses to compile with XvMC enabled then something is still missing. I haven't tried to recompile xine yet.

4. Remove the old Nvidia driver before installing the new one. For some reason the XvMC initialization in mplayer was returning failure even after I updated the driver. Removing the old one and then reinstalling the new one fixed this.

Now there's just one last problem. While the mplayer output clearly says it's using the XvMC extensions now, it isn't running any faster for me! I'm using this command line:

mplayer -vo xvmc -vc ffmpeg12mc idct=2 -cache 8192 /dev/dtv

Without -framedrop, it will quickly fall behind (I'm running an Athlon at only 1.4 Ghz). So there's still some more funny business going on.

Very educational!
View user's profile Send private message
PostPosted: Sun Dec 14, 2003 5:00 pm Reply with quote
Ulmo
 
Joined: 06 Nov 2003
Posts: 95
Location: Aptos,CA,USA




Some additional considerations for XvMC:
[I'm posting this a bit rushed, and my writing form isn't good lately, so sorry about that.]

NVIDIA offers a really great feature called TwinView. It won't work at the same time as XvMC. I had to disable my TwinView to get XvMC. I don't consider it a big loss; others do. TwinView is an awesome product, so those who use it a lot will have to really consider this (there are other options, but some cost money; getting more NVIDIA cards to put into the system might be the answer, since the good ones are so cheap! However, that would require getting PCI versions, which might not be as cheap as the AGP versions; I don't even know).


NVIDIA's TwinView mode disables Video-MotionCompensation (XvMC); use xdpyinfo to verify whether you see "Video-MotionCompensation" in the list. You can't use XvMC and TwinView at the same time.

I skimmed their very well written instructions. I suggest you read them yourself, since they answer just about all these types of questions with a lot of direct pertinent good information. For instance, from their instructions:

NVIDIA Accelerated Linux Driver Set README & Installation Guide
Last Updated: $Date: 2003/07/16 $
Most Recent Driver: 1.0-4496

[...]

The NVIDIA Accelerated Linux Driver Set consists of the following
components (the file in parenthesis is the full name of the component
after installation; "x.y.z" denotes the current version -- in these
cases appropriate symlinks are created during installation):

[...]

o Two XvMC (X-Video Motion Compensation) libraries: a static library
and a shared library (/usr/X11R6/lib/libXvMCNVIDIA.a,
/usr/X11R6/lib/libXvMCNVIDIA.so.x.y.z); please see (app-p) APPENDIX P:
XVMC SUPPORT for details.

o A kernel module (/lib/modules/`uname -r`/video/nvidia.o
or /lib/modules/`uname -r`/kernel/drivers/video/nvidia.o). This

[...]


Thery have a who section on XvMC:

__________________________________________________________________________

(app-p) APPENDIX P: XVMC SUPPORT
__________________________________________________________________________

This release includes support for the X-Video Motion Compensation (XvMC)
version 1.0 API on GeForce4 and GeForce FX products only. There is a static
library "libXvMCNVIDIA.a" and a dynamic one "libXvMCNVIDIA_dynamic.so"
which is suitable for dlopening. GeForce4 MX and GeForce FX products support
both XvMC's "IDCT" and "motion-compensation" levels of acceleration.
GeForce4 Ti products only support the motion-compensation level. AI44 and IA44
subpictures are supported. 4:2:0 Surfaces up to 2032x2032 are supported.

libXvMCNVIDIA observes the XVMC_DEBUG environment variable and will
provide some debug output to stderr when set to an appropriate integer
value. '0' disables debug output. '1' enables debug output for failure
conditions. '2' or higher enables output of warning messages.

-----------

Then, there's an important statement here, in
Appendix i (lll lll):
__________________________________________________________________________

(app-r) APPENDIX R: CONFIGURING MULTIPLE X SCREENS ON ONE CARD
__________________________________________________________________________

Graphics chips that support TwinView (see (app-i) APPENDIX I: CONFIGURING
TWINVIEW) can also be configured to treat each connected display device
as a separate X screen.

While there are several disadvantages to this approach as compared to
TwinView (eg: windows cannot be dragged between X screens, hardware
accelerated OpenGL cannot span the two X screens), it does offer several
advantages over TwinView:

[...]

o Hardware that can only be used on one display at a time (eg:
video overlays, hardware accelerated RGB overlays), and which
consequently cannot be used at all when in TwinView, can be
exposed on the first X screen when each display is a separate
X screen.

..........

I am quite happy so far with my NVIDIA experience. TwinView, multiple X screens out, MPEG decompression ... great for the price. (I got the Asus GeForce FX 5200, and it's in my Asus P4P800 Deluxe MB.)


If you have TwinView on, I think you'll know it, because you probably had to configure it, but anyway, to change it, it's in whereever you have XF86Config (often /etc/X11/XF86Config).

You have to verify in your X startup log that it's getting the nvidia module mentioned above. lsmod to see if it's there. modprobe/insmod/modules.conf/other install method it if it isn't there; it may try to load on its own, but I have to put it in myself. You can see if it's working in xdpyinfo by the information it has, or in the X startup information in the X log (such as in
XFree86.0.log).

There's more below ...

In a post on ... I can't find it. I learned this from someone else in their post. It had more information. Sorry. I remember this part:

xdpyinfo should include the following:

[... among other things NVIDIA driver uses ...]
XTEST
XVideo
XVideo-MotionCompensation

near the end of that list. If you don't see
XVideo-MotionCompensation
you don't have it (that's XvMC unabreviated in
X).

------------
[mythtv-users] XvMC
Jelle Kalf jelle at kalf.org
Mon Dec 1 09:56:59 EST 2003

* Previous message: [mythtv-users] Jumping picture
* Next message: [mythtv-users] XvMC
* Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

For me it broke twinview. I was unable to get it working.

You enable XvMC by editting the settings.pro file or if you use gentoo do
this: env USE="nvidia" emerge mythtv


Jelle Kalf.

-----
[Ulmo:]
Well, I'm trying that right now, and there are some problems. First, you can see, normal Gentoo Myth 0.13 (now in ~x86) doesn't have a dynamic link to my NVIDIA drivers (the good ones, which come directly from NDIVIDA, and the only ones I'll consider for now because they work so well and have so many features). When I do the above (in /etc/make.conf) and then "emerge -p mythtv", I get:


ulmo@A:~:4997$ sudo vi /etc/make.conf
Password:
Sorry, try again.
Password:
ulmo@A:~:4998$ ldd $(which mythfrontend)
libmyth-0.13.so.0 => /usr/lib/libmyth-0.13.so.0 (0x40020000)
libXv.so.1 => /usr/X11R6/lib/libXv.so.1 (0x4017a000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x4017f000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40261000)
libXxf86vm.so.1 => /usr/X11R6/lib/libXxf86vm.so.1 (0x40271000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40277000)
libmp3lame.so.0 => /usr/lib/libmp3lame.so.0 (0x40302000)
libqt-mt.so.3 => /usr/qt/3/lib/libqt-mt.so.3 (0x403b5000)
libpthread.so.0 => /lib/libpthread.so.0 (0x40a79000)
libstdc++.so.5 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libstdc++.so.5 (0x40ac8000)
libm.so.6 => /lib/libm.so.6 (0x40b74000)
libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libgcc_s.so.1 (0x40b96000)
libc.so.6 => /lib/libc.so.6 (0x40b9f000)
libdl.so.2 => /lib/libdl.so.2 (0x40cc7000)
libz.so.1 => /usr/lib/libz.so.1 (0x40cca000)
libasound.so.2 => /usr/lib/libasound.so.2 (0x40ce1000)
liblirc_client.so.0 => /usr/lib/liblirc_client.so.0 (0x40da0000)
libaudio.so.2 => /usr/X11R6/lib/libaudio.so.2 (0x40da5000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x40dbb000)
libmng.so.1 => /usr/lib/libmng.so.1 (0x40e13000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40e7f000)
libpng.so.3 => /usr/lib/libpng.so.3 (0x40eac000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x40ede000)
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x40f47000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40f5d000)
libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x40f66000)
libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x40f6e000)
libXcursor.so.1 => /usr/X11R6/lib/libXcursor.so.1 (0x40f72000)
libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0x40f7c000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x40f90000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40fc5000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40fcf000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
libXau.so.6 => /usr/X11R6/lib/libXau.so.6 (0x40fe6000)
libGLcore.so.1 => /usr/lib/libGLcore.so.1 (0x40fe9000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x414c1000)

ACCEPT_KEYWORDS='~x86';export ACCEPT_KEYWORDS

$ sudo emerge -p mythtv
[ three things; wasn't sure what it would do,
and since I have a very slow connection,
it's safe to let it get stuff if I'm not sure if I
want it installed this way ]
$ sudo emerge mythtv
Calculating dependencies ...done!
>>> emerge (1 of 3) media-video/nvidia-kernel-1.0.4496-r4 to /
>>> Downloading http://gentoo.oregonstate.edu/distfiles/NVIDIA-Linux-x86-1.0-4496-pkg2.run
--15:15:16-- http://gentoo.oregonstate.edu/distfiles/NVIDIA-Linux-x86-1.0-4496-pkg2.run


[...]

WHOA! 8MB download! Interrupt! I already have everything I need, so I realized it's probably trying to use the kernel's quite inferior NVIDIA drivers by getting a new kernel (NOOOOO!), so I'm trying this, to see if it will work:

$ sudo emerge inject media-video/nvidia-kernel-1.0.4496-r4
>>> Injected media-video/nvidia-kernel-1.0.4496-r4.
$ sudo emerge -p mythtv

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild N ] media-video/nvidia-glx-1.0.4496-r1
[ebuild R ] media-tv/mythtv-0.13-r1

$ sudo emerge inject media-video/nvidia-glx-1.0.4496-r1
>>> Injected media-video/nvidia-glx-1.0.4496-r1.
$ sudo emerge -p mythtv

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild R ] media-tv/mythtv-0.13-r1

$ sudo emerge mythtv
Calculating dependencies ...done!
>>> emerge (1 of 1) media-tv/mythtv-0.13-r1 to /
>>> md5 src_uri Wink mythtv-0.13.tar.bz2
>>> Unpacking source...
>>> Unpacking mythtv-0.13.tar.bz2 to /var/tmp/portage/mythtv-0.13-r1/work
* Applying tvformat.fix.0.13.diff... [ ok ]
>>> Source unpacked.
Please note that these settings only deal with

[....]


So, I don't know what's going to happen now. I should read more documentation.

BINGO! Here's the new ldd after re-emerge:

$ ldd $(which mythfrontend)
libmyth-0.13.so.0 => /usr/lib/libmyth-0.13.so.0 (0x40020000)
libXv.so.1 => /usr/X11R6/lib/libXv.so.1 (0x4017a000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x4017f000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40261000)
libXxf86vm.so.1 => /usr/X11R6/lib/libXxf86vm.so.1 (0x40271000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40277000)
libXvMCNVIDIA_dynamic.so.1 => /usr/X11R6/lib/libXvMCNVIDIA_dynamic.so.1 (0x40302000)
libmp3lame.so.0 => /usr/lib/libmp3lame.so.0 (0x4032a000)
libqt-mt.so.3 => /usr/qt/3/lib/libqt-mt.so.3 (0x403dc000)
libpthread.so.0 => /lib/libpthread.so.0 (0x40aa0000)
libstdc++.so.5 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libstdc++.so.5 (0x40aef000)
libm.so.6 => /lib/libm.so.6 (0x40b9b000)
libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libgcc_s.so.1 (0x40bbd000)
libc.so.6 => /lib/libc.so.6 (0x40bc7000)
libdl.so.2 => /lib/libdl.so.2 (0x40cee000)
libz.so.1 => /usr/lib/libz.so.1 (0x40cf1000)
libasound.so.2 => /usr/lib/libasound.so.2 (0x40d08000)
liblirc_client.so.0 => /usr/lib/liblirc_client.so.0 (0x40dc7000)
libaudio.so.2 => /usr/X11R6/lib/libaudio.so.2 (0x40dcd000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x40de2000)
libmng.so.1 => /usr/lib/libmng.so.1 (0x40e3a000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40ea6000)
libpng.so.3 => /usr/lib/libpng.so.3 (0x40ed3000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x40f05000)
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x40f6e000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40f85000)
libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x40f8d000)
libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x40f95000)
libXcursor.so.1 => /usr/X11R6/lib/libXcursor.so.1 (0x40f99000)
libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0x40fa3000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x40fb7000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40fed000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40ff6000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
libXau.so.6 => /usr/X11R6/lib/libXau.so.6 (0x4100d000)
libGLcore.so.1 => /usr/lib/libGLcore.so.1 (0x41010000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x414e8000)

Let's see if it starts ...

Well, it's running; I'm not sure if it's using it or not:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
21070 mythtv 15 0 163m 34m 15m S 30.1 6.9 0:32.61 mythfrontend
21089 ulmo 13 0 1000 1000 796 R 3.9 0.2 0:04.04 top
1648 root 9 0 307m 44m 11m R 1.9 8.9 5:54.65 X
21069 mythbe 9 0 15260 14m 7528 S 1.0 3.0 0:01.85 mythbackend
21073 mythtv 9 0 163m 34m 15m S 1.0 6.9 0:06.36 mythfrontend

perhaps it's in the options:

... not sure ...

mythtv@A:~ $ mythfrontend
2003-12-14 15:49:34 Enabled verbose msgs : important general
mythtv: could not connect to socket
mythtv: No such file or directory
Failed to create lirc socket for mythtv
2003-12-14 15:49:36 Connecting to backend server: 1.2.3.4:4444 (try 1 of 5)
Input #0, mpegts, from 'rbuf://1.2.3.4:44444/v/live/ringbuf2.nuv':
Stream #0.0[0x11]: Video: mpegvideo_xvmc, 704x480, 29.97 fps
Stream #0.1[0x14]: Audio: ac3, 48000 Hz, stereo, 192 kb/s
2003-12-14 15:49:45 Opening OSS audio device '/dev/dsp0'.
Using XvMC version: 1.0
2003-12-14 15:49:45 Using XV port 111
2003-12-14 15:49:45 Changing from None to WatchingLiveTV
2003-12-14 15:52:06 Changing from WatchingLiveTV to None
2003-12-14 15:52:06 Changing from None to None
mythtv@A:~ $

... wow, non-stutter sound on that channel now, and it seems to be working great. MythTV seems to be better than Xine so far ... my system isn't completely up, so no complete description yet. (Still working on multiple computers with grabbers, a network filesystem, chosing and programming program information into MythTV, and verifying that record and playback work in Myth; and probably other things I've forgotten (like remote control, figuring out which computer goes where finally (I'm mostly decided about that though), etc.; chosing a hybrid Debian & Gentoo mix or just Debian or Gentoo; I'm leaning toward hybrid, but if I start network sharing, then I might not want to, but I might still ...); some of those things are very different in HDTV, so I'm coming here a lot to see what little has been said so far, and I have more to read.)

Well, it does say "using XvMC version: 1.0". That seems nice.
View user's profile Send private message Send e-mail
PostPosted: Sun Dec 14, 2003 5:07 pm Reply with quote
Ulmo
 
Joined: 06 Nov 2003
Posts: 95
Location: Aptos,CA,USA




Ulmo wrote:

Well, it does say "using XvMC version: 1.0". That seems nice.


Well, already some trouble:

I went to change a channel, and:

[...]

2003-12-14 16:05:27 prebuffering pause
Video has changed: 720 480 from: 704 480
mythfrontend: xvmcvideo.c:121: XVMC_field_start: Assertion `last->state & 2' failed.
Aborted

The whole program just stopped there. I guess I have to go back to MythTV debugging ...

Changing channels used to work fine without XvMC, except if I went to a channel that wasn't receiving (I didn't try changing back and waiting, though).
View user's profile Send private message Send e-mail
Getting MPEG acceleration to work on Geforce 4 cards.
  pcHDTV Forum Index -> General pcHDTV topics
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 7 Hours  
Page 1 of 1  

  
  
 Post new topic  This topic is locked: you cannot edit posts or make replies.  


Powered by phpBB © 2001-2003 phpBB Group
Theme created by Vjacheslav Trushkin