I'd dearly love to get this working under OSX on a Mac, but I think may not be possible because the OSX version of libusb has problems claiming a usb device (because OSX gets exclusive control as soon as you plug a USB device in). This is certainly true for some devices (e.g. mass storage devices like disks and cards, as well as HID's) does anyone know if it's untrue for cameras?
The libusb page says
Darwin (Mac OS X) implementation has one limitation. If the OS has an interface driver that matches the characteristics of a device, it will seize the interface and the kernel driver cannot easily be detached. So libusb will not be able to use that interface. This is a particular problem with generic HID devices. For HID device, HIDAPI is recommended.
No idea if this applies to PTP devices. If so, maybe a higher level API you can use for PTP commands ? In the long term, I hope to make things modular enough that you could change the underlying communication layer to something other than libusb. You'd expect that there should be some mechanism for camera vendors to support their PTP extensions in their own apps. It looks like there are remote capture apps for Mac (e.g. for Canon cameras that can do remote capture using the Canon SDK), so you might look into how those work.
IUP also does not have native support for OSX. I don't know if it runs under X11. Native OSX support is on their TODO list.
Hello,
I was able to compile IUP.3.7 and CD.5.6 for OSX 10.7 as dylib-s. I would be happy to upload them somewhere so someone else can confirm that they work and then send them to Tecgraf.
I didn't experienced the OSX libusb limitation with my cameras (powershot sx10 and A810). But experienced one other strange behavior:
after connecting the camera to USB port, camera will retract lens and turn of screen. (this is not happening in Ubuntu) Depending on settings in "Image Capture.app" the camera will be mounted to selected app (default is iPhoto. you can turn out mounting, but it has no impact on the behavior that I'm describing). Then I'm able connect to camera with chdkptp with working console, browse and liveview. HW and chdkptp gui buttons are not working but that's porobably normal as I read in this forum. The real problem is switching to record mode with switch_mode_usb(1), which is not working and do something harm in camera. liveview and browsing is still working, but that's all. attempt to switch the camera off with HW button or command is freezing the camera.
I found one workaround for this behavior, but virtualbox is needed and it's not very practical. Create usb filter for one virtualbox host (in my case I it's ubutnu hots). Then when you connect USB cable, connect with chdkptp from virtualbox host, switch to record mode, disconect chdkptp, remove camera from virtualbox host usb devices. then the camera will now connect to OSX as before, but will not retract lens. you can browse content with iPhote OR can connect with chdkptp from OSX and the camera fill not freeze.
I wasn't able to discover what is the reason why this happens. Probably OSX send to camera command to switch to some mode from witch switch_mode_usb(1) is not working and the camera ignore this OSX command when camera already executed switch_mode_usb(1) from virtualbox host. I tried to add autostart script that call switch_mode_usb(1), but it didn't help.
in the attachment is fix for small bug that I found in lua/gui.lua