Pretty print Tv - page 3 - General Discussion and Assistance - CHDK Forum supplierdeeply

Pretty print Tv

  • 31 Replies
  • 5269 Views
*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: Pretty print Tv
« Reply #20 on: 05 / August / 2021, 14:15:00 »
Advertisements
Bulb-noisereduction ... :-X ? [ :o ]
All lifetime is a loan from eternity.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: Pretty print Tv
« Reply #21 on: 06 / August / 2021, 13:07:05 »
 :) Because of motion_detector.c
Quote
    MD_NO_SHUTTER_RELEASE_ON_SHOOT=8
I had expected
Code: [Select]
--[[--
@title Bulb.lua
@chdk_version 1.4
@param     t timer
  @default  t 10
  @range   t  1 1000
@param     f faktor sec/10
  @default  f 10
  @range   f  1  10000

@param    k Keymode
  @default k 0
  @values  k --- shoot/2
--]]--

function bulb(B,key)
local T,h=get_tick_count()
if key then
   while is_pressed(key) do
     print(B,key)
   while md_detect_motion(5,5,5,1000,30,0,3,h,0,0,0,0,0,25,5,1)==0 do O=O end
      while is_pressed(key) do
         sleep(10)
      end
   release("shoot_full_only")
   end
else
     print(B)
   while md_detect_motion(5,5,5,1000,30,0,3,h,0,0,0,0,0,25,5,1)==0 do O=O end
   repeat
         sleep(10)
   until T+B>=get_tick_count()
   release("shoot_full_only")
end
return get_tick_count()-T
end


exc=get_exp_count()
press("shoot_half")
repeat sleep(10) until not get_shooting()
print(bulb(t*f*100,k==1 and "shoot_half"))
release("shoot_half")
while exc==get_exp_count() do sleep(100) end
 
to perform a kind of bulb...  :haha==
All lifetime is a loan from eternity.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Pretty print Tv
« Reply #22 on: 06 / August / 2021, 21:36:05 »
Bottom line: may I suggest you ‘just’ extend the table to cover out to 1/4000 and keep the table as is at the other end, ie 250s. This should at least cover the non BULB use.


@pigeonhill


I have added the extra entries up to 1/4000s into the XIMR build. If this is what you want I will add it the main SVN repo.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Pretty print Tv
« Reply #23 on: 07 / August / 2021, 02:19:21 »
@philmoz

Quote
I have added the extra entries up to 1/4000s into the XIMR build. If this is what you want I will add it the main SVN repo.

Many thanks, that fixes things...unless there is a CHDK camera with a shutter faster than 1/4000: but I'm sure there isn't.

Cheers

Garry


Re: Pretty print Tv
« Reply #24 on: 07 / August / 2021, 02:26:16 »
@philmoz

Should have said, it's not a full fix as you need to test for BULB, as BULB returns id 36, ie the same as 1/4000.

This is why I suggested adding a BULB entry to catch the BULB apex96 shutter that seems to be returned, ie 32767 - at least on the 11-22mm EFM lens.

In other words, the final entry will be to catch shutters faster than 1/4000, which is the BULB  ;)

A bit messy I know.

Cheers

Garry
« Last Edit: 07 / August / 2021, 02:38:16 by pigeonhill »

*

Offline reyalp

  • ******
  • 14082
Re: Pretty print Tv
« Reply #25 on: 07 / August / 2021, 02:49:28 »
Many thanks, that fixes things...unless there is a CHDK camera with a shutter faster than 1/4000: but I'm sure there isn't.
Each camera has its own table, so this would only affect m3 in any case.

This is why I suggested adding a BULB entry to catch the BULB apex96 shutter that seems to be returned, ie 32767 - at least on the 11-22mm EFM lens.

In other words, the final entry will be to catch shutters faster than 1/4000, which is the BULB  ;)

A bit messy I know.
As I've been trying to say, handling bulb in a coherent way requires more than just adding something to the table. The existing logic has no concept of a table entry that doesn't refer to a specific shutter speed.

It would be worthwhile to make the code do something reasonable for bulb mode, but that requires coming up with a specific, desired behavior for the various cases where it might be encountered.
Don't forget what the H stands for.

Re: Pretty print Tv
« Reply #26 on: 07 / August / 2021, 03:32:09 »
@reyalp / @philmoz

Thanks to both of you for your feedback and actions.

Quote
As I've been trying to say, handling bulb in a coherent way requires more than just adding something to the table. The existing logic has no concept of a table entry that doesn't refer to a specific shutter speed.

It would be worthwhile to make the code do something reasonable for bulb mode, but that requires coming up with a specific, desired behavior for the various cases where it might be encountered.

I fully understand what you are saying and I handle the situation in my code by detecting get_user_tv is outside the table's min/max Tv range:

Code: [Select]
if (temp_s > 1152 or temp_s < -480) then temp = "BULB" else temp = tv_str[qqq+16].."s" end

BTW surely you don't need a camera specific table IF the table covers all CHDK possibilities, eg 250s to 1/4000, say.
« Last Edit: 07 / August / 2021, 03:42:10 by pigeonhill »

Re: Pretty print Tv
« Reply #27 on: 07 / August / 2021, 03:34:42 »
@reyalp

Quote
Each camera has its own table, so this would only affect m3 in any case.

Then the M3 table is surely wrong, ie shutters longer than 30s  ;)


Re: Pretty print Tv
« Reply #28 on: 07 / August / 2021, 04:33:41 »
@reyalp

Following from my last post, surely the following will act as the master Tv table for all cameras, as if a camera has BULB then user_tv will be 32767 and if no BULB on a camera the algorithm will simply find the correct table entry.

Code: [Select]
const ShutterSpeed shutter_speeds_table[] = {

    { -24, -768, "250", 250000000 },

    { -23, -736, "200", 200000000 },

    { -22, -704, "160", 160000000 },

    { -21, -672, "125", 125000000 },

    { -20, -640, "100", 100000000 },

    { -19, -608, "80",   80000000 },

    { -18, -576, "60",   60000000 },

    { -17, -544, "50",   50000000 },

    { -16, -512, "40",   40000000 },

    { -15, -480, "30",   30000000 },

    { -14, -448, "25",   25000000 },

    { -13, -416, "20",   20000000 },

    { -12, -384, "15",   15000000 },

    { -11, -352, "13",   13000000 },

    { -10, -320, "10",   10000000 },

    {  -9, -288, "8",     8000000 },

    {  -8, -256, "6",     6000000 },

    {  -7, -224, "5",     5000000 },

    {  -6, -192, "4",     4000000 },

    {  -5, -160, "3.2",   3200000 },

    {  -4, -128, "2.5",   2500000 },

    {  -3,  -96, "2",     2000000 },

    {  -2,  -64, "1.6",   1600000 },

    {  -1,  -32, "1.3",   1300000 },

    {   0,    0, "1",     1000000 },

    {   1,   32, "0.8",    800000 },

    {   2,   64, "0.6",    600000 },

    {   3,   96, "0.5",    500000 },

    {   4,  128, "0.4",    400000 },

    {   5,  160, "0.3",    300000 },

    {   6,  192, "1/4",    250000 },

    {   7,  224, "1/5",    200000 },

    {   8,  256, "1/6",    166667 },

    {   9,  288, "1/8",    125000 },

    {  10,  320, "1/10",   100000 },

    {  11,  352, "1/13",    76923 },

    {  12,  384, "1/15",    66667 },

    {  13,  416, "1/20",    50000 },

    {  14,  448, "1/25",    40000 },

    {  15,  480, "1/30",    33333 },

    {  16,  512, "1/40",    25000 },

    {  17,  544, "1/50",    20000 },

    {  18,  576, "1/60",    16667 },

    {  19,  608, "1/80",    12500 },

    {  20,  640, "1/100",   10000 },

    {  21,  672, "1/125",    8000 },

    {  22,  704, "1/160",    6250 },

    {  23,  736, "1/200",    5000 },

    {  24,  768, "1/250",    4000 },

    {  25,  800, "1/320",    3125 },

    {  26,  832, "1/400",    2500 },

    {  27,  864, "1/500",    2000 },

    {  28,  896, "1/640",    1563 },

    {  29,  928, "1/800",    1250 },

    {  30,  960, "1/1000",   1000 },

    {  31,  992, "1/1250",    800 },

    {  32, 1024, "1/1600",    625 },

    {  33, 1056, "1/2000",    500 },

    {  34, 1088, "1/2500",    400 },

    {  35, 1120, "1/3200",    312 },

    {  36, 1152, "1/4000",    250 },

    {  37, 1156, "BULB",    0 },

};


At least this would return the ‘correct’ Id for bulb, ie 37.
« Last Edit: 07 / August / 2021, 07:10:53 by pigeonhill »

*

Offline reyalp

  • ******
  • 14082
Re: Pretty print Tv
« Reply #29 on: 07 / August / 2021, 12:52:53 »
Following from my last post, surely the following will act as the master Tv table for all cameras,
In the current code, those tables are supposed to reflect the range of exposures supported by the Canon firmware. This table is used (among other things) by set_tv96 to find the nearest "supported" Canon value (see core/shooting.c find_canon_shutter_speed).

As you've noticed, M3 doesn't reflect the Canon range, but that's because it has some inappropriate copy/paste, like many other ports. Making one universal table would change the behavior of a lot of cameras.

Again, it would be nice to clean this up, but someone really has to look at everything that would be impacted.
Quote
as if a camera has BULB then user_tv will be 32767 and if no BULB on a camera the algorithm will simply find the correct table entry.
set_user_tv_by_id_rel(1) from 1/4000 would try to set user_tv to bulb, instead of staying on the shortest supported value.
Don't forget what the H stands for.

 

Related Topics