Kodi Community Forum
[AppleTV] Compiling crystalhd-for-osx Lib/Kext - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Mac OS X (https://forum.kodi.tv/forumdisplay.php?fid=56)
+---- Thread: [AppleTV] Compiling crystalhd-for-osx Lib/Kext (/showthread.php?tid=66174)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19


- davilla - 2010-01-06

TheQuestor Wrote:Not a great fan of adding more kext's to my hackintosh lol but if XBMC knows to skip the calls if the card isn't present then it is not so bad. Plus I have no way to test it as I doubt I will ever buy one of these cards just to be able to compile. Well actually I'd be willing to get one or two if they are cheap enough and I can find WHERE to buy them.

Read the post again TheQuestor, just install the headers, that's all you need. XBMC will load the lib at runtime if it finds it.


- kimsharma - 2010-01-06

Hello, late to the party by a couple of days Smile
I tried installing the headers but here is the error I get
http://pastebin.com/m1aa15d1b

I am not sure what I am missing but appreciate any pointers. thanks.


- davilla - 2010-01-06

kimsharma Wrote:Hello, late to the party by a couple of days Smile
I tried installing the headers but here is the error I get
http://pastebin.com/m1aa15d1b

I am not sure what I am missing but appreciate any pointers. thanks.

post the output of "ls -l /Developer/SDKs/MacOSX10.4u.sdk" Smile


- kimsharma - 2010-01-06

I think I need to wait for a more noob guide - I will let the pros carry on.
I installed XCode but only have 10.5 and 10.6 SDKs .. no 10.4

The release notes say that it shoudl work with 10.5 too though.
Here is my
Code:
$ ls -l /Developer/SDKs/MacOSX10.5.sdk
total 8
drwxr-xr-x  4 root  wheel   136 May 14  2009 Developer
drwxr-xr-x  3 root  wheel   102 Jan  5 21:53 Library
-rw-r--r--  1 root  wheel  1168 Sep 18 23:16 SDKSettings.plist
drwxr-xr-x  3 root  wheel   102 May 12  2009 System
drwxr-xr-x  9 root  wheel   306 Jan  5 21:53 usr



- Coyote63 - 2010-01-06

A Milton Wrote:Have you installed the Crystal HD library on your Apple TV? And loaded the kext?

I knew I was overenthusiastic.... Blush


- i5Js - 2010-01-06

davilla Wrote:No /usr/lib/libcrystalhd.dylib or no BroadcomCrystalHD.kext loaded, then Crystal HD will NOT show up as a rendering option.

I just download the dmg, and I can't see Broadcom HD option as render:

bash-2.05b$ sudo /sbin/kextload -v /System/Library/Extensions/BroadcomCrystalHD.kext
Password:
kextload: extension /System/Library/Extensions/BroadcomCrystalHD.kext appears to be valid
kextload: loading extension /System/Library/Extensions/BroadcomCrystalHD.kext
kextload: extension /System/Library/Extensions/BroadcomCrystalHD.kext is already loaded

-bash-2.05b$ ls -l /usr/lib/libcrystalhd.dylib -rwxr-xr-x 1 root wheel 66464 Jan 5 18:10 /usr/lib/libcrystalhd.dylib


Any ideas?

BR

Fixed, I just copy new version of /usr/lib/libcrystalhd.dylib


- i5Js - 2010-01-06

Like in Linux version, with some movies works great, but with others there are a lot of drops, the most of them in 1080p

BR


- WeakATV - 2010-01-06

I can't create a new thread for some reason... I think it's on topic, here...

I have done the following so far, please let me know what I have done incorrect.

On my Hackintosh 10.5.5, w/Xcode 3.0

Code:
svn checkout http://crystalhd-for-osx.googlecode.com/svn/trunk/ crystalhd-for-osx-read-only

Code:
$ make
OBJFILES = libcrystalhd_if.o libcrystalhd_int_if.o libcrystalhd_fwcmds.o libcrystalhd_priv.o libcrystalhd_fwdiag_if.o
SRCFILES = libcrystalhd_if.cpp libcrystalhd_int_if.cpp libcrystalhd_fwcmds.cpp libcrystalhd_priv.cpp libcrystalhd_fwdiag_if.cpp
LNM = libcrystalhd.dylib
g++  -D__LINUX_USER__ -I./ -I/usr/include -I../../include -I../../include/link -O2 -Wall -fPIC -arch i386 -shared -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4  -c -o libcrystalhd_if.o libcrystalhd_if.cpp
libcrystalhd_if.cpp: In function ‘BC_STATUS DtsProcOutput(void*, uint32_t, BC_DTS_PROC_OUT*)’:
libcrystalhd_if.cpp:1001: warning: comparison is always true due to limited range of data type
g++  -D__LINUX_USER__ -I./ -I/usr/include -I../../include -I../../include/link -O2 -Wall -fPIC -arch i386 -shared -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4  -c -o libcrystalhd_int_if.o libcrystalhd_int_if.cpp
libcrystalhd_int_if.cpp: In function ‘BC_STATUS DtsCopyRawDataToOutBuff(DTS_LIB_CONTEXT*, BC_DTS_PROC_OUT*, BC_DTS_PROC_OUT*)’:
libcrystalhd_int_if.cpp:890: warning: ‘srcWidthInPixels’ may be used uninitialized in this function
libcrystalhd_int_if.cpp: In function ‘BC_STATUS DtsCopyNV12(DTS_LIB_CONTEXT*, BC_DTS_PROC_OUT*, BC_DTS_PROC_OUT*)’:
libcrystalhd_int_if.cpp:1057: warning: ‘srcWidthInPixels’ may be used uninitialized in this function
g++  -D__LINUX_USER__ -I./ -I/usr/include -I../../include -I../../include/link -O2 -Wall -fPIC -arch i386 -shared -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4  -c -o libcrystalhd_fwcmds.o libcrystalhd_fwcmds.cpp
g++  -D__LINUX_USER__ -I./ -I/usr/include -I../../include -I../../include/link -O2 -Wall -fPIC -arch i386 -shared -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4  -c -o libcrystalhd_priv.o libcrystalhd_priv.cpp
g++  -D__LINUX_USER__ -I./ -I/usr/include -I../../include -I../../include/link -O2 -Wall -fPIC -arch i386 -shared -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4  -c -o libcrystalhd_fwdiag_if.o libcrystalhd_fwdiag_if.cpp
g++ -D__LINUX_USER__ -I./ -I/usr/include -I../../include -I../../include/link -O2 -Wall -fPIC -arch i386 -shared -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -dynamiclib -flat_namespace -undefined suppress  -o libcrystalhd.dylib libcrystalhd_if.o libcrystalhd_int_if.o libcrystalhd_fwcmds.o libcrystalhd_priv.o libcrystalhd_fwdiag_if.o

Code:
sudo make install
Password:
# this is messy yes, xbmc needs the headers in /opt/local/include
if [ -d /opt/local/include ] ; then mkdir -p /opt/local/include/libcrystalhd ; fi
if [ -d /opt/local/include ] ; then cp libcrystalhd_if.h /opt/local/include/libcrystalhd/; fi
if [ -d /opt/local/include ] ; then cp ../../include/bc_dts_defs.h /opt/local/include/libcrystalhd/ ; fi
if [ -d /opt/local/include ] ; then cp ../../include/bc_dts_types.h /opt/local/include/libcrystalhd/ ; fi
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 /usr/lib/
cp libcrystalhd.dylib /usr/lib/
install -m 755 libcrystalhd.dylib /usr/lib

Code:
$ xcodebuild -project BroadcomCrystalHD.xcodeproj -target BroadcomCrystalHD -configuration Deployment build
=== BUILDING NATIVE TARGET BroadcomCrystalHD WITH CONFIGURATION Deployment ===

Checking Dependencies...

<snip>
** BUILD SUCCEEDED **

*Installed Crystal HD Card in Apple TV

Scp'd BroadcomCrystalHD.kext from driver/darwin/build/Deployment/ to frontrow's home on the atv

Scp'd libcrystalhd.dylib, and bcmFilePlayFw.bin from /usr/lib on my hackintosh to frontrow's home on the atv

On the Apple TV...

Code:
sudo cp -r BroadcomCrystalHD.kext /System/Library/Extensions/
sudo -S chmod -R 755 /System/Library/Extensions/BroadcomCrystalHD.kext
sudo -S chown -R root:wheel /System/Library/Extensions/BroadcomCrystalHD.kext

Code:
sudo cp libcrystalhd.dylib /usr/lib/
sudo chmod 755 /usr/lib/libcrystalhd.dylib
sudo cp bcmFilePlayFw.bin /usr/lib/

Code:
-bash-2.05b$ cat /etc/rc.local
/sbin/turbo_kext_enabler.bin
/sbin/kextload -v /System/Library/Extensions/IOUSBFamily.kext/sbin/kextload -v /System/Library/Extensions/IOCDStorageFamily.kext
/sbin/kextload -v /System/Library/Extensions/IODVDStorageFamily.kext
/sbin/kextload -v /System/Library/Extensions/msdosfs.kext
/sbin/kextload -v /System/Library/Extensions/IOUSBMassStorageClass.kext
/sbin/kextload -v /System/Library/Extensions/AppleSMBIOS.kext
/sbin/kextload -v /System/Library/Extensions/IOSCSIArchitectureModelFamily.kext
/sbin/kextload -v /System/Library/Extensions/IOStorageFamily.kext
/sbin/kextload -v /System/Library/Extensions/cddafs.kext
/sbin/kextload -v /System/Library/Extensions/smbfs.kext
/sbin/kextload -v /System/Library/Extensions/udf.kext
/sbin/kextload -v /System/Library/Extensions/IOBluetoothFamily.kext
/sbin/kextload -v /System/Library/Extensions/IOBluetoothHIDDriver.kext
/sbin/kextload -v /System/Library/Extensions/IOHDIXController.kext
/sbin/kextload -v /System/Library/Extensions/ntfs.kext
/sbin/kextload -v /System/Library/Filesystems/fusefs.fs/Support/fusefs.kext
/sbin/kextload -v /System/Library/Extensions/BroadcomCrystalHD.kext
mount -t nfs 176.76.67.250:/groups /Users/frontrow/boxee/
-bash-2.05b$

Code:
-bash-2.05b$ ls -al /usr/lib/libcrystalhd.dylib
-rwxr-xr-x   1 root  wheel  69776 Jan  6 13:13 /usr/lib/libcrystalhd.dylib
-bash-2.05b$ ls -al /usr/lib/bcmFilePlayFw.bin
-rwxr-xr-x   1 root  wheel  2786404 Jan  6 13:14 /usr/lib/bcmFilePlayFw.bin
-bash-2.05b$ ls -al /System/Library/Extensions/ |grep Bro
drwxr-xr-x    3 root  wheel   102 Jan  5 23:31 BroadcomCrystalHD.kext
-bash-2.05b$

Restarted.

Code:
-bash-2.05b$ sudo kextload crystal/BroadcomCrystalHD.kext
Password:
kextload: extension crystal/BroadcomCrystalHD.kext is already loaded
-bash-2.05b$

Downloaded Compiled XBMC Here

(Copied from 'history')
Code:
450  wget wget http://atv-xbmc-launcher.googlecode.com/svn/tags/xbmc-info/scripts/xbmc-9.04_update.sh
451  chmod +x xbmc-9.04_update.sh
452  ./xbmc-9.04_update.sh XBMC_OSX_CrystalHD_r26455-Cybernation.dmg

Start XBMC -> System > Video > Playback > Render Method > *selected* "Broadcom Crystal HD"

6-11 fps, 70-90% CPU

Code:
-bash-2.05b$ cat xbmc.log
12:52:55 T:2684407808 M: 41394176  NOTICE: -----------------------------------------------------------------------
12:52:55 T:2684407808 M: 41390080  NOTICE: Starting XBMC, Platform: Mac OS X.  Built on Jan  6 2010 (SVN:26455M)

<snip>

12:52:56 T:2684407808 M: 39772160  NOTICE: Loaded advancedsettings.xml from special://profile/advancedsettings.xml
12:52:56 T:2684407808 M: 39772160  NOTICE: Contents of special://profile/advancedsettings.xml are...
                                            <advancedsettings>
                                              <skiploopfilter>8</skiploopfilter>
                                              <osx_gl_fullscreen>true</osx_gl_fullscreen>
                                            </advancedsettings>
12:52:56 T:2684407808 M: 39768064  NOTICE: Getting hardware information now...

<snip>

12:52:59 T:2684407808 M:  3051520   ERROR: [b]CrystalHD: device open failed[/b]
12:52:59 T:2684407808 M:  3051520    INFO: [b]CrystalHD: broadcom crystal hd not found[/b]
12:52:59 T:2684407808 M:  3047424  NOTICE: initialize done
12:52:59 T:2684407808 M:  3043328  NOTICE: Running the application...

<snip>

Entire xbmc.log here --> http://pastebin.com/m684e7c4e

Movie that was played was a 1080p, x264 MKV. Please let me know any other information I can provide.

TIA


- jayhawk785 - 2010-01-06

Quote:Like in Linux version, with some movies works great, but with others there are a lot of drops, the most of them in 1080p

BR

Perhaps you could provide some examples... so Davilla has something useful to work with?


- i5Js - 2010-01-06

Yes, sure, I can cut a piece of move and upload somewhere...


- agehring - 2010-01-06

davilla Wrote:If you wait at bit, a nice solution will appear sometime today Smile

Should http://code.google.com/p/crystalhd-for-osx/ be watched for this solution or here?


- davilla - 2010-01-06

agehring Wrote:Should http://code.google.com/p/crystalhd-for-osx/ be watched for this solution or here?

xbmc.org


- i5Js - 2010-01-06

davilla, do u want any pice of my movie to test?


- jayhawk785 - 2010-01-06

i5Js, is it a specific movie--do some play all the way through, or do all crash? I'd say providing the file output of the files having problems would be helpful, but I don't know enough about what you're seeing to say either way.


- i5Js - 2010-01-06

jayhawk785 Wrote:i5Js, is it a specific movie--do some play all the way through, or do all crash? I'd say providing the file output of the files having problems would be helpful, but I don't know enough about what you're seeing to say either way.

most of my movies in 720p plays great, some in 1080p plays great too, but there are others (1080p always) that it's imposible to watch