Skip to content

Instantly share code, notes, and snippets.

@PickledDragon
Created March 16, 2016 10:50
Show Gist options
  • Save PickledDragon/a359e51826e64a0be5b6 to your computer and use it in GitHub Desktop.
Save PickledDragon/a359e51826e64a0be5b6 to your computer and use it in GitHub Desktop.
Follow https://github.com/patjak/bcwc_pcie
## Firmware extraction
Download the driver (zip version) and extract it by following these steps:
* Clone the git repository with `$ git clone https://github.com/patjak/bcwc_pcie.git`
* Change to the firmware directory with `$ cd bcwc_pcie/firmware`
* Under bcwc_pcie-master/firmware type `$ make` and then as root type `# make install`
* Result should be like:
```
$ make
Dowloading the driver, please wait...
Found matching hash from OS X, El Capitan 10.11.2
==> Extracting firmware...
--> Decompressing the firmware using gzip...
--> Deleting temporary files...
--> Extracted firmware version 1.43.2
```
```
# make install
Copying firmware into '//usr/lib/firmware/facetimehd'
```
## Installation
@PickledDragon
Copy link
Author

Thanks for the replies:
I was not able to find the needed packages pbzx and xar to extract the driver from .dmg. But I managed to extract the firmware as follows:

  1. Boot to OS X, El Capitan 10.11.2, get driver: /System/Library/Extensions/AppleCameraInterface.kext/Contents/MacOS/
  2. Boot to e.g. ubuntu, cp AppleCameraInterface to bcwc_pcie-master/firmware
  3. Modify extract-firmware.sh and add sha256sum of AppleCameraInterface because it was unknown in may case.
  4. make will generate firmware.bin
  5. add sha256sum of firmware.bin to extract-firmware.sh
  6. make install

I added the following lines to extract-firmware.sh:

hash_drv_osx_143_2='387097b5133e980196ac51504a60ae1ad8bab736eb0070a55774925ca0194892'

hash_fw_osx_143_2='504fcf1565bf10d61b31a12511226ae51991fb55d480f82de202a2f7ee9c966e'

After this, the installation worked right away ;-)

Thanks a lot for the working camera!!!

@PickledDragon
Copy link
Author

Get Started on Fedora

Tested on Fedora 23. - Extract firmware file as described in Firmware extraction

  • Become root sudo su -
  • Install packages kernel-devel (if you installed the Wireless Card driver, you likely already have it): dnf install kernel-devel
  • Clone the driver's code: git clone https://github.com/patjak/bcwc_pcie.git
  • Change into directory: cd bcwc_pcie
  • Build the kernel module: make
  • Install the kernel module: make install
  • Run depmod
  • Load the module: modprobe facetimehd
  • Check if all relevant modules are loaded: lsmod | grep facetimehd

Everything should load fine. Check with command dmesg, the main driver should have loaded and ignore the error about the missing .dat file in the firmware directory (these are the calibration files, we do not have them yet).

Time for testing: launch Cheese and enjoy your own smily face :-)

@PickledDragon
Copy link
Author

To load the module in Fedora during startup

cd /etc/modules-load.d
echo "facetimehd" > facetimehd.conf

@PickledDragon
Copy link
Author

PickledDragon commented Apr 28, 2016

If you screw up

Go to the folder containing facetimehd.ko adn try:

modprobe v4l2-common
modprobe videobuf2-dma-sg
modprobe videobuf2-core
rmmod facetimehd
modprobe -r bdc_pci
insmod ./facetimehd.ko dyndbg==pmf
dmesg

@PickledDragon
Copy link
Author

get AppleCameraInterface
copy to bcwc_pcie/firmware
make
make install
cd ..
make clean
make
make install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment