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

Eventual drift out of sync #79

Closed
muff7 opened this issue Jul 30, 2018 · 29 comments
Closed

Eventual drift out of sync #79

muff7 opened this issue Jul 30, 2018 · 29 comments

Comments

@muff7
Copy link

muff7 commented Jul 30, 2018

I have this set up and running on 2 Raspberry Pi 3b+'s.

Both machines start up in perfect sync +/- 1 frames which is perfectly fine for my use case. Although when I leave the machines running overnight, by the next morning they're seconds out and not correcting back to the master.

Anything I can try to fix this?

Thanks for the great work!

@DSPeelJ
Copy link

DSPeelJ commented Jul 30, 2018

How do you have the Pi's networked? I'm using a managed switch, assigned each Pi a static IP and used the switch IP as the gateway. I've got 24 Pi's running basically 24/7 and haven't seen this behavior.

@muff7
Copy link
Author

muff7 commented Jul 30, 2018

Connected through a switch, static IP's and all. Ping between the machines is 0.242ms pretty sharp!

@turingmachine
Copy link
Owner

@muff7 Can you give some information about the content you are playing? How many files etc?

@muff7
Copy link
Author

muff7 commented Jul 30, 2018

@turingmachine thanks! Just trying the included synctest.mp4 at the moment.

@muff7
Copy link
Author

muff7 commented Jul 31, 2018

Left the machines running overnight again and this morning and they're 11 frames out.

@turingmachine
Copy link
Owner

@muff7 What value are you using for SYNC_TOLERANCE?

@DSPeelJ
Copy link

DSPeelJ commented Jul 31, 2018

I'll look at my config. I did cut down the sync tolerance on my setup by half, I think. I'll confirm and let you know

@turingmachine
Copy link
Owner

The acutal value would be of interest. The current default ist set to 0.05 seconds. This is a little more than the duration of one frame (1/24). This means if the deviation is more than this value it will resync. @muff7 This poses the question why it didn't resync whenn 11 frames apart. Can you verify network connectivity at this time? Does omxplayer-sync throw any errors?

@muff7
Copy link
Author

muff7 commented Jul 31, 2018

What value are you using for SYNC_TOLERANCE?

Yup sync_tolerence is set to 0.05 as per default;
SYNC_TOLERANCE = .05 SYNC_GRACE_TIME = 5 SYNC_JUMP_AHEAD = 3

Can you verify network connectivity at this time?

Yes, both Pi's are connectable and running.

Does omxplayer-sync throw any errors?

None that I can see, is there a log file I can share?

Thanks again.

@DSPeelJ
Copy link

DSPeelJ commented Jul 31, 2018

I set the SYNC_TOLERANCE to .025 on my setup very early on and forgot to mention it earlier. Grace time and jump ahead are unchanged. It seemed to tighten things up for me. I also changed the sleep( ) #wait for omxplayer to appear on dbus value to 20 as I was having problems with the files loading. No other changes. My videos have about 25 seconds of black at the beginning and that is plenty to get them all in sync. The files are all encoded identically.
I did a sample run with a time code overlay and they were within a frame or two at all times.
I uploaded a few sample clips here: https://youtu.be/zupHpzgcJqc and here: https://youtu.be/Xp6GKFaw0io

I did my initial testing in February or March but it seems like I had similar drifting before I tightened up the sync value.

@muff7
Copy link
Author

muff7 commented Aug 2, 2018

Hey all,

update from me here. I've now set the SYNC_TOLERANCE to .025 and I'm still getting frame drift. Overnight the players are 10 or so frames out and not correcting still. Any other suggestions?

@DSPeelJ
Copy link

DSPeelJ commented Aug 2, 2018

Is your system fully updated? Just going back to basics... You don't have loggging enabled? I could upload an image of my SD card for you to try.

@muff7
Copy link
Author

muff7 commented Aug 2, 2018

Yes fully updated, logging as in Verbose mode? I have had that running, I'll disable and test again.

@magdesign
Copy link
Collaborator

magdesign commented Aug 2, 2018

Do you have the exact same setup, that means same resolution, same sd cards, same OS setup ?
Is it syncing in anyway or just both player starting at the same time (you can try this with pausing the master a few seconds and starting it again to see if the slave resyncs)?
@DSPeelJ : may we use your youtube link in the readme as a demo example?

@DSPeelJ
Copy link

DSPeelJ commented Aug 2, 2018

Another note. I added the startup command to the rc.local file so it starts automatically on boot. I have the piconfig set to wait for network. If you start the slave first, it should pause, waiting for the sync commands from the master. When the master boots, the slave should start to follow then. I'm using the same image on all Pi's, identical encoding on the videos, and the same brand and size of sd cards. I then went in, changed the IP addresses, added the appropriate command to rc.local, and loaded the appropriate video file. Over the last few months, I've had a few players hang on occasion (they'll be on a blank screen when we turn the screens on) but I can just reboot the Pi and it falls back in sync within 20 seconds or so. This has happened maybe 3 or 4 times with 24 Pi's running 24/7, so while a quirk, hardly a deal breaker for my installation. I haven't had to reboot the entire setup since I turned it on in early May. I've got heat sinks on the Pi's too but don't think that overheating is any issue.

Happy to have you use the clip as a demo.
Thanks,

@DSPeelJ
Copy link

DSPeelJ commented Aug 2, 2018

Also booting to console, not to desktop.

@muff7
Copy link
Author

muff7 commented Aug 2, 2018

Yup, exactly the same configuration used here also.

I set up one of the Pi's then cloned the SD Card image to the other. I'm running Stretch Lite with no desktop. I haven't yet set the sync to start on boot I simply run the commands manually.

When in verbose mode the pi's do show that they are pausing and correcting at first so I do think there is some sort of syncing happening! I'd be very happy to try your pi image @DSPeelJ!

M

@DSPeelJ
Copy link

DSPeelJ commented Aug 2, 2018

I'm pretty sure I'm on Jesse. What ever was current in February or march. I'm using a 32 gb sd card so the image is that. I'm not at work and have pretty pokey internet where I am. Happy to upload though( it will take a while!) Regarding adding to rc.local, I'm fuzzy on killing the process once it starts, so would use a linux laptop to get back in and do any other edits. Shouldn't be hard to use killall but I just didn't mess with it since I had a laptop available.

@turingmachine
Copy link
Owner

@muff7 Are you running any other programs that could affect performance?

@DSPeelJ
Copy link

DSPeelJ commented Aug 2, 2018

I did disable bluetooth and wireless. Not sure if that made any difference but I tried to keep it as lean as possible.

@hitesh83
Copy link

hitesh83 commented Aug 2, 2018

Sorry to jumping in between discussion.
@DSPeelJ can you enable verbose mode on both (Master & Slave ) , try to keep them side by side and take a photo of console ? this will enable every one to know the difference as per the program and not as per visually.
Same way I diagnosed one of my issue with OmxSync and found out my file was too short to get sync. (not the same issue for you but still one more method to know whats going on )

@DSPeelJ
Copy link

DSPeelJ commented Aug 2, 2018

No worries,
I won't be able to until Monday earliest, I'm off for a few. My files are about 15 minutes long.

@DSPeelJ
Copy link

DSPeelJ commented Aug 2, 2018

Not what you asked for but I did have a shot of 12 screens with timecode embedded in the video files. The setup was running for several days when this was taken.
rodeo timecode

@DSPeelJ
Copy link

DSPeelJ commented Aug 3, 2018

Can you try Jessie instead of Stretch?

@DSPeelJ
Copy link

DSPeelJ commented Aug 8, 2018

Back at work today. I checked the os version and I'm running Stretch but on a PI 3 not the newest 3 B+ I purchased all of mine about a month before the release of the 3 B+

@DSPeelJ
Copy link

DSPeelJ commented Aug 8, 2018

@muff7
I'm redoing the system image in to smaller pieces so I can upload them. I'll let you know.

@magdesign
Copy link
Collaborator

Basically you can just take a "raspian jessie" light image and install omxplayer-sync as described in the readme and everything will work as expected.
I am aware that there are issues with stretch but don't have the time right now to solve them, hoping to get some inputs from the community.

@ghost
Copy link

ghost commented Aug 8, 2018 via email

@DSPeelJ
Copy link

DSPeelJ commented Aug 8, 2018

Here are links to an image of of my Stretch install. you'll need all 3 parts, then un-rar,
Nothing special here but this does work well for me on a PI 3. Not tested on a 3 b+

https://www.icloud.com/iclouddrive/032TQPsrGjEfqWmnE2cBBMbLw#pisync180223.part1.rar
https://www.icloud.com/iclouddrive/0cjZhupaQcfCoXwCGueaa6G9Q#pisync180223.part2.rar
https://www.icloud.com/iclouddrive/0_WeRaMmTZYXPC8B_3M_8FcCQ#pisync180223.part3.rar

I just followed the readme but, again, this is working for sure.

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

5 participants