derf / feh

a fast and light image viewer
https://feh.finalrewind.org
Other
1.52k stars 159 forks source link

keeps repeating images even though large pool of images and i THINK settings are correct #498

Open therealrobster opened 4 years ago

therealrobster commented 4 years ago

I have the following launch command to start up the photo frame on my raspberry pi:

DISPLAY=:0.0 XAUTHORITY=/home/pi/.Xauthority feh -Z -F -z -Y -D 10 --auto-rotate /home/pi/Pictures/piPictureFrame/

I have ABOUT 1500 photos in the folder it's grabbing from and I am seeing repeats within an hour or two. On restart, the same photos are GENERALLY regularly repeating again after time. With 1500 + images I can't see how that can happen.

Can anyone recommend what I'm missing or doing wrong to have it keep selecting the same images?

I would have thought with those command variables it would be refreshing new random images each time but it's showing the same images just too many times every hour or so.

fire-eggs commented 3 years ago

Those settings look fine to me. Repeats within a short time doesn't seem right.

The code to randomize the list (-z) appears to be a valid random shuffle [gib_list.c \ gib_list_randomize].

A delay of 10 seconds would mean a list of 1500 images will "cycle" in about 4 hours. On cycle, the list is re-randomized, which means it is possible an image can show up "again".

Other possible explanations I can think of:

You could test the first two possibilities with the -U option:

feh -U /home/pi/Pictures/piPictureFrame/ | wc -l

will tell you how many images feh will actually load. [If the actual list is (e.g.) 720 files, then the slideshow cycle is 2 hours and the likelihood of seeing a "repeat" image after 2 hours is much higher].

I don't like repeats in a random list either, so I'm going to investigate if the list randomizer is truly random.

splitbrain commented 2 years ago

I can confirm the problem. Even though the images come up in a different order on every start, it seems always to be the same few images. It's as if feh only loads the first X images and shuffles them, but ignores the rest.

Background: feh is triggered by a motion sensor and only runs for as long as there is motion in front of the frame. So it is frequently restarted. With a large number of pictures I would expect to see completely different pictures on every restart. But that's clearly not the case.

pi@picframe:~ $ feh -U photos/ |wc -l
1024
pi@picframe:~ $ ls -1 photos/ |wc -l
1034
fire-eggs commented 2 years ago

We'll need to know which version you're running (feh -v).

splitbrain commented 2 years ago
$ feh -v
feh version 2.18
Compile-time switches: curl exif xinerama

The more I think about it, the more I believe it might actually be just human perception and not an actual bug in the RNG. Is there a way to let feh just print the randomized file list? That way it would be easy to verify.

fire-eggs commented 2 years ago

feh version 2.18

feh version 2.18 is ancient. Several changes have been made to increase randomicity since that version. [Especially feh 2.28]

Raspberry Pi OS bullseye has feh 3.6.3 and I'm using 3.3 on Linux Mint.

Is there a way to let feh just print the randomized file list?

According to the man page for 3.3, there are two ways:

  1. the -U switch outputs the list
  2. pressing the 'L' key during the slideshow will produce a copy of the file list

In my testing, the file list from both approaches appears to be randomized.