Bug #4679
Build broken with libva 2.0.0
100%
Description
Building tvheadend with newly released libva 2.0.0 is broken:
src/libav.c: In function 'libav_vaapi_init': src/libav.c:265:3: error: too few arguments to function 'vaSetErrorCallback' vaSetErrorCallback(libav_va_error_callback); ^~~~~~~~~~~~~~~~~~ In file included from src/libav.c:4:0: /home/bernd/buildroot/output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/va/va.h:270:19: note: declared here VAMessageCallback vaSetErrorCallback(VADisplay dpy, VAMessageCallback callback, void *user_context); ^~~~~~~~~~~~~~~~~~ src/libav.c:266:3: error: too few arguments to function 'vaSetInfoCallback' vaSetInfoCallback(libav_va_info_callback); ^~~~~~~~~~~~~~~~~ In file included from src/libav.c:4:0: /home/bernd/buildroot/output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/va/va.h:276:19: note: declared here VAMessageCallback vaSetInfoCallback(VADisplay dpy, VAMessageCallback callback, void *user_context); ^~~~~~~~~~~~~~~~~
A similar problem was fixed in mpv: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879057
Files
Subtasks
History
Updated by Remi Os about 7 years ago
b kuhls wrote:
Building tvheadend with newly released libva 2.0.0 is broken:
Same problem, ffmpeg builds fine, but tvheadend build failed
I tried building using this :
AUTOBUILD_CONFIGURE_EXTRA="--enable-ffmpeg_static --enable-libffmpeg_static --enable-libx264 --enable-libx265 --enable-vaapi --enable-libfdkaac --extra-libs=-lpthread" ./Autobuild.sh -t precise-amd64
Updated by Michael Marley almost 7 years ago
- File 0004-libva-2.patch 0004-libva-2.patch added
Based on the MPV patch, I made this patch which allows TVHeadend to compile with libva 1 or libva 2. I'm not entirely sure I did it right though, which is why I am posting it here instead of opening a PR.
Because the new API requires that a VADisplay struct be passed to the error/info callbacks, I had to move the code that sets up those callbacks.
Updated by Jaroslav Kysela almost 7 years ago
- Status changed from New to Fixed
Applied in changeset commit:tvheadend|ebabde707086cb5e6f061420aad775b05976c747.
Updated by Jaroslav Kysela almost 7 years ago
Thanks Michael, I reshuffled your code a bit (I'd like to keep the logging interface for both ffmpeg libs and vaapi libs in src/libva.c - perhaps, we can reuse it in future for another component).
Updated by Remi Os almost 7 years ago
Jaroslav Kysela wrote:
Thanks Michael, I reshuffled your code a bit (I'd like to keep the logging interface for both ffmpeg libs and vaapi libs in src/libva.c - perhaps, we can reuse it in future for another component).
Thanks, but unfortunately the same error appears ...
Am i doing someting wrong ?
I tried the building the lastest .. using: "git clone https://github.com/tvheadend/tvheadend.git"
Versions on my system
root@UbuntuServer:~# vainfo
libva info: VA-API version 1.0.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.0 (libva 2.0.1.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) CherryView - 2.0.1.pre1 (2.0.0-6-g4997665)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
Updated by Michael Marley almost 7 years ago
That appears to be because the patch Jaroslav Kysela applied (https://github.com/tvheadend/tvheadend/commit/ebabde707086cb5e6f061420aad775b05976c747) adds a new libva2-specific logging initializer function (https://github.com/tvheadend/tvheadend/blob/ebabde707086cb5e6f061420aad775b05976c747/src/libav.c#L283) but doesn't #if out the old one (https://github.com/tvheadend/tvheadend/blob/ebabde707086cb5e6f061420aad775b05976c747/src/libav.c#L269) in the case of libva1, so the compilation failure still occurs.
Updated by Jaroslav Kysela almost 7 years ago
Yep, one #if is missing: try v4.3-623-g86d2fdf6a ...
Updated by Remi Os almost 7 years ago
Jaroslav Kysela wrote:
Yep, one #if is missing: try v4.3-623-g86d2fdf6a ...
Thanks !
This fixed the libva problem !
First i got an error:
/usr/bin/ld: /usr/local/lib/libfdk-aac.a(aacenc_lib.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfdk-aac.a: error adding symbols: Bad value
But removed the "--enable-libfdkaac" option and now it builds fine
However after installing i can't see any h264_vaapi or h264_vaapi profiles ..
Trying some other build options now
Updated by Remi Os almost 7 years ago
Had to remove some old packages first
now it works great