Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K30, Software shuts down when switched to BULB mode. #52

Open
lkiersey opened this issue Jun 13, 2020 · 9 comments
Open

K30, Software shuts down when switched to BULB mode. #52

lkiersey opened this issue Jun 13, 2020 · 9 comments

Comments

@lkiersey
Copy link

pk

When I switch my K30 to BULB mode the attached message appears and the SW shuts down, If i try to start up in bulb mode, I get the same issue. Its like it cant determine what mode its in. If I start up in U1 mode I can set it to what ever mode I like except bulb, if I set it to bulb the same issue occurs. Other than that functionality is perfect, but I really want to be able to use bulb mode :) Would really appreciate you taking a look.

Thanks!!
Lenny

@lkiersey
Copy link
Author

lkiersey commented Jun 15, 2020

made some progress was able to get it to allow bulb mode by setting plsr_model.c line 981 to
{ 0x12f52, "K-30", false, true, **true,** false, false, false,

How ever when I take a picture the shutter fires and closes and then the countdown starts so its like it dosent know to hold the shutter open
it also posts this error

pslr.c:955:get_status(p->fd) failed: 129
pslr.c:955:get_status(p->fd) failed: 129

@asalamon74
Copy link
Owner

Exposure mode reading

That boolean field was added specially for K-30 because it was the only camera model when the value false was required. It's a bit strange that we need to change it to true.

Can you please send me the output of the following command (with the original code) when you set the camera to M, Av, B:

pktriggercord-cli --statux_hex --debug > debug.log 2>&1

Bulb mode pictures

Can you please try to take a picture with the cli using -t 35 to specify 35 seconds. Please try this in B and M mode as well.

@lkiersey
Copy link
Author

lkiersey commented Jul 4, 2020

Attached are the logs you requested, Manual mode finished at 30 seconds and Bulb mode shutter fired for a split second and failed to remain open.
35secondManual.log
Hex_dump.log
35SecondBulb.log

BulbHex.log
AVHex.log

sh0 added a commit to sh0/pktriggercord that referenced this issue Aug 10, 2020
There are some weird things going on with `pslr_exposure_mode_t` and `pslr_gui_exposure_mode_t`.

My understanding is that there was a commit `582e03f7926314ee6fbec4f1b053e222d96cb6e0` (Wed May 29 18:04:27 2013 +0000) which added separate GUI exposure mode enum `pslr_gui_exposure_mode_t`, but the conversion between enums was forgotten in `user_mode_combo_changed_cb` and/or `pslr_set_exposure_mode`. Then recently this issue was discovered and commit `f9e23edcf88bfc5ca356bbfce91ca085aef56e54` (Sun Mar 22 14:03:39 2020 +0100) tried to fix it by adding enum conversion to `pslr_set_exposure_mode`. However the conversion is done in the wrong direction.

To try to summarize, currently:
* `pktriggercord.c` calls `pslr_set_exposure_mode` with `pslr_gui_exposure_mode_t` argument.
* `pktriggercord-cli.c` calls `pslr_set_exposure_mode` with `pslr_exposure_mode_t` argument.
* `pslr.c` function `pslr_set_exposure_mode` incorrectly converts `pslr_exposure_mode_t` to `pslr_gui_exposure_mode_t`. In CLI case this is incorrect as the enum should be left to `pslr_exposure_mode_t` and in GUI case the mode is already in `pslr_gui_exposure_mode_t` type so it does the conversion twice.

I think the whole mode switching code was buggy before `need_exposure_mode_conversion` flag was added for K-30 camera. This can also be seen from the issue asalamon74#52 that something is wrong. So I think that the K-30 handling was probably not needed in the first place.

My experimental fix is as follows:
* `pslr.c` keeps track of camera mode only using `pslr_exposure_mode_t` type. This is preferred over `pslr_gui_exposure_mode_t` as it has more entries and is more accurate.
* CLI `pktriggercord-cli.c` code mostly operates with `pslr_exposure_mode_t` type except few `PSLR_GUI_EXPOSURE_MODE_B` compares which were changed.
* GUI `pktriggercord.c` now converts between `pslr_gui_exposure_mode_t` and `pslr_exposure_mode_t` as needed.
* `pslr.c` has new functions `pslr_convert_exposure_mode_to_gui` and `pslr_convert_exposure_mode_from_gui` instead of single `exposure_mode_conversion` function.
* `need_exposure_mode_conversion` structure entry and `pslr_get_model_need_exposure_conversion` function are removed.
sh0 added a commit to sh0/pktriggercord that referenced this issue Aug 10, 2020
There are some weird things going on with `pslr_exposure_mode_t` and `pslr_gui_exposure_mode_t`.

My understanding is that there was a commit `582e03f7926314ee6fbec4f1b053e222d96cb6e0` (Wed May 29 18:04:27 2013 +0000) which added separate GUI exposure mode enum `pslr_gui_exposure_mode_t`, but the conversion between enums was forgotten in `user_mode_combo_changed_cb` and/or `pslr_set_exposure_mode`. Then recently this issue was discovered and commit `f9e23edcf88bfc5ca356bbfce91ca085aef56e54` (Sun Mar 22 14:03:39 2020 +0100) tried to fix it by adding enum conversion to `pslr_set_exposure_mode`. However the conversion is done in the wrong direction.

To try to summarize, currently:
* `pktriggercord.c` calls `pslr_set_exposure_mode` with `pslr_gui_exposure_mode_t` argument.
* `pktriggercord-cli.c` calls `pslr_set_exposure_mode` with `pslr_exposure_mode_t` argument.
* `pslr.c` function `pslr_set_exposure_mode` incorrectly converts `pslr_exposure_mode_t` to `pslr_gui_exposure_mode_t`. In CLI case this is incorrect as the enum should be left to `pslr_exposure_mode_t` and in GUI case the mode is already in `pslr_gui_exposure_mode_t` type so it does the conversion twice.

I think the whole mode switching code was buggy before `need_exposure_mode_conversion` flag was added for K-30 camera. This can also be seen from the issue asalamon74#52 that something is wrong. So I think that the K-30 handling was probably not needed in the first place.

My experimental fix is as follows:
* `pslr.c` keeps track of camera mode only using `pslr_exposure_mode_t` type. This is preferred over `pslr_gui_exposure_mode_t` as it has more entries and is more accurate.
* CLI `pktriggercord-cli.c` code mostly operates with `pslr_exposure_mode_t` type except few `PSLR_GUI_EXPOSURE_MODE_B` compares which were changed.
* GUI `pktriggercord.c` now converts between `pslr_gui_exposure_mode_t` and `pslr_exposure_mode_t` as needed.
* `pslr.c` has new functions `pslr_convert_exposure_mode_to_gui` and `pslr_convert_exposure_mode_from_gui` instead of single `exposure_mode_conversion` function.
* `need_exposure_mode_conversion` structure entry and `pslr_get_model_need_exposure_conversion` function are removed.
@sh0
Copy link
Contributor

sh0 commented Aug 10, 2020

@lkiersey can you test pull request #61 and see if it helps you?

@lkiersey
Copy link
Author

@lkiersey can you test pull request #61 and see if it helps you?

Hi I have tested it and there is a positive and a negative result. The positive is that it recognizes the camera is in Bulb mode and allows me to take a picture both in GUI and CLI mode. The negative is that I still have the same issue where the shutter fails to stay open it fires and closes immediately and downloads the image then after the specified time it completes as if it worked fine.
test

so it has always had the issue in the attached image where it cannot get the status. If we can get the shutter to remain open during the exposure then i believe it will be a workable solution.

@sh0
Copy link
Contributor

sh0 commented Aug 12, 2020

@lkiersey Thank you for testing. My changes were mostly about switching to different exposure modes and reading what exposure mode the camera is using. In this sense I guess the patch works to some degree. Can you also tell if the pktriggercord recognizes other exposure modes (Tv, Av, M etc) accurately and if you change modes from pktriggercord then the mode is also correctly changed in camera?

I would suspect that there is also another issue setting camera shutter time. E.g. in bulb mode there needs to be some generic (or maybe special) exposure time setting changed which is currently not done.

@lkiersey
Copy link
Author

Yes I can confirm that the camera correctly switches between all the different modes. And I can select them from the drop down in User mode.

@sh0
Copy link
Contributor

sh0 commented Aug 12, 2020

Thanks. So the mode setting works nicely.

The log lines pslr.c:981:get_status(p->fd) failed: 129 mean that reading status after sending bulb trigger commands failed. So probably the bulb exposure triggering is done in some other way on K-30.

One quick hack to try is to change camera info flags in pslr_model.c. On top of my PR change the following:

{ 0x12f52, "K-30",        false, true, ...

to

{ 0x12f52, "K-30",        false, false, ...

This makes bulb mode use newer commands. However I would suspect that there is a low chance of this patch working as the cameras from this era seem to use older bulb commands.

@lkiersey
Copy link
Author

As you suspected this didnt work as it reports camera cannot work in new bulb mode. Its so close to working :) I can feel it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants