Screenly Cannot play MP4 video on a Raspberry Pi

I was able to get VLC MP4 video playback working after merging GitHub PR #1640 (https://github.com/Screenly/screenly-ose/pull/1640).

However, MP4 video is not playing on a Raspberry Pi 4B with balenaOS 2.105.21 installed. I can only get audio.

I’m getting the following errors from the logs:

[Logs]    [11/8/2022, 5:39:35 PM] [srly-ose-viewer] [f03204b0] mmal_vout vout display error: VCSM init fail
[Logs]    [11/8/2022, 5:39:35 PM] [srly-ose-viewer] [02011f50] main video output error: video output creation failed
[Logs]    [11/8/2022, 5:39:35 PM] [srly-ose-viewer] [f28205c8] main decoder error: failed to create video output
[Logs]    [11/8/2022, 5:39:35 PM] [srly-ose-viewer] [mpeg4 @ 0xf281afb0] get_buffer() failed
[Logs]    [11/8/2022, 5:39:35 PM] [srly-ose-viewer] [mpeg4 @ 0xf281afb0] thread_get_buffer() failed
[Logs]    [11/8/2022, 5:39:35 PM] [srly-ose-viewer] [mpeg4 @ 0xf281afb0] get_buffer() failed (-1 (nil))
[Logs]    [11/8/2022, 5:39:35 PM] [srly-ose-viewer] error: XDG_RUNTIME_DIR not set in the environment.
[Logs]    [11/8/2022, 5:39:35 PM] [srly-ose-viewer] error: XDG_RUNTIME_DIR not set in the environment.

I’ve already tried setting dtoverlay to vc4-fkms-v3d device-wide via Device Configuration.

1 Like

One thing to try would be to run your Screenly container with “privileged” turned on. I see the PR relies on being able to detect what type of Pi it is running on by looking in /proc. Due to this issue, this wont work in Docker (and therefore balenaEngine) unless the container is privileged.

Failing that, I think the key here is “VCSM init fail”. The other errors may just be a consequence (and XDG_RUNTIME_DIR is probably irrelevant). “mmal” is the “Multi-Media Abstraction Layer” which is a software interface to the RPi’s VideoCore GPU, and “VCSM” is the VideoCore shared memory driver. Historically there’s been issues accessing it from 64-bit land, but these errors seem distinct.

I would investigate your GPU_mem setting, and also try some MP4’s from a different source - given audio works, perhaps the issue is specific to the video decoder?

Finally, can you explain your video setup? Do you have something plugged into one of the HDMI ports? Is it otherwise displaying correctly?

Thanks for the feedback! Yes, the Screenly container already runs in privileged mode.

Yes, I have an LCD TV plugged into my Pi 4’s HDMI 1 port. I already tried plugging my TV into HDMI 2, but video’s not playing as well (audio’s OK).

Thanks! Setting gpu_mem to a higher value and dtoverlay to vc4-fkms-v3d fixes the playback issue, at least on my Pi 4 running balenaOS.