popcornmix / omxplayer

omxplayer
GNU General Public License v2.0
1.02k stars 334 forks source link

omxplayer.bin not terminating when LAN lost. #163

Closed delinend closed 10 years ago

delinend commented 10 years ago

I'm trying to build a Raspberry, stable and a headless streaming box. I'm starting a live stream with: $ omxplayer --live -o hdmi http://192.168.1.210:82/h264/cam21/temp.ts And this work very stable, over many days. No problem..

But if I unplug my Ethernet cable on my RaspberryPi for ex. 40sec., and plug it back again, the last image of the stream is frozen on the screen. And the funny this is, that I can see, that the omxplayer.bin is still running on the Pi.

I have made a simple script, that check, when omxplayer.bin is running, and restart the stream again, but thats a problem, when the omxplayer.bin not is terminating, when the stream stops, after LAN lost.

Is ther any setting, or other processes that I can check ?

I use the the last Wheezy image, whith all updates, and rpi-update (git firmware). Here the omxplayer info: omxplayer - Commandline multimedia player for the Raspberry Pi Build date: Mon, 16 Dec 2013 22:06:42 +0100 Version : b34143c [master] Repository: https://github.com/popcornmix/omxplayer.git

skgsergio commented 10 years ago

Get the latest version from http://omxplayer.sconde.net/ check if still happening. If still happens exec omxplayer with genlog option and paste it here (use pastebin or similar please).

Although popcornmix should know better than me how this works it's probably the lack of timeout or something.

delinend commented 10 years ago

Just installed omxplayer_0.3.5~git20140309~9b0793f_armhf.deb, and I see the same issue. The omxplayer.bin, is not terminating, when I unplug and replug the LAN for about 40 sec.

Here the genlog, where I unplug the LAN at 14:07:00 and wait 40sec.before I replug the LAN again. But nothing after 14:07:00 is written in the log file, when I terminate omxplayer with ctrl+c at 14:08:30 http://pastebin.com/ba753bCE

delinend commented 10 years ago

Btw. the omxplayer version from the test: omxplayer - Commandline multimedia player for the Raspberry Pi Build date: Sun, 09 Mar 2014 18:17:45 +0000 Version : 9b0793f [master] Repository: https://github.com/popcornmix/omxplayer.git

popcornmix commented 10 years ago

Do you have a publicly accessible URL that shows the same behaviour? That would make it easier for me to test.

I do have a suspicion that it's ffmpeg that hangs when network connection stalls, so it may not be easy to fix. (Does xbmc behave better?)

skgsergio commented 10 years ago

@popcornmix I don't know about ffmpeg but... http://stackoverflow.com/a/10666409/1158333

delinend commented 10 years ago

Popcornmix: You got a PM, with a public URL for test.

delinend commented 10 years ago

News: I see se same behavour, if I remove the LAN from my streaming source (a server with BlueIris streaming/webcam server). But if I kill the source stream on my BlueIris server... the omxplayer on my RPI is terminating right (Have a nice day).

skgsergio commented 10 years ago

There is nothing strange on that @delinend. If you kill the source the source is closed properly, but if you cut the link (on the RPi or on the server) isn't closed properly.

delinend commented 10 years ago

@skgserdio. Yes. But is it not normal for a player, when no data is comming in to it for X sec., it has to terminate ? The omxplayer just frezz with last image, and do not terminate at all. Btw. The stream is a mpeg2/TS.

popcornmix commented 10 years ago

I've had a look and found an issue. An update has been pushed which hopefully fixes this.

delinend commented 10 years ago

Thanks Popcornmix.

I have just tested the new build from @skgsergio and I see the same problem, that the omxplayer not is terminating, when I disconnect the LAN cable. I can't see if your last change, is in that build. Build date: 15/03/2014 22:00 UTC Git version: 7fb5ef0 Download .deb (armhf): omxplayer_0.3.5~git20140315~7fb5ef0_armhf.deb

delinend commented 10 years ago

Here a new log, with test of the new Build 15/03/2014, where I still see the problem. The omxplayer is not terminating, when I unplug the LAN cable from my RPI. http://pastebin.com/2NXtrT5y I unplug the cable at 16:36:00, and after that.. nothing is written in the log. I have to terminate omxplayer with ctrl+c.

delinend commented 10 years ago

Any news ? Can I do more logging to help trace this problem down ?

Best regards Jesper

delinend commented 10 years ago

When the omxplayer is hanging, I have made a "strace -p 'pid' " on the omxplayer.bin Here the resulte: http://pastebin.com/UQZNHn1z

popcornmix commented 10 years ago

Okay, I've had another go. My dev environment uses an NFS boot, which make testing network disconnection tricky. I've been testing with an sdcard install, and could see the problem. Should be fixed with this commit: https://github.com/popcornmix/omxplayer/commit/39e63429d7558053350cad2f6dc2f281527342fe

delinend commented 10 years ago

Wow.. ! Thanks popcornmix. It looks like it works now :-) Q: When will this fix, bee on the official apt-get update release ?

popcornmix commented 10 years ago

The apt-get version typically gets updated when a new raspbian sdcard image is produced (normally every couple of months). It can happen more often if a critical issue is fixed, but I'm not sure this one is critical enough.

Good to hear it is fixed.

delinend commented 10 years ago

Thanks popcornmix for your help and work. The new fix works great.. I'll close this issue.

skgsergio commented 10 years ago

I don't know who is in charge of the RPi foundation repo but maybe we can poke him to update their omxplayer package since it have the fix for https too.

KenT2 commented 10 years ago

It would be super to get the @jehutting reliabilty fix into an image or at least sudo apt-get upgrade, There are lots of less techie Pi Presents and other digital signage users who need reliable long duration video playing.

asb commented 10 years ago

I've updated the archive.raspberrypi.org repo with a newer version of the package