Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to run hybrid-dump for VDPAU accelerated video playing on Ubuntu 11.10 with Bumblebee 3.0 installed and running. But following the instructions in the URL below, I can't get mplayer with vdpau to work:

http://askubuntu.com/a/100812/17702

avilella@magneto:~/hybrid_graphics/hybrid-windump$ git pull
Already up-to-date.
avilella@magneto:~/hybrid_graphics/hybrid-windump$ make clean && make

optirun true
LD_LIBRARY_PATH=/usr/lib/nvidia-current DISPLAY=:8 metacity --replace &
LD_LIBRARY_PATH=/usr/lib/nvidia-current DISPLAY=:8 mplayer -vo vdpau file.720p.mkv
#(in the other gnome-terminal tab)
LD_LIBRARY_PATH=/usr/lib/nvidia-current ~/hybrid_graphics/hybrid-windump/windump :8 :0

Also tried:

LD_LIBRARY_PATH=/usr/lib/nvidia-current DISPLAY=:8 mplayer -vo vdpau -vc ffh264vdpau file.720p.mkv

I don't get any video from it, only audio. I do get video and audio if I remove the vdpau bit, but then windump is not needed:

LD_LIBRARY_PATH=/usr/lib/nvidia-current DISPLAY=:8 mplayer file.720p.mkv

If I try glxspheres, it works well, like this:

LD_LIBRARY_PATH=/usr/lib/nvidia-current DISPLAY=:8 glxspheres
#(in the other gnome-terminal tab)
LD_LIBRARY_PATH=/usr/lib/nvidia-current ~/hybrid_graphics/hybrid-windump/windump :8 :0

Polygons in scene: 62464
Visual ID of window: 0x27
Context is Direct
OpenGL Renderer: GeForce 310M/PCI/SSE2

Now video playing. Following the instructions below, I got it to work to some extend:

Edit /etc/bumblebee/xorg.conf.nvidia and added:

Section "Screen"
    Identifier "Screen0"
    DefaultDepth 24
    SubSection "Display"
        Depth    24
        Virtual  1280 720
    EndSubSection
EndSection

Restarted bumblebeed:

sudo restart bumblebeed

In one of the terminals, I call the mplayer command:

LD_LIBRARY_PATH=/usr/lib/nvidia-current:/usr/lib/nvidia-current/vdpau DISPLAY=:8 optirun mplayer -vo vdpau -ao alsa file.720p.mkv

In another terminal, I then call the compiz and then windump commands:

LD_LIBRARY_PATH=/usr/lib/nvidia-current DISPLAY=:8  compiz --replace &

~/hybrid-windump/windump :8 :0

PROBLEMS: I am struggling with the size of the video window. In a 1366x768 screen, I set up for a 1280x720 video size, but the image is chopped by about 200 pixels on the right hand side, leaving the same size of black windump area.

Any ideas?

share|improve this question
    
Still not able to do this, I saw a new patch has been added to Mesa 8.1. Is this supposed to help me here? phoronix.com/scan.php?page=news_item&px=MTA2MzY –  213441265152351 Feb 29 '12 at 9:28
    
check hardware acceleration askubuntu.com/questions/285434/… –  Qasim May 15 '13 at 19:58

4 Answers 4

This is how I got vdpau:

  1. Edited /etc/bumblebee/xorg.conf.nvidia to have

    Section "Screen"
        Identifier "Screen0"
        DefaultDepth 24
        SubSection "Display"
            Depth    24
            Virtual  1920 1080
        EndSubSection
    EndSection
    
  2. Run

    LD_LIBRARY_PATH=/usr/lib/nvidia-current:/usr/lib/nvidia-current/vdpau DISPLAY=:8 optirun mplayer -vo vdpau file.720p.mkv
    
  3. Run

    LD_LIBRARY_PATH=/usr/lib/nvidia-current DISPLAY=:8  compiz --replace &
    
  4. Downloaded https://github.com/gebart/hybrid-windump, removed xorg.conf from it, then compiled (just make command).

  5. Run ./windump :8 :0

Note: You don't need to edit /etc/bumblebee/bumblebee.conf and change KeepUnusedXServer to true as we run MPlayer directly with Optirun.

share|improve this answer

I can see one flaw in your approach to use the X server started by Bumblebee (:8). Once the Bumblebee daemon detects that there are no optirun clients, it shuts down the X server. To make the X server stay alive even if optirun has exited:

  1. Edit /etc/bumblebee/bumblebee.conf and set KeepUnusedXServer=true
  2. Restart the daemon using sudo restart bumblebeed (beware: this will kill any existing optirun application)
  3. Trigger a start of the X server: optirun true (true is just a command that immediately returns, it could be anything)
  4. Run an application on the secondary X server. The LD_LIBRARY_PATH part is necessary if you are using the nvidia driver:

    LD_LIBRARY_PATH=/usr/lib/nvidia-current DISPLAY=:8 metacity --replace &`
    
  5. Run windump with: windump :8 :0

Note: I could not get this to work with xorg-edgers/ppa+nouveau and the nvidia driver using gebarts' fork. With the nvidia driver, I got a lot tearing when running glxspheres. If the resolution of the dumped screen does not match the primary display resolution, you need to probably need to add extra modelines to /etc/bumblebee/xorg.conf.nvidia. For 1920x1080, the lines to be added looks like:

Section "Screen"
    Identifier "Screen0"
    DefaultDepth 24
    SubSection "Display"
        Depth    24
        Virtual  1920 1080
    EndSubSection
EndSection
share|improve this answer
    
I followed the instructions but got this error: DISPLAY=:8 glxspheres & [1] 2352 avilella@magneto:~$ Polygons in scene: 62464 ERROR (596): Could not obtain RGB visual with requested properties [1]+ Exit 255 DISPLAY=:8 glxspheres –  213441265152351 Feb 25 '12 at 13:50
    
Sounds like you've forgotten the LD_LIBRARY_PATH setting –  Lekensteyn Feb 25 '12 at 14:50
    
I've indeed updated it now to reflrect that change. glxspheres is now running fine with no tearing, but no mplayer video output –  213441265152351 Feb 25 '12 at 15:50
    
From your question, I cannot see whether you've started windump or not after mplayer. –  Lekensteyn Feb 25 '12 at 15:53
    
Yes, I start it in the other gnome-terminal tab. –  213441265152351 Feb 25 '12 at 15:54

I'm glad people like my solution but I'd like to stress that this is only a proof of concept way of doing VDPAU with Optimus.

gebart wrote hybrid-windump in a way that is heavily CPU-bound since everything is copied from "screen" to "screen" in a rather inefficient way.

Yes, you are using VDPAU for decoding, but you are getting none of the CPU-usage savings.

There's also an option to dump single windows by their x window ID.

For keyboard, you need Option "AutoAddDevices" "true".

You can also use hybrid-windump to start a whole VDPAU-ready desktop session using your DE of choice.

If you still want to use this, here's some videos of what the results look like (depending on X config):

http://www.youtube.com/watch?v=WVBMLdeRoUU

http://www.youtube.com/watch?v=pxziIAPFIFY

share|improve this answer

It should be DISPLAY=:0; metacity --replace &

Also, optirun says that your display is clearly :0.0, why are you trying to start metacity on display :8? Do you have a program running on display :8 that we can't see in your post? If you do, please provide us that info as well, please?

share|improve this answer
    
I am just following the instructions in the post: askubuntu.com/a/100812/17702 –  213441265152351 Feb 18 '12 at 16:55
    
As a matter of fact yes, bumblebee has been there since day one. –  Behrooz Dec 27 '13 at 22:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.