Hi Marcus,

Here's the debug for your latest version:
https://drive.usercontent.google.com/uc?id=1MGvbSM_Oo2x6CpfFHn0cM8VAqgDvjDR0&export=download
Your version seems to come to the same result as mine (same list of
properties).

I see that you have chosen to use the second (more complete) enum list for
the final property description. From that, I understand that the
ptp_unpack_Sony_DPD function should return a complete list of options,
including those that may currently not be available, right?

Additionally, there were also 3 properties for which I needed to change the
data type for the ILCE-7SM3 in ptp2/config.c:

{ N_("Exposure Program"),               "expprogram",
PTP_DPC_ExposureProgramMode,            0,                  PTP_DTC_UINT16,
_get_ExposureProgram,               _put_ExposureProgram }, => to =>
{ N_("Exposure Program"),               "expprogram",
PTP_DPC_ExposureProgramMode,            0,                  PTP_DTC_UINT32,
_get_ExposureProgram,               _put_ExposureProgram },

static struct deviceproptableu16 exposure_program_modes[] = { => to =>
static struct deviceproptableu32 exposure_program_modes[] = {

GENERIC16TABLE(ExposureProgram,exposure_program_modes) => to =>
GENERIC32TABLE(ExposureProgram,exposure_program_modes)

===

{ N_("Still Capture Mode"),             "capturemode",
 PTP_DPC_StillCaptureMode,               0,
 PTP_DTC_UINT16, _get_CaptureMode,                   _put_CaptureMode },
=> to =>
{ N_("Still Capture Mode"),             "capturemode",
 PTP_DPC_StillCaptureMode,               0,
 PTP_DTC_UINT32, _get_CaptureMode,               _put_CaptureMode },

static struct deviceproptableu16 capture_mode[] = { => to =>
static struct deviceproptableu32 capture_mode[] = {

GENERIC16TABLE(CaptureMode,capture_mode) => to =>
GENERIC32TABLE(CaptureMode,capture_mode)

===

{ N_("Priority Mode"), "prioritymode", PTP_DPC_SONY_PriorityMode,
 PTP_VENDOR_SONY, PTP_DTC_INT8, _get_Sony_PriorityMode,
_put_Sony_PriorityMode }, => to =>
{ N_("Priority Mode"), "prioritymode", PTP_DPC_SONY_PriorityMode,
 PTP_VENDOR_SONY, PTP_DTC_UINT8, _get_Sony_PriorityMode,
_put_Sony_PriorityMode },

static struct deviceproptablei8 sony_prioritymode[] = { => to =>
static struct deviceproptableu8 sony_prioritymode[] = {

===

Obviously, some additional device-specific definitions are needed here,
because now it won't work anymore for the other Sony cameras. But I haven't
yet figured out how to target a specific Sony device in config.c.

Unfortunately, still the operations/properties below are missing. I guess
there might be some more binary coding differences for operations as well.
Still some more work to do...

Autofocus(0xd2c1): error 2002 on query.
Capture(0xd2c2): error 2002 on query.
Property 0xd2c3: error 2002 on query.
Property 0xd2c4: error 2002 on query.
Still Image(0xd2c7): error 2002 on query.
Movie(0xd2c8): error 2002 on query.
Property 0xd2c9: error 2002 on query.
Near Far(0xd2d1): error 2002 on query.
Property 0xd2d2: error 2002 on query.
Property 0xd2d7: error 2002 on query.
Property 0xd2d8: error 2002 on query.
Property 0xd2d9: error 2002 on query.
Property 0xd2da: error 2002 on query.
Property 0xd2db: error 2002 on query.
AF Area Position(0xd2dc): error 2002 on query.
Property 0xd2dd: error 2002 on query.
Property 0xd2df: error 2002 on query.
Property 0xd2e0: error 2002 on query.
Property 0xd2e1: error 2002 on query.
Property 0xd2e2: error 2002 on query.
Property 0xd2e4: error 2002 on query.
Property 0xd2e5: error 2002 on query.
Property 0xd2e6: error 2002 on query.
Property 0xd2e7: error 2002 on query.
Property 0xd2e8: error 2002 on query.
Property 0xd2e9: error 2002 on query.
Property 0xd2ea: error 2002 on query.
Property 0xd2eb: error 2002 on query.
Property 0xd2f3: error 2002 on query.
Property 0xd302: error 2002 on query.
Property 0xd303: error 2002 on query.
Property 0xd305: error 2002 on query.
Property 0xd306: error 2002 on query.
Property 0xd304: error 2002 on query.
Property 0xd301: error 2002 on query.
Property 0xd300: error 2002 on query.
Property 0xd308: error 2002 on query.
Property 0xd2f2: error 2002 on query.
Property 0xd309: error 2002 on query.
Property 0xd30a: error 2002 on query.
Property 0xd30b: error 2002 on query.
Still Image(0xd2c7): error 2002 on query.
Property 0xd2cd: error 2002 on query.
Property 0xd2ce: error 2002 on query.
Property 0xd2cf: error 2002 on query.
Property 0xd2d0: error 2002 on query.

Kind regards, Jeroen

On Thu, Apr 4, 2024 at 5:40 PM Marcus Meissner <mar...@jet.franken.de>
wrote:

> Hi,
>
> I just committed code that tries to handle it more generically.
>
> commit 4ab78020b304ef3105d11701d70d8b785476fafa
> Author: Marcus Meissner <mar...@jet.franken.de>
> Date:   Thu Apr 4 17:35:06 2024 +0200
>
>     try a workaround for newer Sonys that have two enums.
>
>
> It reads the next 16bit value, if its < 0x200 (as it would be 0x5something
> or 0xDsomething)
> it assumes it has a secondary enum list and reads over that.
>
> Can you try this?
>
> Ciao, Marcus
> On Wed, Apr 03, 2024 at 09:44:29PM +0200, Jeroen Lichtenauer wrote:
> > Hi Marcus,
> >
> > Thank you for your quick reply.
> > After doing some debugging, I found out that the Sony A7S III includes a
> > second ENUM list for every property. The second one is either as long as
> > the first list, or longer. It seems like the first list contains the
> > enabled options, and the second list contains all the possible options
> > (some of which you might not be able to choose in the current state).
> >
> > in ptp2/ptp-pack.c
> > static inline int ptp_unpack_Sony_DPD (PTPParams *params, unsigned char*
> > data, PTPDevicePropDesc *dpd, unsigned int dpdlen, unsigned int *poffset)
> >
> > After the current ENUM list extraction
> > for (i=0;i<N;i++) {
> >    ret = ptp_unpack_DPV (params, data, poffset, dpdlen,
> > &dpd->FORM.Enum.SupportedValue[i], dpd->DataType);
> >
> >      /* Slightly different handling here. The HP PhotoSmart 120
> >      * specifies an enumeration with N in wrong endian
> >      * 00 01 instead of 01 00, so we count the enum just until the
> >      * the end of the packet.
> >      */
> >      if (!ret) {
> >      if (!i)
> >      goto outofmemory;
> >      dpd->FORM.Enum.NumberOfValues = i;
> >      break;
> >      }
> > }
> >
> > I added some code that updates the offset to skip the second list:
> >
> > if(strcmp(params->deviceinfo.Model, "ILCE-7SM3")==0)
> > {
> >      int enum_value_len;
> >      switch (dpd->DataType) {
> >           case PTP_DTC_INT8:
> >           enum_value_len = 1;
> >           break;
> >           case PTP_DTC_UINT8:
> >           enum_value_len = 1;
> >           break;
> >           case PTP_DTC_INT16:
> >           enum_value_len = 2;
> >           break;
> >           case PTP_DTC_UINT16:
> >           enum_value_len = 2;
> >           break;
> >           case PTP_DTC_INT32:
> >           enum_value_len = 4;
> >           break;
> >           case PTP_DTC_UINT32:
> >           enum_value_len = 4;
> >           break;
> >           case PTP_DTC_INT64:
> >           enum_value_len = 8;
> >           break;
> >           case PTP_DTC_UINT64:
> >           enum_value_len = 8;
> >           break;
> >           case PTP_DTC_UINT128:
> >           enum_value_len = 16;
> >           break;
> >           case PTP_DTC_INT128:
> >           enum_value_len = 16;
> >           break;
> >           case PTP_DTC_AINT8:
> >           enum_value_len = 1;
> >           break;
> >           case PTP_DTC_AUINT8:
> >           enum_value_len = 1;
> >           break;
> >           case PTP_DTC_AUINT16:
> >           enum_value_len = 2;
> >           break;
> >           case PTP_DTC_AINT16:
> >           enum_value_len = 2;
> >           break;
> >           case PTP_DTC_AUINT32:
> >           enum_value_len = 4;
> >           break;
> >           case PTP_DTC_AINT32:
> >           enum_value_len = 4;
> >           break;
> >           case PTP_DTC_AUINT64:
> >           enum_value_len = 8;
> >           break;
> >           case PTP_DTC_AINT64:
> >           enum_value_len = 8;
> >           break;
> >           case PTP_DTC_STR:
> >           goto outofmemory;
> >           break;
> >           default:
> >           goto outofmemory;
> >      }
> >      uint16_t N_all = dtoh16a(&data[*poffset]);
> >      *poffset+=sizeof(uint16_t);
> >      *poffset += enum_value_len*N_all;
> > }
> >
> > The debug log is here
> >
> https://drive.usercontent.google.com/uc?id=1MEanNTniSpzv8xd82fZ_D9n72hZBrFwQ&export=download
> > Although I now finally get lots of properties (hundreds), it still misses
> > some essential actions, such as image capture.
> > Perhaps because these have different addresses for this camera?
> >
> > Kind regards, Jeroen
> >
> > On Wed, Apr 3, 2024 at 3:47 PM Marcus Meissner <mar...@jet.franken.de>
> > wrote:
> >
> > > Hi,
> > >
> > > Thanks for this report.
> > >
> > > it seems the binary format of this variable has changed, which leds to
> > > this error.
> > >
> > > I will need to adjust the decoder :(
> > >
> > > You can short term perhaps add a ignore to the decoder, perhaps it will
> > > help,
> > > except you cant use any config reads
> > >
> > > Ciao, Marcus
> > > On Wed, Apr 03, 2024 at 02:13:31PM +0200, Jeroen Lichtenauer wrote:
> > >
>
_______________________________________________
Gphoto-devel mailing list
Gphoto-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gphoto-devel

Reply via email to