bootlin / libva-v4l2-request

LibVA implementation for the Linux Video4Linux2 Request API
Other
77 stars 60 forks source link

Compilation under debian #15

Closed villalvilla closed 5 years ago

villalvilla commented 5 years ago

Hi,

I don't know exactly were to post this indications to compile your drivers under debian, but I finally managed to do it. It is a little bit tricky and won't be possible if you don't patch file src/video.c and replace #include with #include <drm/drm_fourcc.h> (in any other way it will include local drm_fourcc.h header and won't find DRM_FORMAT_MOD_ALLWINNER_MB32_TILED declaration). Should this be patched it your code?

On top of everything, debian won't compile if you don't use this configuration with autogen.sh:

./autogen.sh --enable-tools=yes --prefix=/usr/local CFLAGS="-I/usr/src/linux-headers-4.18.0-uname -r/include/uapi/ -I/usr/src/linux-headers-uname -r/include/"

Thanks for your help

villalvilla commented 5 years ago

Hi,

After testing your demos, I allways get the same results: va_openDriver() returns 1

If I run vlc, previously configured with your indications: Tools > Preferences > Input / Codecs > Codecs > Hardware-accelerated decoding > VA-API video decoder Tools > Preferences > Video > Display > Output > X11 video output (XCB)

and exports: export LIBVA_DRIVER_NAME=v4l2_request

I get this output from vlc:

libEGL warning: DRI2: failed to authenticate
libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libEGL warning: DRI2: failed to authenticate
libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
[afe11748] xcb_x11 vout display error: shared memory allocation error: Function not implemented
[005b3748] main video output error: video output creation failed
[af2121d8] main decoder error: failed to create video output
[mpeg2video @ 0x530d90] get_buffer() failed
[mpeg2video @ 0x530d90] thread_get_buffer() failed
[mpeg2video @ 0x530d90] get_buffer() failed (-1 (nil))

I also installed vainfo, and vainfo drops this output:

libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns -1
libva info: User requested driver 'v4l2_request'
libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri//v4l2_request_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva error: /usr/lib/arm-linux-gnueabihf/dri//v4l2_request_drv_video.so init failed
libva info: va_openDriver() returns 1
vaInitialize failed with error code 1 (operation failed),exit

It seems to be everything ok, but driver is not working. Following some suggestions from old issues, I upgraded some packages to debian buster distro for supporting VA-API 1.x instead of 0.3.X, that is the one supported in debian stretch. Maybe something is wrong there?

I'm totally lost at this point and don't know how to test if kernel parts of the driver are loaded or not. It would be helpful if you clarify how to do it, because maybe I had some compilation errors in the kernel.

Thanks

paulkocialkowski commented 5 years ago

Should be fixed now, feel free to retry with the release-2019.03 tag!

villalvilla commented 5 years ago

Thanks for your great help, Paul. Just to clarify, because after taking a look at your release-2019.03 patch now slice_params.forward_ref_index and slice_params.backward_ref_index disappeared and they are only declared in your kernel version linux-cedrus/tree/cedrus/4.18, Which kernel branch should I use from https://github.com/bootlin/linux-cedrus? linux-cedrus/tree/cedrus/4.18 or I can pick up the one with the tag release-2019.03 that you posted yesterday?

Thanks for clarifying and your great support on this, Miguel

Dreyk007 commented 5 years ago

@villalvilla , hi! In the end, did you manage to start VLC with the v4l2_request? If so, how did you to achieve this? Now i have same error as you, even with release-2019.03 ...

agajjar-os commented 3 years ago

@Dreyk007 @villalvilla

I am facing the below error, what am I missing here?

root@# vainfo
libva info: VA-API version 1.1.0 libva info: va_getDriverName() returns 0 libva info: User requested driver 'v4l2_request' libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so libva error: /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so has no function __vaDriverInit_1_0 libva info: va_openDriver() returns -1 vaInitialize failed with error code -1 (unknown libva error),exit

sukrugorgulu commented 2 years ago

@Dreyk007 @villalvilla

I am facing the below error, what am I missing here?

root@# vainfo libva info: VA-API version 1.1.0 libva info: va_getDriverName() returns 0 libva info: User requested driver 'v4l2_request' libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so libva error: /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so has no function __vaDriverInit_1_0 libva info: va_openDriver() returns -1 vaInitialize failed with error code -1 (unknown libva error),exit

Hello, I'm facing the same problem with kernel 5.10 cedrus enabled in openwrt on orange pi pc. Can you guide us on what to do to fix this issue? I think, I can not make libva properly be installed.

villalvilla commented 2 years ago

Hi Sukru,

I had never managed to get this working, and we finally changed to another SoC. Now we have some bananapis A20 still working, but we never managed to upgrade them to mainline kernel with cedrus.

We are no working with Rock Pi 4 model A.

Thanks,

Política de Privacidad http://www.acervantes.com/privacidad.html

El vie, 18 mar 2022 a las 13:37, Sukru @.***>) escribió:

@Dreyk007 https://github.com/Dreyk007 @villalvilla https://github.com/villalvilla

I am facing the below error, what am I missing here?

root@# vainfo libva info: VA-API version 1.1.0 libva info: va_getDriverName() returns 0 libva info: User requested driver 'v4l2_request' libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so libva error: /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so has no function __vaDriverInit_1_0 libva info: va_openDriver() returns -1 vaInitialize failed with error code -1 (unknown libva error),exit

Hello, I'm facing the same problem with kernel 5.10 cedrus enabled in openwrt on orange pi pc. Can you guide us on what to do to fix this issue? I think, I can not make libva properly be installed.

— Reply to this email directly, view it on GitHub https://github.com/bootlin/libva-v4l2-request/issues/15#issuecomment-1072370583, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA54ZFHF5XDRMM3RBA3FSO3VAR2HBANCNFSM4G4BVBLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

sukrugorgulu commented 2 years ago

Hi Sukru, I had never managed to get this working, and we finally changed to another SoC. Now we have some bananapis A20 still working, but we never managed to upgrade them to mainline kernel with cedrus. We are no working with Rock Pi 4 model A. Thanks

Okay, thank you for the reply. I think the Makefiles used for cross compiling should be modified. Because the .so files are generated on the laptop host side, however they are not transferred to the target package. I work on adding the Makefile scripts to guarantee the transfer.