I have a project, part of which involves playing a video using omxplayer, but when I trigger the video I can hear the audio but the screen just stays showing the BalenaCloud logo.
I’ve tried stripping everything back so that it’s as simple as possible. I now have a container that installs omxplayer and then runs omxplayer --display=5 /home/pi/videos/default.mp4, but I still just hear the audio and see the BalenaCloud logo.
To check the container can reach the screen I’ve tried displaying an image with feh test.jpeg and that worked fine, I’m at a loss as what to try next.
Thanks for getting back to me - is there any chance you can share your Dockerfile as well, then we can try to reproduce this and work out what’s happening.
My project is a copy of the simple-server-python repo, I’ve added the install of omxplayer, and I have a folder in my project called ./videos that gets but into /home/pi/videos:
# base-image for python on any machine using a template variable,
# see more about dockerfile templates here: https://www.balena.io/docs/learn/develop/dockerfile/
FROM balenalib/%%BALENA_MACHINE_NAME%%-python:3-stretch-run
# use `install_packages` if you need to install dependencies,
# for instance if you need git, just uncomment the line below.
RUN install_packages git omxplayer
COPY ./videos /home/pi/videos
# Set our working directory
WORKDIR /usr/src/app
# Copy requirements.txt first for better cache on later pushes
COPY requirements.txt requirements.txt
# pip install python deps from requirements.txt on the resin.io build server
RUN pip install -r requirements.txt
# This will copy all files in our root to the working directory in the container
COPY . ./
# Enable udevd so that plugged dynamic hardware devices show up in our container.
ENV UDEV=1
# main.py will run when container starts up on the device
CMD ["python","-u","src/main.py"]
To test if omxplayer works I then ssh in and run omxplayer --display=5 /home/pi/videos/default.mp4.
@dfunckt Things seem worse on 2.38.0. Now, omxplayer won’t do anything, it just hangs with no output at all. I ran it with --genlog and the only line in the logfile is DEBUG: DllBcm: Using omx system library.
On 2.41.0 omxplayer runs with no errors and exits as expected, the audio is played over HDMI but the screen just shows the Balena logo.
@wrboyce I’ve just switched back to 2.41.0 and things have gone back to as before.
I ran omxplayer --display=5 --genlog /home/pi/videos/default.mp4 and then used transfer.sh to pull the log file, which I have attached.omxplayer.log (141.2 KB)
Thanks, I’m taking a look at those logs now and I’ve just built a quick test app using omxplayer which I’m building too. I’ll let you know if I find anything.
Thanks, I’ve got my test app built and am seeing exactly as you describe. I will dig around for a bit locally and see if I can work anything out. At least you know it isn’t just you
Okay, got there in the end. If you set RESIN_HOST_CONFIG_dtoverlay to "vc4-fkms-v3d" then it will work as expected (or you can set dtoverlay in config.txt if you wish).
Awesome, glad it worked! If I’m honest I’m not sure why the overlay has been set to that by default, but I did see the same on my side.
As for how I worked it out… I’d love to tell you a tale of hardcore debugging but the truth of the matter is I asked my colleagues who were already aware of a similar issue and suggested I give the alternative dtoverlay a try. I do know we’ve been having issues with the latest BalenaOS builds due to Pi firmware changes, but that is a bit beyond my remit and I don’t have too many details I’m afraid. Happy to summon somebody from the devices team if you’d like an in depth explanation though?
Hi @s-ince, we’ve had to pull 2.41.0 as it was causing some issues but I believe your app should work with 2.38.0. Let me try my similar test app on 2.38.0 and see if I can work out what is going on. I’ll get back to you if I find anything interesting.
Thank you @wrboyce, the problem is a little difference with 2.38.0. Now running omxplayer --display=5 --genlog /home/pi/videos/default.mp4 results in no output at all, nothing from stdout nothing from the HDMI and nothing in the logfile, it’s really odd, it seems like omxplayer just freezes the second you try and run it.
Hi @s.ince, I pinged Will about it and he’s still investigating it. He might reply if he finds a workaround. Then it’s probably best for you to wait for the next release – as we know that solves this issue.