Photos added from Camera app take longer than manually added files

Hi all,

I noticed something weird: Basically, manually copying a file into my DCIM/Camera folder on my phone results in a much faster sync to my laptop than if I take a photo with the camera app, which also places the picture into DCIM/Camera. (I made sure that the test files which I manually copied into DCIM/Camera are always new, i.e. syncthing has not seen/hashed them before.)

I tested this on a Pixel 8 and also a Pixel 5. On both phones, I tested this with the stock Camera app from GrapheneOS and OpenCamera from F-Droid.

My general setup

  • Linux laptop running syncthing 1.29.3
    • In advanced syncthing settings, set fsWatcherDelayS to 0.5.
  • Phone (Pixel 8) with GrapheneOS (currently Android 15) running syncthing-fork 1.29.4 (from F-Droid)
    • In advanced syncthing settings, set fsWatcherDelayS to 1.
  • Phone (Pixel 5) with GrapheneOS (currently Android 14) running syncthing-fork 1.29.4 (from F-Droid)
    • In advanced syncthing settings, set fsWatcherDelayS to 1.
  • Syncthing only runs over LAN via local discovery (no global discovery, no NAT, no relaying).
  • Each phone has their DCIM folder shared with the laptop, so no loops in the sync graph.

For the following, by “full folder” I mean a folder that contains 800 photos (3.8 GB) and 200 videos (8.3 GB), so a total of 1000 files (12.1 GB). By “empty folder”, I mean a folder that contains about 10 photos à 5 MB.

I did use the same dataset of photos and videos for both phones, for consistency.

Measurements on Pixel 8

  • New photo with Stock Camera into “full folder”: 45s-48s
  • New photo with OpenCamera into “full folder”: 15s
  • New photo with Stock Camera into “empty folder”: 1s
  • New photo with OpenCamera into “empty folder”: 1s
  • Manually copy a file into “full folder”: 1s
  • Manually copy a file into “empty folder”: 1s

Measurements on Pixel 5

  • New photo with Stock Camera into “full folder”: 4s
  • New photo with OpenCamera into “full folder”: 5s
  • New photo with Stock Camera into “empty folder”: 1s
  • New photo with OpenCamera into “empty folder”: 1s
  • Manually copy a file into “full folder”: 1s
  • Manually copy a file into “empty folder”: 1s

Additional info

I measured the time just by looking at the clock, while having something like watch -n .1 'ls -lat pixel8_DCIM_sync/Camera | head -n 10' running on my laptop. I did several measurements, on different days, and rebooted the phone inbetween.

On all cases where the time was above 1 second, there was a temporary syncthing file present, e.g. .syncthing.IMG_20250505_001914_896.jpg.tmp, which was then renamed to e.g. IMG_20250505_001914_896.jpg when the sync finished (that’s when I noted the time).

I’m aware of syncthing’s slow performance on folders that contain many files, but it seems that this issue here is different.

My question

I would be interested if someone could think of an explanation of this issue? And maybe even has ideas for a fix, or how one could debug this further? Maybe someone could try to reproduce this on another phone?

Semi-related: Over the course of these tests, I renamed DCIM/Camera to DCIM/OpenCamera and DCIM/OpenCamera to DCIM/Camera (using one temporary name to avoid a collision). After that, I had to restart syncthing-fork for it to recognize new photos again, for some reason (even though I did a manual rescan and waited until both devices were in sync again).

Thank you :slight_smile:

This is a different problem. Basically, the file watcher is tied to the original folder, and it will keep tracking changes in it even after renaming or moving it to a different location. Only a full Syncthing restart fixes the problem, changing the watched folder to the new one. I think there should be an issue on GitHub open about this (but I’m not 100% sure).

I think I found the issue: fsnotify: fs events have wrong paths after renaming a directory, then back to original name · Issue #7950 · syncthing/syncthing · GitHub

Good to know it’s a known issue.