Skip to content

About

Arch packaging: FacetimeHD camera firmware and sensor calibration extracted from macOS 10.12.6, for the 12-inch MacBook

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

facetimehd-macos

Arch packaging for the FacetimeHD (Broadcom 1570) camera's firmware and sensor calibration, extracted from macOS Sierra 10.12.6 at build time.

Split package producing:

package replaces contents
facetimehd-firmware-macos facetimehd-firmware ISP firmware 5.60.0
facetimehd-data-macos facetimehd-data all 11 sensor set files

Nothing Apple-owned is redistributed. The update package is downloaded from Apple's CDN during the build and the blobs are carved out locally, exactly as the existing facetimehd-firmware package does with OS X 10.11.5.

Why this exists

The existing packages are enough for most Macs but not for the 12-inch MacBook (MacBook8,1 / 9,1 / 10,1), which has never had a working camera on Linux. Two reasons:

The firmware predates the hardware. facetimehd-firmware extracts firmware 1.43.0 from OS X 10.11.5 (2016). The MacBook10,1 shipped in June 2017 with macOS 10.12.5, and 1.43.0 has no tables for its sensor, so the ISP boots, loads firmware, answers every command — and finds nothing:

FWMSG: ERR: .../CImageCaptureH4.cpp, 2667: Sensor is null after hNVStorage Validate
sensor id: 0000 0000
sensor count: 0

Firmware 5.60.0 detects it:

sensor id: 0005 9774
sensor count: 1

The calibration file is missing. With the sensor visible, the driver asks for 1675_01XX.dat. facetimehd-data ships 4 of the 11 set files, extracted from a Boot Camp driver dated 2014 that does not contain this one at all. All 11 live in macOS instead, in the userspace camera plugin's helper binary (AppleCamera.plugin/Contents/Resources/AppleCameraAssistant).

Are the extracted files correct?

check() asserts it rather than assuming it. facetimehd-data already ships four of these set files, obtained from a completely different binary at completely different offsets. Carving those four out of AppleCameraAssistant reproduces them byte for byte, so the same method is trusted for the rest. The firmware and 1675_01XX.dat are pinned by checksum too.

Sizes for 9112/1771/1871/1874 are the established ones. The other seven are each blob's non-zero content rounded up to a 4-byte boundary; of those only 1675 has been verified on hardware, where the ISP accepts it and then reports the sensor's true 848x588 active area instead of a 640x480 fallback.

Usage

yay -S facetimehd-dkms-git facetimehd-firmware-macos facetimehd-data-macos

facetimehd-dkms-git matters: the crop fix for small sensors (98b55fd) is merged but not in any tagged release, so facetimehd-dkms (0.7.0.2) still commands a 1280x720 crop on the 848x588 array and fails with sifIrq = 0x804 followed by IO: timeout.

Verify:

v4l2-ctl -d /dev/video0 --list-formats-ext
ffmpeg -f v4l2 -i /dev/video0 -frames:v 1 -update 1 -y /tmp/cam.jpg

Build notes

Needs roughly 4.5 GB free in the build directory and downloads ~2 GB.

The payload inside the update uses Apple's pbzx container, which libarchive cannot read; pbzx.py decodes it into a plain cpio stream.

Status

Developed and verified on a MacBook10,1 (12-inch, 2017), Arch, kernel 7.1.8: 848x588 at 30fps, no SIF errors. Other Macs should be unaffected — the firmware is newer but the set files are identical to what they already had.

Upstream discussion: patjak/facetimehd-firmware#12, patjak/facetimehd-firmware#3, patjak/facetimehd#178, patjak/facetimehd#196.

About

Arch packaging: FacetimeHD camera firmware and sensor calibration extracted from macOS 10.12.6, for the 12-inch MacBook

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages