Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nVidia + XvMC + MythTV
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
stdPikachu
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 254
Location: UK

PostPosted: Fri Jan 19, 2007 8:48 pm    Post subject: nVidia + XvMC + MythTV Reply with quote

I've finally managed to get my DVB card set up to receive the new BBC HD channel. Utterly, utterly gorgeous video - it's broadcast at some insane bitrate (4.5GB for a 28min program) and looks utterly stunning (HTPC hooked up to an HDTV via DVI).

The problem is, it utterly chomps CPU and stutters like a mad thing - I get maybe 10fps if I'm lucky. So I'd like to enable XvMC on my nVidia GFX card.

Everything is already compiled with the xvmc USE flag, so I figured just going into Myth's options and changing the decoder to "Standard XvMC" would do the trick, but it doesn't make a jot of difference. Argh. At first I thought that it might just be too weak a CPU (AMD65 3500) but there are already plenty of Myth users who get good results with 3200's and below when paired with an nV GFX card. Not to mention that if XvMC was working, then even if I didn't get flawless playback I might at least get 20fps...!

So I delve into stuff and it appears (to me) that XvMC isn't running at all. I start googlerising stuff and add myself a:
Code:
banquo ~ # cat /etc/X11/XvMCConfig
/usr/lib/libXvMCNVIDIA_dynamic.so.1

which, according to some, is the correct way to point X at the correct XvMC libraries.

However, when I start X I get no change in output messages:
Code:
banquo ~ # grep -i xv /var/log/Xorg.0.log
(II) Loading extension XVideo
(II) Loading extension XVideo-MotionCompensation

And I get output like this from mythfrontend:
Code:
...
stream: start_time: 67879.147 duration: 1710.789 bitrate=20382 kb/s
2007-01-19 19:35:39.335 AFD: Opened codec 0x8b98ae0, id(H264) type(Video)
2007-01-19 19:35:39.337 AFD: Opened codec 0x906a050, id(AC3) type(Audio)
2007-01-19 19:35:40.028 TV: Attempting to change from None to WatchingPreRecorded
0: start_time: 6109.201 duration: 153.893
1: start_time: 6109.123 duration: 153.924
stream: start_time: 67879.147 duration: 1710.789 bitrate=20382 kb/s
2007-01-19 19:35:40.507 AFD: Opened codec 0x8ffab50, id(H264) type(Video)
2007-01-19 19:35:40.509 AFD: Opened codec 0x8b98ae0, id(AC3) type(Audio)
2007-01-19 19:35:40.516 Opening OSS audio device '/dev/dsp'.
2007-01-19 19:35:40.986 VideoOutputXv: XvMCTex: Init failed
2007-01-19 19:35:40.986 VideoOutputXv: XVideo Adaptor Name: 'NV17 Video Texture'
X Error: BadMatch (invalid parameter attributes) 8
  Major opcode:  140
  Minor opcode:  14
  Resource id:  0x1ce
2007-01-19 19:35:41.749 TV: Changing from None to WatchingPreRecorded
2007-01-19 19:35:41.773 The realtime priority setting is not enabled.
2007-01-19 19:35:43.167 Video timing method: SGI OpenGL
2007-01-19 19:35:44.428 NVP: prebuffering pause
2007-01-19 19:35:45.804 NVP: prebuffering pause
2007-01-19 19:35:47.362 NVP: prebuffering pause
2007-01-19 19:35:48.838 NVP: prebuffering pause
2007-01-19 19:35:50.295 NVP: prebuffering pause
2007-01-19 19:35:51.953 NVP: prebuffering pause
2007-01-19 19:35:53.378 NVP: prebuffering pause
...


Is there anyone out there who's got XvMC definitely working?

One thing that did strike me as odd was the fact that Myth seems to be pointed at the wrong XvMC libs:
Code:
banquo ~ # ldd /usr/bin/mythbackend | grep -i xvmc
        libXvMCW.so.1 => /usr/lib/libXvMCW.so.1 (0xa68c0000)
        libXvMC.so.1 => /usr/lib/libXvMC.so.1 (0xa68bd000)

But then I imagine this is a bark up a wrong tree since the nVidia XvMC stuff is binary-only that these are probably merely wrapper libs for pointing at the correct XvMC stuff, since libXvMCW is 15k and libXvMCNVIDIA.so.1.0.9746 is 175k.

Am using nVidia 8776 drivers and a 2.6.18 kernel. AM yet to try and see if mplayer works on this box cos a) it's not installed yet and b) it's set up as a kiosk unit and I'm going have to rustle up an alternative config before I can run apps other than mythfrontend on it.

In the meantime, if any of you HDTV-wielding, XvMC blitting MythTV hard hitters have any info on your setups I'd love to her 'em!
Back to top
View user's profile Send private message
wingrunr21
Tux's lil' helper
Tux's lil' helper


Joined: 13 May 2005
Posts: 91

PostPosted: Sat Jan 27, 2007 4:05 pm    Post subject: Reply with quote

I have as yet been unsuccessful in getting XvMC to work correctly with HDTV. I have a 7300GS coupled with an Athlon X2 3800+ and 1 gigabyte of RAM. To get smooth playback, I have set my decoding library to libmpeg2 and the deinterlacer to Kernel Motion Blur. If anyone does manage to get XvMC working with HDTV in MythTV .20, I'd love to hear how. The MythTV wiki for this stuff doesn't help at all. Also make sure you have enabled aggressive sound buffering otherwise you will get choppy audio.
Back to top
View user's profile Send private message
number_nine
Tux's lil' helper
Tux's lil' helper


Joined: 05 May 2005
Posts: 136

PostPosted: Fri Feb 02, 2007 4:03 am    Post subject: Reply with quote

Bump... I'm having the exact same problems as the original poster.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Fri Feb 02, 2007 12:24 pm    Post subject: Reply with quote

BBC HD uses mpeg4-avc/h264 video. But XvMC is only for mpeg2, so it won't work with BBC.
Back to top
View user's profile Send private message
number_nine
Tux's lil' helper
Tux's lil' helper


Joined: 05 May 2005
Posts: 136

PostPosted: Fri Feb 02, 2007 1:21 pm    Post subject: Reply with quote

Gusar wrote:
BBC HD uses mpeg4-avc/h264 video. But XvMC is only for mpeg2, so it won't work with BBC.


What about NBC in the US?

In general, how do you find out the format a network uses for its broadcasts?

Thanks!
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Fri Feb 02, 2007 6:05 pm    Post subject: Reply with quote

No idea what the US uses, I think they're still on mpeg2. The easiest way I know of to check what's being used is to simply try to play the stream with mplayer and see what decoders it loads.
Back to top
View user's profile Send private message
GodMoney
n00b
n00b


Joined: 26 Mar 2005
Posts: 5

PostPosted: Fri Feb 02, 2007 6:23 pm    Post subject: Reply with quote

Generally HDTV in the US is broacast as mpeg2 with ac3 sound, most of europe uses h264. I'm not sure about the rest of the world but mplayer can identify it for you ( mplayer -vo null -ao null -frames 0 -identify $filename ).
Back to top
View user's profile Send private message
Hobbes-X
l33t
l33t


Joined: 04 Feb 2004
Posts: 823
Location: Seattle, WA

PostPosted: Fri Feb 02, 2007 6:25 pm    Post subject: Reply with quote

Looks like mythfrontend will report it too, from the clip above:
Quote:
2007-01-19 19:35:40.507 AFD: Opened codec 0x8ffab50, id(H264) type(Video)
2007-01-19 19:35:40.509 AFD: Opened codec 0x8b98ae0, id(AC3) type(Audio)
Back to top
View user's profile Send private message
number_nine
Tux's lil' helper
Tux's lil' helper


Joined: 05 May 2005
Posts: 136

PostPosted: Mon Mar 05, 2007 1:57 am    Post subject: Reply with quote

Hmmm... This thread (and other sources) have verified that US broadcast is MPEG2.

However, I'm still having the same problems as the original poster. My error messages and everything are the same.

I believe the problem lies within MythTV, because I can use xine or mplayer with the xvmc drivers to watch the .mpg files created my MythTV (i.e. recorded programming).

I'm open to any and all suggestions and ideas... perhaps someone with a working mythtv+xvmc could post their /etc/X11/xorg.conf file? Or any other relevant steps taken to achieve this.

Thank you!
Back to top
View user's profile Send private message
RoundsToZero
Guru
Guru


Joined: 17 Nov 2003
Posts: 478
Location: New York, NY

PostPosted: Mon Mar 05, 2007 2:08 am    Post subject: Reply with quote

I have a line like this that may be sufficient to show that XvMC is running.
Code:

AFD: Opened codec 0x84b7150, id(MPEG2VIDEO_XVMC) type(Video)

Don't worry about "VideoOutputXv: XvMCTex: Init failed", it doesn't matter.

Edit: Well, XvMC doesn't help me completely, I still get audio buffer underruns. XvMC has been up and down over various versions of stuff as far as how much it helps. Luckily, my laptop is fast enough to not require XvMC, so I can watch HD on it as opposed to my desktop.

mplayer seems to work better with XvMC than Myth does. Without XvMC, CPU usage ran high, and the A/V sync was very bad. With XvMC, CPU usage was low, but A/V sync was still bad. Perhaps this sync issue is what causes the audio buffer underruns with Myth as it tries to keep the two in sync. In any case, adding -framedrop to the mplayer options made watching HD recordings work fine. XvMC gives me the low CPU usage and -framedrop gives me good A/V sync. That option sounds kind of scary, but rest assured I did not notice any frame drops or skips. If there were a -framedrop option for MythTV that might help.

By the way, this is how you use XvMC in mplayer, assuming you have mplayer compiled with it:
Code:
mplayer -vo xvmc -vc ffmpeg12mc /path/to/video.mpg [-framedrop]
Back to top
View user's profile Send private message
number_nine
Tux's lil' helper
Tux's lil' helper


Joined: 05 May 2005
Posts: 136

PostPosted: Mon Mar 05, 2007 2:38 pm    Post subject: Reply with quote

RoundsToZero wrote:
I have a line like this that may be sufficient to show that XvMC is running.
Code:

AFD: Opened codec 0x84b7150, id(MPEG2VIDEO_XVMC) type(Video)


Hmm. I think I get that line (can't verify it ATM).

But what's throwing me is this: my CPU usage is still quite high. From the research I've done, most people with hardware similar to mine and working XvMC get around 25--30% CPU usage. Mine was pushing 90%!

RoundsToZero wrote:
mplayer seems to work better with XvMC than Myth does. Without XvMC, CPU usage ran high, and the A/V sync was very bad. With XvMC, CPU usage was low, but A/V sync was still bad. Perhaps this sync issue is what causes the audio buffer underruns with Myth as it tries to keep the two in sync. In any case, adding -framedrop to the mplayer options made watching HD recordings work fine. XvMC gives me the low CPU usage and -framedrop gives me good A/V sync. That option sounds kind of scary, but rest assured I did not notice any frame drops or skips. If there were a -framedrop option for MythTV that might help.

By the way, this is how you use XvMC in mplayer, assuming you have mplayer compiled with it:
Code:
mplayer -vo xvmc -vc ffmpeg12mc /path/to/video.mpg [-framedrop]


Yup, that's the exact command I used to test mplayer+XvMC. And my video was one of the high-definition videos that mythbackend had previously recorded. With mplayer (or even xine --video-driver xvmc -f /path/to/video.mpg), I get perfect playback (in sync and low CPU usage).
Back to top
View user's profile Send private message
number_nine
Tux's lil' helper
Tux's lil' helper


Joined: 05 May 2005
Posts: 136

PostPosted: Tue Mar 06, 2007 1:50 pm    Post subject: Reply with quote

I found that adding the "UseEvents" "true" option to the "Device" section of my xorg.conf file made a huge difference:

Code:
Section "Device"
         Identifier  "Videocard0"
         Driver      "nvidia"
         VendorName  "Videocard vendor"
         BoardName   "nVidia Corporation C51 PCI Express Bridge"
         Option "UseEvents" "True"
EndSection


I spent so long trying to get XvMC to work reliably until I found this hint. Now I feel obliged to post it everywhere I can, in case someone else is having the same problems! :)
Back to top
View user's profile Send private message
stdPikachu
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 254
Location: UK

PostPosted: Tue Mar 06, 2007 5:48 pm    Post subject: Reply with quote

Thanks for the info regarding the UseEvents xorg option, worked a treat with general playback.

Yes, I should have read the texts more and reliased that XvMC currently doesn't work for H264 - doubly annoying that it doesn't yet work on my Intel GFX chip either (GMA 3000, which supports everything needed for MPEG4 MC, including iDCT).

Good news is that if I confuzzle mplayer a bit I can get full-blown H264 playback on my C2D machine with the BBC streams and not lose any frames (although it chomps almost 100% of a CPU).

Just have to wait for better drivers I suppose...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
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