[LINUX] How do I complile Broadcom Crystal HD driver on Ubuntu Karmic?
#1
Question 
The current XBMC SVN trunk already contains the bits for using the Broadcom BCM70012 Crystal HD (mini-)PCI-e video card.

Obtaining these bits is pretty straight forward using these instructions for installing pre-compiled development branch builds on Ubuntu Karmic.

If your using an atv, there is enough information available here and here getting XBMC running using the Broadcom card.

However if you're not using a atv but a regular motherboard with a Broadcom card installed in a (mini)PCI-e slot, then it's harder to get things up and running. The difficulty is in compiling and installing the latest linux drivers for Karmic. There is a guide available here for compiling drivers for the 2 year old Ubuntu Hardy 8.04. This guide unfortunately uses dated drivers that are not compatible with the kernel used in recent Ubuntu Karmic. The recently updated driver source code provided by Broadcom does however support more recent kernels. The last missing link is a nice guide how to compile and use these recent drivers in Karmic.

Using all information I could find I've tried and failed in compiling these drivers in Karmic. I'm not a developer, but have compiled drivers before. If someone will help me get on my way, I'll create a nice guide for all those out there not having an atv, but that do want to start benefiting from the recent Crystal HD goodness in XBMC.

Who will help me get started?
Reply
#2
atbrandt Wrote:The current XBMC SVN trunk already contains the bits for using the Broadcom BCM70012 Crystal HD (mini-)PCI-e video card.

Obtaining these bits is pretty straight forward using these instructions for installing pre-compiled development branch builds on Ubuntu Karmic.

If your using an atv, there is enough information available here and here getting XBMC running using the Broadcom card.

However if you're not using a atv but a regular motherboard with a Broadcom card installed in a (mini)PCI-e slot, then it's harder to get things up and running. The difficulty is in compiling and installing the latest linux drivers for Karmic. There is a guide available here for compiling drivers for the 2 year old Ubuntu Hardy 8.04. This guide unfortunately uses dated drivers that are not compatible with the kernel used in recent Ubuntu Karmic. The recently updated driver source code provided by Broadcom does however support more recent kernels. The last missing link is a nice guide how to compile and use these recent drivers in Karmic.

Using all information I could find I've tried and failed in compiling these drivers in Karmic. I'm not a developer, but have compiled drivers before. If someone will help me get on my way, I'll create a nice guide for all those out there not having an atv, but that do want to start benefiting from the recent Crystal HD goodness in XBMC.

Who will help me get started?

Pull from public upstream tree at http://git.wilsonet.com/crystalhd.git/

http://code.google.com/p/crystalhd-for-osx/ also contains patches and bugfixes for both osx and linux but it's a little behind the above.
Reply
#3
Question 
I managed to get on step futher. Here is what I did:

1. Dowloaded and unpacked the latest (Wed, 6 Jan 2010 23:08:04 +0000) snapshot from here as suggested.
2. Installed autoconf and g++ (sudo apt-get install autoconf g++).
3. Entered unpacked directory ~/crystalhd/driver/linux and ran autoconf there to create the configure script.
4. Ran './configure' to create the makefile
5. Ran 'make' and ran 'make install'
6. Loaded the driver with command modprobe crystalhd
This I believe installed the driver correctly as it now is listed in lsmod and the Ubuntu 'Hardware Drivers' tool.

Went on to compile the libraries;
1. Entered ~/crystalhd/linux_lib/libcrystalhd and ran make and make install
This compiled the libraries and installed them in /usr/libs and installed the blob firmware in the /lib/firmware directory.

Next I installed build 26540 of XBMC by adding ppa:team-xbmc-svn/ppa to Software Sources and selecting XBMC in the package manager. I also installed the recommended 190.53 drivers for my ION graphics card by disabling the included drivers through the 'Hardware Drivers tool', adding ppa:nvidia-vdpau/ppa to Software Sources, selecting the 190.53 driver in the package manager and running nvidia-xconfig as root.

Finally I fired up XBMC and it started up fine. I expected something like a new Crystal HD option under System->Video->Render Method, but unfortunately no change there. So I'm not sure if it actually works. Should a new option appear? Or can't Crystal HD be combined with an ION platform?

To pre-empt the obvious question you might ask; I know that VDPAU works well, I just want to check if Crystal HD might be an alternative combined with Intel's new Pine Trail platform. This could make a nice low-power and proprietary free solution.

Any tips on how I can check the card is actually working? If it turns out to be working, I'll rewrite the above into a nice step by step guide.
Reply
#4
atbrandt Wrote:I managed to get on step futher. Here is what I did:

1. Dowloaded and unpacked the latest (Wed, 6 Jan 2010 23:08:04 +0000) snapshot from here as suggested.
2. Installed autoconf and g++ (sudo apt-get install autoconf g++).
3. Entered unpacked directory ~/crystalhd/driver/linux and ran autoconf there to create the configure script.
4. Ran './configure' to create the makefile
5. Ran 'make' and ran 'make install'
6. Loaded the driver with command modprobe crystalhd
This I believe installed the driver correctly as it now is listed in lsmod and the Ubuntu 'Hardware Drivers' tool.

Went on to compile the libraries;
1. Entered ~/crystalhd/linux_lib/libcrystalhd and ran make and make install
This compiled the libraries and installed them in /usr/libs and installed the blob firmware in the /lib/firmware directory.

Next I installed build 26540 of XBMC by adding ppa:team-xbmc-svn/ppa to Software Sources and selecting XBMC in the package manager. I also installed the recommended 190.53 drivers for my ION graphics card by disabling the included drivers through the 'Hardware Drivers tool', adding ppa:nvidia-vdpau/ppa to Software Sources, selecting the 190.53 driver in the package manager and running nvidia-xconfig as root.

Finally I fired up XBMC and it started up fine. I expected something like a new Crystal HD option under System->Video->Render Method, but unfortunately no change there. So I'm not sure if it actually works. Should a new option appear? Or can't Crystal HD be combined with an ION platform?

To pre-empt the obvious question you might ask; I know that VDPAU works well, I just want to check if Crystal HD might be an alternative combined with Intel's new Pine Trail platform. This could make a nice low-power and proprietary free solution.

Any tips on how I can check the card is actually working? If it turns out to be working, I'll rewrite the above into a nice step by step guide.

ppa is not building with crystalhd headers installed so crystalhd support is not compiled in using XBMC from a ppa. This is a known issue that will be resolved at some time.
Reply
#5
Has this source for nightlies the same problem?
http://sshcs.com/xbmc/

Otherwise I'll use svn..

edit: My system is 64bit, and the mentioned source does not have 64 builds. So I'll need to compile.. On Atom, it'll take a while.
Reply
#6
atbrandt Wrote:Has this source for nightlies the same problem?
http://sshcs.com/xbmc/

Otherwise I'll use svn..

The official xbmc nightlies are compiled with crystalhd enabled. see,

http://mirrors.xbmc.org/nightlies/osx/
Reply
#7
davilla Wrote:The official xbmc nightlies are compiled with crystalhd enabled. see,

http://mirrors.xbmc.org/nightlies/osx/

I'm trying to get this to work for a Karmic machine. The builds you're referring to are for OSX. So I guess there is no way around compiling. I'm reading the guides now.
Reply
#8
atbrandt Wrote:I'm trying to get this to work for a Karmic machine. The builds you're referring to are for OSX. So I guess there is no way around compiling. I'm reading the guides now.

see README.ubuntu in svn.
Reply
#9
I'd like to report success; I've managed to get SVN checkout R26614 running on a Zotac ION using a BCM70012 mini-PCIe HD accelerator card on Ubuntu Karmic.

Here is what I did:

1. Installed subversion: 'sudo apt-get install subversion'
2. Got the latest XBMC source code: 'svn co https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk/ XBMC'
3. Installed the needed dependencies listed in the included README.ubuntu file. The 'trick' suggested to install all dependencies auto-magically didn't work for me. I ended up 'sudo apt-get installing' all dependencies by hand. It's a laborious process as not all mentioned dependencies are actually available, and there are some conflicts to resolve. I kept going until the configure script ran without errors.
4. Compiled XBMC by executing './configure' and 'make'.

And voila; I could start XBMC by running ./xbmc.bin from the command line. The 1st time XBMC crashed, but the second try it started up nicely. Now the option 'Crystal HD' was available as video renderer, which needs to be selected. Also setting 'Use pixel buffer objects' seemed to decrease the lead time before video playback starts.

Video playback observations running some quick tests are: Picture quality seems to have improved compared to VDPAU (nicer colours) and Bluray stream files take some seconds to load before playback starts. Flash playback seems quite smooth (tested with TED).

I've also tried to compile the gstreamer plugin that in contained within the sources provided by broadcom, but was less successfull. I needed to declare some variables and a file bc_ldil_if.h in /usr/includes/crystalhd was missing. I ended up renaming another file and putting it in this directory as per these instructions.
This resulted in the following error when running 'make':
Code:
../libtool: line 4450: cd: ../../../../linux_lib/ldil: No such file or directory
libtool: link: cannot determine absolute directory name of `../../../../linux_lib/ldil'

Unfortunately I don't know how to fix this, so my attempt ended there.

Many thanks to davilla for pointing me in the right direction now and then.
Reply
#10
atbrandt Wrote:I've also tried to compile the gstreamer plugin that in contained within the sources provided by broadcom, but was less successfull. I needed to declare some variables and a file bc_ldil_if.h in /usr/includes/crystalhd was missing. I ended up renaming another file and putting it in this directory as per these instructions.
This resulted in the following error when running 'make':
Code:
../libtool: line 4450: cd: ../../../../linux_lib/ldil: No such file or directory
libtool: link: cannot determine absolute directory name of `../../../../linux_lib/ldil'

Unfortunately I don't know how to fix this, so my attempt ended there.

Many thanks to davilla for pointing me in the right direction now and then.

Looks like the gstreamer code missed being updated to the new file names.

bc_ldil_if.h -> crystalhd_if.h

linux_lib/ldil -> linux_lib/libcrystalhd

it's also going to link to the wrong lib name, change "-lldil" to "-llibcrystalhd" in it's makefile.

I would be interested in feedback regarding h.264 files played under xbmc and this gstreamer plugin. The bit to byte stream handling (annex B format) is different than under xbmc and this might expose any problems we might have with bit to byte stream handling in xbmc.
Reply
#11
Information 
I've managed to complile and install. It seems to be working as gst-inspect reports it. However it doesn't seem to be used when playing an .avi, because it plays with delays. When trying to play a mvk Totems only shows an error.
Code:
GStreamer encountered a general stream error.
Reply
#12
Sad 
I'm repeating my steps to create a how-to, however I'm running into an issue I haven't seen last time around. This time I installed the dependencies by:

1. Adding the following PPA's to my sources list:
Code:
deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/team-xbmc/ppa/ubuntu karmic main

2. Installing the dependencies:
Code:
sudo apt-get install libasound2-dev
sudo apt-get build-dep xbmc
Installing libasound2-dev first resolves the conflict that otherwise occur when issuing the buid-dep command.

3. Checking out XBMC SVN
Code:
svn co https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk/@26614 XBMC
Using the same build number as checked out last go.

4. Creating the configure script by running
Code:
autoconf

Then when running the configure script I get the following error before the script terminates:
Code:
......
checking for main in -lcrypto... yes
./configure: line 5605: syntax error near unexpected token `MAD,'
./configure: line 5605: `PKG_CHECK_MODULES(MAD,        mad,'

Googling didn't give me any clues.

Any thoughts?
Reply
#13
atbrandt Wrote:I'm repeating my steps to create a how-to, however I'm running into an issue I haven't seen last time around. This time I installed the dependencies by:

1. Adding the following PPA's to my sources list:
Code:
deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/team-xbmc/ppa/ubuntu karmic main

2. Installing the dependencies:
Code:
sudo apt-get install libasound2-dev
sudo apt-get build-dep xbmc
Installing libasound2-dev first resolves the conflict that otherwise occur when issuing the buid-dep command.

3. Checking out XBMC SVN
Code:
svn co https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk/@26614 XBMC
Using the same build number as checked out last go.

4. Creating the configure script by running
Code:
autoconf

Then when running the configure script I get the following error before the script terminates:
Code:
......
checking for main in -lcrypto... yes
./configure: line 5605: syntax error near unexpected token `MAD,'
./configure: line 5605: `PKG_CHECK_MODULES(MAD,        mad,'

Googling didn't give me any clues.

Any thoughts?

./bootstrap instead of autoconf
Reply
#14
@atbrandt: Big thumbs up for creating this howto!

It's nice to claim unified OS support but without any directions it's not more then a gimmick to me.

Planning to give it a try soon on an intel GM 945 laptop.
Reply
#15
Smile 
@miseryshining: Thanks for your thumbs up. Most work is done by davilla of course. I think he's currently more focused on getting a good baseline on the atv/Hardy combination. But anyway he spent the time to give me all the hints needed. Kudos for that! That said; you might want to wait a day or so until I clean the how-to up a bit.

@davilla: Clear case of RTFM on the ./bootstrap. Missed that. It's now compiling.Thanks.

On the Gstreamer plugin. I get the below error when playing a Avatar trailer in Totem. That's h.264 isn't it? When I rmmod the crystalhd module, Totem plays it fine, only very choppy.

Code:
$ totem
Running DIL (0.9.25) Version
Mdata Pool Created...
DtsSetupHardware: DtsPushAuthFwToLink
DtsGetFirmwareFiles:Ctx->FwBinFile is /lib/firmware/bcm70012fw.bin
DtsSetupHardware: Success
OPEN success
** Message: Error: GStreamer encountered a general stream error.
qtdemux.c(2448): gst_qtdemux_loop (): /GstPlayBin2:play/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstQTDemux:qtdemux0:
streaming stopped, reason not-negotiated

DtsFWDecFlushChannel: Ioctl failed: 11
DtsCancelFetchOutInt: Called
DtsCancelFetchOutInt: No Pending Req
DtsAllocIoctlData Error
Deleted Mdata Pool...
DtsDeviceClose: Invoked
$

I'll check playback of this file in XBMC tomorrow. Do you have any suggestions on which other files to check playback of?

Do you have a suggestion on what might be causing the Gstreamer fail?
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] How do I complile Broadcom Crystal HD driver on Ubuntu Karmic?0