This suggests the interface was not actually connected since if it was, this rule would be in the policy: /dev/fb[0-9]* rw, which would make the above policy violation go away.
I tried to use the snapcraft.yaml that you originally posted, but it fails to build (I tried on amd64). It also doesn’t list ‘framebuffer’ in any of the plugs. Perhaps you forgot to add it? If you provide a working snapcraft.yaml or an amd64 snap, I can look into this further.
If I connect the framebuffer before and execute ffplay I do not see anything in the logs. Except for the error message being displayed directly with the ffplay command:
Could not initialize SDL - Unable to open a console terminal
(Did you set the DISPLAY variable?)
Now I thought ffplay might be hard to get working and it is not the best player anyway. So I tried to use the MPV player. I am successful in building the snap [1] but if I try to run it (after connecting the framebuffer plug) I run into the following problem:
Fontconfig error: Cannot load default config file
[osd/libass] No usable fontconfig configuration file found, using fallback.
Fontconfig error: Cannot load default config file
Playing: TestVideoColorChange.mp4
(+) Video --vid=1 (*) (h264 1280x720 25.000fps)
[vo/opengl/x11] couldn't open the X11 display ()!
[vo/opengl/x11] couldn't open the X11 display ()!
[vo/opengl/x11] couldn't open the X11 display ()!
[vo/opengl/wayland] failed to connect to a wayland server: check if a wayland compositor is running
[vo/opengl] VT_GETMODE failed: Inappropriate ioctl for device
[vo/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/opengl] Cannot open card "0": No such file or directory.
[vo/opengl] Failed to create KMS.
[vo/opengl] 'drm-egl' is deprecated, use 'drm' instead.
[vo/opengl] Can't handle VT release - signal already used
[vo/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/opengl] Cannot open card "0": No such file or directory.
[vo/opengl] Failed to create KMS.
[vo/opengl/x11] couldn't open the X11 display ()!
Error opening/initializing the selected video_out (--vo) device.
Video: no video
No video or audio streams selected.
Exiting... (Errors when loading file)
Maybe you have any suggestions for this problem or my initial ffplay problem. Thanks a lot and best regards
looks like you might need special build options for gles (though the bug only mentions intel)
you might also need libegl1-mesa-drivers in stage-packages since you do not have an X11 server or wayland compositor … alternatively you could install mir-kiosk alongside to get a wayland compositor/server to connect to and use the wayland-socket-dir and x11 plugs like in:
some more details are at:
and if you look for a completely quiet boot with splash screen there is:
EDIT: and i forgot to link the full tutorial (see step 12):
Sorry for the late reply. I was away for a while. Thanks for your support.
So I found out a few things but I am still having trouble:
I was using Ubuntu Core stable version which was the problem why I was not able to see anything on the screen. Seems that the edge version is required to get mir-kiosk and graphical snaps running.
I’ve installed mir-kiosk for wayland support and I can also see something on my screen when I try out mir-kiosk-apps
My mpv snap is here [1]
When executing the mpv snap “mpv-casept.mpv SampleVideo.mp4 --vo=wayland” I get the following message: [vo/wayland/wayland] failed to connect to a wayland server: check if a wayland compositor is running Error opening/initializing the selected video_out (--vo) device.
Executing the mpv snap with sudo gets me further and I see the first frame of the video on the screen. Afterwards no further frames are shown and in the logs the following is shown: [vo/wayland/wayland] can't draw, back buffer is busy
Some additional information:
I’ve tried to build mpv with the --enable-rpi flag but I am running into: You manually enabled the feature 'rpi', but the autodetection check failed. Failed to run './waf configure --enable-rpi' for 'mpv': Exited with code 1. Verify that the part is using the correct parameters and try again.
I am not sure if mir-kiosk actually allows apps that are not running as service (i assume you need write access to the socket, which likely is root owned), probably someone from the mir team can clearify this … @greyback@alan_g ?
There are no oddities with RPi graphics regarding “just running” GL/GLES stuff on mir, glamour works perfectly fine here …
there might be issues with HW acceleration though (specfically for video playback and decoding), and this might need some special work later. but the snap should still start and run fine (despite the possibility of it being a slideshow like experience) as long as everything is properly connected …
Thanks for your replies.
I checked on the permissions:
snap run --shell mpv-casept.mpv
getty23@localhost:/home/getty23$ ls -hl $XDG_RUNTIME_DIR
ls: cannot open directory '/var/snap/mpv-casept/x1/wayland': Permission denied
While with sudo I get:
sudo snap run --shell mpv-casept.mpv
root@localhost:/home/getty23# ls -hl $XDG_RUNTIME_DIR
total 4.0K
drwx------ 2 root root 4.0K Aug 2 04:22 pulse
srw-rw-rw- 1 root root 0 Aug 7 05:09 wayland-0
-rw-r----- 1 root root 0 Aug 6 04:50 wayland-0.lock
Regarding the graphics I am also puzzled because even if hw acceleration is not yet working it should play the video slow but I just see the first frame and afterwards for each frame in the log it is printed: [vo/wayland/wayland] can't draw, back buffer is busy. The frames are not dropped but just this message is shown.
Hey,
you will need to run the snap as root, to get access to the directory containing the wayland socket - I’m refactoring the snap interface design to make this problem go away.
It looks like MPV is getting a wayland connection when you run as root, but something is wrong when swapping frames. Could be a Mir/wayland issue.
Trying mpv with Mir on stock Xenial is crashing for me, need to figure that out first. Why it isn’t crashing for you is a curiosity for me!
-G
Thanks for the support. Let me know if I can support in this issue.
Currently I am trying to integrate mmal, libEGL and libGLESv2 in my snap directly from the raspberry firmware (as described here https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=199775 in step12) because mmal is needed if I build ffmpeg with --enable-mmal and I think the EGL and GLESv2 libraries will help mvp. Though I am having trouble how to integrate it in my snap:
using the part should put the libs into $SNAP/opt/vc … note that layouts are still an experimental feature (i.e. it will cause a manual review in the store and you need to explicitly enable it on your core image) in case you want to use the fancy layouts re-mapping i use above … but perhaps it helps to just add $SNAP/opt/vc/lib to LD_LIBRARY_PATH in a wrapper of your app.
I build the ffmpeg part after vclibs, I have the layout included (though I am not sure if it applies to the build process already) and I tried multiple things to set additional paths for the ffmpeg part. For example
Maybe you have a hint for me how to make the libs for mmal available for the ffmpeg build. Sorry for asking so many questions but I am still learning on snap ;). Thanks for your great support!
i think the vc libs will actually only help at runtime mmal.h should actually be shipped with the kernel headers, try adding linux-headers-raspi2 to your build-packages …
for openmax support (i.e. if you also want to set --enable-omx-rpi, you also want libomxil-bellagio-dev in build-packages)