gphoto / libgphoto2

The libgphoto2 camera access and control library.
GNU Lesser General Public License v2.1
999 stars 318 forks source link

FujiFilm X-S10 fw: 2.0 #730

Open ratcashdev opened 2 years ago

ratcashdev commented 2 years ago

Previously, my X-S10 was working fine with gphoto --capture-movie using the the patches like https://github.com/gphoto/libgphoto2/commit/118903d57192ec048b3b3dd4101aba5f0a264bf7 and increasing the tries to 20 or 30

However, after I have upgraded its firmare to 2.0 (adding full tethered shooting support), gphoto is not able to use it at all.

Using gphoto2 --camera="Fuji Fujifilm X-S10" --capture-movie --debug-logfile=capturepreview.log results in the following:

Capturing preview frames as movie to 'movie.mjpg'. Press Ctrl-C to abort.      
ERROR: Movie capture error... Exiting.
Movie capture finished (0 frames)

The log is attached.

capturepreview.log

msmeissn commented 2 years ago

can you increae the tries again? or the wait time?

ratcashdev commented 2 years ago

current diff. What values should I try?

diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c
index bd8b3514f..ede030e9a 100644
--- a/camlibs/ptp2/library.c
+++ b/camlibs/ptp2/library.c
@@ -2568,7 +2568,7 @@ static struct {
        /* https://github.com/gphoto/libgphoto2/issues/505 */
        {"Fuji:Fujifilm X-T4",                  0x04cb, 0x02e6, PTP_CAP|PTP_CAP_PREVIEW},
        /* https://github.com/gphoto/libgphoto2/issues/603 */
-   {"Fuji:Fujifilm X-S10",                 0x04cb, 0x02ea, PTP_CAP_PREVIEW},       /* only webcam mode apparently */
+ {"Fuji:Fujifilm X-S10",                     0x04cb, 0x02ea, 0},     /* only webcam mode apparently */

        {"Ricoh:Caplio R5 (PTP mode)",          0x05ca, 0x0110, 0},
        {"Ricoh:Caplio GX (PTP mode)",          0x05ca, 0x0325, 0},
@@ -3624,7 +3624,7 @@ enable_liveview:
                PTPObjectInfo   oi;
                uint32_t        preview_object = 0x80000001; /* this is where the liveview image is accessed */
                unsigned char   *ximage = NULL;
-           int             tries = 10;
+         int         tries = 30;

                if (params->jpgfd) {
                        unsigned int i;

Edit: tried 60, result still the same.

msmeissn commented 2 years ago

there is a tries = 5 around 25 lines lower, can you increase that a bit too?

ratcashdev commented 2 years ago

Increased both following tries to 60. The error shows up a bit later now, the captured movies is 0 bytes.

ratcashdev commented 2 years ago

FW version 2.10 - still the same. Attached a new debug log: capturepreview.log

keep saying PTP_OC 0x1008 receiving resp failed: PTP Invalid Object Handle (0x2009)

msmeissn commented 2 years ago

thanks ... it seems the new firmware needs a bit different setup code than before.

Sadly my camera rental agency currently has no S10... does it happen for other Fujis too?

Or

Is someone able to capture a USB Trace of this in Windows? via usbpcap or simiklar tool?

ratcashdev commented 2 years ago

What kind of communication needs to be captured using usbpcap? What exactly needs to be done?

msmeissn commented 2 years ago

basically from start of the tool / plugin of the camera to the start of the preview stream

ratcashdev commented 2 years ago

but what SW should I use to talk to the camera under windows?

angryziber commented 2 years ago

I have used usbpcap to capture using of X-S10 as a webcam on Windows (using the Fujifilm X Webcam 2 software). Camera firmware 2.10

In the pcap file, the camera is device 2.4.0/2.4.1 I have turned the camera on in the USB TETHER SHOOTING AUTO (there is no separate X-WEBCAM mode anymore), then started the webcam preview and saw the live image, then changed exposure compensation through X Webcam UI. compressed pcap file

Note that when turning the camera on in tethering mode, it is mounted in Windows with two folders inside: Still and Live. Whan I manually take a picture, a JPG files appears in the Still folder, the same both folders are also seen in the gphoto2 --summary

angryziber commented 2 years ago

Adding also logs files and summary from gphoto2, same camera and same laptop capture-image.txt config.txt summary.txt

Note that gphoto2 --capture-tethered doesn't fail and is able to save the first image that I capture with the camera manually. When pressing Ctrl+C, the "-1: Unspecified error" appears as well.

msmeissn commented 2 years ago

first look at pcap dump ... can you try:

gphoto2 --set-config d21c=0 --capture-preview gphoto2 --set-config d21c=0 --capture-image-and-download ?

ratcashdev commented 2 years ago

Result of gphoto2 --set-config d21c=0 --capture-preview debug.log

Result of

gphoto2 --set-config d21c=0 --capture-image-and-download

*** Error ***              
PTP General Error
ERROR: Could not capture image.
ERROR: Could not capture.
New file is in location /store_10000001/DSCF0002.jpg on the camera
Saving file as DSCF0002.jpg
Deleting file /store_10000001/DSCF0002.jpg on the camera

it failed to capture the image automatically, but it downloaded the image when I hit the button manually.

msmeissn commented 2 years ago

ok, but that was working before. can you try some other values besides 0 ( 1 - 14 ) althogu I think i need to dig deeper

sorry, i dont have much time currently ... i will check back occasionaly

ratcashdev commented 2 years ago

other values did not help, unfortunately.

ratcashdev commented 2 years ago

@msmeissn any chance of having a look at it this time?

ratcashdev commented 2 years ago

Darktable recognizes the device as a Fuji GFX 100S. When I click "Tethered shoot" and manually hit the button, I get the image to the PC. However, the led on the camera keeps blinking (as if transfer to PC was still ongoing). Subsequent attempts to capture all fail. If I disconnect the USB cable, the camera warns me, that it believes transfer is still ongoing, and gives me the possibility to cancel it.

The only solution to successfully repeat the capture is to disconnect the USB cable and reconnect it.

From a command line, gphoto2 --set-config d21c=0 --capture-image-and-download downloads a single image (but I need to hit the shutter manually). Repeated attempts fail, just like above.

mdietz commented 2 years ago

@ratcashdev @angryziber @msmeissn I have an X-S10 and can start reproing what's been tried in this thread. I'll also be referencing #653 as I believe the X-T4 and X-S10 use the same sensor.