Hello all, I am using NetBSD 9 on my laptop, I installed firefox
and mpv and i noticed that video is slow.

In youtube I noticed it slow particularly when I am in fullscreen.

Mpv reported the following messages when trying to reproduce a video: https://bsd.to/XS4S

My laptop has two video cards but I think NetBSD is only using the integrated
video card. I provide my dmesg output here: https://bsd.to/Aof2

Also my /proc/cpuinfo is this one: processor: https://bsd.to/uzjK

Can somebody help me understand what may be the cause of this?
Or how can I fix this?

I didn't touch any of the Xorg config stuff.

Hope you can help me, was really excited to use NetBSD on my driver laptop.

Thanks

  • pin replied to this.

    netbsdnoob Does it help if you install /multimedia/libvdpau?

    My bad, it should already be installed as a dependency of mpv

      pin Actually i found out that libvdpau was not installed....
      Anyway after installation, I retried with mpv and the situation is worse, now i have no video.

      Mpv gives me the following error messages:
      https://bsd.to/jMJp

      Any idea? what should I do? It seems like it is not finding the .so, but I am sure I installed libvdpau.

      What should I do?

      The kernel driver is active but Xorg is not using GPU acceleration at all. Please post output of glxinfo, cat /var/log/Xorg.0.log, ls -l /dev/dri. Is your user account a member of the wheel group?

        Actually, I think the problem wasn't what I expected. I think we've already fixed it for the next pkgsrc branch... The mpv package was mistakenly built without EGL support.

        Can you try -vo=sdl for mpv?

          nia The output of mpv can be found here: https://bsd.to/Dz6J

          The issue is the same, the video is extremely slow.

          Any other ideas on what could be the problem?
          I am lost.

          • rvp replied to this.

            netbsdnoob As you've introduced me to Vulfpeck, I'll try to help you.

            Download the video using youtube-dl, then play it locally using mpv. Press I. How many frames are dropped?

            Using my lowest CPU frequency, 800 MHz, playing Dean Town, I see 7 output frames dropped at the end of the video with vo=sdl, and 425 dropped output frames with vo=xv (the default), but, no noticeable slowdowns in either case.

              rvp Ok i am about to do this test, but in the meanwhile I wanted to share additional info when I tried
              to download a youtube video with youtube-dl and tried to play with vlc.

              VLC seems not able to work at all with the following errors:
              https://bsd.to/WKOt

              Are the issues related?
              P.S.: I am about to try your suggestion now.

              rvp I installed:

              • gst-plugins1-vaapi-1.16.2nb1
              • intel-vaapi-driver-2.4.0

              Then i rebooted, and tried with mpv --vo=vaapi video.mp4, now the video works, but i still get the warning
              from mpv that the VO is low quality and that vo=gpu should be the preferred option.

              Anyway after installing those packages vlc does not show any warnings about drivers, but still i am not able to play videos.

              nia Can you tell me how you verified if it was using GPU acceleration or not?
              Thanks

                nia Yes but I wanted to learn how to check if acceleration is enabled.
                @nia also it seems i have the same issue with vlc, it just hangs the system.

                At first it was complaning about missing driver "intel vaapi", then I installed it, and it still crashes.

                Any idea? Also how could i fix mpv to make it work?
                Should i recompile it with opengl support?
                Do you think that may help?

                netbsdnoob Can you tell me how you verified if it was using GPU acceleration or not?

                This is in the mpv man page. Type Ctrl-h. On FreeBSD, this will toggle HW video decoding--if possible: if your CPU is too old, then some video formats will not be decoded. That Coin Operated video is a good example. It's an AV1 video, and on my CPU, an Intel Core i3 IvyBridge mobile, the vo=sdl driver uses SW decoding (massive frame drops), and only uses OpenGL for rendering the frames. (Compare with the vo=x11 driver which uses SW for both: decoding and rendering.)

                Something is wrong on NetBSD though. Doesn't look like HW video decoding is available--no VAAPI/VDPAU (mpv + 9.99.82 + 2021Q1). And, the libva is also pretty old: 2.6, compared to 2.11 on FreeBSD.

                  rvp Yes thanks a lot for the info, I deep dived into video playing to really understand where my issue was.

                  It actually seems that my CPU is too old and requires playing videos using hardware decoding and vaapi as backend.
                  In this way the performances are acceptable anyway I cannot use --vo=gpu (after i compiled mpv with opengl support, since in the binaries mpv is compiled without opengl support) since it has massive frame drops and sometimes the video hangs.
                  Anyway thanks for the suggestions.

                  • rvp replied to this.

                    netbsdnoob It actually seems that my CPU is too old and requires playing videos using hardware decoding

                    Well, it depends on the library used too. For example, for AV1 videos, mpv on FreeBSD uses libdav1d whereas mpv on NetBSD uses libaom. My CPU doesn't decode AV1 streams, but, playback on FreeBSD is smooth (with about 90% CPU used); mpv on NetBSD uses about 250% of the CPU (400% = all 4 CPU threads) and playback is choppy with lots of frame drops.

                    • nia replied to this.
                    • Jay likes this.

                      rvp Have you tested ffmpeg built against dav1d on NetBSD?

                      • rvp replied to this.
                      • Jay likes this.

                        nia No...I'll have to compile the beast for that, I thnk.

                        • nia replied to this.