KillerInk / FreeDcam

FreeDcam is a CameraApp for Android >4.0(ics) wich try to enable stuff that is forgotten by the manufacturs
GNU General Public License v2.0
294 stars 45 forks source link

Interval Mode delay/lag (plus possible solutions?) #208

Open jaimet opened 1 year ago

jaimet commented 1 year ago

Describe the bug When I set the "Shutter Fire Interval" to 1 minute and then use "Interval Mode", the delay between the pictures is 61 seconds, not 60 seconds.

To Reproduce Steps to reproduce the behavior:

  1. Set "Shutter Fire Interval" to 1 minute.
  2. Set "Duration till interval ends" to 20 minutes.
  3. Press Shutter Button and wait 20 minutes.
  4. Inspect the timestamps on the files:
IMG_2022_10_25_21_23_07.jpg  21:23:07.14603
IMG_2022_10_25_21_24_07.jpg  21:24:07.30937
IMG_2022_10_25_21_25_08.jpg  21:25:08.30604
IMG_2022_10_25_21_26_09.jpg  21:26:09.49938
IMG_2022_10_25_21_27_10.jpg  21:27:10.52605
IMG_2022_10_25_21_28_11.jpg  21:28:11.70939
IMG_2022_10_25_21_29_12.jpg  21:29:12.78273
IMG_2022_10_25_21_30_13.jpg  21:30:13.83274
IMG_2022_10_25_21_31_15.jpg  21:31:15.00941
IMG_2022_10_25_21_32_16.jpg  21:32:16.09942
IMG_2022_10_25_21_33_17.jpg  21:33:17.25942
IMG_2022_10_25_21_34_18.jpg  21:34:18.37943
IMG_2022_10_25_21_35_19.jpg  21:35:19.43277
IMG_2022_10_25_21_36_20.jpg  21:36:20.51611
IMG_2022_10_25_21_37_21.jpg  21:37:21.69278
IMG_2022_10_25_21_38_22.jpg  21:38:22.83612
IMG_2022_10_25_21_39_23.jpg  21:39:23.91613
IMG_2022_10_25_21_40_25.jpg  21:40:25.10280
IMG_2022_10_25_21_41_26.jpg  21:41:26.22281
IMG_2022_10_25_21_42_27.jpg  21:42:27.32948

Expected behavior I am not expecting particularly accurate timing. I am expecting the cumulative delay to not exceed 1 minute. (The cumulative delay in my example has reached 20 seconds after 20 photographs - by extrapolation, the cumulative delay will exceed 1 minute after 60 photographs.)

Screenshots n/a

Smartphone (please complete the following information):

Additional context

I have tested a lot of open source apps to see whether they all have this "bug". The only 2 apps that I have found that do not have this bug are:

https://github.com/floe/Background-Timelapse https://play.google.com/store/apps/details?id=floe.timelapse

which produces the following timestamps:

2022-10-24 16:25:12.53 img000000.jpg
2022-10-24 16:26:12.52 img000001.jpg
2022-10-24 16:27:12.54 img000002.jpg
2022-10-24 16:28:12.48 img000003.jpg
2022-10-24 16:29:12.46 img000004.jpg
2022-10-24 16:30:12.44 img000005.jpg
2022-10-24 16:31:12.48 img000006.jpg
2022-10-24 16:32:12.50 img000007.jpg
2022-10-24 16:33:12.44 img000008.jpg
2022-10-24 16:34:12.47 img000009.jpg
2022-10-24 16:35:12.49 img000010.jpg
2022-10-24 16:36:12.53 img000011.jpg
2022-10-24 16:37:12.49 img000012.jpg
2022-10-24 16:38:12.41 img000013.jpg
2022-10-24 16:39:12.43 img000014.jpg
2022-10-24 16:40:12.40 img000015.jpg
2022-10-24 16:41:12.43 img000016.jpg
2022-10-24 16:42:12.45 img000017.jpg
2022-10-24 16:43:12.44 img000018.jpg
2022-10-24 16:44:12.42 img000019.jpg

(that's a 0.14 second variation across 20 photos), and:

https://github.com/nathan-osman/chronosnap https://f-droid.org/packages/com.nathanosman.chronosnap/

which produces the following timestamps:

0000.jpg 13:57:20.50
0001.jpg 13:58:20.25
0002.jpg 13:59:20.27
0003.jpg 14:00:20.23
0004.jpg 14:01:20.22
0005.jpg 14:02:20.27
0006.jpg 14:03:20.31
0007.jpg 14:04:20.30
0008.jpg 14:05:20.29
0009.jpg 14:06:20.24
0010.jpg 14:07:20.29
0011.jpg 14:08:20.28
0012.jpg 14:09:20.20
0013.jpg 14:10:20.31
0014.jpg 14:11:20.21
0015.jpg 14:12:20.25
0016.jpg 14:13:20.29
0017.jpg 14:14:20.28
0018.jpg 14:15:20.30
0019.jpg 14:16:20.33

(that's a 0.3 second variation across 20 photos).

I have not had the time to see how FreeDcam schedules its intervals, but I have found that https://github.com/floe/Background-Timelapse uses scheduleAtFixedRate.

HTH.

PS: I have already seen: https://github.com/KillerInk/FreeDcam/issues/109 https://github.com/KillerInk/FreeDcam/issues/148