Facetime hd camera linux

Stono / 99-install-facetime-camera.sh

#! /bin/bash
set -e
export CONFIG_MODULE_SIG=n
export CONFIG_MODULE_SIG_ALL=n
export KERNELRELEASE= $
echo » Installing FacetimeHD camera for $KERNELRELEASE «
cd /tmp
git clone https://github.com/patjak/bcwc_pcie.git
cd bcwc_pcie/firmware
make
make install
cd ..
make
make install
rm -rf /tmp/bcwc_pcie
if [ ! -d » /etc/modules-load.d » ] ; then
mkdir -p » /etc/modules-load.d «
fi
cat > » /etc/modules-load.d/facetimehd.conf » EOL
videobuf2-core
videobuf2_v4l2
videobuf2-dma-sg
facetimehd
EOL
echo » Install complete. «

This comment has been minimized.

Copy link Quote reply

Stono commented Feb 27, 2017

Put this file in /etc/kernel/postinst.d/99-install-facetime-camera.sh and it’ll be done each time you update the kernel.
Make sure you have the dependencies mentioned on https://github.com/patjak/bcwc_pcie/wiki/Get-Started

You can ‘one shot’ run it for your current kernel with /etc/kernel/postinst.d/99-install-facetime-camera.sh $(uname -r)

I’m running Korora (Fedora) 25 on a 2016 Macbook Pro, so that’s what this is tested on.

This comment has been minimized.

Copy link Quote reply

vablinux commented Jul 6, 2018

I’ve tried to install the camera using the tutorial but I got the same error message. So I decided to run your script but I got the same error.

Copying firmware into ‘//usr/lib/firmware/facetimehd’
make -C /lib/modules//build M=/tmp/bcwc_pcie modules
make[1]: *** /lib/modules//build: No such file or directory. Stop.
make: *** [Makefile:12: all] Error 2

Any help is much appreciated.
Thanks

This comment has been minimized.

Copy link Quote reply

vablinux commented Jul 6, 2018

I found a solution. Followed this instructions https://github.com/patjak/bcwc_pcie/wiki/Get-Started#get-started-on-fedora
Then I installed sudo yum install elfutils-libelf-devel
Facetime camera working fine on my macbook pro with fedora 28

This comment has been minimized.

Copy link Quote reply

jpretori commented Apr 4, 2019

Thanks!
I get this problem though — can you help?

This comment has been minimized.

Copy link Quote reply

gonzaloFigueras commented Apr 27, 2019

Hello, I have tried the script but I am getting the following error:

**Installing FacetimeHD camera for
Cloning into ‘bcwc_pcie’.
remote: Enumerating objects: 1049, done.
remote: Total 1049 (delta 0), reused 0 (delta 0), pack-reused 1049
Receiving objects: 100% (1049/1049), 350.72 KiB | 503.00 KiB/s, done.
Resolving deltas: 100% (707/707), done.

Checking dependencies for driver download.
/usr/bin/xzcat
/bin/cpio
Makefile:34: fallo en las instrucciones para el objetivo ‘AppleCameraInterface’
make: *** [AppleCameraInterface] Error 1**

I don’t know what to do here. I am stucked.

Thanks in advanced!

This comment has been minimized.

Copy link Quote reply

erwinfeser commented May 2, 2019

This script seems to be outdated

This comment has been minimized.

Copy link Quote reply

urbantrout commented Apr 7, 2020

@gonzaloFigueras You need to install curl

This comment has been minimized.

Copy link Quote reply

avtkal commented May 2, 2020

I get stucked here:
/tmp/bcwc_pcie/firmware$ make
make: *** No targets specified and no makefile found. Stop.

Could someone help with this?
Thank you!

This comment has been minimized.

Copy link Quote reply

atulpendse commented May 11, 2020

Same error for me on Fedora 32

[apendse@apendse-fedora firmware]$ pwd
/data/workspace/bcwc_pcie/firmware

[apendse@apendse-fedora firmware]$ sudo make
make: *** No targets specified and no makefile found. Stop.

This comment has been minimized.

Copy link Quote reply

ukn commented Jul 3, 2020

Had to modify the script a bit but got it working on Linux Mint 19.3 (kernel 5.4.0-40-generic)
https://gist.github.com/ukn/a2f85e3420ae7d0f64db2274a9bc106b

This comment has been minimized.

Copy link Quote reply

petrstepanov commented Sep 28, 2020

Thanks @ukn I’ve just tried your script on Fedora 32. I had to comment out line #43:
https://gist.github.com/petrstepanov/73e1eeaeca8b56bf4bca2a367f18fe95
and it worked great. Enjoying my camera now!

This comment has been minimized.

Copy link Quote reply

DavefromGA commented Sep 29, 2021

Thanks Stono for this script. I ended up using it as the base for what I was trying to solve. I did try it like you instructed, but it wouldnt work on my machine. I have a 2015 MacBook Pro. I though about it a while and realized that the only time I need this to run is when I update the kernel, since this is when it kills the install. So I just changed the script to do the apt update then automatically just run your script and basically reinstall the driver immediately after the kernel update. Works perfectly. I put it on my page if your interested in seeing how I did it. Thank you for helping me get my camera running again.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

petrstepanov / install-facetime-hd-webcam.sh

#! /bin/bash
set -e
export CONFIG_MODULE_SIG=n
export CONFIG_MODULE_SIG_ALL=n
# For current kernel
export KERNELRELEASE= $( cat /proc/version | awk ‘ ‘ )
temp_dir= $( mktemp -d )
echo » Installing FacetimeHD camera for $KERNELRELEASE «
cd $temp_dir
git clone https://github.com/patjak/facetimehd-firmware.git
git clone https://github.com/patjak/bcwc_pcie.git
cd $temp_dir /facetimehd-firmware
pwd
make
make install
cd $temp_dir /bcwc_pcie
pwd
make
make install
rm -rf $temp_dir
if [ ! -d » /etc/modules-load.d » ] ; then
mkdir -p » /etc/modules-load.d «
fi
cat > » /etc/modules-load.d/facetimehd.conf » EOL
videobuf2-core
videobuf2_v4l2
videobuf2-dma-sg
facetimehd
EOL
# Workaround for depmod being skipped above with error:
# Warning: modules_install: missing ‘System.map’ file. Skipping depmod
echo » Generate modules.dep and map files «
sudo depmod
echo » Adding kernel modules «
# sudo modprobe -r bdc_pci
sudo modprobe facetimehd
echo » Install complete «

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

MacBook 12″, 2017: 480p FaceTime camera supported? #178

Comments

marbetschar commented Apr 7, 2019 •

Thanks for providing this awesome driver!! However, I’m currently struggling with one small issue: I suspect that the screen resolutions Cheese uses in my environment are too high and therefore it is not able to capture any video.

Here’s what I get when querying for supported resolutions:

And this is how Cheese looks like:

Please note I’m not able to select any other resolution in Cheese. The one selected is the only one available.

Any help would be highly appreciated.

UPDATE: For what it’s worth, this is the MacBook device I’m trying to get the camera working on: https://www.apple.com/chde/macbook/specs/

The text was updated successfully, but these errors were encountered:

marbetschar commented Apr 11, 2019 •

Any ideas how I might fix the webcam issue? I’d happily provide a pull request or anything else which takes this further — but I don’t know where to start unfortunately. A little hint to get things rolling would be awesome! 🎢

UPDATE: While trying to track this down I came accross the following:

  • The green light only flashes during boot. Never ever when an application is started or tries to grab video
  • /dev/video0 exists with the permissions crw-rw—-+ 1 root video . and my user is in the video group
  • mpv tv:// does open a window, but this only shows a green background
  • mpv tv:// logs [tv] ioctl enum norm failed: Inappropriate ioctl for device and [tv] Error: Cannot set norm!
  • v4l2-compliance compliance fails for «VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF» (output below)

Slowly running out of ideas. Is there anything else I can check?

marbetschar commented Apr 11, 2019 •

One more thing: The green webcam light is flashing as soon as the driver gets loaded ( modprobe facetimehd ). This happens even if I manually load the driver. The full dmesg output for driver loading is as follows:

EDIT: For the sake of completeness, here the full mpv tv:// output.

Which displays like this:

JUST SEEN: the MacBook seems to have a 480p FaceTime camera builtin. Is all of these, because the driver does not support the camera at all. 🙁

marbetschar commented Apr 22, 2019

Is this driver still under development?

Asking this not to offend anyone, we all get busy from time to time. But I’m wondering because there doesn’t seem to be much activity in this repo by the owner. Lots of open issues and no new commits.

That said, I’m wondering if there’s any chance to get help at all.

maximilianduell commented May 10, 2019 •

Probably that is a different camera model. Does it use the same firmware as the 720p cameras? That would be the first thing I would try. For now the necessary firmware for the 720p cameras is extracted from an OSX install image on the apple webpage. Perhaps the 480p cameras need a different one? Perhaps you can find it on your OSX install if you look at the older firmware extraction script code.

marbetschar commented May 10, 2019 •

@maximilianduell thanks for getting back on this 👍

Found the AppleCameraInterface binary within /System/Library/Extensions/AppleCameraInterface.kext/Contents/MacOS/ thanks to the firmware extraction script as you pointed out.

If I’m on the right track you are suggesting to use AppleCameraInterface file from my macOS install, rename it to firmware.bin and replace the default /usr/lib/firmware/facetimehd/firmware.bin under Linux . right?

UPDATE: Just tested. After replacing the default firmware.bin the camera is no longer displayed in Cheese. Also the file sizes differ quite a bit, wondering if I missed something:

In addition mpv does no longer work:

maximilianduell commented May 10, 2019 •

If I interpret the extraction script correctly, the file AppleCameraInterface is not just the firmware but also contains OSX driver code. You can’t just rename it to firmware.bin From this file the firmware has to be extracted in some way.

can help with this step. But if we are unlucky, then the 480p camera and its firmware work completely different compared to the 720p camera. 😐 Note also, that the extraction script also has a disclaimer that only specific versions of the firmware/driver are actually known to work.

marbetschar commented May 14, 2019

Unfortunately no luck. If I run the script as provided, it fails since my AppleCameraInterface file does not match any known hash. In addition, I changed the script a bit so it ignores the checks (version attached) and exports the firmware regardless if the hash is known or not.

When I run the script, it will export the following files:

Now I replaced the /usr/lib/firmware/facetimehd/firmware.bin with each one of the osx firmware versions and after each replacement made a reboot. After reach reboot I ran mpv tv:// and the only thing that indeed improved is the fact, that the green flash light is on as long as the command is running. Other than that nothing changed. In addition I’m only able to execute the command once. The second time nothing happens anymore.

Any other ideas? 🙂

maximilianduell commented May 17, 2019 •

I do not have much experience with developing drivers. Unfortunately I do not have a Macbook with a 480p camera I could use for testing. If I had one I would try to compare the various functionalities and initialization routines of the driver on the two different hardware models and see if I can get those running component wise.

Perhaps I may be able to borrow such a Macbook for a short time in one or two months.

Otherwise without access to the hardware it is hard for me to say what else one could try. But my guess is that it likely is a deeper issue and that some initialization routines perhaps or data conversion routines have to be adapted or implemented differently.

patjak commented Dec 9, 2019

As Maximilian say, the Macbook 480p camera is likely a model we don’t support. Not much I can do without actually having a device to work with. Sorry.

maximeplante commented Aug 4, 2020

For people encountering this issue: see #196 for a fix. You have to change some values in fthd_isp.c and fthd_v4l2.c.

Источник

Читайте также:  Команда для подключения удаленного рабочего стола windows
Оцените статью