Kodi Community Forum
[LINUX] HOW-TO use VAAPI HW Acceleration on AMD Zacate (Fusion) platform - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: [LINUX] HOW-TO use VAAPI HW Acceleration on AMD Zacate (Fusion) platform (/showthread.php?tid=99154)



white screen - Boyz - 2011-11-09

Hello,

my system is debian squeeze amd64, i compiled xbmc from the git followed the instruction on first page, everything was working fine.
Yesterday i upgraded ati driver to ati-driver-installer-11-10-x86.x86_64.run, with that driver xbmc was also working until a REBOOT.
After reboot when i try to play a mkv file with vaapi enabled i get white screen!
I reinstalled also the ati driver and used older version of xbmc, but still the white screen only for mkv, avi is working fine.
I hope somebody can help me.

Thanks

regards
Nitha

edit: white screen but sound is working!


- Boyz - 2011-11-10

fixed!
I deleted whole xbmc configuration and restarted xbmc.
Now its working fine.


Boyz Wrote:Hello,

my system is debian squeeze amd64, i compiled xbmc from the git followed the instruction on first page, everything was working fine.
Yesterday i upgraded ati driver to ati-driver-installer-11-10-x86.x86_64.run, with that driver xbmc was also working until a REBOOT.
After reboot when i try to play a mkv file with vaapi enabled i get white screen!
I reinstalled also the ati driver and used older version of xbmc, but still the white screen only for mkv, avi is working fine.
I hope somebody can help me.

Thanks

regards
Nitha

edit: white screen but sound is working!



- chemical - 2011-11-10

Long time reader, first time poster.

I just want to say Thank you! Wink to all involved. Based on this thread I decided to get a Zotac Fusion (AMD Zacate) and built a nice HTPC around it.

It is replacing my DVD Player, dbox2, Popcorn Hour and Creative DTS Decoder - quite nice progress at the moment, last step is to switch from optical out to 5.1 analog output and do the right thing (upmixing 2.0 -> 2.1, 5.1 mapping .. and stuff) in software - don't have an A/V receiver, it is directly connected to a 5.1 set with integrated amp (Teufel Concept Magnum E).

(TBS 6981, Scythe Slim 120mm, Silverstone ML02, Atric IR Empfaenger (Receiver)). Runs with 20W idle, and 30W loaded (TV, HDTV, ..).

Programmed my favourite "custom" IR remote to the computer (other way around, was interesting to learn how irrecord,lirc,xbmc, Lircmap.xml,keymap.xml all fit together).

TV is mostly SD (DVB-S, MPEG2) and thus decoded by CPU (missing profile for HWaccel). I guess this is by design, so sometimes there is some "stutter" when fading in/out of menus during watching.

I'm running on git (Opdenkamp) with 3 patches earlier in this thread (FernetMenta). It runs great so far, using the machine mainly for TV (PVR + XVDR).

Looking forward to continued development regarding VAAPI / XvBA.

Just want to say that I'm here, following closely. :-)

Thanks guys!
Roland


- kobik - 2011-11-10

What FernetMenta patches you referring to?


- tjones - 2011-11-10

24Hz/fps I was able to achieve it even though a 24Hz modeline is not in my TV's edid. I used amdcccle Display > DTV > HDTV Enable 1080p 24hz HD profile.

The 1080p24Hz modeline provided by amdcccle was.

Code:
"1920x1080"  74.25  1920 2558 2602 2750  1080 1084 1089 1125 +hsync +vsync

I gathered from my Xorg.0.log after enabling the profile and rebooting/restarting x

Code:
cat /var/log/Xorg.0.log | grep 1920x1080

(II) fglrx(0): Modeline "1920x1080"x60.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.5 kHz)
(II) fglrx(0): Modeline "1920x1080"x60.0   74.25  1920 2008 2052 2200  1080 1085 1095 1125 interlace +hsync +vsync (33.8 kHz)
(II) fglrx(0): Modeline "1920x1080"x24.0   74.25  1920 2558 2602 2750  1080 1084 1089 1125 +hsync +vsync (27.0 kHz)

The 24Hz modeline was not present without this toggle.

It shows up in xrandr -q and can be switched to via xrandr --rate 24.

In xbmc I used Adjust display refresh rate to match video it originally looks like dermute's video. However after a minute or two it sync's up and stops stuttering.

If 24hz is enabled as the desktop fresh rate and xbmc sync video to display is enabled (opposite scenario at 24Hz) it does not sync at all.

When I enabled Composite in my xorg.conf and used
Code:
sudo aticonfig --xv-pixmap-buffer-type=lfb

to use the local framebuffer it apparently decreased the sync time to 15-45s.

For the life of me I cannot figure out how to disable EDID/DCC probing and modevalidation in xorg.conf with fglrx. Apparently by doing this and explicitly stating your desktop(60Hz for me) and 24Hz modes you can get rid of the stuttering. It's a workaround reported with nvidia cards. All the classic options I've tried are ignored with my current fglrx/xorg.

xrandr really doesn't like the 24Hz modeline. With the amdcccle toggle it will use it. If the same modeline is added via xorg.conf it refuses to switch to it. I'm missing something here.

This fix works as of feb this year. I just need to turn off the probing and get xrandr to play nice with my freaking modlines.

My last attempt was the following:
Code:
Section "ServerLayout"
    Identifier     "aticonfig Layout"
    Screen      0  "aticonfig-Screen[0]-0" 0 0
EndSection

Section "Module"
        load        "dri"
EndSection

Section "Monitor"
    Identifier   "aticonfig-Monitor[0]-0"
    Option        "VendorName" "ATI Proprietary Driver"
    Option        "ModelName" "Generic Autodetecting Monitor"
    Option        "DPMS" "true"
        HorizSync 26-81
        VertRefresh 24-75
    Modeline "1920x1080_a"  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync
    Modeline "1920x1080_a"  74.25  1920 2558 2602 2750  1080 1084 1089 1125 +hsync +vsync
EndSection

Section "Device"
    Identifier  "aticonfig-Device[0]-0"
    Driver      "fglrx"
    BusID       "PCI:0:1:0"
        Option      "SWCursor" "true"
    Option "ModeDebug" "true"
EndSection

Section "Screen"
    Identifier "aticonfig-Screen[0]-0"
    Device     "aticonfig-Device[0]-0"
    Monitor    "aticonfig-Monitor[0]-0"
    DefaultDepth     24
    SubSection "Display"
        Viewport   0 0
        Depth     24
        Modes "1920x1080_a"
    EndSubSection
EndSection

Section "Extensions"
        Option      "Composite" "Disable"
EndSection

All values besides the 24Hz modeline gathered from my edid., 24Hz from amdcccle. This creates a combined mode under xrandr.

1920x1080_a 60 24

The amdcccle toggle creates a combined mode as well

1920x1080 60 30 24

I'm trying to recreate the functionality of the amdcccle toggle with xorg.conf.

If I can get this working I'd then create an explicit 60Hz and 24Hz modes eg 1920x1080_60 1920x1080_24. This is what the traditional fix is.

Right now I'm stuck messing with xrandr and some sort of mode validation somewhere. Note all modes I'm using have been established as working. I just having trouble switching modes for some reason.


- chemical - 2011-11-10

kobik Wrote:What FernetMenta patches you referring to?

I'm referring to the patches mentioned in post #492

One of them is already applied to Opdenkamp git, I think it is the first one. The other three still apply.

https://github.com/FernetMenta/xbmc/commit/0c2185d62f858f7b41461b4141e731dc7ec01ca6.patch
https://github.com/FernetMenta/xbmc/commit/f46d7a99bc2f3bc70f274422ec8d16257e2a97aa.patch
https://github.com/FernetMenta/xbmc/commit/dff7d824c82f957e19ad56247134912d70862188.patch


- kobik - 2011-11-10

Something isn't right for me here.
I'm watching a Californication episode and I can see tearing when objects are moving on screen. The episode isn't fluid and once I noticed this, I can't ignore it.
Checked also on 2012 and it seems the same more or less.
This isn't the same on Windows 7.

My CPU usage is ~13% using VAAPI and display 1280X720@50Hz.


1080p issue - GamblerAN - 2011-11-11

Hi guys.
I have an issue with playing back some of 1080p clips and movies. But no problem with 720p or lower.
For example using YouTube plugin in XBMC and playing 1080p clips, something goes wrong,
picture starting ti shake and shiver, sometimes showing extra large pixels
The issue can be seen in this screenshots:
Image
Image
Image

My configuration:
Motherboard: MSI E350IA-E45
OS: Ubuntu 11.10
I am using unity 2D, so compiz should be turned off.
xbmc-dharma-pvr from ppa:alexandr-surkov/dharma-pvr
latest ati drivers (11.10)
latest libva

mediacenter@htpc:~$ fglrxinfo
display: :0 screen: 0
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 6300 series Graphics
OpenGL version string: 4.1.11161 Compatibility Profile Context

mediacenter@htpc:~$ vainfo
libva: VA-API version 0.32.0
libva: User requested driver 'xvba'
libva: Trying to open /usr/lib/va/drivers/xvba_drv_video.so
libva: va_openDriver() returns 0
vainfo: VA-API version: 0.32 (libva 1.0.15)
vainfo: Driver version: Splitted-Desktop Systems XvBA backend for VA-API - 0.8.0
vainfo: Supported profile and entrypoints
VAProfileH264High : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD

Please help!


- tjones - 2011-11-11

Cont. from http://forum.xbmc.org/showpost.php?p=932593&postcount=650


In hindsight the fix I'm trying to achieve also requires the line Option "ExactModeTimingsDVI" in the monitor section. I've already tried this with my fglrx/x and the option was ignored according the log. I could not find any reference to this in aticonfig --help, man xorg.conf, or man xrandr. crtc = cathode ray tube controller.

I've tried the crtc 1 toggle to use manual settings when I discovered a crtc reference with vesa to use manual settings. But in regards to xrandr crtc I can't figure out where to do manual settings. With the amdcccle toggle the crtc remains at 0 and not 1 (manual settings) I have no clue what is going on there.

For a CLI no desktop install any modifications could be included in the rc.local, X startup script, or a custom bash script if something needs to be set before/after starting X/xrandr. If I could figure them out that is.

Final info's since I'm trying really hard to leave this topic alone.

sudo xrandr --verbose (without amdcccle 24Hz line relevant section)
Code:
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 1920 x 1920
DFP1 connected 1920x1080+0+0 (0x98) normal (normal left inverted right x axis y axis) 160mm x 90mm
    Identifier: 0x95
    Timestamp:  13325
    Subpixel:   unknown
    Clones:    
    CRTC:       0
    CRTCs:      0 1
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter:
    EDID_DATA:
        00ffffffffffff004c2dc30701000000
        2e140103807944780aee91a3544c9926
        0f5054bdef80714f8100814081809500
        950fb300a940023a801871382d40582c
        4500a05a0000001e662150b051001b30
        40703600a05a0000001e000000fd0018
        4b1a5117000a202020202020000000fc
        0053414d53554e470a20202020200128
    SignalFormat:    TMDS
    ConnectorType:    HDMI
  1920x1080 (0x98)  148.5MHz +HSync +VSync *current +preferred
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   67.5KHz
        v: height 1080 start 1084 end 1089 total 1125           clock   60.0Hz
  1920x1080 (0x99)   74.2MHz +HSync +VSync Interlace
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   33.8KHz
        v: height 1080 start 1085 end 1095 total 1125           clock   30.0Hz
  1776x1000 (0x9a)  148.4MHz +HSync +VSync
        h: width  1776 start 1864 end 1908 total 2200 skew    0 clock   67.4KHz
        v: height 1000 start 1004 end 1009 total 1125           clock   59.9Hz
  1776x1000 (0x9b)   74.2MHz +HSync +VSync
        h: width  1776 start 2414 end 2458 total 2750 skew    0 clock   27.0KHz
        v: height 1000 start 1004 end 1009 total 1125           clock   24.0Hz
  1776x1000 (0x9c)   74.2MHz +HSync +VSync Interlace
        h: width  1776 start 1864 end 1908 total 2200 skew    0 clock   33.7KHz
        v: height 1000 start 1005 end 1015 total 1125           clock   30.0Hz
  1776x1000 (0x9d)   74.2MHz +HSync +VSync
        h: width  1776 start 1864 end 1908 total 2200 skew    0 clock   33.7KHz
        v: height 1000 start 1004 end 1009 total 1125           clock   30.0Hz

sudo xrandr --verbose (with amdcccle 24Hz line, relevant section)

Code:
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 1920 x 1920
DFP1 connected 1920x1080+0+0 (0x98) normal (normal left inverted right x axis y axis) 160mm x 90mm
    Identifier: 0x95
    Timestamp:  13325
    Subpixel:   unknown
    Clones:    
    CRTC:       0
    CRTCs:      0 1
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter:
    EDID_DATA:
        00ffffffffffff004c2dc30701000000
        2e140103807944780aee91a3544c9926
        0f5054bdef80714f8100814081809500
        950fb300a940023a801871382d40582c
        4500a05a0000001e662150b051001b30
        40703600a05a0000001e000000fd0018
        4b1a5117000a202020202020000000fc
        0053414d53554e470a20202020200128
    SignalFormat:    TMDS
    ConnectorType:    HDMI
  1920x1080 (0x98)  148.5MHz +HSync +VSync *current +preferred
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   67.5KHz
        v: height 1080 start 1084 end 1089 total 1125           clock   60.0Hz
  1920x1080 (0x99)   74.2MHz +HSync +VSync Interlace
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   33.8KHz
        v: height 1080 start 1085 end 1095 total 1125           clock   30.0Hz
  1920x1080 (0xb7)   74.2MHz +HSync +VSync
        h: width  1920 start 2558 end 2602 total 2750 skew    0 clock   27.0KHz
        v: height 1080 start 1084 end 1089 total 1125           clock   24.0Hz
  1776x1000 (0x9a)  148.4MHz +HSync +VSync
        h: width  1776 start 1864 end 1908 total 2200 skew    0 clock   67.4KHz
        v: height 1000 start 1004 end 1009 total 1125           clock   59.9Hz
  1776x1000 (0x9b)   74.2MHz +HSync +VSync
        h: width  1776 start 2414 end 2458 total 2750 skew    0 clock   27.0KHz
        v: height 1000 start 1004 end 1009 total 1125           clock   24.0Hz
  1776x1000 (0x9c)   74.2MHz +HSync +VSync Interlace
        h: width  1776 start 1864 end 1908 total 2200 skew    0 clock   33.7KHz
        v: height 1000 start 1005 end 1015 total 1125           clock   30.0Hz
  1776x1000 (0x9d)   74.2MHz +HSync +VSync
        h: width  1776 start 1864 end 1908 total 2200 skew    0 clock   33.7KHz
        v: height 1000 start 1004 end 1009 total 1125           clock   30.0Hz

I'm left to assume the amdcccle 24Hz line is an internal driver option (crtc =0 in both situations). I was unable to use custom modelines with fglrx via xorg.conf. If I can't ignore the EDID modeline validation with fglrx the only option left for custom modelines would be to create a custom EDID itself. Go to the source so to speak. Xorg has an option for a custom EDID that should be independent of the video driver.

I did find this in aticonfig --help but there is no reference to specific frequencies or timings.

Code:
--resolution=Screen#,W1xH1,W2xH2,W3xH3,...
        Set the modes for the specified screen.  You may specify several
        resolutions separated by commas.
        Screens start at 0.  You can use 1 for dual-head
  --hsync=Screen#,LOW-HIGH
        Change the horizontal sync range of the specified monitor.  Make sure
        you know the capabilities of your monitor before changing this option.
        Screens start at 0.  You can use 1 for dual-head
  --vrefresh=Screen#,LOW-HIGH
        Change the vertical refresh range of the specified monitor.  Make sure
        you know the capabilities of your monitor before changing this option.
        Screens start at 0.  You can use 1 for dual-head

Edit: Ah ha!! **rsync is a backup/archive utility.

Just did a fresh rsync backup before the amdcccle toggle and discovered this after toggling and doing a dryrun delete restore.
Code:
pinker@pinker-E350:~$ sudo rsync --dry-run --delete -av --exclude-from '/backup/pinker-E350.txt' /backup/pinker-E350/ /
sending incremental file list
home/pinker/.bash_history
home/pinker/.gksu.lock
home/pinker/.gconf/
home/pinker/.gconfd/
home/pinker/.gconfd/saved_state
usr/lib/fglrx/etc/ati/amdpcsdb
var/cache/samba/
var/cache/samba/browse.dat
var/cache/samba/winbindd_cache.tdb
var/lib/samba/passdb.tdb
var/log/Xorg.0.log
var/log/auth.log
var/log/wtmp
var/log/samba/log.winbindd-idmap
var/run/utmp
var/run/sudo/pinker/
deleting var/run/sudo/pinker/1
var/run/sudo/pinker/0

sent 2929063 bytes  received 11746 bytes  840231.14 bytes/sec
total size is 4303774899  speedup is 1463.47 (DRY RUN)

My excludes were.
Code:
pinker@pinker-E350:~$ cat /backup/pinker-E350.txt
backup
proc
sys
dev
tmp
/home/pinker/.gvfs

cat /usr/lib/fglrx/etc/ati/amdpcsdb produced, along with a bunch of other stuff.

DALNonStandardModesBCD=R140010500000006017921344000000601800144000000060185613920000006016001200000000601280076800000060144009000000006012800960000000601680105000000060

DAL2_DATA__2_0\EDID_2D4C_7C3\UserForceModeSupport_DVI_Conn12556=R0000000000040000

I guess this is where the internal variables are stored.

Edit: further poking around the amdpcsdb file reveals multiple hidden modes in the R* format. The R* proprietary format they're using does not seem to refer to pixel clocks only resolution and Hz. A diff file1 file2 between 24Hz enabled fglrx and standard only shows that DAL2 change I've already quoted. I believe this is in reference to a standard set included with the driver. If anybody cares the reason I keep pursing a toggleable custom 24Hz mode is because if the custom mode had a higher pixel clock it could perhaps eliminate the stuttering (as hinted by my framebuffer observation, pixel clock = video bandwidth). There is only one way to find out. A custom 24Hz mode with a higher pixel clock than the one provided by amd.

What this also suggests is if you have a TV that does not declare a 1080p 24Hz mode in it's edid and you have no desktop environment installed if you changed the DAL2_DATA__2_0\EDID_2D4C_7C3\UserForceModeSupport_DVI_Conn*=R0000000000000000 line to DAL2_DATA__2_0\EDID_2D4C_7C3\UserForceModeSupport_DVI_Conn*=R0000000000040000 it could perhaps enable the 1080p24Hz mode without using amdcccle.


- kobik - 2011-11-11

chemical Wrote:I'm referring to the patches mentioned in post #492

One of them is already applied to Opdenkamp git, I think it is the first one. The other three still apply.

https://github.com/FernetMenta/xbmc/commit/0c2185d62f858f7b41461b4141e731dc7ec01ca6.patch
https://github.com/FernetMenta/xbmc/commit/f46d7a99bc2f3bc70f274422ec8d16257e2a97aa.patch
https://github.com/FernetMenta/xbmc/commit/dff7d824c82f957e19ad56247134912d70862188.patch

Thanks!


- Ason - 2011-11-12

tjones Wrote:@Ason

Starting at the beginning of the thread is usually the best point, then use all relevant references near the end of the thread since these typically will pertain to current issues. If you are having trouble understanding installing minimal Ubuntu I suggest you install Oracle Virtual Box in your desktop pc and play around installing minimal Ubuntu in virtual machines first. Once you're confident with your minimal Ubuntu installation use it on the real system and move onto installing xbmc. This will save you a lot of headaches.

Thanks for answer, i have running Linux on some server along time ago (stop using it about 10 years ago)
So i have little basic knowledge.
Should i take 11.04 that first post says, or go for 11.10?


- wsnipex - 2011-11-12

go for 11.10 directly as there is everything you need in the official repos.


- tjones - 2011-11-12

Go for 11.10 if they now have official support. When I was trying it I had to use natty (11.04) references. This is probably why it failed for me.

The 3.0 kernel in 11.10 should be worth the effort if it is now officially supported.


- kobik - 2011-11-13

tjones,
How do I get this kind of Modeline information for my TV?
Code:
Modeline "1920x1080_a"  74.25  1920 2558 2602 2750  1080 1084 1089 1125 +hsync +vsync



- wsnipex - 2011-11-13

tjones Wrote:Go for 11.10 if they now have official support. When I was trying it I had to use natty (11.04) references. This is probably why it failed for me.

The 3.0 kernel in 11.10 should be worth the effort if it is now officially supported.

if you use the unstable ppa, you still need to change oneiric to natty in the apt sources file.
But all dependencies incl libva and xvba-va-driver are in the ubuntu repos.