subogero / omxd

Raspberry Pi omxplayer playlist daemon and YouTube player
Other
85 stars 19 forks source link

Various issues setting up a looped playback system (black screen, overlapping players, not autostarting) #87

Open RobinFen opened 5 years ago

RobinFen commented 5 years ago

Hello. Sorry this is a long post, so I really appreciate your time. I have read through the closed issues and couldn't find anything exactly like the problem I'm having.

On paper the OMDX service does exactly what I need. However I'm having a few problems getting it to work properly as per the documentation.

My goal is fairly standard - on boot to randomly auto-play on loop a large number of short videos (several thousand, each around 30 seconds long). I don't care about audio, just the video, which is coming from the composite jack.

Pi 3 model B+ Running latest Stretch lite. Brand new 32gb card. I have no GUI installed, this is an entirely command-line installation, and everything is done via SSH.

I have a directory on the PI containing the videos on the card.

I installed omxd from apt-get following this https://linux.subogero.com/tag/omxd/ (I had to use HTTPS rather than HTTP due to certificate complaints from apt).

First of all I'm going to describe how I currently have it working in a hacked way, and the main blocker to my project. After that, I'm going to explain a few issues I've run into which led me to my current solution.

so, hacked way - My rc.local calls a script containing this series of instructions

# display fullscreen image with fbi to hide the command prompt
fbi -a --noverbose -T 10 /home/pi/image.png

echo X > /var/run/omxctl

for filename in /home/pi/livevideos/*.mp4; do
    echo a $filename > /var/run/omxctl
done

#unsorted (shuffle playback)
echo u > /var/run/omxctl

# set omxplayer background to black
echo O -b > /var/run/omxctl

# play next
echo n > /var/run/omxctl
echo u > /var/run/omxctl
echo l > /var/run/omxctl

and gap=1 set in /etc/omxd.conf

On boot, this launches the player, and plays the videos. The first video is always the same, but after that it is random. This is fine for my needs.

However the main problem I'm facing is after an undetermined amount of time the player turns into a black screen and no more videos play. The only way to recover is to reboot the Pi.

Now, I have seen on the omxPlayer docs there is a known issue with the black screen, but I am unsure how to resolve this when the player is called from omxd. If I can solve this then my project is finished.

Surrounding issues. OK, so I understand omxd should save the playlist between boot sessions, and that I shouldn't need to call X to clear my playlist, add it again and set up the rest of the flags each time I boot.

However the problem is when I try this approach, upon reboot, only the first video plays, and then it returns to the command prompt. Probably I'm doing something wrong - so what command should I echo to omxctl to kick off the playlist loop on boot?

The way I understand it all, I should really need to do is something like call the following one time to set it up

echo a /home/pi/livevideos/ > /var/run/omxctl
echo u > /var/run/omxctl

and then reboot to see the playlist

Secondly, if I remove the gap=1 setting, I see two simultaneous fully-screen videos playing on top of one-another/competing for the foreground. There's clearly something wrong here, but I don't know if it's omxplayer or omxd?

If you need steps to reproduce any of this I am happy to provide. Thank you

autr commented 3 years ago

Hey @RobinFen , did you make any progress with this? What was your final setup? Thanks!