Why is VA-API missing in Smplayer under FreeBSD ?

smplayer performance.png

When I was using Linux I was able to select va-api & va-api copy from that list but these two options are missing under FreeBSD.
What's the reason ?
 
With that amount of info, I can only guess: no driver installed? (graphics/mesa-gallium-va)
I have found that package that you mentioned but I don't want to install it without confirmation. Under Linux I was using a system restore tool called Timeshift. I haven't yet figured out how to do that under FreeBSD. So I am worried if installing that package causes breakage which needs a reinstall of FreeBSD it will be a disaster. I have invested a lot of time configuring my install.

Is this info enough to be really sure ? If not please tell which command is required to get the needed info.
~
Code:
> pciconf -lv
hostb0@pci0:0:0:0:    class=0x060000 rev=0x07 hdr=0x00 vendor=0x8086 device=0x190f subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = 'Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers'
    class      = bridge
    subclass   = HOST-PCI
vgapci0@pci0:0:2:0:    class=0x030000 rev=0x06 hdr=0x00 vendor=0x8086 device=0x1912 subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = 'HD Graphics 530'
    class      = display
    subclass   = VGA
xhci0@pci0:0:20:0:    class=0x0c0330 rev=0x31 hdr=0x00 vendor=0x8086 device=0xa12f subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = '100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller'
    class      = serial bus
    subclass   = USB
none0@pci0:0:22:0:    class=0x078000 rev=0x31 hdr=0x00 vendor=0x8086 device=0xa13a subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = '100 Series/C230 Series Chipset Family MEI Controller'
    class      = simple comms
ahci0@pci0:0:23:0:    class=0x010601 rev=0x31 hdr=0x00 vendor=0x8086 device=0xa102 subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = 'Q170/Q150/B150/H170/H110/Z170/CM236 Chipset SATA Controller [AHCI Mode]'
    class      = mass storage
    subclass   = SATA
pcib1@pci0:0:28:0:    class=0x060400 rev=0xf1 hdr=0x01 vendor=0x8086 device=0xa114 subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = '100 Series/C230 Series Chipset Family PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib2@pci0:0:28:7:    class=0x060400 rev=0xf1 hdr=0x01 vendor=0x8086 device=0xa117 subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = '100 Series/C230 Series Chipset Family PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib3@pci0:0:29:0:    class=0x060400 rev=0xf1 hdr=0x01 vendor=0x8086 device=0xa118 subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = '100 Series/C230 Series Chipset Family PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
isab0@pci0:0:31:0:    class=0x060100 rev=0x31 hdr=0x00 vendor=0x8086 device=0xa143 subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = 'H110 Chipset LPC/eSPI Controller'
    class      = bridge
    subclass   = PCI-ISA
none1@pci0:0:31:2:    class=0x058000 rev=0x31 hdr=0x00 vendor=0x8086 device=0xa121 subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = '100 Series/C230 Series Chipset Family Power Management Controller'
    class      = memory
hdac0@pci0:0:31:3:    class=0x040300 rev=0x31 hdr=0x00 vendor=0x8086 device=0xa170 subvendor=0x1043 subdevice=0x86c7
    vendor     = 'Intel Corporation'
    device     = '100 Series/C230 Series Chipset Family HD Audio Controller'
    class      = multimedia
    subclass   = HDA
ichsmb0@pci0:0:31:4:    class=0x0c0500 rev=0x31 hdr=0x00 vendor=0x8086 device=0xa123 subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = '100 Series/C230 Series Chipset Family SMBus'
    class      = serial bus
    subclass   = SMBus
re0@pci0:2:0:0:    class=0x020000 rev=0x15 hdr=0x00 vendor=0x10ec device=0x8168 subvendor=0x1043 subdevice=0x8677
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller'
    class      = network
    subclass   = ethernet

That driver is available as a binary package

Code:
~> pkg search mesa-gallium-va
mesa-gallium-va-21.1.8         Mesa Gallium VAAPI drivers
 
From your pciconf output, I see you have an intel GPU. There are several va-api drivers for those in ports, I assume the correct one would be multimedia/libva-intel-media-driver
Many years ago I had used PC-BSD which as you no was based on FreeBSD. I remember I had this same issue so I had written in their forum. A dev replied saying that Smplayer was not compiled with vdpau support. I was using a Nvidia GPU back then. He asked me to wait for a few days while he compiles Smplayer with vdpau support & he asked me to update my system after a week which will include the Smplayer package which was compiled with vdpau support. After 5-6 days I received an update for Smplayer & I was able to enable vdpau.

So my point is are you sure we have taken the right approach in solving this issue ? I mean maybe the Smplayer package that is in the FreeBSD repos is not compiled with va-api support ?
 
I mean maybe the Smplayer package that is in the FreeBSD repos is not compiled with va-api support ?
You can see the compile options on the Freshports page for SMPlayer.
Code:
===> The following configuration options are available for smplayer-21.1.0_1:
     DEBUG=off: Build with debugging support
     DOCS=on: Build and/or install documentation
     SKINS=on: Install additional skins
     THEMES=on: Install additional themes
====> Multimedia engine: you have to choose at least one of them
     MPLAYER=off: Allow to use MPlayer as multimedia engine
     MPV=on: Allow to use mpv as multimedia engine
===> Use 'make config' to modify these settings
 
... where multimedia/mpv has optional support for VAAPI.
... which is enabled by default.

So john_rambo if you didn't fiddle with port options yourself, then yes, identifying which driver you are missing is the correct way to solve this.

In a nutshell, make sure you have libva and libva-glx installed and then install the correct driver for your card. There are several options for intel GPUs, I think the one I mentioned above is the correct one for you, but if it doesn't work, try the others as well.
 
... which is enabled by default.

So john_rambo if you didn't fiddle with port options yourself, then yes, identifying which driver you are missing is the correct way to solve this.

In a nutshell, make sure you have libva and libva-glx installed and then install the correct driver for your card. There are several options for intel GPUs, I think the one I mentioned above is the correct one for you, but if it doesn't work, try the others as well.
Installed libva-intel-media-driver & rebooted but didn't work. Before I install other drivers I want to know something. Since these are all drivers am I not suppose to reboot after each driver install ? Or at least log out & log back in ?
 
These are not kernel drivers, just libraries dynamically loaded, so no. But you should restart your video player of course. I also can't guarantee you there's nothing else wrong with either mpv or smplayer right now, so maybe the driver isn't found. If no driver seems to work, I'd first try to use mpv directly from the commandline enabling vaapi to see whether this works.

edit: the best way to test is to install multimedia/libva-utils and first check with vainfo. Here, it looks like this:
Code:
$ vainfo
libva info: VA-API version 1.13.0
libva info: Trying to open /usr/local/lib/dri/r600_drv_video.so
libva info: Found init function __vaDriverInit_1_13
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: Mesa Gallium driver 21.1.8 for AMD SUMO (DRM 2.50.0 / 13.0-RELEASE-p4, LLVM 12.0.1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileNone                   :    VAEntrypointVideoProc

Only once this finds a working driver, start experimenting with your video player again.
 
the best way to test is to install multimedia/libva-utils and first check with vainfo. Here, it looks like this:


Only once this finds a working driver, start experimenting with your video player again.
This is my output

Code:
~> vainfo
libva info: VA-API version 1.13.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_13
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.3.5 (intel-media-21.3.5)
vainfo: Supported profile and entrypoints
      VAProfileNone                   :    VAEntrypointVideoProc
      VAProfileNone                   :    VAEntrypointStats
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Simple            :    VAEntrypointEncSlice
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointEncSlice
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointEncSlice
      VAProfileH264Main               :    VAEntrypointFEI
      VAProfileH264Main               :    VAEntrypointEncSliceLP
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointEncSlice
      VAProfileH264High               :    VAEntrypointFEI
      VAProfileH264High               :    VAEntrypointEncSliceLP
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:    VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :    VAEntrypointVLD
      VAProfileHEVCMain               :    VAEntrypointVLD
      VAProfileHEVCMain               :    VAEntrypointEncSlice
      VAProfileHEVCMain               :    VAEntrypointFEI
 
That's great, so it is the correct driver after all. Then, the next step would be: try to play a video using va-api with mpv (without using the GUI frontend).
 
That's great, so it is the correct driver after all. Then, the next step would be: try to play a video using va-api with mpv (without using the GUI frontend).
Code:
~> mpv --vo=vaapi video.mkv
 (+) Video --vid=1 (*) (h264 640x480 25.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
[vo/vaapi] OSD format not supported. Disabling OSD.
[vo/vaapi] Warning: this compatibility VO is low quality and may have issues with OSD, scaling, screenshots and more.
[vo/vaapi] vo=gpu is the preferred choice in any case and includes VA-API support via hwdec=vaapi or vaapi-copy.
AO: [oss] 48000Hz stereo 2ch s32
VO: [vaapi] 640x480 yuv420p
AV: 00:00:46 / 00:04:17 (18%) A-V:  0.000

Exiting... (Quit)
 
So, use this?

But, did your video play correctly with vaapi?
Yes, it played properly with the --vo=vaapi option. All videos including Full HD & even 4K videos are playing properly even without vaapi but I am worried that this may put excess load on the CPU which may shorten its lifespan.

Code:
~> mpv --vo=gpu video.mkv
 (+) Video --vid=1 (*) (h264 640x480 25.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
AO: [oss] 48000Hz stereo 2ch s32
VO: [gpu] 640x480 yuv420p
AV: 00:00:10 / 00:04:17 (4%) A-V: -0.000

Exiting... (Quit)

This is the output using --vo=gpu. As usual the video playback was flawless.
Now the question is how do I configure the Smplayer frontend to use VA-API ? Using mpv directly without Smplayer is quite troublesome.
 
I assume mpv offers a config file? Then maybe just configure vo=gpu and hwdec=vaapi there and use the "Auto" option in the frontend?
 
I assume mpv offers a config file? Then maybe just configure vo=gpu and hwdec=vaapi there and use the "Auto" option in the frontend?
There is a folder named mpv inside the hidden .config which is in the home folder but that mpv folder is empty.
I just selected the auto option in the Smplayer's settings & played that video. Then I checked the mpv logs by going to View>>mpv logs. The log is a bit long. This is the important part

Code:
(+) Video --vid=1 (*) (h264 640x480 25.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
[ffmpeg] AVHWDeviceContext: Failed to query surface attributes: 20 (the requested function is not implemented).
[vo/gpu/vaapi-egl] failed to retrieve libavutil frame constraints
Using hardware decoding (vaapi).
AO: [oss] 48000Hz stereo 2ch s32
VO: [gpu] 640x480 vaapi[nv12]

So I guess the auto option actually works as it selected va-api. I really don't understand what's point in removing the
va-api & vdpau options which are self explanatory & easy to spot. People who know that VA-API is for Intel & VDPAU is for Nvidia will select them as per hardware & non tech users will choose AUTO. We did all this for a problem which doesn't exist.
 
I think this problem might have existed, as without the correct vaapi driver installed, it wouldn't have worked. But then, I guess using it when it is there isn't the worst default for something labeled "Auto" ;)
 
If you run pkg info multimedia/smplayer, it will tell you whether your installation has VA-API support compiled into SMPlayer. Just installing the VA-API from packages is not going to help if SMPlayer is compiled without support for it.

This is why I go for ports, rather than packages - I can make sure that VA-API support is actually available and compiled for SMPlayer.
 
If you run pkg info multimedia/smplayer, it will tell you whether your installation has VA-API support compiled into SMPlayer.
smplayer is just a GUI frontend for either mpv or mplayer, so it doesn't have any VA-API support itself. It defaults to mpv, and mpv has VA-API support enabled by default.
 
If you run pkg info multimedia/smplayer, it will tell you whether your installation has VA-API support compiled into SMPlayer. Just installing the VA-API from packages is not going to help if SMPlayer is compiled without support for it.

This is why I go for ports, rather than packages - I can make sure that VA-API support is actually available and compiled for SMPlayer.
Many years ago I tried using PC-BSD which honestly I didn't like so I went back to Linux. Under PC-BSD I tried to install mplayer from ports. Back then I was using my old desktop which went bad some years later. The experience of compiling was just terrible for me. It took hours to compile mplayer. Since then I never tried to compile anything which is why I never even bothered to install Gentoo despite being a distrohopper. One more thing which I am not sure about the ports system. I check for updates everyday & install them as soon as they are offered. If I install an app from the ports how do I update it ? Also is the update process means another waiting for hours ?
smplayer is just a GUI frontend for either mpv or mplayer, so it doesn't have any VA-API support itself. It defaults to mpv, and mpv has VA-API support enabled by default.
Yes, I used the pkg info command but couldn't find the mention of the for VA-API anywhere but since I already know that its working it wasn't a cause for worry.
 
Back
Top