turingmachine / omxplayer-sync

OMXPlayer-Sync facilitates synchronization of multiple OMXPlayer instances over the network in a master/slave fashion.
194 stars 70 forks source link

No Sync #14

Closed dash508 closed 9 years ago

dash508 commented 9 years ago

hi there,

I have omxplayer-sync installed on two raspberry pi's connected via ethernet, and while i can play the synctest.mp4 file on either of them individually, anytime i enter the command omxplayer-sync -muv synctest.mp4 it tells me "connect:network is unreachable" and when i enter omxplayer-sync -luv synctest.mp4 it tells me "Warning: unable to get current filename from master" and continues to loop only the first five seconds of the synctest.mp4

I'm assuming I have something incorrectly setup regarding the network. both pi's have static IP addresses set. what further steps are necessary to setup communication between the slave and master?

apologies for being a novice at this. any help would be appreciated. all the best!

turingmachine commented 9 years ago

what's the output of ifconfig -a and route -n

dash508 commented 9 years ago

Pi 1: eth0 Link encap:Ethernet HWaddr b8:27:eb:6d:50:a2
inet addr:169.254.0.2 Bcast:169.254.255.255 Mask:255.255.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:6 errors:0 dropped:0 overruns:0 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:390 (390.0 B) TX bytes:418 (418.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0

PI 2: eth0 Link encap:Ethernet HWaddr b8:27:eb:6f:49:56 inet addr:169.254.0.3 Bcast:169.254.255.255 Mask:255.255.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5 errors:0 dropped:0 overruns:0 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:344 (344.0 B) TX bytes:418 (418.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0

turingmachine commented 9 years ago

copy and paste the following code into a shell and press enter:

cat <<-EOD > debug-omxplayer.py import socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0) sock.bind(('0.0.0.0', 1666)) sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) sock.connect(('255.255.255.255', 1666)) EOD python debug-omxplayer.py

dash508 commented 9 years ago

when entered into a python shell the code returns:

Traceback (most recent call last): File "<pyshell#0>", line 1, in cat <<-EOD > debug-omxplayer.py NameError: name 'cat' is not defined

I wasn't sure if it was meant to be pasted into a python shell or LX terminal (apologies again for being such a beginner) so i pasted it into lxterminal as well which returned this:

Traceback (most recent call last): File "debug-omxplayer.py", line 5, in sock.connect(('255.255.255.255', 1666)) File "/usr/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) socket.error: [Errno 101] Network is unreachable

omxplayer-sync still saying network is unreachable.

dash508 commented 9 years ago

Hi Turingmachine so sorry for all the trouble. I've actually somehow gotten it to sync successfully!

However, the slave still seems to pause on its own every 5 seconds or so. any idea what might be causing that?

Thank you so much for all the help you've already given!

All the best from miami, fl

turingmachine commented 9 years ago

How did you solve the network problem?

Start both the master and the slave at the same time. Paste about 15 seconds of the output of omxplayer-sync -luv in a gist and paste the link here.

dash508 commented 9 years ago

Hi turingmachine,

It's strange how I was able to solve the network issue. I had been attempting to use pi#1 as the master and pi# 2 as the slave the whole time, but out of curiosity I attempted to use pi#2 as the master and it worked!

As for the pausing, I've actually sorted out that issue as well. For some reason, whenever I used the -luv argument, it pauses as such; however by instead entering "omxplayer-sync -u -l synctest.mp4" it does as it should without pausing!

All that I would like to try to attempt now is to write a script that would start the playback automatically upon booting up; Also if you know of anyway to get omxplayer-sync to seamlessly loop, that would be much appreciated, but not necessarily necessary.

Also it would be beneficial to have some way to replace video clips across the Pi's via a network.

Over the next few days, I'm going to be attempting to network 15 PIs together as such, and hopefully use them to power a 360º wraparound video wall at a local venue. I'll let you know of the results!

All the best!

turingmachine commented 9 years ago

The -v argument produces lots of output on the console, this can impact the performance.

A simple way to execute programs upon bootup is the /etc/rc.local file. Just add the command line you would normally use to start omxplayer-sync at the end of the file.

The are also numerous different ways to manage your files on the pi over the network. I suggest you use a SFTP client like WinSCP or CyberDuck. SFTP is provided through OpenSSH which is already installed and configured.

Currently omxplayer-sync needs to be restarted if you want to play different files. You could however easily implement your own player loop which checks for new files each time all supplied files played once, e.g:

while true; do omxplayer-sync -l /media/sdcard/* # notice the -u option is omited done

The PocketVJ video player uses omxplayer-sync as its default media player. This is a full-featured product including WiFi and a web interface to control player aspects as well as file management.