Bug 282300 - multimedia/mpv
Summary: multimedia/mpv
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-x11 (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-24 09:27 UTC by hbsd
Modified: 2024-10-26 21:56 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (multimedia)


Attachments
mpv --log-file=output.txt <file.mp4> (33.72 KB, text/plain)
2024-10-24 11:03 UTC, hbsd
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description hbsd 2024-10-24 09:27:08 UTC
Hi, after updating and upgrading, mpv stopped working. My OS is FreeBSD 13.3-RELEASE-p3 GENERIC amd64, and the mpv version is 0.39.0. Thanks.
Comment 1 Christos Margiolis freebsd_committer freebsd_triage 2024-10-24 10:46:15 UTC
Could you provide some information regarding the issue? Is there any error message from mpv? Did you change anything in your sound setup? Was it caused by updating mpv, or FreeBSD?
Comment 2 hbsd 2024-10-24 10:52:14 UTC
(In reply to Christos Margiolis from comment #1)
Here's a corrected version of your response:

---

It happened after updating mpv. I never had any issues with mpv before, but now it won't open anymore. For now, I'm using an alternative player. Below are some errors/warnings from mpv when running it via the command line. I used the CLI version to capture and show you the errors:

libEGL warning: DRI2: failed to authenticate
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen
[vo/gpu/opengl] Suspected software renderer or indirect context.
[vo/gpu/drm] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/drm] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/gpu/drm] Listing DRM devices with drmGetDevices failed! (No such file or directory)
[vo/gpu/drm] Failed to find a usable DRM primary node!
[vo/gpu/libplacebo] Found no suitable device, giving up.
[vo/gpu/libplacebo] Failed initializing vulkan device
XIO:  fatal IO error 9 (Bad file descriptor) on X server ":0"
      after 79 requests (52 known processed) with 0 events remaining.

Thanks.
Comment 3 Christos Margiolis freebsd_committer freebsd_triage 2024-10-24 10:57:47 UTC
I think it's better to run your command as shown below, and attach the log file here:

mpv --log-file=output.txt <file>
Comment 4 hbsd 2024-10-24 11:03:40 UTC
Created attachment 254481 [details]
mpv --log-file=output.txt <file.mp4>

I attached output.txt file from one of my videos.
Comment 5 Christos Margiolis freebsd_committer freebsd_triage 2024-10-24 11:10:35 UTC
Right, I am not really an expert on mpv, but I suspect these errors point to some problem with your drm_kmod. Perhaps it got updated as well. Can you try rolling back to a previous drm_kmod version you were using and test if the issue goes away?
Comment 6 hbsd 2024-10-24 11:45:44 UTC
(In reply to Christos Margiolis from comment #5)
I don't know how to roll back, and rolling back to an older version might ruin other packages.
Comment 7 Christos Margiolis freebsd_committer freebsd_triage 2024-10-24 11:49:20 UTC
IIRC you can roll back like this:

# pkg add /var/cache/pkg/foo

I would suggest you try so that we can narrow down the possible scenarios.
Comment 8 hbsd 2024-10-24 15:48:50 UTC
(In reply to Christos Margiolis from comment #7)
Unfortunately, there's no drm_kmod package in /var/cache/pkg/.
Comment 9 Sergiy 2024-10-24 20:18:50 UTC
(In reply to hbsd from comment #8)
I got the same problem after updating mpv (FreeBSD 13.3-RELEASE-p7):

mpv: 0.38.0_1,1 -> 0.39.0,1

But I use the xf86-video-nv driver (my hardware is old), so for me I use the following:

$ mpv --vo=x11 video.mp4

This works for me... I understand this may not be the solution for you.
Comment 10 Jan Beich freebsd_committer freebsd_triage 2024-10-24 22:34:37 UTC
(In reply to hbsd from comment #2)
> libEGL warning: DRI2: failed to authenticate

Did you VT switch? It breaks DRM thus no GL/Vulkan accel until Xorg is restarted. See bug 271995.

AFAIK, mpv expects working DRM for many VOs except --vo=x11 and --vo=xv. CPU rendering via GL/Vulkan is *extremely* slow, so many apps reject it in favor of Xshm/wl_shm sometimes with skia/cairo/pixman. For example, mpv requires --gpu-sw flag to allow swrast (llvmpipe) with --vo=gpu or --vo=gpu-next.

(In reply to Sergiy from comment #9)
> But I use the xf86-video-nv driver (my hardware is old),

xf86-video-nv doesn't use drm-kmod but supports XVideo. mpv should default to --vo=xv. If it fails you need to report upstream after bisecting.
Comment 11 Sergiy 2024-10-25 11:31:41 UTC
(In reply to Jan Beich from comment #10)
> xf86-video-nv doesn't use drm-kmod but supports XVideo. mpv should default to
> --vo=xv. If it fails you need to report upstream after bisecting.
Thank you. 
For information, in my case --vo=xv works without playing video.
Example:

$ mpv --vo=xv test.mp4
● Video  --vid=1               (h264 1280x720 29.97 fps) [default]
● Audio  --aid=1  --alang=eng  (aac 2ch 44100 Hz 128 kbps) [default]
[vo/xv] No Xvideo support found.
Error opening/initializing the selected video_out (--vo) device.
Video: no video
AO: [oss] 44100Hz stereo 2ch s32
A: 00:01:23 / 00:01:23 (100%) 
Exiting... (End of file)

But:

$ mpv --vo=x11 test.mp4
● Video  --vid=1               (h264 1280x720 29.97 fps) [default]
● Audio  --aid=1  --alang=eng  (aac 2ch 44100 Hz 128 kbps) [default]
[vo/x11] Warning: this legacy VO has bad performance. Consider fixing your graphics drivers, or not forcing the x11 VO.
AO: [oss] 44100Hz stereo 2ch s32
VO: [x11] 1280x720 yuv420p
AV: 00:01:23 / 00:01:23 (100%) A-V:  0.000 Dropped: 800 
Exiting... (End of file)
Comment 12 Sergiy 2024-10-25 11:40:58 UTC
(In reply to Sergiy from comment #11)
Sorry, and defaults:

$ mpv test.mp4
● Video  --vid=1               (h264 1280x720 29.97 fps) [default]
● Audio  --aid=1  --alang=eng  (aac 2ch 44100 Hz 128 kbps) [default]
libEGL warning: DRI2: failed to authenticate
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen
[vo/gpu/opengl] Suspected software renderer or indirect context.
[vo/gpu/drm] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/drm] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/gpu/drm] Listing DRM devices with drmGetDevices failed! (No such file or directory)
[vo/gpu/drm] Failed to find a usable DRM primary node!
[vo/gpu/libplacebo] Found no suitable device, giving up.
[vo/gpu/libplacebo] Failed initializing vulkan device
XIO:  fatal IO error 9 (Bad file descriptor) on X server ":0.0"
      after 79 requests (52 known processed) with 0 events remaining.
Comment 13 hbsd 2024-10-26 21:56:44 UTC
(In reply to Sergiy from comment #9)
Thank you! This is works! mpv --vo=x11 video.mp4