Настройка аппаратного декодера HD видео Broadcom CrystalHD BCM70012 в связке с XBMC на Ubuntu Karmic 9.10
apt-get install build-essential git-core autoconf subversion ccache
cd /usr/local/src
git clone git://git.wilsonet.com/crystalhd.git/
cd /usr/local/src/crystalhd/driver/linux
autoconf
[ 1116.445682] Loading crystalhd 0.9.27
[ 1116.445795] PCI_INFO: Vendor:0x14e4 Device:0x1612 s_vendor:0x14e4 s_device: 0x2612
[ 1116.445848] Broadcom 70012 Decoder 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[ 1116.447087] allocated 18 elem
[ 1116.447239] alloc irq_desc for 29 on node -1
[ 1116.447256] alloc kstat_irqs on node -1
[ 1116.447301] Broadcom 70012 Decoder 0000:02:00.0: irq 29 for MSI/MSI-X
[ 1116.447399] Starting BCM70012 Device
[ 1116.684240] clock is moving to 175 with n 35 with vco_mg 2
[ 1116.684272] CStopping BCM70012 Device
[ 1116.908158] Broadcom 70012 Decoder 0000:02:00.0: setting latency timer to 64
modinfo crystalhd
root@crystal:/usr/local/src# modinfo crystalhd
filename: /lib/modules/2.6.31-19-generic/kernel/drivers/video/broadcom/crystalhd.ko
alias: bcm70012
license: GPL
description: Broadcom Crystal HD Decoder (BCM70012) Driver
author: Prasad Bolisetty
author: Naren Sankar
srcversion: 8B48BA26802A1E8B58F4AFD
alias: pci:v000014E4d00001612sv*sd*bc*sc*i*
depends:
vermagic: 2.6.31-19-generic SMP mod_unload modversions 586
root@crystal:/usr/local/src# ls -lia /dev/crystalhd
13609 crw-rw-rw- 1 root root 251, 0 2010-02-08 22:44 /dev/crystalhd
aptitude install subversion make g++ gcc gawk pmount libtool nasm automake cmake gperf 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-openssl-dev x11proto-xinerama-dev libxinerama-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 libfaac-dev libenca-dev libxt-dev libxtst-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate-dev libmms-dev libmpeg3-dev libfaad-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libwavpack-dev libmpeg2-4-dev
cd /usr/local/src/xbmc-pvr2
./bootstrap
./configure —enable-crystalhd —disable-joystick —enable-ccache
— XBMC Configuration:
— Debugging: Yes
Profiling: No
Optimization: Yes
OpenGL: Yes
VDPAU: No
CrystalHD: Yes
Joystick: No
XRandR: Yes
GOOM: No
PCRE Support: Yes
MID Support: No
ccache: Yes
PulseAudio: Yes
FAAC: Yes
DVDCSS: Yes
Avahi: Yes
Non-free: Yes
ASAP Codec: No
Deprecated libdts: No
Deprecated liba52: No
External Libraries: No
External FFmpeg: No
External liba52: No
External libdts: No
External libass: No
External Python: No
prefix: /usr/local
————————
checkinstall —fstrans=no —install=yes —pkgname=xbmc-crystal —pkgversion «last-svn-xbmc-pvr2-crystal»
Источник
Broadcom Crystal HD: аппаратное ускорение HD видео «от А до Я»
Думаю, многие знают, что HD (720p) H.264 видео так просто на нетбуке не посмотришь. Мощности Intel Atom просто не хватает на декодирование. Я использую свой Acer Aspire One в качестве видеоплеера во время командировок и длинных поездок и тоже с этим сталкивался. Есть несколько способов решить эту проблему:
- перекодировать с более низким разрешением/битрейтом
- использовать программные ухищрения
- использовать аппаратное ускорение
Первый способ слишком медленный и унизительный (т.к. типичен для портативных плееров вроде iPod и т.п.).
Второй — не универсален и ограничен. Мне известны два способа — установка кодека CoreAVC и опережающий воспроизведение буфер Crystal Player-а (см. Настройка нетбука на максимальную производительность для HDTV). В принципе, это вполне сносное решение для 720p. Однако, есть два больших минуса: 100% загрузки процессора и полная несостоятельность в случае с 1080p.
Третий кажется мне наиболее «правильным». Можно сразу купить нетбук с Nvidia ION — универсальное решение, которое дает дополнительные плюшки вроде вычислений CUDA и возможности играть в 3D игры (впрочем, удовольствие на маленьком экранчике сомнительное). К сожалению, Nvidia ION-powered нетбуки появились лишь недавно и пока еще дороги. Да и что поделать, если уже купил себе нетбук без всяких «понтов»?
Есть выход! Называется он Broadcom Crystal HD, и «ускорить» им свой EEE PC или Aspire One вполне реально и дешево.
Корпорация Broadcom год назад выпустила карту Crystal HD на интерфейсе Mini PCI Express, которая предоставляет аппаратное ускорение воспроизведения H.264 и MPEG 2,4 (а по слухам и Flash). Прелесть вся в том, что микросхемку можно всунуть в свободный PCIe слот нетбука. Дальше пойдет речь о том, как это чудо заполучить, как настроить и как оно работает.
Все, о чем дальше пойдет речь ниже, может при наличии очень кривых рук привести к потерям как денег, так и нетбука в целом.
Рассказывать я буду на своем примере. Моя конфигурация:
Acer Aspire One AOD 250:
Intel Atom Single Core N270 (1.60 ГГц/ 512 КБ/ FSB 533), 10.1″ SD (1024×600), 2GB RAM
Windows 7 + Xubuntu 10.04 (beta)
Что нам потребуется
- наличие свободного mini PCIe слота
- около 30$ на PayPal или уже купленный Crystal HD
- если будете покупать — готовность ждать 2 месяца *
- специфический софт под Windows
- терпение и крепкие нервы (само собой)
* если Почта России будет работать по-прежнему
Ссылка на mini PCIe с википедии.
Обычно у дешевого нетбука без Yota есть свободный слот под 3G карту, он как раз и есть нужный. В моем случае он был на задней стороне, слева от отсека для смены оперативной памяти. Точно знаю, что похожее есть и у старичка AOD150, но там нет коннектора (т.е. куда непосредственно втыкать плату). Если слота нет, а вставить микросхемку очень хочется, можно разобрать нетбук, заменить wifi-карту (которая в подавляющем большинстве случаев mini PCIe) на Crystal HD, а проблему с беспроводным интернетом решить покупкой USB wifi донгла.
Я покупал карту на eBay. Не исключено, что она продается на каких-то радиорынках. Времени бегать/узнавать у меня не было, зато были деньги на PayPal.
Список софта я опишу дальше.
Получаем Crystal HD
Покупаем микросхемку на eBay. Например здесь. Я покупал 2 месяца назад, и стояла она 23 бакса включая доставку. Сейчас видимо запас их подходит к концу, и стоят они гораздо дороже. Обращаю внимание, что есть 3 разновидности модели — 70010 (старая), 70012 (как у меня), 70015 (самая новая и крутая по фичам). 70012 вполне хорошо работает.
Ждем около 2 месяцев, пока ее доставят (мне прислали из Сингапура).
Заставляем железо работать
Когда я радостно вставил Crystal HD в свой нетбук, то сначала жестко обломался, потому что ее не видел ни Windows 7, ни Xubuntu. Команда
lspci | grep Broadcom
показала шиш с маслом. Не надо расстраиваться, друзья! Возможно, в этом случае дело не в том что микросхемку облучили чем-то на таможне или долбанули статикой в самолете, а банально в старой версии BIOS вашего нетбука. Действуя интуитивно и наугад, я перепрошил BIOS своего AOD250 с 1.06 до 1.27. О чудо! Карта определилась,
lspci | grep Broadcom
Multimedia controller: Broadcom Corporation BCM70012 Video Decoder [Crystal HD] (rev 01)
Windows 7 попытался при загрузке установить драйвер на Multimedia controller, но, ясное дело, у него ничего не вышло. Переходим к списку необходимого софта:
- драйвер с сайта Broadcom
- для проигрывания MKV — Haali Media Splitter
- для проигрывания звука — AC3 Filter и CoreAAC
- если у вас Windows 7 — Windows 7 Preferred Filter Tweaker
- для диагностики кодеков — GraphStudio
Тем, у кого стоит CoreAVC + Haali Matroska (Media) Splitter (как у меня) и тем, у кого стоят CCCP-ы, K-Lite Codec Pack-и и т.д. — снести все под корень.
Качаем, ставим драйвер (32-bit).
Замечу, что именно в такой последовательности.
Возимся с кодеками
Ставим Haali Media Splitter (для контейнера MKV). Ставим AC3Filter (для Dolby AC3) и CoreAAC (для AAC).
Может, конечно, у некоторых счастливчиков после этого все сразу заработает, но я был явно не в их числе. При открытии первого попавшегося под руку 720p mkv (h.264) Windows Media Player-ом (и Media Player Classic Home Cinema тоже) я получил давно знакомые тормоза и 100% CPU. Здравствуй, codec hell.
Открыв этот файл в GraphStudio (File->Add Media file), я увидел, что h.264 видео поток по-прежнему декодируется встроенным в Windows 7 кодеком. DirectShow фильтр от Broadcom стоял. Убедиться в этом можно, найдя «Broadcom Video Decoder» в списке Graph->Insert filter…
Размеется, перезагрузка ничего не поменяла. На помощь приходит Windows 7 Preferred Filter Tweaker!
Запустив его, переключаем h.264 и MPEG2 с Microsoft на Broadcom. Видимо, в дальнейшем разработчики этой тулзы добавят заявленную поддержку Xvid, VC-1 и Divx для Broadcom-а, но на момент написания этого не было. Жмем Apply, в следующем окне везде ставим галки (отключаем все кодеки Microsoft, чтобы потом не мешались). Вуаля! GraphEdit показывает, что h.264 декодируется Broadcom-ом, звук — CoreAAC, Windows Media Player и др. уверенно показывает видео со звуком.
Возможно, у тех, у кого стоит Windows XP, такие проблемы не возникнут.
Мне так и не удалось заставить Broadcom играть Xvid, даже собрав «блоксхему» в GraphEdit-е. Быть может, я что-то упустил и вам это удастся. Неспроста в Windows 7 Preferred Filter Tweaker разработчики не добавили Broadcom в качестве Xvid-декодера. Я удовлетворился установкой обычного Xvid-а c xvid.org.
Настройка Crystal HD под Xubuntu тянет на отдельный топик…
Полевые испытания
… проводились на Windows Media Player 12, экране нетбука и питании от сети.
Media | Нагрузка CPU, avg | Нагрузка CPU, max | Качество |
720p MKV (3216MB, 2:18) Video: AVC 1280×544 24.00fps Audio: AAC 48000Hz 6ch | 30% | 40% | Отличное |
1080p MKV (8421MB, 1:43) AVC 1920×816 23.98fps Audio: Dolby AC3 48000Hz 6ch | 30% | 40% | Отличное |
DWM (эффекты Aero) ел до 15% CPU.
Под «отличным» качеством воспроизведения я имел в виду синхронизацию видео со звуком, отсутствие отставаний и рывков, насыщенность цвета, в общем обычный нормальный показ фильма. Время работы от стандартной 3-ячеечной батареи составило 2 часа в случае с 720p и 1 час 55 мин в случае с 1080p. Crystal HD сильно греется (не просто так на нем была специальная термонаклейка, рассеивающая тепло).
Обновление: я протестировал Crystal HD на внешнем мониторе. Youtube. Вердикт — «отлично». Монитор был SyncMaster 2223nw 1680×1050, 1080p видео — фрагмент фильма №2.
При обычной работе с нетбуком карта совсем не греется и не сказывается на времени автономной работы.
Источник
Broadcom crystal hd linux
atbrandt
Junior Member
The current XBMC SVN trunk already contains the bits for using the Broadcom BCM70012 Crystal HD (mini-)PCI-e video card.
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?
atbrandt Wrote: The current XBMC SVN trunk already contains the bits for using the Broadcom BCM70012 Crystal HD (mini-)PCI-e video card.
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?
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.
atbrandt
Junior Member
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.
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.
Источник