Kodi Community Forum

Full Version: [LINUX] [ATI] [Zotac] How I got XBMC running on ZBOX HD AD01
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The system is a Zotac ZBOX-HD-AD01 AMD Athlon Neo X2 L325 (1.5 GHz, dual-core) coupled with an AMD 780E ATI Radeon HD 3200, 16gb kingston SSD

Pros:
+low power consumption
+6 USB ports
+small
+HDMI
+esata port with PORT MULTIPLIER

Cons:
-runs hot
-no 'official' Linux support
-runs hot

As those of you who want this hardware to run XBMC on linux, I spent a lot of time combing this forum and the internet in general looking for advice and pointers to get a successful XBMC install with linux on the Zotac. At first it was simple enough and linux/XBMC installs without any issues.

But out of the box you get Zero HW acceleration for AVC/H264 videos. Meaning that it runs at 100% CPU and stutters. A Lot. Almost every post says "get NVIDIA". Others are just forum wh*res that care more about upping their posting count on the forum than to actually provide useful suggestions. But patience pays off when searching these and all other forums, because every once in a while someone actually posts good ideas that you can use to solve your related issue.

In essence what worked for me was:

1. install Lucid
2. update everything [sudo apt-get update, sudo apt-get upgrade]
3. install catalyst 11.5 from amd site
4. Initialize xorg.config [sudo aticonfig --initial]
5. reboot
6. install libva packages from
http://www.splitted-desktop.com/~gbeauchesne/libva/
get libva1_0.31.1-1+sds4_i386.deb, as well as the related -dbg and -dev packages. Install them using the sudo dpkg -i command
7. get and install the xvba package as well. I used the 7.2 version, but 7.8 works just fine as well.
8. reboot
9. verify correct vainfo output
$ vainfo
$ vainfo
libva: libva version 0.31.0-sds6
Xlib: extension "XFree86-DRI" missing on display ":0.0".
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib/va/drivers/fglrx_drv_video.so
libva: va_openDriver() returns 0
vainfo: VA API version: 0.31
vainfo: Driver version: Splitted-Desktop Systems XvBA backend for VA API - 0.6.11
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointIDCT
VAProfileMPEG2Main : VAEntrypointIDCT
VAProfileH264High : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
$

10. Install the additional packages needed for compiling.

sudo apt-get install python-dev
sudo add-apt-repository ppa:team-xbmc-svn/ppa
sudo apt-get update

from http://xbmcmediacenter.com/compile-xbmc-on-linux/
sudo apt-get install git-core autopoint checkinstall libvdpau-dev libvdpau1 make g++ gcc gawk pmount libtool nasm yasm automake cmake gperf zip unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound-dev python-sqlite libglew-dev libcurl3 libcurl4-gnutls-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbisenc2 libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxtst-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate-dev libmpeg3-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libwavpack-dev libmpeg2-4-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext

11. Get the GIT version of xbmc. You can get the SVN if you want or even the current stable Dharma, but the GIT has a lot of issues fixed into it, as well as some new bugs (not that I have found any yet on the May 25'th version)

cd /usr/local/src
sudo git clone git://github.com/xbmc/xbmc.git xbmc
cd xbmc
sudo git checkout master

12. compile XBMC with VAAPI, Disable built-in nvidia accel options.
sudo ./bootstrap
sudo ./configure --prefix=/usr --disable-libvdpau --enable-vaapi

at the end, it should spit this out:
------------------------
XBMC Configuration:
------------------------
Debugging: Yes
Profiling: No
Optimization: Yes
Crosscomp.: No
target ARCH: no
target CPU: no
OpenGL: Yes
VDPAU: No
VAAPI: Yes
CrystalHD: No
VDADecoder: No
VTBDecoder: No
OpenMax: No
Joystick: Yes
XRandR: Yes
GOOM: No
Bluray: No
TexturePacker:Yes
MID Support: No
ccache: No
PulseAudio: No
HAL Support: Yes
DVDCSS: Yes
Avahi: Yes
Non-free: Yes
ASAP Codec: No
Webserver: Yes
libRTMP support: No
Optical drive: Yes
External FFmpeg: No
prefix: /usr
------------------------

If all is ok, issue
sudo make -j2

sudo checkinstall -y --fstrans=no --install=yes --pkgname=vaapi-xbmc

13. At the end of this, you should see XBMC under the Applications->sound and video section on the taskbar.

14. Configure XBMC and your video sources as you see fit and enjoy.

The video issue that I had was stuttering/sync issues with video playing on menu backgrounds in XBMC. I had to disable background video visualization, and disable vsync on the XBMC settings as well. You need to enable vsync via the aticonfig tool instead.

Not having background video visualization is not a huge deal for me. The ATI setup has an HDMI output and a standard VGA output.
I am able to dual-display XBMC to both my tv and my projector. These settings are best done thru the catalyst control panel. Remember that when you change or add a custom setting in xorg.conf, you need to reboot or re-start X.
I also managed to send stereo output to both the HDMI port and the analog stereo plug using the suggestions at http://www.randomwalking.com/project.php...ct=mediapc .

The HDMI defaults to 1080p output, which is fine if you are one of those that have a TV with TRUE native 1920x1080 panel. Mine is not native 1080p and it displays 1080p by virtue of the built-in scaler. I figured that it is futile to
have the HD3200 send 1080p output to a TV that is just going to scale that back to 1366x768. So I set the hdmi output to 1368x768 using the

$cvt 1366 768 60

tool, which gives the correct modeline for addition into xorg.conf.

I also added a xrandr --setmode command at startup so the correct resolution is set at every boot.

The only thing that is still a little shaky is the tear-free option in the Catalyst Control Panel, it seems to work, but on reboot it kind of changes the resolution to full 1080p and the sync values are off, giving a garbled display.
If I turn it on, it helps a little with the hulu desktop application on full screen (not perfect though). I left mine off until I can play with it more.

I am pleased with the esata port. I can set the drives to spin down on 5 minutes of inactivity via

$sudo hdparm -S60 /dev/sd*

and they suspend. I have a Probox http://www.newegg.com/Product/Product.as...6817576001 and it works awesome via esata and usb.
Of course esata is much faster. Mine's filled up with 4 2TB WD drives. You can only imagine the low-power mediaserver possibilites...
If I ever run out of space, I can attach another Probox and keep on humming along.

Since the flashplayer revamp of the encryption keys, I have seen most of my favorite plug-ins not working with XBMC anymore. Bluecop does not work (hulu, freecable)
Gametrailers and gamespot trailers. So, with the AdvancedLauncher plug-in, I am able to switch to huludesktop full screen and watch some tv series there.
The Video addons were not properly working for me. I had to recompile XBMC with libRTMP support. I downloaded the source from the git link in http://rtmpdump.mplayerhq.hu/.
I followed the libRTMP section on this link: http://slaxbmc.blogspot.com/2011/03/23-i...ource.html
The command 'joe' is just another 'nano' or 'vi' in this case.

Afterwards, I confirmed that XBMC compiled with libRTMP support. Most of the addons now work (DIY,FOOD,HGTV,etc.) only Gametrailers freezes the system with no error printout.

I was watching some of my vids and noticed stuttering on some of my high-def multichannel audio movies.
CPU readings did not show high usage, HW was on, but FPS started going down into the 15-19 range.

I did a lot of research, and no single posting gave any insight. I theorized that it must be ffmpeg acting up, as the version integrated with XBMC is quite outdated.
I searched into enabling multi-cpu support, and a project named FFMPEG-mt. It has since been merged into the main ffmpeg branch. So, I searched and attempted many times to
compile XBMC with the external FFMPEG libraried. I was unsuccessful until I stumbled across this post: http://grapz.wordpress.com/2010/08/13/co...on-ubuntu/

I followed more or less to the letter, I installed some required dependencies but the x264 and ffmpeg sources must be gotten from the latest tarballs for compatibility (http://www.ffmpeg.org/download.html & http://www.videolan.org/developers/x264.html)
FFMPEG and X264 are more or less tracking each other. That means that you cannot compile a newer ffmpeg with an older x264 library, so make sure you download the sources that are released close to each other in time. Otherwise you will probably get a "error: libx264 version must be >= 0.xx".

Take care to read the ./configure --help to see all the options available for each package. I added --enable-shared to x264 and --prefix=/usr to all of them.

Make sure that apt-get upgrade does not overwrite your packages unless you really want it to. It will probably break something.

I re-compiled XBMC with and removed all additional audio processing, and set it to send audio to HDMI only with no Downmix boost.

BTW, this is what ./configure looks like now:
------------------------
XBMC Configuration:
------------------------
Debugging: Yes
Profiling: No
Optimization: Yes
Crosscomp.: No
target ARCH: no
target CPU: no
OpenGL: Yes
VDPAU: No
VAAPI: Yes
CrystalHD: No
VDADecoder: No
VTBDecoder: No
OpenMax: No
Joystick: Yes
XRandR: Yes
GOOM: No
Bluray: No
TexturePacker:Yes
MID Support: No
ccache: No
PulseAudio: Yes
HAL Support: Yes
DVDCSS: Yes
Avahi: Yes
Non-free: Yes
ASAP Codec: No
Webserver: Yes
libRTMP support: Yes
Optical drive: Yes
External FFmpeg: Yes
prefix: /usr
------------------------

All seems to be working fine now. I am not sure if there is a way to test if XBMC is actually using the external FFMPEG library, and by extension if that external library is using both CPU's for decoding.
Last weekend I had to downgrade to Dharma 10.1, as I was having issues with the Scraper plugins not working with the Git versions.

I downloaded the 3-30-11 source from the git xbmc trunk and compiled it. It will not install with the external ffmpeg option enabled. It will not tell you of any errors during make, but it will just not produce the necessary xbmc.bin package for installation.
I ended up compiling it with rtmp support, but internal ffmpeg. I am happy to report that I was successfull and Dharma 10.1 is running fine on the Zotac AD01. I loaded up the mediastream skin and rescanned all my library as some items were missing, but in the end it worked just fine.
On a side note, I had to bump up the pulseaudio process priority to a -20 nice value for video to work flawlessly during playback.
Many thanks for posting such detail on this! Will be giving this a whirl as it would be great to get this running as it should.

Re heat - I posted on that myself a while back - see here. Hope that helps!
Just a quick tip: try the XvBA branch, it eliminates the VA-API interface and calls XvBA directly. Works great here, and it's said to work way better than VA-API (I never used VA-API with AMD/ATi myself).
Thanks for that - I was wondering about that actually. Will try that out first.
Thanks for the tips, guys. So with XvBA, do you still compile with vaapi option or will it just access it via the default vpdau/nvidia compile?

I haven't updated this post since my box is still running just fine. I updated to 11.0 Eden beta 3, git nightly version, custom compile as usual with the previously mentioned options, running on ubuntu 2.6.32-34. The hulu plugin works so much better now under Eden beta.

I did find a while back that I had my memory settings all wrong in the bios, and that was causing a lot of jittering with the video. I was basically running the thing too fast, so once I put the proper speed settings the jittering went away. I am still using the same vaapi libraries with no issue.

Re Heat: I got it solved by getting rid of the SSD drive. I moved my ubuntu image a couple of months ago to an external 16GB SD card and set up the system to boot off from the SD card. No more heat issues with the box. I have it mounted vertically with the factory feet though. Flawless everything now, I have ran it for more than 4 hours doing full 1920x1080 h.264 mp4 movies, the processors stay under 20%. I have yet to hear the fans go high speed.

Only thing missing is the damn thing will not do a proper low-power standby mode under linux. So I just set the timer to shutdown after an hour idle. It boots up from SD in under a minute (the SD is kinda slow, SSD booted in less than 30 sec) but after that, everything works as expected, no difference.

Keep on XBMC'ing...
VA-API doesn't even enter the equasion anymore with XvBA.
Indeed. I updated my set up to 12.04 lubuntu, with xbmc-xba precompiled. It is much more stable, and its driving my display at 1080p full res.

Thanks to all for the progress!