On Sat, Aug 17, 2013 at 09:23:56PM +0200, Wolfram Sang wrote:
> I'm back at the observatory. First, I can confirm that Marcus'
> replacement of n_tries with timeouts in canon_usb_poll_interrupt_pipe()
> [revision 14166, 8 months ago] works for me with a 5D and 350D. No more
> OS communication errors. Hooray!
> Still, I get this error (and see it plenty on the web):
> 10.159575 canon/canon/usb.c(2): canon_usb_dialogue_full: camera status "Unknown status code 0x82120022 from camera" in response to command 0x7 0x11 0x201 (Set file attributes (new)))
> 10.159595 context(0): canon_usb_set_file_attributes: canon_usb_dialogue failed
> *** Error ***
> canon_usb_set_file_attributes: canon_usb_dialogue failed
> This is for a 5D, the 350D returns 0x00000086 ("Can't unlock EOS keys
> (new)"). While debugging, I noticed that my attributes are all 0, so
> I wondered if it makes sense to issue the command at all? And while I
> was at it, the logic for STATUS_DOWNLOADED seems wrong, see attached
> patch. This does not technically solve the problem but seems worth to
> have nonetheless?
The issue is that clearing the 0x20 bit seems to mark it as "downloaded",
so the code change is probably bad.
You could check that with
gphoto2 -P --new
it should downloaded images just once?
I think it actually misses a query of the old attribute here and a adjustment
Or just leave this funny "downloaded check" code out if it makes too much trouble :/
> Only set file attributes if there are any, saving some communication.
> Also, STATUS_DOWNLOADED should probably set bits; clearing a bit
> is useless since attr is initialized to 0.
> Signed-off-by: Wolfram Sang <wolfram@...>
> Index: camlibs/canon/library.c
> --- camlibs/canon/library.c (revision 14502)
> +++ camlibs/canon/library.c (working copy)
> @@ -796,11 +796,12 @@
> CameraFileInfo info;
> gp_filesystem_get_info (fs, folder, filename, &info, context);
> - if (info.file.status == GP_FILE_STATUS_NOT_DOWNLOADED)
> - attr &= ~CANON_ATTR_DOWNLOADED;
> + if (info.file.status == GP_FILE_STATUS_DOWNLOADED)
> + attr |= CANON_ATTR_DOWNLOADED;
> if ((info.file.permissions & GP_FILE_PERM_DELETE) == 0)
> attr |= CANON_ATTR_WRITE_PROTECTED;
> - canon_int_set_file_attributes (camera, filename,
> + if (attr)
> + canon_int_set_file_attributes (camera, filename,
> gphoto2canonpath (camera,
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> Gphoto-devel mailing list