UVC camera control on OF0.10


#1

Hi all,

I was trying to use the ofxUVC addon to control a webcam’s focus and exposure.
First of all my current setup:
OF0.10
XCode 10.0
MacOS 10.13
Logitech C920 webcam.
ofxUVC: https://github.com/atduskgreg/ofxUVC

Since updating to OF0.10, XCode 10, I can’t seem to connect at all to the camera anymore.
I’ve used this addon without problems with many other OF releases and never had any issues. I’ve tested the camera with an older app that was compiled with OF090 and it still runs great and controls my Logitech C920 without issues.

The problem seems to be that inside - (id)initWithVendorID:(long)vendorID productID:(long)productID

HRESULT res = (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), (LPVOID*) &deviceInterface );
		(*plugInInterface)->Release(plugInInterface);

always returns NULL for the deviceInterface.

Does anyone know if Apple changed anything in the way we’re supposed to talk to USB devices since MacOS 10.13? I’ve looked in their documentation, but haven’t found anything.


#2

Could it be to do with the camera permissions in Xcode 10.0 / 10.14?
https://github.com/openframeworks/openFrameworks/issues/6139

Are you builds targeting the 10.14 SDK or 10.13?


#3

YESS! Thank you Theo! :pray:t2::slightly_smiling_face:
That was it. Strange that video worked, but the camera control didn’t…

I actuality checked for the camera privacy change and added the NSCameraUsageDescription key, but then abandoned that idea because I assumed Xcode was compiling against 10.13 (new Xcode isn’t very clear about that)

Good thing I keep a backup of every SDK I’ve ever used ꒰。•‿•。꒱
Compiled with 10.13 and now everything works as expected.


#4

Ahh. Glad to hear!
We’re working on an Xcode 10 / 10.14 fix release so hopefully it should be fixed in the next release.

I would be curious to know if its not a pain:
Does it work if built against the 10.14 SDK but with the following as the plist:
https://raw.githubusercontent.com/openframeworks/openFrameworks/d8b6287148d929f0c07f067a417596f2a38f0986/scripts/templates/osx/openFrameworks-Info.plist


#5

Hi Theo,

I just tested it with your plist, which is almost the same as what I used before to try to fix my problem (the content of my NSCameraUsageDescription was just ‘yo’ before :slight_smile: ) but it didn’t work.

As before, everything compiles fine, no crashes, video works, but deviceInterface is just returned NULL again.

Maybe a quirk between running 10.14 compiled code on 10.13?

best,
Tim


#6

Funny…I was doing the exact same thing the exact same day…same Logitech camera. Ended up upgrading to Mojave since the videoGrabber.listDevices() with OF1.0 returned empty on a MacMini with the C920 attached (OSX 10.9 or something). There was no privacy prompt. On 10.14 the camera is detected fine, but on a Macbook Pro changing the videoGrabber.setDeviceID when restarting grabbing seems unreliable, it defaults back to built in camera. Just test that as well if you are fixing stuff.

Best
/Andreas