ptpcam with Linux 3.0 kernel - General Help and Assistance on using CHDK stable releases - CHDK Forum supplierdeeply

ptpcam with Linux 3.0 kernel

  • 2 Replies
  • 3466 Views
ptpcam with Linux 3.0 kernel
« on: 11 / April / 2012, 13:59:56 »
Advertisements
Hey all. I've modified ptpcam some more to fit my own purposes (remote control from an embedded computer basically). I've been using it without any real problems until just recently.

I realize that the ptpcam version with chdk extensions was never meant to be a long-term solution, but it's come in pretty handy for me. However, with the new Linux 3.0 kernel, things aren't working quite right.

The problem seems to be that ptpcam cannot open a session to the camera:

# ./ptpcam -l

Listing devices...
bus/dev vendorID/prodID device model
ERROR: Could not open session!
Try to reset the camera.

I'm using an S95 and ptpcam is running in the Angstrom distro with the 3.0.0 kernel. However, I don't think it's specific to the camera or distro because everything works fine with the same camera and distro but a 2.6.* kernel.

Also, the system can see the camera just fine:

# lsusb
...
Bus 001 Device 003: ID 04a9:3212 Canon, Inc.

Doing some quicking Googling, it appears that the culprit may be the libusb-0 library:

A project called Digikam was having a similar problem with the new kernel and talking to ptp cameras: https://bugs.launchpad.net/ubuntu/+source/digikam/+bug/865032

In that post, someone linked to this guy's code where he explains about some namespace errors he corrected for that particular project: http://sourceforge.net/tracker/?func=detail&atid=308157&aid=3361405&group_id=8157
Quote
I've investigated a crash with digikam (www.digikam.org), that eventually boiled down to a linker namespace conflict. digikam can be compiled with OpenCV support (which in turn can have libdc1394 support) and gphoto2 support (which uses libusb-0). When both are enabled, the 'usb_init' function of libdc1394 will get into namespace before usb_init of libusb.
AFAIK usb_init in libdc1394 is only required internally, so the attached patch alters visibility of methods of libdc1394. I have made public all methods starting with dc1394 prefix. However, an earlier patch is availble on request that enables only methods specified in the API description on the libdc1394 (which will break compilation of OpenCV).

Does ptpcam use libdc1394 (for firewire support)? I didn't think that library was being used, but could it be something else along those lines?

Basically I'm looking for at least a point in the right direction here. I stumbled across this yesterday and I'm just starting to figure this out. If someone knows how I can go about determining what the problem is, I'd be all ears. And if by some chance someone knows how to fix it, that would be great, too!

Thanks!

*

Offline reyalp

  • ******
  • 14079
Re: ptpcam with Linux 3.0 kernel
« Reply #1 on: 11 / April / 2012, 23:29:51 »
ptpcam shouldn't have any 1394 stuff that I know of.

However, your problem sounds like it might be related to this issue http://www.assembla.com/spaces/chdkptp/tickets/65 I fixed in chdkptp. See this change http://trac.assembla.com/chdkptp/changeset/222

Don't forget what the H stands for.

Re: ptpcam with Linux 3.0 kernel
« Reply #2 on: 12 / April / 2012, 15:00:33 »
I totally should have checked that first. I had a problem with that section of code the first time I built ptpcam for Angstrom (http://chdk.setepontos.com/index.php?topic=6954.msg74580#msg74580).

Thanks for the help, though, that seemed to have fixed it!

 

Related Topics