Mpv on Pi4 crashes

Running testing on raspberry Pi4.
The last 2 updates of mpv (mpv-1:0.35.1-3-aarch64.pkg.tar.xz and mpv-1:0.35.1-4-aarch64.pkg.tar.xz) cause failure:

libEGL warning: DRI2: failed to authenticate
[vo/gpu/opengl] Suspected software renderer or indirect context.
[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory
Failed to create scanout resource
DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory
Failed to create scanout resource
[vo/gpu/opengl] Failed to lock GBM surface.
[vo/gpu] Failed initializing any suitable GPU context!
Error opening/initializing the selected video_out (--vo) device.
Video: no video

Exiting... (Errors when loading file)

unless

-vo=x11
is set in ~/.config/mpv/mpv.conf, which makes it choppy as cpu intensive, so not really usable.
I get the same issue on my Pi3+ running 32 bit Arch.

Also, maybe related, xfce4-screensaver configured to display .jpgs using slideshow causes xfce to stop responding to the mouse.

I do not have any issues with mpv and xfce. You did not post any configs or say what type of vo= you were trying to force if you were but mpv is pretty good about figuring things out on it’s own. Also I do know things change from time to time and mpv gets finicky where it would use to ignore a specified perimeter if it was not supported then things change where it would just error out.

[ray@jellyfin Season 3]$ mpv 'Star Trek Picard S03E06.mp4'
 (+) Video --vid=1 (*) (h264 1920x800 24.000fps)
 (+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1920x800 yuv420p
AV: 00:00:23 / 00:52:25 (1%) A-V:  0.000
1 Like

I don’t force any parameters such as -vo=, just found -vo=x11 works, while every other option fails.

I managed to get VLC working correctly by downgrading mesa to mesa-22.1.7-1.1-aarch64, so I have a video player.

The regressed mesa makes mpv additionally complain about llvm. Tried installing llvm, but same complaints.

dad@a:/mnt/Torrents/The.Simpsons.S33.WEBRip.x264-ION10 $ mpv The.Simpsons.S33E17.WEBRip.x264-ION10.mp4
 (+) Video --vid=1 (*) (h264 720x400 23.976fps)
 (+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
File tags:
 Comment: RARBG - The.Simpsons.S33E17.WEBRip.x264-ION10
 Title: RARBG - The.Simpsons.S33E17.WEBRip.x264-ION10
libEGL warning: DRI2: failed to authenticate
libEGL warning: MESA-LOADER: failed to open swrast: libLLVM-14.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri, suffix _dri)

[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
MESA-LOADER: failed to open vc4: libLLVM-14.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri, suffix _dri)
failed to load driver: vc4
MESA-LOADER: failed to open zink: libLLVM-14.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri, suffix _dri)
failed to load driver: zink
MESA-LOADER: failed to open kms_swrast: libLLVM-14.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri, suffix _dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: libLLVM-14.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri, suffix _dri)
failed to load swrast driver
[vo/gpu] Failed to create GBM device.
[vo/gpu] Failed to setup GBM.
[vo/gpu] Failed initializing any suitable GPU context!
Error opening/initializing the selected video_out (--vo) device.
Video: no video

Exiting... (Errors when loading file)

mpv pretty good, no issues.

I have not seen anyone else complaining about mpv here or on the arch forums. I use mpv/xfce here every day. Downgrading packages is generally not a good idea.

What is your /boot/config.txt on your pi4?

gpu_mem=512
cma=512
initramfs initramfs-linux.img followkernel
kernel=kernel8.img
arm_64bit=1
enable_gic=1
disable_overscan=1

#enable sound
dtparam=audio=on
#hdmi_force_hotplug=1
hdmi_drive=2
#framebuffer_width=1920
#framebuffer_height=1080

#dtparam=krnbt=on

#enable vc4
dtoverlay=vc4-kms-v3d-pi4
max_framebuffers=2

[pi4]
# Run as fast as firmware / board allows
arm_boost=1

I agree, I prefer to keep to the latest, but VLC has corrupted video output with recent mesa versions.

Try this. I removed gpu_mem=512 as the cma is used instead with V3D. Your cma=512 is moved to dtoverlay=vc4-kms-v3d,cma-512 (notice using the dash instead of the equal sign). The enable_gic=1 has been hard codeded in the code for a while now so removed it.

I removed the [pi4] header as I am assuming you are booting the pi4 only. If not then it needs to be put back but it is suggested that another header [all] should be the next line after arm_boost=1 line. There does not need to be an entry following the [all] header.

If your pi4 does not support arm_boost=1 it will be ignored so if you are not getting cpu speed of 1800 you can remove arm_boost=1 and put in arm_freq=1800 and get more speed. Personally here I use arm_freq=2000.

If you want to get back with the current testing branch do a sudo pacman -Syyuu

initramfs initramfs-linux.img followkernel
kernel=kernel8.img
arm_64bit=1
disable_overscan=1

#enable sound
dtparam=audio=on
#hdmi_force_hotplug=1
hdmi_drive=2
#framebuffer_width=1920
#framebuffer_height=1080

#dtparam=krnbt=on

#enable vc4
dtoverlay=vc4-kms-v3d,cma-512
max_framebuffers=2

# Run as fast as firmware / board allows
arm_boost=1

Thanks Darksky

mpv now works, although VLC has the video corruption back because of mesa.

I used to use

over_voltage=6
arm_freq=2100
gpu_freq=650
a while back, before I saw the arm_boost=1 come in.

Thanks again

1 Like

While mpv now plays OK, it always starts in, and will not leave full screen and when started by selecting mpv from the “open with” in thunar, does not respond to keyboard or mouse.
When starting from command line it does respond to keyboard actions, apart from toggling full screen, and complains:

dad@a:~ $ mpv --no-config /mnt/Backup/SavP/movie.mp4
 (+) Video --vid=1 (*) (h264 640x480 2.000fps)
libEGL warning: DRI2: failed to authenticate
[vo/gpu/opengl] Suspected software renderer or indirect context.
[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
VO: [gpu] 640x480 yuv420p
V: 00:00:07 / 00:03:23 (4%) Cache: 191s/5MB

Exiting... (Quit)

With config it additionally complains

dad@a:~ $ mpv /mnt/Backup/SavP/movie.mp4
Resuming playback. This behavior can be disabled with --no-resume-playback.
 (+) Video --vid=1 (*) (h264 640x480 2.000fps)
libEGL warning: DRI2: failed to authenticate
[vo/gpu/opengl] Suspected software renderer or indirect context.
[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/gpu] Disabling scaler #0 spline36 (GLSL version too old).
[vo/gpu] Disabling scaler #1 mitchell (GLSL version too old).
[vo/gpu] Disabling scaler #2 spline36 (GLSL version too old).
[vo/gpu] Disabling scaler #3 mitchell (GLSL version too old).
[vo/gpu] Disabling linear/sigmoid scaling (GLSL version too old).
[vo/gpu] Disabling debanding (GLSL version too old).
[vo/gpu] correct-downscaling requires non-bilinear scaler.
VO: [gpu] 640x480 yuv420p
V: 00:01:16 / 00:03:23 (38%) Cache: 122s/3MB
Saving state.

Exiting... (Quit)

The config files are standard apart from fs=no