JizzaDaMan
Posts: 66
Joined: Sun Apr 07, 2013 2:14 pm

omxplayer won't quit - intermittent bug

Sat May 24, 2014 1:11 pm

This is going to take a bit of explaining, so please bear with me :)

I have the ultimate aim of using raspberry pis to drive remotely controlled displays. In the end, they'll be able to display videos, pictures, or webcam feeds.

For the 'remote control' element, I'm using sockets. I have a python script running on my 'server' computer, and a python script running on each of the pis. In this way I can send a byte of data to each pi simultaneously. When each pi recieves this byte of data it runs all the scripts in a file corresponding to the value of the byte it received. I have this part of the process working properly.

The way I'm displaying videos is using omxplayer.
First I make a fifo:

Code: Select all

mkfifo /home/pi/vid
I then run a bash script containing the following command:

Code: Select all

omxplayer --no-osd [filename] < /home/pi/vid
I background all the scripts, otherwise everything freezes up.

Then to play I do:

Code: Select all

echo . > /home/pi/vid
To pause or continue I do:

Code: Select all

echo -n p > /home/pi/vid
And to quit I do:

Code: Select all

echo -n q > /home/pi/vid
This all worked without a hitch during testing with just one pi, but by adding another one, I found I had developed an intermittent bug, whereby the signal would be sent to the pis, and the script to quit omxplayer would be run, but (when having only two pis hooked up), only one pi would quit omxplayer, and the other one would continue (but only sometimes!).

To see if I could analyse things more closely I set up SSH, and executed the python scripts on the pis through this SSH. This way I could see the output messages from omxplayer.

On the one that quit successfully, when the 'quit' script ran, I got the following output:

Code: Select all

0+0 records in
0+0 records out
0 bytes (0B) copied,
followed by a time in seconds and some thing else that didn't seem relevant

On the one that didn't quit successfully, when the 'quit' script ran, I got the following, similar, output:

Code: Select all

0+1 records in
0+1 records out
1 byte (1B) copied,
I'm partly wondering what the significance of the 1 byte of data is, but mainly I'm wondering about what's going on!!!

Thanks in advance for any help

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: omxplayer won't quit - intermittent bug

Sat May 24, 2014 1:33 pm

You might be suffering from omxplayer occasional lockups. Sometimes the lockup is so bad that q does not work and you need to kill omxplayer with a SIGINT.

Make sure you have the latest 'raspbian' version of omxplayer by doign a sudo apt-get upgrade and maybe by installing the very latest from

http://omxplayer.sconde.net/
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

JizzaDaMan
Posts: 66
Joined: Sun Apr 07, 2013 2:14 pm

Re: omxplayer won't quit - intermittent bug

Sat May 24, 2014 1:40 pm

I flashed all the operating systems and performed full system updates only yesterday, so I'm almost certain I'm fully updated.

gkreidl
Posts: 5997
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: omxplayer won't quit - intermittent bug

Sat May 24, 2014 3:59 pm

JizzaDaMan wrote:I flashed all the operating systems and performed full system updates only yesterday, so I'm almost certain I'm fully updated.
No, omxplayer in Raspbian is behind the latest releases which you will only get from http://omxplayer.sconde.net/
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

JizzaDaMan
Posts: 66
Joined: Sun Apr 07, 2013 2:14 pm

Re: omxplayer won't quit - intermittent bug

Sat May 24, 2014 11:29 pm

Oh ok, well I'll try that at some point when I've got the time :) Thanks for the help :)

Return to “Troubleshooting”