Kodi Community Forum
[LINUX] Problems compiling crystalhd branch - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: [LINUX] Problems compiling crystalhd branch (/showthread.php?tid=62708)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34


- dan1son - 2009-12-30

theuni Wrote:The driver was released less than 3 hours ago. Please give it a bit. In the near future, it will (probably?) be merged into mainline so there will be no need to do anything manually.

I haven't looked into it personally, though i assume it would be a typical make and modprobe. Davilla, how far off am I?

TheUni

It's not a simple make and modprobe. I wasn't saying it's impossible. I'm just amazed they released all of it like that.


- davilla - 2009-12-30

Picky, picky. Come one guys. You would not believe how hard this was to get this rolled out.

Give me a few hours to ramp up.


- padukes - 2009-12-30

davilla Wrote:Picky, picky. Come one guys. You would not believe how hard this was to get this rolled out.

Give me a few hours to ramp up.

Sorry. You're right. You are the roxxorz! Yay Davilla!


- dan1son - 2009-12-30

davilla Wrote:Picky, picky. Come one guys. You would not believe how hard this was to get this rolled out.

Give me a few hours to ramp up.

We love you Scott.


- dan1son - 2009-12-30

For what it's worth I managed to get the new kernel driver compiled and loaded... also got the scripts in the linux driver folder to run and setup my /dev files and so forth.

To compile I edited the Makefile.in file to point to the crystalhd/driver/linux directory and the kernel header files at /usr/src/linux. copied Makefile.in to Makefile

I then edited crystalhd_misc.c to remove all references to "dma_length" which were inside of #ifdef statements that don't fit my setup anyway (I'm guessing some configure stuff should be ran to get those defines setup).

ran make to compile the kernel driver and make install to install it.


Then to get the bcm_70012_*.sh files to run I had to use the dos2unix command which removes all of the CTRL-M chars before the end lines... it looks like someone used a windows box to make those scripts and I was getting errors saying /bin/bash^M doesn't exist.

Then modprobe crystalhd and poof
Code:
[ 1086.408860] Loading crystalhd 0.9.27
[ 1086.408913] PCI_INFO: Vendor:0x14e4 Device:0x1612 s_vendor:0x14e4 s_device: 0x2612
[ 1086.408956] ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 16 (level, low) -> IRQ 16
[ 1086.409003] allocated 18 elem
[ 1086.409152] Starting BCM70012 Device



- davilla - 2009-12-30

EDIT1: new patch -> http://pastebin.com/m6e9b4e42

cd crystalhd/driver/linux

autoconf
./configure
make
sudo make install
sudo ./bcm_70012_run.sh

cd crystalhd/linux_lib/libcrystalhd
make
sudo make install

now wait as I merge up svn trunk Smile
EDIT2: r26179 is sync'ed to the released source code. Make sure you pass "--enable-crystalhd" into configure.


- andybz - 2009-12-30

I've got r26179 checked out. I followed your instructions (plus I had to dos2unix a few files)

Now I'm getting:

Code:
make[1]: Entering directory `/home/andy/src/xbmc/xbmc/cores/dvdplayer/DVDCodecs/Video'
g++ -MD -c -O2 -g -D_DEBUG -Wall -D_LINUX -D_FILE_DEFINED -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DINSTALL_PATH="\"/usr/local/share/xbmc\"" -DHAS_SDL_JOYSTICK -D'SVN_REV="26179M"' -DHAVE_CONFIG_H  -I../../../../.. -I. -I../../ -I../../../../ -I../../Codecs/ffmpeg -I../../../../linux -I../../../../../guilib -I/home/andy/src/xbmc     -I/usr/include/fribidi     -I/usr/include/libpng12         -I/usr/include/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include/freetype2       -I/usr/include/alsa               -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL   -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -D__LINUX_USER__ -I/usr/include/lzo CrystalHD.cpp -o CrystalHD.o
In file included from CrystalHD.cpp:45:
/usr/include/libcrystalhd/bc_dts_types.h:69: error: multiple types in one declaration
/usr/include/libcrystalhd/bc_dts_types.h:69: error: declaration does not declare anything
make[1]: *** [CrystalHD.o] Error 1
make[1]: Leaving directory `/home/andy/src/xbmc/xbmc/cores/dvdplayer/DVDCodecs/Video'
make: *** [xbmc/cores/dvdplayer/DVDCodecs/Video/Video.a] Error 2



- padukes - 2009-12-30

davilla Wrote:EDIT1: new patch -> http://pastebin.com/m6e9b4e42

Hi,

Sorry for my ignorance but when I try to apply the patch I get the below. Any ideas?

Thanks!
P

Code:
root@mini:/usr/src/crystal# patch -p0 < 2.patch
(Stripping trailing CRs from patch.)
patching file crystalhd/driver/linux/bcm_70012_dev.sh
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file crystalhd/driver/linux/bcm_70012_dev.sh.rej
(Stripping trailing CRs from patch.)
patching file crystalhd/driver/linux/bcm_70012_run.sh
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file crystalhd/driver/linux/bcm_70012_run.sh.rej
(Stripping trailing CRs from patch.)
patching file crystalhd/driver/linux/configure.ac
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file crystalhd/driver/linux/configure.ac.rej
(Stripping trailing CRs from patch.)
patching file crystalhd/driver/linux/crystalhd_misc.c
Hunk #1 FAILED at 769.
Hunk #2 FAILED at 791.
2 out of 2 hunks FAILED -- saving rejects to file crystalhd/driver/linux/crystalhd_misc.c.rej
(Stripping trailing CRs from patch.)
patching file crystalhd/driver/linux/Makefile.in
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file crystalhd/driver/linux/Makefile.in.rej
(Stripping trailing CRs from patch.)
patching file crystalhd/linux_lib/libcrystalhd/ln-libcrystalhd.sh
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file crystalhd/linux_lib/libcrystalhd/ln-libcrystalhd.sh.rej
(Stripping trailing CRs from patch.)
patching file crystalhd/linux_lib/libcrystalhd/Makefile
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file crystalhd/linux_lib/libcrystalhd/Makefile.rej



- davilla - 2009-12-30

andybz Wrote:I've got r26179 checked out. I followed your instructions (plus I had to dos2unix a few files)

Now I'm getting:

Code:
make[1]: Entering directory `/home/andy/src/xbmc/xbmc/cores/dvdplayer/DVDCodecs/Video'
g++ -MD -c -O2 -g -D_DEBUG -Wall -D_LINUX -D_FILE_DEFINED -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DINSTALL_PATH="\"/usr/local/share/xbmc\"" -DHAS_SDL_JOYSTICK -D'SVN_REV="26179M"' -DHAVE_CONFIG_H  -I../../../../.. -I. -I../../ -I../../../../ -I../../Codecs/ffmpeg -I../../../../linux -I../../../../../guilib -I/home/andy/src/xbmc     -I/usr/include/fribidi     -I/usr/include/libpng12         -I/usr/include/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include/freetype2       -I/usr/include/alsa               -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL   -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -D__LINUX_USER__ -I/usr/include/lzo CrystalHD.cpp -o CrystalHD.o
In file included from CrystalHD.cpp:45:
/usr/include/libcrystalhd/bc_dts_types.h:69: error: multiple types in one declaration
/usr/include/libcrystalhd/bc_dts_types.h:69: error: declaration does not declare anything
make[1]: *** [CrystalHD.o] Error 1
make[1]: Leaving directory `/home/andy/src/xbmc/xbmc/cores/dvdplayer/DVDCodecs/Video'
make: *** [xbmc/cores/dvdplayer/DVDCodecs/Video/Video.a] Error 2

comment out line 69 in bc_dts_types.h


- dan1son - 2009-12-30

padukes Wrote:Hi,

Sorry for my ignorance but when I try to apply the patch I get the below. Any ideas?

Thanks!
P

That's due to the fact that the broadcom released code has windows style endlines on it. Run dos2unix on the source files (at least the ones patched) and you should be good to go.


- padukes - 2009-12-30

dan1son Wrote:That's due to the fact that the broadcom released code has windows style endlines on it. Run dos2unix on the source files (at least the ones patched) and you should be good to go.

Thanks, that worked! As a heads up I had to run
./configure
in between the "autoconf" and "make" lines that Davilla describes above.

Now when I run xbmc I get a bunch of errors like the below - The file was recorded on an HD Homerun using Mythtv. Any ideas?

Code:
11:25:07 T:2885958512 M:773758976   DEBUG: CrystalHD: SetDropState... 0
11:25:07 T:2877565808 M:773758976   ERROR: GetDelay - snd_pcm_delay, alsa error: -32 - Broken pipe
11:25:07 T:2885958512 M:773758976   DEBUG: CrystalHD: SetDropState... 1
11:25:07 T:2877565808 M:773758976   ERROR: GetDelay - snd_pcm_delay, alsa error: -32 - Broken pipe
11:25:07 T:2877565808 M:773758976   DEBUG: CDVDPlayerAudio:: Discontinuty - was:13065945.189026, should be:12868766.222222, error:-197178.966804
11:25:08 T:2885958512 M:773758976   DEBUG: CrystalHD: SetDropState... 0


Thanks again!
P


- dan1son - 2009-12-30

padukes Wrote:Now when I run xbmc I get a bunch of errors like the below - The file was recorded on an HD Homerun using Mythtv. Any ideas?

Does it play? Those errors usually happen during startup of a movie and are somewhat expected right now (read back about 3-4 pages in this thread).


- padukes - 2009-12-30

dan1son Wrote:Does it play? Those errors usually happen during startup of a movie and are somewhat expected right now (read back about 3-4 pages in this thread).

It does play. I let it go for ~5 mins and the CPU stayed < 20% the whole time (mac mini) but play back was very choppy and it kept loosing frames the whole time. Could this be related to the interlacing stuff Davilla previously mentioned?

Thanks again!
P


- matthoffman - 2009-12-30

EDIT: Nevermind a reboot seems to have solved the problem.





I followed all the steps to compile CrystalHD module but ran into problems when I tried
"sudo ./bcm_70012_run.sh"

I get the following error. "Error(): Loading Broadcom Crystal HD (BCM70012) Module"

Checked syslog and found the following
I am doing this on the CrystalHD USB release that is in another thread.

---------------
Dec 30 09:41:35 atv kernel: [ 2388.999505] Loading crystalhd 0.9.27
Dec 30 09:41:35 atv kernel: [ 2388.999528] sysfs: duplicate filename 'Broadcom 70012 Decoder' can not be created
Dec 30 09:41:35 atv kernel: [ 2388.999533] WARNING: at /build/buildd/linux-2.6.24/fs/sysfs/dir.c:424 sysfs_add_one()
Dec 30 09:41:35 atv kernel: [ 2388.999540] Pid: 7886, comm: insmod Tainted: P 2.6.24-26-generic #1
Dec 30 09:41:35 atv kernel: [ 2388.999564] [sysfs_add_one+0x9f/0xe0] sysfs_add_one+0x9f/0xe0
Dec 30 09:41:35 atv kernel: [ 2388.999586] [create_dir+0x48/0x90] create_dir+0x48/0x90
Dec 30 09:41:35 atv kernel: [ 2388.999600] [sysfs_create_dir+0x29/0x50] sysfs_create_dir+0x29/0x50
Dec 30 09:41:35 atv kernel: [ 2388.999608] [kobject_get+0xf/0x20] kobject_get+0xf/0x20
Dec 30 09:41:35 atv kernel: [ 2388.999617] [kobject_add+0x93/0x1b0] kobject_add+0x93/0x1b0
Dec 30 09:41:35 atv kernel: [ 2388.999631] [pci_hotplug:kobject_register+0x21/0x2df0] kobject_register+0x21/0x50
Dec 30 09:41:35 atv kernel: [ 2388.999639] [bus_add_driver+0x71/0x1e0] bus_add_driver+0x71/0x1e0
Dec 30 09:41:35 atv kernel: [ 2388.999657] [nvidia:__pci_register_driver+0x56/0x490] __pci_register_driver+0x56/0x90
Dec 30 09:41:35 atv kernel: [ 2388.999667] [<d0f2102d>] chd_dec_module_init+0x2d/0x96 [crystalhd]
Dec 30 09:41:35 atv kernel: [ 2388.999684] [sys_init_module+0x126/0x19c0] sys_init_module+0x126/0x19c0
Dec 30 09:41:35 atv kernel: [ 2388.999723] [hfsplus:_atomic_dec_and_lock+0x47/0x40d0] _atomic_dec_and_lock+0x47/0x70
Dec 30 09:41:35 atv kernel: [ 2388.999749] [sysenter_past_esp+0x6b/0xa9] sysenter_past_esp+0x6b/0xa9
Dec 30 09:41:35 atv kernel: [ 2388.999770] =======================
Dec 30 09:41:35 atv kernel: [ 2388.999775] kobject_add failed for Broadcom 70012 Decoder with -EEXIST, don't try to register things with the same name in the same directory.
Dec 30 09:41:35 atv kernel: [ 2388.999785] Pid: 7886, comm: insmod Tainted: P 2.6.24-26-generic #1
Dec 30 09:41:35 atv kernel: [ 2388.999791] [kobject_add+0x113/0x1b0] kobject_add+0x113/0x1b0
Dec 30 09:41:35 atv kernel: [ 2388.999805] [pci_hotplug:kobject_register+0x21/0x2df0] kobject_register+0x21/0x50
Dec 30 09:41:35 atv kernel: [ 2388.999813] [bus_add_driver+0x71/0x1e0] bus_add_driver+0x71/0x1e0
Dec 30 09:41:35 atv kernel: [ 2388.999829] [nvidia:__pci_register_driver+0x56/0x490] __pci_register_driver+0x56/0x90
Dec 30 09:41:35 atv kernel: [ 2388.999838] [<d0f2102d>] chd_dec_module_init+0x2d/0x96 [crystalhd]
Dec 30 09:41:35 atv kernel: [ 2388.999853] [sys_init_module+0x126/0x19c0] sys_init_module+0x126/0x19c0
Dec 30 09:41:35 atv kernel: [ 2388.999890] [hfsplus:_atomic_dec_and_lock+0x47/0x40d0] _atomic_dec_and_lock+0x47/0x70
Dec 30 09:41:35 atv kernel: [ 2388.999916] [sysenter_past_esp+0x6b/0xa9] sysenter_past_esp+0x6b/0xa9
Dec 30 09:41:35 atv kernel: [ 2388.999936] =======================
Dec 30 09:41:35 atv kernel: [ 2388.999940] *ERR*:/usr/src/crystal/crystalhd/driver/linux/crystalhd_lnx.c:731: Could not find any devices. err:-17


lspci show that the device does exist.
Guessing that a duplicate needs to be removed from an earlier broadcom install. Any ideas? I am lost


- pouldam - 2009-12-30

Hi,

I can not get the Crystal card to work since I upgraded to the official driver (and revision 26190).

Doing an 'lsmod' reveals a 'crystalhd' entry (and no bcm70012 entry as I removed the old driver).

I have also tried the bcm_70012_run.sh script, but to no avail...

Is it because the firmware does not get downloaded to the card? I have bcmFilePlayFw.bin in /usr/lib. Have tried with both the new official firmware and the old one.

Kernel log: http://pastebin.com/m5732c378
xbmc log: http://pastebin.com/m3f406863

Any help is highly appreciated as it was working fine until I updated to the new official driver Sad