# Broadcom Hardware Decoder BCM970012 - PCIe MiniCard [solved]

## h2sammo

how do i install its linux driver?

as of right now it is recognized by lspci but no driver associated to it.  please help

this seems to be the driver on Broadcom's website: http://www.broadcom.com/support/crystal_hd/Last edited by h2sammo on Mon May 10, 2010 12:42 am; edited 3 times in total

----------

## cach0rr0

what's the lspci and lspci -n look like? 

if nothing else I can do a quickie grep of the source tree and see if the pci id is found.

----------

## h2sammo

```
 lspci | grep Broad

02:00.0 Multimedia controller: Broadcom Corportion Device 1612 )rev 01)
```

```
lspci -n

...

02:00.0 0480: 14e4:1612 (rev 01)
```

----------

## cach0rr0

nope, no joy

I don't know if anyone else has anything to add, but methinks the only way to do this would be to snag the driver source from the broadcom site and build it by hand, since far as I can tell it isn't anywhere in the kernel.

----------

## h2sammo

thank you. unfortunately i dont know how to build it by hand.  could you give me the sequence of commands or an example, etc?

----------

## EzInKy

Usually it's...

```

./configure

make

su ....

make install

```

...but directions should accompany the sources in an INSTALL or README file.

----------

## Ion Silverbolt

Yeah it was nice of broadcom to include an Install or readme file.   :Rolling Eyes: 

In the crystalhd/linux folder, type autoconf, then ./configure

I didn't have any luck with it though. I get this error:

```
checking for ld... ld

configure: creating ./config.status

.infig.status: error: cannot find input file:
```

Anyway, the most info on it seems to be on the xbmc forums.

http://blog.xbmc.org/forum/showthread.php?t=66650&highlight=crystalhd

Hopefully someone will put it in portage soon. Or at least in an overlay.

----------

## h2sammo

i could not figure it out...but i have never installed a module from scratch before.  could a more experienced user give this a go and post the steps?

many thanks.

----------

## NeddySeagoon

h2sammo,

fetch the driver to /home/h2sammo it will be called crystalhd_linux_20091229.zip

```
unzip crystalhd_linux_20091229.zip
```

and you will have a new dir called crystalhd

which contains

```
 driver  examples  filters  firmware  include  linux_lib
```

unusually, README is missing.

```
cd driver/linux
```

which looks like the driver

```
autoconfig

./configure

make

su

make install
```

Will be most of it - however there are a few scripts provided to glue it all together and on my system, without the hardware, the ./configure step fails, so I can't test further.

----------

## Ion Silverbolt

Thanks for the help Neddy.   :Smile: 

I have the same card. Mine croaks at ./configure

```
autoconf

./configure

checking for ld... ld

configure: creating ./config.status

.infig.status: error: cannot find input file:
```

I read on the xbmc post where you have to run ./bootstrap to create a sane build environment for the driver. Whatever the hell that means. I tried running ./bootstrap but it doesn't do anything except complain about no such file or directory.

This driver is supposed to eventually be in the kernel soon. Hopefully it will be easier to deal with then.

----------

## EzInKy

Look for a "scripts", "tools" directory, or similar directory for a bootstrap.sh file.

----------

## Ion Silverbolt

I saw it earlier but thought it was for building the toolchain or something. I'll give it a try. Thanks.

----------

## EzInKy

 *Ion Silverbolt wrote:*   

> I saw it earlier but thought it was for building the toolchain or something. I'll give it a try. Thanks.

 

That's pretty much what bootstrapping is B-)

EDIT: Be sure of your working directory before executing that command. You especially don't want to be in /usr/portage/scripts.

----------

## Ion Silverbolt

Well whatever they did with ./bootstrap in that xbmc thread was an Ubuntu specific fix I think. Nothing about the /usr/portage/scripts/bootstrap.sh file seems relevant to building this driver. Technically it shouldn't involve that much effort. I've compiled wireless drivers from source on my own that didn't involve this much effort.

Anyway, I'll just wait it out. Support for this card will get better. 1080p on a netbook or appletv has a lot of people looking at this card. 

Thanks for the help EzinKy.  :Smile: 

----------

## EzInKy

 *Ion Silverbolt wrote:*   

> 
> 
> Anyway, I'll just wait it out. Support for this card will get better. 1080p on a netbook or appletv has a lot of people looking at this card. 
> 
> 

 

I went the ion route during a moment of weakness for my latest htpc build and have had misgivings ever since. It's been years since any of my computers needed closed sourced drivers. I'm not a complete OSS zealot as I don't normally criticize others for using binary blobs, but my doing so somehow makes me feels "dirty". Anyway, like you, I'm really looking forward to a bright future for this card.

----------

## roarinelk

 *Ion Silverbolt wrote:*   

> 
> 
> I have the same card. Mine croaks at ./configure
> 
> ```
> ...

 

run dos2unix on the configure.ac and Makefile.in files and rerun autoconf.

----------

## Ion Silverbolt

Already tried that. I should have mentioned that earlier.

Update:  I tried it again and it worked this time. I ran it without specifying the file last time. I assumed it worked on anything in the folder. Thank you.

----------

## h2sammo

 *Ion Silverbolt wrote:*   

> Already tried that. I should have mentioned that earlier.
> 
> Update:  I tried it again and it worked this time. I ran it without specifying the file last time. I assumed it worked on anything in the folder. Thank you.

 

can you please do a step by step for the newb that i am?

----------

## Ion Silverbolt

emerge dos2unix if you don't have it. Enter the driver/linux folder.

```

#dos2unix configure.ac

#dos2unix Makefile.in

#autoconf

#./configure

#make

#make install

#modprobe crystalhd
```

This is the easy part. Compiling the gstreamer plug-in is even more screwed up. Honestly, I can't believe broadcom released such a pile of crap. It's like they just said, "here" without even attempting to make it accessible to anyone but skilled programmers.

----------

## Ion Silverbolt

I can get configure to run on the gstreamer plugin, but it croaks at make. It takes even more "tweaking" to get to this point than it does for the driver.

in crystalhd/filters/gst/gst-plugin:

```

#dos2unix Makefile.in configure.ac configure.guess

#autoconf

#sh ./configure

#make
```

That's as far as I get with it. Besides the dos2unix step, I had to use sh to get configure to run. Otherwise it says access denied even as root. After make is ran, I get this error:

```

#make

make  all-recursive

make[1]: Entering directory `/usr/local/src/crystalhd/filters/gst/gst-plugin'

Making all in m4

make[2]: Entering directory `/usr/local/src/crystalhd/filters/gst/gst-plugin/m4'

make[2]: Nothing to be done for `all'.

make[2]: Leaving directory `/usr/local/src/crystalhd/filters/gst/gst-plugin/m4'

Making all in src

make[2]: Entering directory `/usr/local/src/crystalhd/filters/gst/gst-plugin/src'

Makefile:313: .deps/libgstbcmdec_la-decif.Plo: No such file or directory

Makefile:314: .deps/libgstbcmdec_la-gstbcmdec.Plo: No such file or directory

Makefile:315: .deps/libgstbcmdec_la-parse.Plo: No such file or directory

make[2]: *** No rule to make target `.deps/libgstbcmdec_la-parse.Plo'.  Stop.

make[2]: Leaving directory `/usr/local/src/crystalhd/filters/gst/gst-plugin/src'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/usr/local/src/crystalhd/filters/gst/gst-plugin'

make: *** [all] Error 2
```

This is just nuts IMO. Compiling a driver or plugin shouldn't be this difficult.

----------

## Monkeh

 *Ion Silverbolt wrote:*   

> I had to use sh to get configure to run. Otherwise it says access denied even as root.

 

Perhaps you should make it executable then...

----------

## Ion Silverbolt

Aren't you essentially executing it by using sh regardless of file attributes?

Anyway, I made it executable. Same result.

----------

## h2sammo

ok thank youi for the instructions.  i have installed the crystalhd driver properly and it shows in lsmod when i put the decoder card in.  i see however NO CHANGE in the way 720p and 1080p mkv content is playing in mplayer and xbmc.  is support for this card not implemented in these players yet? or what is the deal?

also, do i have to install the gstreamer plugin as well? i was not able to complete that task.  not sure what that plugin is for and why i would need to compile  a driver for it.

----------

## Ion Silverbolt

The Gstreamer plugin is what will allow access to the CrystalHD card in programs such as totem. Without it, the card is no better than a paper weight.

xbmc should work for you though. Are you using the crystalhd specific build of xbmc? I don't think it is available in portage. You'll have to manually install it. It may be in an overlay though. Maybe somebody else here can verify that. I'm too lazy to try any harder to get this card working. lol  I know it's just a matter of time though. It should be better supported. In fact, it's supposed to be in a future kernel at some point.

----------

## h2sammo

i followed neddy and your instructions to install it.  the driver is not available in portage. is there a way to check beyond reasonable doubt that it works

?

----------

## Ion Silverbolt

There's a test file you can run to see if the card works in the driver. It's in the example folder. I didn't get that far though. It won't work right without the gstreamer plugin.

Right now, the xbmc forums are the best place for info on this card. There are people having success. It's just not an easy road by any means.

----------

## h2sammo

i have XBMC 9.11-r1 working with crystal hd driver compiled manually. this is due to special crystalhd support added into this version of xbmc.  i have not even tried gstreamer compilation as i only use xbmc on this machine.  

unzip driver as needed then cd in to the linux folder inside the crystald/driver folder.

emerge dos2unix as you will need it below

```
cd /crystalhd/driver/linux

dos2unix configure.ac

dos2unix Makefile.in

autoconf

./configure

make

make install

modprobe crystalhd
```

this sequence will have to be redone everytime you change the kernel in any way.

i had to re-emerge xbmc because of some lib problems (not related) after i have done all this.  i doubt it should be necessary in order for this to work but i figured i would mention it.

thank you all who helped me

----------

## h2sammo

after about 2 weeks of use i have to confess the decoder is not working with XBMC as well as i had hoped.  the video frames are fairly smooth at 720p when there are no sudden abrupt events (car chases, fights, sporting events, etc) and the audio sync pretty well with the voice. my tv resolution only goes to 720p so thats all i can attest to.

but... when i do watch action movies or sporting events as mkv files at 720p there is an irregularity in rendering. frames accelerate periodically as if the video has to catch up with the audio.  the sync is still pretty good though.

i have not played with the XBMC rendering options but i am a bit disappointed as this decoder is supposed to play 1080p!

----------

## Ion Silverbolt

Yeah it doesn't sound like it is working fully, or not at all. I can play 720p mkv files in gstreamer now without the card with a bit of tweaking. 

Progress on these drivers is taking longer than I thought it would. I thought there were more people who use it. Guess not.

----------

## h2sammo

can u give the steps for how you compiled gstreamer successfully please?

----------

## h2sammo

some useful messages:

```
appletv appletv # dmesg | grep cryst*

Loading crystalhd 0.9.27
```

```
appletv appletv # dmesg | grep 70012   

Broadcom 70012 Decoder 0000:02:00.0: enabling device (0000 -> 0002)

Broadcom 70012 Decoder 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

Starting BCM70012 Device

CStopping BCM70012 Device

Broadcom 70012 Decoder 0000:02:00.0: setting latency timer to 64
```

```
appletv appletv # dmesg | tail

eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

Loading crystalhd 0.9.27 

PCI_INFO: Vendor:0x14e4 Device:0x1612 s_vendor:0x14e4 s_device: 0x2612

Broadcom 70012 Decoder 0000:02:00.0: enabling device (0000 -> 0002)

Broadcom 70012 Decoder 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

allocated 18 elem

Starting BCM70012 Device

clock is moving to 175 with n 35 with vco_mg 2

CStopping BCM70012 Device

Broadcom 70012 Decoder 0000:02:00.0: setting latency timer to 64
```

```
appletv appletv # lsmod

Module                  Size  Used by

crystalhd              45548  0 

snd_seq                36860  0 

snd_seq_device          5432  1 snd_seq

wl                   1942460  0 

snd_pcm_oss            29704  0 

snd_mixer_oss          11908  1 snd_pcm_oss

nvidia               8858588  48 

snd_hda_codec_atihdmi     2852  1 

hid_logitech            5220  0 

hid_apple               5372  0 

snd_hda_codec_realtek   182676  1 

usbhid                 15020  0 

snd_hda_intel          21312  3 

snd_hda_codec          47240  3 snd_hda_codec_atihdmi,snd_hda_codec_realtek,snd_hda_intel

snd_pcm                49076  4 snd_pcm_oss,snd_hda_intel,snd_hda_codec

snd_timer              15152  3 snd_seq,snd_pcm

i2c_i801                8148  0 

snd                    40552  13 snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer

soundcore               4844  1 snd

i2c_core               16712  2 nvidia,i2c_i801

snd_page_alloc          7060  2 snd_hda_intel,snd_pc
```

EDIT:

i restarted the machine for some other reason, now Broadcom is enabled properly... very weird. i tried playing a 720p mkv movie and its still crappy in fast scenes, etc, but dmsg does not show anything wrong with the device.

```
appletv appletv # dmesg | tail

Broadcom 70012 Decoder 0000:02:00.0: setting latency timer to 64

nvidia: module license 'NVIDIA' taints kernel.

Disabling lock debugging due to kernel taint

nvidia 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

nvidia 0000:01:00.0: setting latency timer to 64

NVRM: loading NVIDIA UNIX x86 Kernel Module  190.42  Tue Oct 20 20:18:32 PDT 2009

EXT3 FS on hda4, internal journal

Adding 1081772k swap on /dev/hda5.  Priority:-1 extents:1 across:1081772k 

Clocksource tsc unstable (delta = -128667184 ns)

eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

```

----------

## h2sammo

anyone figured out how to properly install this driver?

i found this, but its too complex for me: http://multimedia.cx/eggs/installing-crystalhd-drivers-in-linux/

----------

## h2sammo

ok i have news: http://forum.xbmc.org/showthread.php?p=532636#post532636

i need to compile libs and driver from http://wiki.xbmc.org/index.php?title=HOW-TO_install_a_Miminal_Ubuntu_and_XBMC_with_sound_over_HDMI_on_the_AppleTV#Install_crystal_HD_driver_and_library

i am stuck here for the libs (driver installs fine)

```

appletv libcrystalhd #  make install

mkdir -p /usr/include/libcrystalhd

cp libcrystalhd_if.h /usr/include/libcrystalhd/

cp ../../include/bc_dts_defs.h /usr/include/libcrystalhd/

cp ../../include/bc_dts_types.h /usr/include/libcrystalhd/

cp ../../firmware/fwbin/70012/bcmFilePlayFw.bin /lib/firmware/

cp: cannot create regular file `/lib/firmware/': Is a directory

make: *** [install] Error 1
```

----------

## h2sammo

```
mkdir /lib/firmware/
```

do i have to remove my existing xbmc gentoo patched version if i want to compile a subversion release of xbmc?

----------

## h2sammo

i didnt have to remove anything, revision 28256 of xbmc from xbmc-999 subversion trunk (see https://forums.gentoo.org/viewtopic-t-827023-highlight-.html) uses crystalhd to play 1080p on my appletv with 15% cpu usage  :Smile: .  first few frames are stutterish but after then it catches up all is dandy. pretty amazing.

this post on xbmc forums might be useful as well: http://forum.xbmc.org/showthread.php?p=534051#post534051 .

for my purposes, this thread is solved. thank you all.

----------

## h2sammo

this decoder card is now supported in linux-2.6.34-gentoo-r1 kernel which is keyworded in portage

----------

## Aries97

So I'm using kernel 2.6.36-hardened-9.   I don't expect you to know if my kernel has support for CrystalHD.  But say it does, is there a Kernel config option that I have to enable; and where do I go from there?  -  In other words, what's changed.  With kernel support, what else needs to be done to utilize the CrystalHD decoder?  

I'm trying to follow http://multimedia.cx/eggs/installing-crystalhd-drivers-in-linux/ I'll let you all know how it goes.

----------

## Aries97

```
Device Drivers

    [*] Staging drivers

       [ ]   Exclude Staging drivers from being built

          [*]  Broadcom Crystal HD video decoder support
```

----------

## Aries97

Ok so I found this:  CrystalHD support now merged in FFmpeg and MPlayer Finally some recent, and hopefully, up to date information (3-24-2011 !)

Unfortunately I already compiled CrystalHD support into the kernel; so now I have to remove it.  Also I have no idea how to get "the latest driver and userspace library from Jarod Wilson’s git tree".

So I guess I have to learn how to use git.  I've seen  Linus Torvalds talk on git but I don't program; so I never had a reason to learn how to use it until now.

----------

