nikhiljha / pp-fedora-sdsetup

PinePhone Fedora Image Generation Script
GNU General Public License v3.0
107 stars 21 forks source link

enable Allwinner HW acceleration support #103

Open Cyborgscode opened 3 years ago

Cyborgscode commented 3 years ago

We need: libva-v4l2-request on the image, it's already compiled and packaged in fedora, so no big deal.

Changes in Desktopfiles are needed, as we can't overwrite them, we need wrapper-packages like "firefox-wayland" for wayland versions of firefox options.

TEST:

"LIBVA_DRIVER_NAME=v4l2_request LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video0 LIBVA_V4L2_REQUEST_MEDIA_PATH=/dev/media0 vainfo " gives:

libva info: VA-API version 1.10.0 libva info: User environment variable requested driver 'v4l2_request' libva info: Trying to open /usr/lib64/dri/v4l2_request_drv_video.so libva info: Found init function __vaDriverInit_1_8 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.10 (libva 2.10.0) vainfo: Driver version: v4l2-request vainfo: Supported profile and entrypoints

MPV:

TESTED && WORKS

change in desktopfile is enough

Exec=env LIBVA_DRIVER_NAME=v4l2_request LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video0 LIBVA_V4L2_REQUEST_MEDIA_PATH=/dev/media0 mpv --osd-duration=3000 --fs --hwdec=vaapi-copy --vo=gpu,drm --player-operation-mode=pseudo-gui -- %U

Firefox: untested yet.

change in desktopfile:

Exec=env LIBVA_DRIVER_NAME=v4l2_request LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video0 LIBVA_V4L2_REQUEST_MEDIA_PATH=/dev/media0 MOZ_ENABLE_WAYLAND=1 firefox %u Exec=env LIBVA_DRIVER_NAME=v4l2_request LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video0 LIBVA_V4L2_REQUEST_MEDIA_PATH=/dev/media0 MOZ_ENABLE_WAYLAND=1 firefox --new-window %u Exec=env LIBVA_DRIVER_NAME=v4l2_request LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video0 LIBVA_V4L2_REQUEST_MEDIA_PATH=/dev/media0 MOZ_ENABLE_WAYLAND=1 firefox --private-window %u Exec=env LIBVA_DRIVER_NAME=v4l2_request LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video0 LIBVA_V4L2_REQUEST_MEDIA_PATH=/dev/media0 MOZ_ENABLE_WAYLAND=1 firefox --ProfileManager

Also we need to change the default prefs.js

widget.wayland-dmabuf-vaapi.enabled in about:config.

PROBLEM: no such option in firefox or firefox-wayland

M. Stransky was informed, answere incoming

and the following packages:

ffmpeg libva libva-utils

ATM... FF NOT WORKING

CHROMIUM: FF NOT WORKING change in desktopfile:

Exec=env LIBVA_DRIVER_NAME=v4l2_request LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video0 LIBVA_V4L2_REQUEST_MEDIA_PATH=/dev/media0 /usr/bin/chromium-browser %U

it showed a better performance on WEBRTC than before, but had problem rendering incoming streams.

ATM... UNCERTAIN if it really works

Cyborgscode commented 3 years ago

Update:

firefox still searches for gpus on the pci bus, not on a phone-soc. As long as mozilla devs do not change this, firefox won't be able to use hw acceleration for decoding. ( not to speak of hw acceleration for encoding)