Re: Adding properties for the Nikon Z8
Nick Hilton <[email protected]> Tue, 15 Jul 2025 21:29:37 -0700
| Newsgroups | gmane.comp.multimedia.gphoto.devel |
|---|---|
| Message-ID | <CAHaJagCWkwJEGH+okknsuSob1DMNQwpwD+piLqihFZU3dehgpg@mail.gmail.com> |
--===============2801356115609058556== Content-Type: multipart/alternative; boundary="000000000000d5bc68063a045796" --000000000000d5bc68063a045796 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable How does one add an additional widget for the same property? Using the symbolic shutterspeed2 as in: gphoto2 --set-config shutterspeed2=3D1/500 is definitely preferable over gphoto2 --set-config shutterspeed=3D0.0020s I have a z7 where I developed my app that uses libgphoto2, and was using shutterspeed2 with it. Then I tried testing with my z8 and discovered shutterspeed2 wasn't available (among other things I wish to fix). The z7 reports properties 0x500d (Shutter Speed) and 0xd100 (Nikon Exposure Time), these are mapped to shutterspeed and shutterspeed2 respectively, however the z8 is only reporting 0x500d. I did manage to add shutterspeed2 for the Z8, by changing the duplicate prop detection to do string comparison instead of int comparison just to see if it would work at all. Turns out it works just fine for my z7 and z8. It sort of makes sense that widgets in the camera specific menus would get added before any of the generic ones, and allows duplicate widgets if one wanted to customize the string to value mapping for a specific camera make & model. Here's my change with lots of added debug messages: https://github.com/weegreenblobbie/libgphoto2/compare/81904a36a2a64e1f60051= 99ef9193db70e1fc444...a00bc950dc3bd3cf1a62506c3e65650b3a0ab5a6#diff-d3c5da5= d3a5099832467c8377ed035f65cc92e5e0aae288462a9d265d6125de9 I'm curious if this is the right direction or if there's a better way. Thanks for reading, Nick On Sun, Jul 13, 2025 at 4:53=E2=80=AFAM Marcus Meissner <[email protected]= .de> wrote: > Hi Nick, > > I am not sure. but "shutterspeed" should already cover this configuratuon= . > > - it is UINT32 > - it is using value / 10.000 currently > > Only problem is the very short exposuretimes perhaps. > > > > On Sat, Jul 12, 2025 at 08:45:47PM -0700, Nick Hilton wrote: > > After a bit of debugging, I managed to get shutterspeed2 working with m= y > > Nikon Z8! > > > > > https://github.com/weegreenblobbie/libgphoto2/compare/81904a36a2a64e1f600= 5199ef9193db70e1fc444...8ccf7153f4e95e71c17cd83e19ddbb4e46353cff > > > > It turned out to be a 32-bit property, unlike the 8bit properties like > the > > other nikon props. I'd like to add some documentation steps somewhere > too > > for how I figured this out. Mostly a process of producing and reading > the > > debug log carefully: > > gphoto2 --summary should show all values in the enum (if its an enum). > > and usually you would map what is on the camera to this enum. > > The Nikon Z8 SDK is however available to get interseting values. > > > rm -f my-logfile.txt; env LANG=3DC bin/gphoto2 --debug > > --debug-logfile=3Dmy-logfile.txt --list-all-config > > > > I'll see about adding support for a few more nikon specific properties > > and/or values for the Z8 to be on par with the Z7. > > > > -Nick > > > > gphoto2 --get-config shutterspeed2 > > Label: Shutter Speed 2 > > > > Readonly: 0 > > Type: RADIO > > Current: 1/1000 > > Choice: 0 1/6400 > > Choice: 1 1/4000 > > Choice: 2 1/3200 > > Choice: 3 1/2500 > > Choice: 4 1/2000 > > Choice: 5 1/1600 > > Choice: 6 1/1250 > > Choice: 7 1/1000 > > Choice: 8 1/800 > > Choice: 9 1/640 > > Choice: 10 1/500 > > Choice: 11 1/400 > > Choice: 12 1/320 > > Choice: 13 1/250 > > Choice: 14 1/200 > > Choice: 15 1/160 > > Choice: 16 1/125 > > Choice: 17 1/100 > > Choice: 18 1/80 > > Choice: 19 1/60 > > Choice: 20 1/50 > > Choice: 21 1/40 > > Choice: 22 1/30 > > Choice: 23 1/25 > > Choice: 24 1/20 > > Choice: 25 1/15 > > Choice: 26 1/13 > > Choice: 27 1/10 > > Choice: 28 1/8 > > Choice: 29 1/6 > > Choice: 30 1/5 > > Choice: 31 1/4 > > Choice: 32 1/3 > > Choice: 33 1/2.5 > > Choice: 34 1/2 > > Choice: 35 1/1.6 > > Choice: 36 1/1.3 > > Choice: 37 1 > > Choice: 38 1.3 > > Choice: 39 1.6 > > Choice: 40 2 > > Choice: 41 2.5 > > Choice: 42 3 > > Choice: 43 4 > > Choice: 44 5 > > Choice: 45 6 > > Choice: 46 8 > > Choice: 47 10 > > Choice: 48 13 > > Choice: 49 15 > > Choice: 50 20 > > Choice: 51 25 > > Choice: 52 30 > > Choice: 53 60 > > Choice: 54 90 > > Choice: 55 120 > > Choice: 56 180 > > Choice: 57 240 > > Choice: 58 300 > > Choice: 59 480 > > Choice: 60 600 > > Choice: 61 720 > > Choice: 62 900 > > Choice: 63 Bulb > > Choice: 64 Time > > END > > > > On Sun, Jul 6, 2025 at 3:25=E2=80=AFPM Nick Hilton <weegreenblobbie2@gm= ail.com> > > wrote: > > > > > Hello! > > > > > > I'm new to libgphoto2 development. I'm interested in adding > shutterspeed2 > > > for the Nikon Z8, I have a Z7 mark I, which does support shutterspeed= 2. > > > > > > Looking at the code here > > > < > https://github.com/gphoto/libgphoto2/blob/81904a36a2a64e1f6005199ef9193db= 70e1fc444/camlibs/ptp2/config.c#L11886 > > > > > for the Z7, looks like it's using nikon_z6_capture_settings, so is th= e > Z8. > > > I've tried adding a custom nikon_z8_capture_settings menu item here > > > < > https://github.com/gphoto/libgphoto2/compare/master...weegreenblobbie:lib= gphoto2:dev/nikon-z8-shutterspeed2 > >. > > > I've built the lib and the gphoto2 cli utility, verified it's linking > with > > > my local build: > > > > > > ldd gphoto2 | grep libgphoto > > > libgphoto2.so.6 =3D> > > > /home/nhilton/development/pycontrol/external/lib/libgphoto2.so.6 > > > (0x00007275d35f8000) > > > libgphoto2_port.so.12 =3D> > > > /home/nhilton/development/pycontrol/external/lib/libgphoto2_port.so.1= 2 > > > (0x00007275d35e8000) > > > > > > However I don't see any indication my updates are having any impact. > > > > > > I had looked at previous commit changes sets that added various nikon > > > cameras, and it looked similar to what I did, however it's not workin= g. > > > Not really sure how to proceed. > > > > > > Is there any documentation on how config.c is organized that I > missed? I > > > own the following camera and can test the changes necessary: z6ii, > z6iii, > > > z7, z8. > > I try to keep the number of tables to a minimum there, as various Nikon Z > series cameras have the same tables. > > Ciao, Marcus > --000000000000d5bc68063a045796 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">How does one add an additional=C2=A0widget for the same pr= operty?=C2=A0 Using the symbolic shutterspeed2 as in:<br><br><div>gphoto2 -= -set-config shutterspeed2=3D1/500</div><div><br></div><div>is definitely=C2= =A0preferable=C2=A0over</div><div><br></div><div><div>gphoto2 --set-config = shutterspeed=3D0.0020s</div><div><br></div></div><div>I have=C2=A0a z7 wher= e I developed my app that uses libgphoto2, and was using shutterspeed2 with= it.=C2=A0 Then I tried testing with my z8 and discovered shutterspeed2 was= n't available=C2=A0(among other things I wish to fix).</div><div><br></= div><div>The z7 reports properties 0x500d (Shutter Speed) and 0xd100 (Nikon= Exposure=C2=A0Time), these are mapped to shutterspeed and shutterspeed2 re= spectively, however the z8 is only reporting 0x500d.=C2=A0=C2=A0</div><div>= <br></div><div>I did manage to add shutterspeed2 for the Z8, by changing th= e duplicate prop detection to do string comparison instead of int compariso= n=C2=A0just to see if it would work at all.=C2=A0 Turns out it works just f= ine for my z7 and z8.=C2=A0 It sort of makes sense that widgets=C2=A0in the= =C2=A0camera specific menus would get added before any of the generic ones,= and allows duplicate widgets if one wanted to customize the string to valu= e mapping for a specific camera make & model.</div><div><br></div><div>= Here's my change with lots of added debug messages:</div><div><br></div= ><div><a href=3D"https://github.com/weegreenblobbie/libgphoto2/compare/8190= 4a36a2a64e1f6005199ef9193db70e1fc444...a00bc950dc3bd3cf1a62506c3e65650b3a0a= b5a6#diff-d3c5da5d3a5099832467c8377ed035f65cc92e5e0aae288462a9d265d6125de9"= >https://github.com/weegreenblobbie/libgphoto2/compare/81904a36a2a64e1f6005= 199ef9193db70e1fc444...a00bc950dc3bd3cf1a62506c3e65650b3a0ab5a6#diff-d3c5da= 5d3a5099832467c8377ed035f65cc92e5e0aae288462a9d265d6125de9</a></div><div><b= r></div><div>I'm curious if this is the right direction or if there'= ;s a better way.</div><div><br></div><div>Thanks for reading,</div><div>Nic= k</div></div><br><div class=3D"gmail_quote gmail_quote_container"><div dir= =3D"ltr" class=3D"gmail_attr">On Sun, Jul 13, 2025 at 4:53=E2=80=AFAM Marcu= s Meissner <<a href=3D"mailto:[email protected]">[email protected].= de</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi= n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex= ">Hi Nick,<br> <br> I am not sure. but "shutterspeed" should already cover this confi= guratuon.<br> <br> - it is UINT32<br> - it is using value / 10.000 currently<br> <br> Only problem is the very short exposuretimes perhaps.<br> <br> <br> <br> On Sat, Jul 12, 2025 at 08:45:47PM -0700, Nick Hilton wrote:<br> > After a bit of debugging, I managed to get shutterspeed2 working with = my<br> > Nikon Z8!<br> > <br> > <a href=3D"https://github.com/weegreenblobbie/libgphoto2/compare/81904= a36a2a64e1f6005199ef9193db70e1fc444...8ccf7153f4e95e71c17cd83e19ddbb4e46353= cff" rel=3D"noreferrer" target=3D"_blank">https://github.com/weegreenblobbi= e/libgphoto2/compare/81904a36a2a64e1f6005199ef9193db70e1fc444...8ccf7153f4e= 95e71c17cd83e19ddbb4e46353cff</a><br> > <br> > It turned out to be a 32-bit property, unlike the 8bit properties like= the<br> > other nikon props.=C2=A0 I'd like to add some documentation steps = somewhere too<br> > for how I figured this out.=C2=A0 Mostly a process of producing and re= ading the<br> > debug log carefully:<br> <br> gphoto2 --summary=C2=A0 =C2=A0should show all values in the enum (if its an= enum).<br> <br> and usually you would map what is on the camera to this enum.<br> <br> The Nikon Z8 SDK is however available to get interseting values.<br> <br> > rm -f my-logfile.txt; env LANG=3DC bin/gphoto2 --debug<br> > --debug-logfile=3Dmy-logfile.txt --list-all-config<br> > <br> > I'll see about adding support for a few more nikon specific proper= ties<br> > and/or values for the Z8 to be on par with the Z7.<br> > <br> > -Nick<br> > <br> > gphoto2 --get-config shutterspeed2<br> > Label: Shutter Speed 2<br> > <br> > Readonly: 0<br> > Type: RADIO<br> > Current: 1/1000<br> > Choice: 0 1/6400<br> > Choice: 1 1/4000<br> > Choice: 2 1/3200<br> > Choice: 3 1/2500<br> > Choice: 4 1/2000<br> > Choice: 5 1/1600<br> > Choice: 6 1/1250<br> > Choice: 7 1/1000<br> > Choice: 8 1/800<br> > Choice: 9 1/640<br> > Choice: 10 1/500<br> > Choice: 11 1/400<br> > Choice: 12 1/320<br> > Choice: 13 1/250<br> > Choice: 14 1/200<br> > Choice: 15 1/160<br> > Choice: 16 1/125<br> > Choice: 17 1/100<br> > Choice: 18 1/80<br> > Choice: 19 1/60<br> > Choice: 20 1/50<br> > Choice: 21 1/40<br> > Choice: 22 1/30<br> > Choice: 23 1/25<br> > Choice: 24 1/20<br> > Choice: 25 1/15<br> > Choice: 26 1/13<br> > Choice: 27 1/10<br> > Choice: 28 1/8<br> > Choice: 29 1/6<br> > Choice: 30 1/5<br> > Choice: 31 1/4<br> > Choice: 32 1/3<br> > Choice: 33 1/2.5<br> > Choice: 34 1/2<br> > Choice: 35 1/1.6<br> > Choice: 36 1/1.3<br> > Choice: 37 1<br> > Choice: 38 1.3<br> > Choice: 39 1.6<br> > Choice: 40 2<br> > Choice: 41 2.5<br> > Choice: 42 3<br> > Choice: 43 4<br> > Choice: 44 5<br> > Choice: 45 6<br> > Choice: 46 8<br> > Choice: 47 10<br> > Choice: 48 13<br> > Choice: 49 15<br> > Choice: 50 20<br> > Choice: 51 25<br> > Choice: 52 30<br> > Choice: 53 60<br> > Choice: 54 90<br> > Choice: 55 120<br> > Choice: 56 180<br> > Choice: 57 240<br> > Choice: 58 300<br> > Choice: 59 480<br> > Choice: 60 600<br> > Choice: 61 720<br> > Choice: 62 900<br> > Choice: 63 Bulb<br> > Choice: 64 Time<br> > END<br> > <br> > On Sun, Jul 6, 2025 at 3:25=E2=80=AFPM Nick Hilton <<a href=3D"mail= to:[email protected]" target=3D"_blank">[email protected]= </a>><br> > wrote:<br> > <br> > > Hello!<br> > ><br> > > I'm new to libgphoto2 development.=C2=A0 I'm interested i= n adding shutterspeed2<br> > > for the Nikon Z8, I have a Z7 mark I, which does support shutters= peed2.<br> > ><br> > > Looking at the code here<br> > > <<a href=3D"https://github.com/gphoto/libgphoto2/blob/81904a36= a2a64e1f6005199ef9193db70e1fc444/camlibs/ptp2/config.c#L11886" rel=3D"noref= errer" target=3D"_blank">https://github.com/gphoto/libgphoto2/blob/81904a36= a2a64e1f6005199ef9193db70e1fc444/camlibs/ptp2/config.c#L11886</a>><br> > > for the Z7, looks like it's using nikon_z6_capture_settings, = so is the Z8.<br> > > I've tried adding a custom nikon_z8_capture_settings menu ite= m here<br> > > <<a href=3D"https://github.com/gphoto/libgphoto2/compare/maste= r...weegreenblobbie:libgphoto2:dev/nikon-z8-shutterspeed2" rel=3D"noreferre= r" target=3D"_blank">https://github.com/gphoto/libgphoto2/compare/master...= weegreenblobbie:libgphoto2:dev/nikon-z8-shutterspeed2</a>>.<br> > > I've built the lib and the gphoto2 cli utility, verified it&#= 39;s linking with<br> > > my local build:<br> > ><br> > > ldd gphoto2 | grep libgphoto<br> > > libgphoto2.so.6 =3D><br> > > /home/nhilton/development/pycontrol/external/lib/libgphoto2.so.6<= br> > > (0x00007275d35f8000)<br> > > libgphoto2_port.so.12 =3D><br> > > /home/nhilton/development/pycontrol/external/lib/libgphoto2_port.= so.12<br> > > (0x00007275d35e8000)<br> > ><br> > > However I don't see any indication my updates are having any = impact.<br> > ><br> > > I had looked at previous commit changes sets that added various n= ikon<br> > > cameras, and it looked similar to what I did, however it's no= t working.<br> > > Not really sure how to proceed.<br> > ><br> > > Is there any documentation on how config.c is organized that I mi= ssed?=C2=A0 I<br> > > own the following camera and can test the changes necessary: z6ii= , z6iii,<br> > > z7, z8.<br> <br> I try to keep the number of tables to a minimum there, as various Nikon Z s= eries cameras have the same tables.<br> <br> Ciao, Marcus<br> </blockquote></div> --000000000000d5bc68063a045796-- --===============2801356115609058556== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============2801356115609058556== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Gphoto-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gphoto-devel --===============2801356115609058556==--