Kodi 14.1 + Crystal HD hardware acceleration + Ubuntu/Linux 32bit
#1
Here's a bit of a blast from the past but still pretty capable for those that want to dust off old hardware.

A Kodi 14.1 stable with Crystal Hardware acceleration reverted back in.
Also the latest PVR addons included, special mention to the modified pvh.tvh one for setting Autorecordings.

Code:
wget https://dl.dropboxusercontent.com/u/27641650/Kodi.14.1.final.ubuntu.12.04.tar.gz
sudo tar xzvf Kodi.14.1.final.ubuntu.12.04.tar.gz -C /

Smile

Reply
#2
Hi, thanks.
Exactly waht i need!
Gonna check soon.
Please, dont stop on 14.1Smile

A lot of regrets that kodi stoped CHD support..
Reply
#3
Actully I've lost in dependencies..

That was my way:
1. Setup ubuntu 12.04.5LTS server
2. xorg
than tries to untar yours kodi, but a lot of dependicies lost..

4. installed kodi form official ppa (to have dependencies)
5. untar yours kodi again

So now i'm able to run (xinit) official in /usr/lib/xbmc/kodi.bin
And yours in /usr/xbmc/lib/kodi.bin
Here i have 100%CPU while running kodi in main screen (without any video).
OpenGL ver: VMwareSmile Seems like you did it on VM.

And main - shoud i see in Settings/Video/Accelaration "CrystalHD"
I dont see it..

Is there any mistakes?
Thanks in advnce.
Reply
#4
Hi, yes I just put this compile out there if anyone needed it.

It was compiled and quickly tested on a Ubuntu 12.04 LTS - Virtual Box, but of course no CHD card was present.
I'm aware of the dependencies issue, as I had the same problem going from Gotham to Kodi on an Ubuntu ATV1.
Install Kodi dependencies:

Code:
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update

Just confirming you have the Crystal HD installed on your server ?

Code:
lspci | grep -i crystal
Which should result in:

02:00.0 Multimedia controller: Broadcom Corporation BCM70015 Video Decoder [Crystal HD]

To install the drivers:

Code:
sudo apt-get install crystalhd-dkms firmware-crystalhd

or have a look here:

https://github.com/yeradis/crystalhd

Crystal HD does pop up in the Acceleration menu on my ATV1 / Ubuntu / Kodi / CHD box.

To start Kodi:
Code:
sudo /usr/xbmc/bin/kodi --standalone

Reply
#5
Hi, wrxtasy.

Tried it again from the clear ubuntu on CHD installed device:

1. ubuntu 12.04.05LTS kernel 3.13.0-32-generic
2. lspci
Code:
lspci | grep -i crystal
03:00.0 Multimedia controller: Broadcom Corporation BCM70015 Video Decoder [Crystal HD]
3. than ppa for xbmc/kodi (python-software-properties is needed before add-apt-repo):
Code:
sudo apt-get install software-properties-common
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:team-xbmc/ppa
4. In: /etc/apt/sources.list i added:
Code:
deb http://ppa.launchpad.net/team-xbmc/xbmc-ppa-build-depends/ubuntu precise main
deb-src http://ppa.launchpad.net/team-xbmc/xbmc-ppa-build-depends/ubuntu precise main
5. Installed dependencies (plus 675 MB!!)
Code:
sudo apt-get update
sudo apt-get build-dep xbmc
6. Tried to instal drivers - no luck here:
Code:
sudo apt-get install crystalhd-dkms firmware-crystalhd
...
Error! Bad return status for module build on kernel: 3.13.0-32-generic (i686)
Consult /var/lib/dkms/crystalhd/0.0~git20110715.fdd2f19/build/make.log for more information.

make.log:
Thu Mar 19 20:51:27 MSK 2015
checking for ld... ld
configure: creating ./config.status
config.status: creating ./Makefile
make -C /lib/modules/3.13.0-32-generic/build SUBDIRS=/var/lib/dkms/crystalhd/0.0~git20110715.fdd2f19/build/driver/linux modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-32-generic'
  CC [M]  /var/lib/dkms/crystalhd/0.0~git20110715.fdd2f19/build/driver/linux/crystalhd_lnx.o
In file included from /var/lib/dkms/crystalhd/0.0~git20110715.fdd2f19/build/driver/linux/crystalhd_lnx.c:20:0:
/var/lib/dkms/crystalhd/0.0~git20110715.fdd2f19/build/driver/linux/crystalhd_lnx.h:48:24: fatal error: asm/system.h: No such file or directory
compilation terminated.
make[2]: *** [/var/lib/dkms/crystalhd/0.0~git20110715.fdd2f19/build/driver/linux/crystalhd_lnx.o] Error 1
make[1]: *** [_module_/var/lib/dkms/crystalhd/0.0~git20110715.fdd2f19/build/driver/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-32-generic'
make: *** [all] Error 2

7, Tried from: https://github.com/yeradis/crystalhd - no luck (make failed):
Code:
[email protected]:~/crystalhd/driver/linux$ make -j2 CONFIG_DEBUG_SECTION_MISMATCH=y
make -C /lib/modules/3.13.0-32-generic/build SUBDIRS=/home/kodi/crystalhd/driver/linux modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-32-generic'
  CC [M]  /home/kodi/crystalhd/driver/linux/crystalhd_lnx.o
  CC [M]  /home/kodi/crystalhd/driver/linux/crystalhd_misc.o
  CC [M]  /home/kodi/crystalhd/driver/linux/crystalhd_cmds.o
  CC [M]  /home/kodi/crystalhd/driver/linux/crystalhd_hw.o
  CC [M]  /home/kodi/crystalhd/driver/linux/crystalhd_linkfuncs.o
  CC [M]  /home/kodi/crystalhd/driver/linux/crystalhd_fleafuncs.o
/home/kodi/crystalhd/driver/linux/crystalhd_fleafuncs.c: In function ‘crystalhd_flea_runtime_power_dn’:
/home/kodi/crystalhd/driver/linux/crystalhd_fleafuncs.c:619:14: error: ‘regVal’ may be used uninitialized in this function [-Werror=uninitialized]
cc1: all warnings being treated as errors
make[2]: *** [/home/kodi/crystalhd/driver/linux/crystalhd_fleafuncs.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_module_/home/kodi/crystalhd/driver/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-32-generic'
make: *** [all] Error 2
[email protected]:~/crystalhd/driver/linux$
8, So your kodi, of course, does not work:
Code:
sudo /usr/xbmc/bin/kodi-standalone
sh: 1: glxinfo: not found
Kodi needs hardware accelerated OpenGL rendering.
Install an appropriate graphics driver.
Please consult Kodi Wiki for supported hardware
http://kodi.wiki/view/Supported_hardware

I am giving up...
I'm not a C++ addictedSmile
Or there is a kernel issues (not a kernel, but age of these drivers)

And thank you much!
Reply
#6
thats the reason chd supprt was removed. The chd kernel driver is completely unmaintained for years now and doesn't work on even remotely recent kernels.
Reply
#7
Not to speak of kodi's "back patched in" code. mpeg-2 and vc-1 was just disabled ... h264 is left, but it was never adjusted to the buffering render also ... but if users are happy ...
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#8
Does it mean that if i could able to find and change kernel that can suite CHD driver - could kodi work well? Or it is gonna be another subject to discuss?Smile
Does anybody know what is the last CHD suported kernel?

Thanks.
Reply
#9
You have to compile chd driver as a module from git, the kernel driver has always been useless. (And since nobody used the kernel driver anyways, imho it's kind of a moot point blaming this as one of the reasons chd was removed from Kodi. Then again I could be entirely wrong)
Reply
#10
chd was removed cause:

a) No maintainer that actually knows what was needed
b) No adjustments to buffering render have been done - it just runs very bad (e.g. see the start of a video)
c) ffmpeg transition no one did -> ffmpeg has a hwaccel for it, that can replace all this custom code - with working mpeg-2 / vc1
d) A whole lot of support needed cause of _no_ working out of the box kernel driver on any distribution (*)
e) Original maintainer, that has written this code, said: it's in bad shape - its time has come - remove it.


The version that now came back is just a revert of parts of the old code and non working functions just patched out (mpeg-2, vc1, most likely also live tv in h264).

*) Someone that shipped crystalhd systems for many years promissed to fix a) to e) and get it back upstream ... did not yet happen.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#11
Yes understandable.

I've taken mpeg2 and vc1 out of various Kodi + CHD compiles I have done. mpeg2 and Live TV were not happy companions on the ATV1. But its lowly 1Ghz Pentium now has enough spare CPU capacity to decode mpeg2 and do basic Bob deinterlacing.

Optimisations in the XBMC code and ffmpeg that started with Gotham allowed this. Deinterlacing quality using the CHD card turned out lousy anyway. vc1 has always been broken.

@alicks there are further compile instructions for CrystalHD drivers with Ubuntu here if that helps:

https://code.google.com/p/indicator-crys...talHDHowTo

Reply
#12
Thanks for setting the record straight, Fritsch =)

my experiences with the x12 card was that it was never stable, dropping frames, and a lot of times the picture would dissappear when FWD/RWD. Maybe because of immaturity of the driver and various bits of code in xbmc/elsewhere. But the X15 card has always worked perfect. The code might have been in bad shape from a software engineering view, however it did work more than fine with the x15 with h264 at very high bitrates. Maybe less so with VC1 or MPEG2 but I don't have any experiences with these types. I'm not arguing, just sharing my experienceSmile

Hope that someone could implement the code to let FFMPEG handle CHD. As you pointed out, it supports hardware MPEG2 and VC1 (progressive and interlaced) with the X15 card.
Reply
#13
(2015-03-21, 17:25)wrxtasy Wrote: @alicks there are further compile instructions for CrystalHD drivers with Ubuntu here if that helps:

https://code.google.com/p/indicator-crys...talHDHowTo


Code:
[email protected]:~/crystalhd/driver/linux#
[email protected]:~/crystalhd/driver/linux# uname -a
Linux ubuntu 3.13.0-32-generic #57~precise1-Ubuntu SMP Tue Jul 15 03:50:54 UTC 2014 i686 i686 i386 GNU/Linux
[email protected]:~/crystalhd/driver/linux# lspci | grep Cr
03:00.0 Multimedia controller: Broadcom Corporation BCM70015 Video Decoder [Crystal HD]
[email protected]:~/crystalhd/driver/linux#

No luck from the beginning:

Code:
[email protected]:~/crystalhd/driver/linux# make
make -C /lib/modules/3.13.0-32-generic/build SUBDIRS=/root/crystalhd/driver/linux modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-32-generic'
  CC [M]  /root/crystalhd/driver/linux/crystalhd_lnx.o
/root/crystalhd/driver/linux/crystalhd_lnx.c:434:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_dec_init_chdev’
/root/crystalhd/driver/linux/crystalhd_lnx.c:501:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_dec_release_chdev’
/root/crystalhd/driver/linux/crystalhd_lnx.c:526:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_pci_reserve_mem’
/root/crystalhd/driver/linux/crystalhd_lnx.c:585:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_pci_release_mem’
/root/crystalhd/driver/linux/crystalhd_lnx.c:600:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_dec_pci_remove’
/root/crystalhd/driver/linux/crystalhd_lnx.c:628:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chd_dec_pci_probe’
/root/crystalhd/driver/linux/crystalhd_lnx.c:817:14: error: ‘chd_dec_pci_probe’ undeclared here (not in a function)
/root/crystalhd/driver/linux/crystalhd_lnx.c:818:2: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/root/crystalhd/driver/linux/crystalhd_lnx.c:818:26: error: ‘chd_dec_pci_remove’ undeclared here (not in a function)
/root/crystalhd/driver/linux/crystalhd_lnx.c:22:22: error: ‘crystalhd_class’ defined but not used [-Werror=unused-variable]
cc1: all warnings being treated as errors
make[2]: *** [/root/crystalhd/driver/linux/crystalhd_lnx.o] Error 1
make[1]: *** [_module_/root/crystalhd/driver/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-32-generic'
make: *** [all] Error 2
[email protected]:~/crystalhd/driver/linux#

But that seems like helps:
http://strzelecki.info/tag/crystalhd/

Code:
wget http://m25.mooo.com/devinitFix.patch
patch -p0 < devinitFix.patch

So finally:
Code:
[email protected]:~# lsmod | grep crystalhd
crystalhd              87965  0
[email protected]:~#

Code:
[email protected]:~# dmesg | grep crys
[    6.750449] crystalhd: module verification failed: signature and/or  required key missing - tainting kernel
[    6.751640] Loading crystalhd v3.10.0
[    6.751707] crystalhd 0000:03:00.0: Starting Device:0x1615
[    6.759707] crystalhd 0000:03:00.0: irq 43 for MSI/MSI-X
[email protected]:~#

But kodi don't start

Code:
[email protected]:~# /usr/xbmc/bin/kodi-standalone
sh: 1: glxinfo: not found
Kodi needs hardware accelerated OpenGL rendering.
Install an appropriate graphics driver.

Please consult Kodi Wiki for supported hardware
http://kodi.wiki/view/Supported_hardware
sh: 1: glxinfo: not found
Kodi needs hardware accelerated OpenGL rendering.
Install an appropriate graphics driver.

Please consult Kodi Wiki for supported hardware
http://kodi.wiki/view/Supported_hardware
sh: 1: glxinfo: not found
Kodi needs hardware accelerated OpenGL rendering.
Install an appropriate graphics driver.

Please consult Kodi Wiki for supported hardware
http://kodi.wiki/view/Supported_hardware
/usr/xbmc/bin/kodi --standalone  has exited uncleanly 3 times in the last 0 seconds.
Something is probably wrong
[email protected]:~#
Reply
#14
Hi!

Finally i got success!

1. Installed GUIed Linux - LinuxMint17.1 Rebecca (Ubuntu trusty 14.04.2)
With: 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:30:01 UTC 2014 i686 i686 i686 GNU/Linux
2. CHD Drivers - https://code.google.com/p/indicator-crys...talHDHowTo
with some tips from http://strzelecki.info/tag/crystalhd/
Code:
wget http://strzelecki.info/_important/devinitFix.patch
patch -p0 < devinitFix.patch
3. XBMC dependencies
Code:
sudo apt-get install software-properties-common
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get build-dep xbmc
4. Your Kodi from OP
5. Missed old libs (libmicrohttpd.so.5 ; libyajl.so.1 ; libGLEW.so.1.6 ; libudev.so.0 - seems like due to your ubuntu 12.04). Just copy their distrs to /usr/

Kodi starts (/usr/xbmc/bin/kodi-standalone) and, finally works with CHD (BTW, there is CHD choice in Acceleration tab under Video!).

Bugs:
1. Some error in kodi.log:
Code:
[email protected] ~/.kodi/temp $ more kodi.log |grep ERR
16:33:29 T:2851248960   ERROR: Traceback (most recent call last):
16:33:29 T:2851248960   ERROR:   File "/home/xbmc/.kodi/addons/script.plexbmc.helper-3.4.1/resources/lib/httppersist.py", line 34, in post
16:33:29 T:2851248960   ERROR:     conn.request("POST", path, body, header)
16:33:29 T:2851248960   ERROR:   File "/usr/lib/python2.7/httplib.py", line 973, in request
16:33:29 T:2851248960   ERROR:     self._send_request(method, url, body, headers)
16:33:29 T:2851248960   ERROR:   File "/usr/lib/python2.7/httplib.py", line 1007, in _send_request
16:33:29 T:2851248960   ERROR:     self.endheaders(body)
16:33:29 T:2851248960   ERROR:   File "/usr/lib/python2.7/httplib.py", line 969, in endheaders
16:33:29 T:2851248960   ERROR:     self._send_output(message_body)
16:33:29 T:2851248960   ERROR:   File "/usr/lib/python2.7/httplib.py", line 829, in _send_output
16:33:29 T:2851248960   ERROR:     self.send(msg)
16:33:29 T:2851248960   ERROR:   File "/usr/lib/python2.7/httplib.py", line 791, in send
16:33:29 T:2851248960   ERROR:     self.connect()
16:33:29 T:2851248960   ERROR:   File "/usr/lib/python2.7/httplib.py", line 772, in connect
16:33:29 T:2851248960   ERROR:     self.timeout, self.source_address)
16:33:29 T:2851248960   ERROR:   File "/usr/lib/python2.7/socket.py", line 571, in create_connection
16:33:29 T:2851248960   ERROR:     raise err
16:33:29 T:2851248960   ERROR: error: [Errno 111] Connection refused
16:33:29 T:2851248960   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
2.Some error on exit Kodi:
Code:
[email protected] ~ $ sudo /usr/xbmc/bin/kodi-standalone
[sudo] password for xbmc:
Running DIL (3.22.0) Version
DtsDeviceOpen: Opening HW in mode 0
DtsAllocIoctlData Error
Running DIL (3.22.0) Version
DtsDeviceOpen: Opening HW in mode 0
Scaling command param 0x0,ctx_scal:0x0
DtsAllocIoctlData Error


@wrxtasy
Is it possible if you can describe how to switch "on" CHD support in Kodi sources? I will try to compile Kodi myself in more fresh ubuntu distro and more fresh Kodi then.

And.. many many Thanks to you and all poster here.
Reply
#15
@wrxtasy is the source code of your Kodi 14.1 available?

I was running a small server with NextCloud and Kodi on my Ubuntu 12.04 atom notebook, but time came to upgrade.

I was able to compile crystalhd without a glitch on Ubuntu 16.04 using https://github.com/dbason/crystalhd repository. It works perfectly with VLC.

Nevertheless, I decided to switch to amd64 architecture, and I'm unable to make your Kodi 14.1 run. I end up with Kodi needing opengl acceleration to work. Nonetheless the Kodi from Lubuntu 16.04 repositories works fine.

Could you make the sources available? Or give me a hint how to make it work? Or even compile it for amd64 :-D ?

The crystalhd works really nice with VLC and having it available with Kodi might be a major win with little effort. Having crystalhd working on a recent distribution could be a good solution for another 4 years.

Do you think it could be doable?

Could you help me?

Thanks and happy new year!

elpraga
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Kodi 14.1 + Crystal HD hardware acceleration + Ubuntu/Linux 32bit00