libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.34k stars 1.84k forks source link

[Pi4] Integrated video player only displays on screen garbage #13937

Open rtomasa opened 2 years ago

rtomasa commented 2 years ago

I'm wondering why the integrated video player never worked in any Pi model no matter the Linux video driver, retroarch video driver, etc. It only displays on screen garbage but the audio seem to work (with some pops).

Is something missing in the Linux libraries at compile time? can be fixed in anyway?

LibretroAdmin commented 2 years ago

Can you try seeing if you get any video output if you disable the hardware video decoder? It should be a core option in Quick Menu -> Options.

rtomasa commented 2 years ago

I think I've tested all combinations. I've tested right now with the following config and still only color noise is displayed:

[EDIT] BTW I'm testing in Lakka 4.2 64 bits but it happens in any other distro

rtomasa commented 2 years ago

Just to put some more info on this issue. This is what is displayed when trying to run a video:

./retroarch video.mp4 
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isom
  Duration: 00:00:29.38, start: 0.000000, bitrate: 2103 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 640x352, 1942 kb/s, 58.99 fps, 59.94 tbr, 60k tbn, 120k tbc (default)
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 157 kb/s (default)
[swscaler @ 0x7f84000b60] No accelerated colorspace conversion found from yuv420p to bgra.
[swscaler @ 0x7f80000b60] No accelerated colorspace conversion found from yuv420p to bgra.
[swscaler @ 0x7f84023fd0] No accelerated colorspace conversion found from yuv420p to bgra.
[swscaler @ 0x7f80023fd0] No accelerated colorspace conversion found from yuv420p to bgra.

Also do note that I'm able to play the same video file using the standalone ffplay_g

rtomasa commented 2 years ago

OK it seems that HW acceleration is broken. I get the following messages when forcing VAAPI:

[libretro INFO] [FFMPEG] Selected HW decoder vaapi.
[libretro INFO] [FFMPEG] Selected HW pixel format vaapi_vld.
[AVHWDeviceContext @ 0x55986dc480] libva: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[AVHWDeviceContext @ 0x55986dc480] Failed to initialise VAAPI connection: -1 (unknown libva error).
[libretro ERROR] [FFMPEG] Failed to create specified HW device: Input/output error
[libretro INFO] [FFMPEG] Using SW decoding.
YaYaLanD commented 1 year ago

bumping this issue, is there any progress on fixing ? regards

rtomasa commented 10 months ago

@LibretroAdmin Today I came back to this topic doing some testing, and I found out that the issue is because the Makefile is compiling against OpenGL instead OpenGL ES. When disabling OpenGL in compilation process via make OPENGL=0 the core is able to play video (I assume that this only prevents from using shaders and interpolation).

Also in the HW decoder option list there is not Video4Linux (V4L2) which AFAIK is the only supported API in FFmpeg compatible with Raspberry

Edit: I saw that HEVC HW decode should be done via DRM option which is available, but maybe it requires special https://github.com/jc-kynesim/rpi-ffmpeg