Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#608 HP Photosmart M415: PTP Protocol Error

closed-fixed
None
5
2007-08-05
2006-10-29
Jason
No

Trying to use gphoto and PTP for the first time with
this camera. Until today, USB Mass Storage always
worked fine. Today it didn't, so I installed gphoto2
to try PTP.

With PTP I can download earlier images, but I get an
error past a certain point. The interesting bits at
the end of the debug log:

7.069829 context(0): PTP Protocol error, response expected

*** Error ***
PTP Protocol error, response expected
7.069863 libgphoto2/gphoto2-filesys.c(2): Download of
'HPIM0148.JPG' from '/store_00010042/DCIM/100HP415'
(type 1) failed. Reason: 'Unspecified error'
7.069874 gphoto2-camera(2): Operation failed!
*** Error (-1: 'Unspecified error') ***

Will upload the full debug log. I noticed that the
dumped data contains a lot of repeated zero bytes and
other bytes. These suspicious bytes don't appear in a
debug log of a successful download (just the "random"
bytes that I might expect to see).

As mentioned above, other problems also occur under
Linux with USB mass storage (though Linux works with
e.g. my flash drive). I went to a Windows machine and
tried USB mass storage, and the camera worked fine
there!.....

Version of gphoto is 2.1.5; libgphoto is 2.1.6;
libgphoto2_port is 0.5.1.

Discussion

  • Jason
    Jason
    2006-10-29

    Logged In: YES
    user_id=1632624

    Retrying file upload--got a 500 error last time.

     
    • assigned_to: nobody --> marcusmeissner
     
  • Logged In: YES
    user_id=48092

    nothing attached yet. make sure it is not too large.

     
  • Jason
    Jason
    2006-10-30

    Logged In: YES
    user_id=1632624

    Yeah, your server didn't seem to like me uploading the log.
    I did bzip2 it to shrink it down but that apparently wasn't
    good enough (about 3.5MB compressed)... Let me know how
    else I can upload this.

    I saw the other bug you noted, but his log appears to be
    trying to write several times and not succeeding, if I'm
    reading it right. My log is reading a lot of bytes--valid
    ones at first, then invalid nonsense, then it errors out. I
    do get the same "resource temporarily unavailable" though.

    Here's the start of the log:
    >>>>>>>>
    0.000023 main(2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN
    SENDING DEBUG MESSAGES TO THE MAILING LIST:
    0.000098 main(2): gphoto2 2.1.5
    0.000108 main(2): gphoto2 has been compiled with the
    following options:
    0.000116 main(2): + i686-pc-linux-gnu-gcc (C compiler used)
    0.000123 main(2): + popt (for handling command-line parameters)
    0.000130 main(2): + exif (for displaying EXIF information)
    0.000138 main(2): + cdk (for accessing configuration options)
    0.000145 main(2): + no aa (for displaying live previews)
    0.000152 main(2): + no jpeg (for displaying live previews
    in JPEG format)
    0.000159 main(2): + readline (for easy navigation in the shell)
    0.000173 main(2): libgphoto2 2.1.6
    0.000192 main(2): libgphoto2 has been compiled with the
    following options:
    0.000199 main(2): + i686-pc-linux-gnu-gcc (C compiler used)
    0.000209 main(2): + no EXIF (for special handling of EXIF
    files)
    0.000216 main(2): + no ltdl (working around buggy libltdl,
    eh? :-)
    0.000223 main(2): + /proc/meminfo (adapts cache size to
    memory available)
    0.000234 main(2): libgphoto2_port 0.5.1
    0.000243 main(2): libgphoto2_port has been compiled with the
    following options:
    0.000250 main(2): + i686-pc-linux-gnu-gcc (C compiler used)
    0.000257 main(2): + USB (for USB cameras)
    0.000264 main(2): + serial (for serial cameras)
    0.000271 main(2): + no resmgr (serial port access and locking)
    0.000278 main(2): + no baudboy (serial port locking)
    0.000286 main(2): + no ttylock (serial port locking)
    0.000293 main(2): + no lockdev (serial port locking)
    0.000300 main(2): + no ltdl (working around buggy libltdl,
    eh? :-)
    <<<<<<<<

    and here's the end of the log:

    >>>>>>>>>>>>>>
    7.069829 context(0): PTP Protocol error, response expected

    *** Error ***
    PTP Protocol error, response expected
    7.069863 libgphoto2/gphoto2-filesys.c(2): Download of
    'HPIM0148.JPG' from '/store_00010042/DCIM/100HP415' (type 1)
    failed. Reason: 'Unspecified error'
    7.069874 gphoto2-camera(2): Operation failed!
    *** Error (-1: 'Unspecified error') ***

    7.070138 gp-camera(2): Freeing camera...
    7.070154 gphoto2-camera(2): Exiting camera ('USB PTP Class
    Camera')...
    7.070185 ptp(2): PTP: Closing session
    7.070197 gphoto2-port(2): Writing 12=0xc byte(s) to port...
    7.070208 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
    0000 0c 00 00 00 01 00 03 10-35 00 00 00
    ........5...

    gp_port_write: Resource temporarily unavailable
    15.073136 PTP2/library.c(2): PTP: gp_port_* function
    returned 0xffffffdd
    -35
    15.073189 gphoto2-port(2): Clear halt...
    15.075059 gphoto2-port(2): Clear halt...
    15.076055 gphoto2-port(2): Clear halt...
    15.077066 gphoto2-port(2): Closing port...
    15.078274 libgphoto2/gphoto2-filesys.c(2): Clearing fscache
    LRU list...
    15.078287 libgphoto2/gphoto2-filesys.c(2): fscache LRU list
    already empty
    15.078295 gphoto2-filesystem(2): Internally deleting all
    folders from '/'...
    15.078333 gphoto2-port(2): Freeing port...
    15.078343 gphoto2-port(2): Closing port...
    15.078395 libgphoto2/gphoto2-filesys.c(2): Clearing fscache
    LRU list...
    15.078404 libgphoto2/gphoto2-filesys.c(2): fscache LRU list
    already empty
    15.078412 gphoto2-filesystem(2): Internally deleting all
    folders from '/'...
    For debugging messages, please use the --debug option.
    Debugging messages may help finding a solution to your problem.
    If you intend to send any error or debug messages to the gphoto
    developer mailing list <gphoto-devel@lists.sourceforge.net>,
    please run
    gphoto2 as follows:

    env LANG=C gphoto2 --debug -f
    "/store_00010042/DCIM/100HP415" -p "HPIM0148.JPG" --debug

    Please make sure there is sufficient quoting around the
    arguments.
    <<<<<<<<<<<<<<

     
  • Jason
    Jason
    2006-10-30

    Logged In: YES
    user_id=1632624

    BTW this happens on the first run after powering on/plugging
    in the camera, which is different from the problem in the
    other ticket (the first run would always work there, AIUI).

     
  • Logged In: YES
    user_id=27487

    libgphoto2 2.2.1 addressed a lot of problems with PTP.
    Please upgrade first.

     
  • Logged In: YES
    user_id=48092

    i am afraid a need more data ... some "read" data from the camera ... just look at the
    beginning of the trace, the first data exchanges would be interesting.

     
  • Jason
    Jason
    2006-11-02

    Logged In: YES
    user_id=1632624

    First, installed libgphoto2 version 2.2.1-r1 from Gentoo
    ~x86, and it looks like it gets farther than before, but now
    it exits with:

    gphoto2: symbol lookup error: gphoto2: undefined symbol:
    GP_SYSTEM_IS_FILE

    Are these versions compatible?

    I then upgraded to gphoto2 version 2.2.0 from Gentoo's ~x86
    and it looks like it works, mostly. The picture where it
    was crashing came up corrupted: The top half-plus of the
    picture was OK, then there was a band of dark pink, then the
    bottom half was shifted over and wrapped around the edges.
    But I just went back and looked at the copy that I'd
    transferred via the Windows machine and it looks exactly the
    same! When I look at the picture on the camera, it appears
    fine, though.

    So it performs at least as well as Windows now.

    The little bit that I tried other pictures on the camera, it
    worked OK.

    I took a debug log of the transfer and I see a sea of zeroes
    at about 59% of the way into the log file. (I'll put
    snippets in a followup reply here.)

    If I can borrow or buy a SD flash reader I might be able to
    see if that behaves any differently.

    Also, let me know if you want me to file a separate bug here
    on that missing symbol error above. If that's expected, let
    me know so I can file a bug on Gentoo to tweak the declared
    dependencies.

     
  • Jason
    Jason
    2006-11-02

    Logged In: YES
    user_id=1632624

    Here's a condensed excerpt of the debug log. Interesting
    that the transitions seem to like to happen right at about
    0x0A0C in the 4k block.

    0.000023 main(2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN
    SENDING DEBUG MESSAGES TO THE MAILING LIST:
    0.000170 main(2): gphoto2 2.2.0
    0.000192 main(2): gphoto2 has been compiled with the
    following options:
    0.000213 main(2): + i686-pc-linux-gnu-gcc (C compiler used)
    0.000232 main(2): + popt (for handling command-line parameters)
    0.000251 main(2): + exif (for displaying EXIF information)
    0.000270 main(2): + cdk (for accessing configuration options)
    0.000289 main(2): + no aa (for displaying live previews)
    0.000308 main(2): + no jpeg (for displaying live previews
    in JPEG format)
    0.000327 main(2): + readline (for easy navigation in the shell)
    0.000353 main(2): libgphoto2 2.2.1
    0.000375 main(2): libgphoto2 has been compiled with the
    following options:
    0.000395 main(2): + i686-pc-linux-gnu-gcc (C compiler used)
    0.000414 main(2): + EXIF (for special handling of EXIF files)
    0.000434 main(2): + no /proc/meminfo (adapts cache size to
    memory available)
    0.000457 main(2): libgphoto2_port 0.6.1
    0.000477 main(2): libgphoto2_port has been compiled with the
    following options:
    0.000506 main(2): + i686-pc-linux-gnu-gcc (C compiler used)
    0.000526 main(2): + USB (libusb, for USB cameras)
    0.000546 main(2): + serial (for serial cameras)
    0.000565 main(2): + no resmgr (serial port access and locking)
    0.000584 main(2): + no baudboy (serial port locking)
    0.000604 main(2): + no ttylock (serial port locking)
    0.000623 main(2): + no lockdev (serial port locking)
    [snip]
    5.283380 gphoto2-port(2): Reading 4096=0x1000 bytes from port...
    5.291101 gphoto2-port(3): Hexdump of 4096 = 0x1000 bytes
    follows:
    [snip]
    0800 e2 b8 e0 e7 1c 64 e3 af-a9 cd 6c c1 36 36 17 e0
    .....d....l.66..
    0810 16 60 3f ef 57 38 fc f1-f9 d3 ae a3 49 94 b0 53
    .`?.W8......I..S
    0820 95 52 4e 3d 40 e0 1e bc-64 63 8a 99 29 2d 7a 02
    .RN=@...dc..)-z.
    0830 7a d8 e2 ee 21 3f 36 06-dc 1d a4 11 fd d3 ce 38
    z...!?6........8
    0840 eb 91 de b1 de f2 7d 3d-90 c6 49 8d 5c 96 56 ce
    ......}=..I.\.V.
    0850 0e 4b 75 c1 19 ed d7 23-d4 57 61 77 68 06 e7 65
    .Ku....#.Wawh..e
    0860 c9 6c ed c8 f5 27 3d b2-33 f5 ae 6f 51 b3 56 8d
    .l...'=.3..oQ.V.
    0870 e4 07 85 f9 8e ee 98 c9-3d c6 38 c0 3d 69 d2 a8
    ........=.8.=i..
    0880 d4 ac c6 9f 44 6c 69 1a-fc 57 88 02 36 f9 46 0b
    ....Dli..W..6.F.
    0890 80 79 4c f3 86 50 3e 5c-9e 99 26 ba 98 26 46 50
    .yL..P>\..&..&FP
    08a0 72 06 ec 91 9e f9 c8 fa-57 9a e9 de 17 9e f6 da
    r.......W.......
    08b0 e7 53 d2 6e 4a 6a d6 b3-19 22 b4 7d 82 29 60 e1
    .S.nJj...".}.)`.
    08c0 40 cb a0 75 c8 62 72 c5-94 31 e0 74 35 af a3 6b
    @..u.br..1.t5..k
    08d0 fb 66 5d 2b 56 0d 65 75-0b b2 4b 0c fb 81 0c 99
    .f]+V.eu..K.....
    08e0 07 1b 80 5e 83 3c 13 9e-99 ae 8a b4 63 f6 35 b6
    ...^.<......c.5.
    08f0 ac 85 56 33 93 82 d1 ad-d1 db fa b0 1c 90 01 c8
    ..V3............
    0900 fa ff 00 2e 6a a5 ca 02-37 01 82 c0 8c 0f 5c 7b
    ....j...7.....\{
    0910 7f 9e 69 c9 38 70 1c 7d-d3 c0 24 63 39 07 19 f4
    ..i.8p.}..$c9...
    0920 34 fb 84 f3 02 aa 73 93-bf 83 ce 30 47 a7 20 f1
    4.....s....0G. .
    0930 58 d9 5b 51 a4 f7 30 e7-0b ca 10 03 28 1c e3 93
    X.[Q..0.....(...
    0940 ce 4f f8 56 55 dd b0 c9-66 20 6e c8 39 1c 65 81
    .O.VU...f n.9.e.
    0950 e0 71 dc 0c 56 e4 f1 2a-86 91 fe f7 27 8f 62 41
    .q..V..*....'.bA
    0960 03 f9 d5 13 6e 26 05 e7-07 79 f9 50 06 03 8c 92
    ....n&...y.P....
    0970 a4 8c 7a 75 fe b4 2f 75-e8 5a 8a 94 6e ce 6a 63
    ..zu../u.Z..n.jc
    0980 2d b8 63 1f 01 c6 0e 3d-31 8c 0f 4f 4a c8 ba b8
    -.c....=1..OJ...
    0990 9a ea 4f b2 aa b0 56 42-c5 88 3b 40 5c ee 5d e3
    ..O...VB..;@\.].
    09a0 2b 9d b9 38 ea 71 5d 5d-dc 21 5b 62 fc c3 69 19
    +..8.q]].![b..i.
    09b0 23 3c e0 ff 00 5a e7 9e-0f 22 52 91 e1 63 91 82
    #<...Z..."R..c..
    09c0 e1 f2 e5 46 fc b6 19 8e-ec e3 1d 49 ea 6b bb 2d
    ...F.......I.k.-
    09d0 9d 27 59 3a 8b 53 9f 12-eb 46 84 d5 1d da d0 ad
    .'Y:.S...F......
    09e0 24 ad 22 2c 2c 32 2d f6-81 9e c8 71 f8 9e 57 f4
    $.",,2-....q..W.
    09f0 a4 0a 80 10 e8 a4 4b ce-36 9c 06 23 6e 4f 5f 98
    ......K.6..#nO_.
    0a00 72 69 ec 11 19 c3 30 56-04 2a e3 38 95 09 8a 52
    ri....0V.*.8...R
    0a10 90 64 e0 96 2e 20 20 20-20 20 20 20 20 20 20 10 .d...
    .
    0a20 00 00 00 00 00 00 00 00-00 00 6a a4 5c 35 04 01
    ..........j.\5..
    0a30 00 00 00 00 2e 2e 20 20-20 20 20 20 20 20 20 10
    ...... .
    0a40 00 00 00 00 00 00 00 00-00 00 6a a4 5c 35 00 00
    ..........j.\5..
    0a50 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
    ................
    0a60 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
    ................
    [[more zeroes]]

    5.291371 gphoto2-port(2): Reading 4096=0x1000 bytes from port...
    5.299094 gphoto2-port(3): Hexdump of 4096 = 0x1000 bytes
    follows:
    0000 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
    ................
    [[more zeroes]]

    5.299352 gphoto2-port(2): Reading 4096=0x1000 bytes from port...
    5.307119 gphoto2-port(3): Hexdump of 4096 = 0x1000 bytes
    follows:
    [[more zeroes]]

    5.307398 gphoto2-port(2): Reading 4096=0x1000 bytes from port...
    5.315131 gphoto2-port(3): Hexdump of 4096 = 0x1000 bytes
    follows:
    [[more zeroes]]

    5.315394 gphoto2-port(2): Reading 4096=0x1000 bytes from port...
    5.323091 gphoto2-port(3): Hexdump of 4096 = 0x1000 bytes
    follows:
    [[more zeroes]]
    09e0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
    ................
    09f0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
    ................
    0a00 00 00 00 00 00 00 00 00-00 00 00 00 5b 71 1f a0
    ............[q..
    0a10 ab 37 97 4f 2e 20 20 20-20 20 20 20 20 20 20 10 .7.O.
    .
    0a20 00 00 00 00 00 00 00 00-00 00 6a a4 5c 35 05 01
    ..........j.\5..
    0a30 00 00 00 00 2e 2e 20 20-20 20 20 20 20 20 20 10
    ...... .
    0a40 00 00 00 00 00 00 00 00-00 00 6a a4 5c 35 00 00
    ..........j.\5..
    0a50 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
    ................
    0a60 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
    ................
    [[more zeroes]]

    5.323354 gphoto2-port(2): Reading 4096=0x1000 bytes from port...
    5.331088 gphoto2-port(3): Hexdump of 4096 = 0x1000 bytes
    follows:
    [[more zeroes]]

    5.331350 gphoto2-port(2): Reading 4096=0x1000 bytes from port...
    5.339088 gphoto2-port(3): Hexdump of 4096 = 0x1000 bytes
    follows:
    [[more zeroes]]

    5.339344 gphoto2-port(2): Reading 4096=0x1000 bytes from port...
    5.347087 gphoto2-port(3): Hexdump of 4096 = 0x1000 bytes
    follows:
    [[more zeroes]]

    5.347344 gphoto2-port(2): Reading 4096=0x1000 bytes from port...
    5.355089 gphoto2-port(3): Hexdump of 4096 = 0x1000 bytes
    follows:
    [[more zeroes]]
    09d0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
    ................
    09e0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
    ................
    09f0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
    ................
    0a00 00 00 00 00 00 00 00 00-00 00 00 00 0b 2e 7d 7d
    ..............}}
    0a10 3b e0 74 e9 eb 4e e8 a8-b7 7d 4b 87 71 63 31 60
    ;.t..N...}K.qc1`
    0a20 91 b6 77 29 19 52 fc 32-91 f9 91 d3 bd 55 7c 09
    ..w).R.2.....U|.
    0a30 24 0c 14 13 26 62 23 8c-44 e4 90 3d 30 b9 c7 3e
    $...&b#.D..=0..>
    0a40 95 62 32 42 4b 13 9d b8-da 50 b6 4e 4e 18 30 ef
    .b2BK....P.NN.0.
    0a50 ce 71 e9 55 5e 29 18 6f-38 05 30 ad b7 dc e7 d8
    .q.U^).o8.0.....
    0a60 f2 7d aa 64 9d ee 6b 07-7d 19 14 12 85 bb 78 e5
    .}.d..k.}.....x.
    0a70 04 05 76 41 91 c7 23 70-3f 4c 30 07 dc 55 d9 55
    ..vA..#p?L0..U.U
    0a80 25 55 87 88 cb a3 f2 bc-36 d1 9e 01 c7 70 33 8e
    %U......6....p3.
    0a90 70 48 ac d3 b8 5c 2f cb-94 71 d7 af 04 b2 36 38
    pH...\/..q....68
    0aa0 c6 57 68 3d ba 8a ba aa-0b 00 c4 86 6d d1 c4 c0
    .Wh=........m...
    0ab0 70 7a 9c 81 8e 7a 7e 95-32 4a fc c6 b0 ef d0 b5
    pz...z~.2J......
    0ac0 fe b2 30 0f 18 20 64 81-f4 f4 e7 8a b1 08 11 86 ..0..
    d.........
    0ad0 56 39 db 81 cf 6e 4e 31-fa d5 7f 9e 34 8d 95 0b
    V9...nN1....4...
    0ae0 94 91 a3 75 e5 48 ec c4-8f 55 ce 71 c7 4a b5 2c
    ...u.H...U.q.J.,
    0af0 24 c4 93 2b 63 2f 9c 0e-e0 63 3d 3d 79 14 92 d2
    $..+c/...c==y...
    [snip]

     
  • Logged In: YES
    user_id=48092
    Originator: NO

    I am pretty sure this is fixed with libgphoto2 2.4.0 now. please retest

     
    • status: open --> pending-fixed
     
  • Jason
    Jason
    2007-08-04

    • status: pending-fixed --> open-fixed
     
  • Jason
    Jason
    2007-08-04

    Logged In: YES
    user_id=1632624
    Originator: YES

    Unfortunately I cleaned out my camera's storage some weeks ago so I deleted the picture that was demonstrating the problem. So I can't meaningfully test it any more. :(

     
    • status: open-fixed --> closed-fixed
     
  • Logged In: YES
    user_id=48092
    Originator: NO

    please reopen the bug if it shows up again (or open a new one). :)