Re: Live view on Canon EOS M50

Marcus Meissner <[email protected]> Mon, 18 May 2020 09:14:59 +0200
Newsgroups gmane.comp.multimedia.gphoto.user
Organization SUSE Software Solutions Ger many GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany , GF: Felix Imendörffer, HRB 36809, AG Nürnber g
Message-ID <[email protected]>
Hi,

On Sun, May 17, 2020 at 09:05:44PM +0200, Antonio Cuni wrote:
> Hello Marcus,
> thanks to your input, I am making some progress.
> 
> > We have decoded more values for "output" in the meantime (in libgphoto2
> 2.5.23 or later):
> >
> >         { N_("Off"),            0, 0 }, /*On 5DM3, LCD/TFT is off, mirror
> down and optical view finder enabled */
> >         { N_("TFT"),            1, 0 },
> >         { N_("PC"),             2, 0 },
> >         { N_("TFT + PC"),       3, 0 },
> >         { N_("MOBILE"),         4, 0 },
> >         { N_("TFT + MOBILE"),   5, 0 },
> >         { N_("PC + MOBILE"),    6, 0 },
> >         { N_("TFT + PC + MOBILE"), 7, 0 },
> >         { N_("MOBILE2"),        8, 0 },
> >         { N_("TFT + MOBILE2"),  9, 0 },
> >         { N_("PC + MOBILE2"),   10, 0 },
> >         { N_("TFT + PC + MOBILE2"), 11, 0 },
> 
> This is interesting: do you know what "MOBILE" and "MOBILE2" actually mean?

Not at this time, it was contributed by another user.

 
> Anyway, I compiled gphoto2 (ae708e6) and libgphoto2 (ed6a19059) from git:
> $ LD_LIBRARY_PATH=/usr/local/lib/ gphoto2 --version
> gphoto2 2.5.23.1
> [...]
> This version of gphoto2 is using the following software versions and
> options:
> gphoto2         2.5.23.1       gcc, popt(m), exif, cdk, no aa, jpeg,
> readline
> libgphoto2      2.5.24.1       standard camlibs (SKIPPING lumix), gcc,
> ltdl, EXIF
> libgphoto2_port 0.12.0         iolibs: disk ptpip serial usb usbdiskdirect
> usbscsi, gcc, ltdl, EXIF, USB, serial without locking
> 
> The first weird thing which I noticed is that now gphoto is VERY slow at
> establishing a connection with my camera (via usb): before it took 0.16
> seconds, now it takes 24 seconds 😱:
> 
> $ time gphoto2 --auto-detect  # stock ubuntu
> Model                          Port
> 
> ----------------------------------------------------------
> Canon EOS M50                  usb:005,014
> 0.07user 0.08system 0:00.16elapsed 97%CPU (0avgtext+0avgdata
> 13416maxresident)k
> 0inputs+0outputs (0major+3315minor)pagefaults 0swaps
>
> $ LD_LIBRARY_PATH=/usr/local/lib/ time gphoto2 --auto-detect  # compiled
> from git
> Model                          Port
> 
> ----------------------------------------------------------
> Canon EOS M50                  usb:005,014
> 0.05user 0.07system 0:24.08elapsed 0%CPU (0avgtext+0avgdata
> 11288maxresident)k
> 280inputs+0outputs (4major+2637minor)pagefaults 0swaps
> 
> I can see this ~25s delay with every gphoto2 command which connects to the
> camera, including --config, --capture-movie, etc.. I have no idea what
> causes it.

Can you capture a debug logfile of this? 

	gphoto2 --auto-detect --debug --debug-logfile=xx.log

This will have timestamps in front so we can see where the delays comes from.

It could be a filesystem access or similar during the "directory" driver probing.

> Then, I tried various values of "output" on this command line, as you
> suggested, but none of them seems to work:
>         gphoto2 --capture-preview --set-config output="TFT + MOBILE2"
> --capture-movie --stdout
>         gphoto2 --capture-preview --set-config output="TFT + PC"
> --capture-movie --stdout
> 
> But I didn't manage to make it working, the LCD continues to turn off.
> 
> On reading the source, capture-preview/capture-movie was currently always
> > setting
> > it back to 2 (PC), if it was not 2 (PC).
> 
> 
> I tried to look at recent git commits but I didn't find anything related to
> that. Is it possible that you forgot to push?
> Anyway, I dug a bit in the code and I think I found the relevant line: is
> it this one?
> https://github.com/gphoto/libgphoto2/blob/master/camlibs/ptp2/library.c#L3043

I actually forgot to commit and push it, sorry...  It is now in there.
 
> I tried to change the hard-coded "2" into "3" (which should mean "TFT +
> PC"), and it actually worked!

Very good to hear!

> Now I can see the preview both on the LCD and on my PC, and I can even
> change the settings from the camera during the preview; however, as soon as
> I take a picture gphoto2 stops/crashes, but maybe this is expected? (Well,
> I suppose the stop could be expected, but the segfault not :)):
> 
> $ LD_LIBRARY_PATH=/usr/local/lib/ gphoto2 --capture-movie --stdout |
> ~/pypy/misc/gphoto2-liveview-example/gphoto2-liveview-example
> Capturing preview frames as movie to 'stdout'. Press Ctrl-C to abort.
> 
> #... worked well for a while, then I released the shutter
> ERROR: Movie capture error... Exiting.
> Movie capture finished (971 frames)
> Segmentation fault
> 
> In case it might be useful to anybody, there is the patch which I applied:

Can you try the one I did? It will need a --set-config output="TFT + PC"

It should not crash when pressing the shutter ;)

There it would be good to have a gdb backtrace or a debuglogfile of it. (but the latter might be kind of large,
so only the last 50 lines before the crash or so)=

Ciao, Marcus


_______________________________________________
Gphoto-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gphoto-user