I installed Debian 12, but VLC cannot use hardware acceleration on my 11th Gen Intel core i3. Looking up the issue it appears that some VAAPI is disabled when using VLC 3.x and ffmpeg 5, which makes my computer unusable for media.
is there a media player in Debian 12 that can use the hardware acceleration on intel processors?
Is there some workaround to the issue? The only answer I could find is that it would be fixed when VLC developers issue a newer version.
EDIT: Installing the latest snap of VLC 4.0 doesnât seem to fix the issue
You can try using MPV from the terminal and switching the decoder manually:
If a suitible hardware decoder is available, you can toggle between software & hardware decoding using Ctrl+H.
You can then create a configuration file in ./config/mpv/mpv.conf with your desired parameters (ie: hwdec=auto-safe to enable GPU acceleration if available).
On Debian 11, I had to manually install the VAAPI drivers from Intel.
Run your VLC player > click âToolsâ / âPreferencesâ
goto âInput/Codecsâ >
find âHardware accelerated decodingâ under Codecs.
Change the default âDisableâ to âAutomaticâ
hit âSaveâ button. And thatâs it!
that should be it.
check your gpu driver isnt set to nouveau driver
lspci | grep -i vga
should spit out something like
07:00.0 VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1)
lspci -s 07:00.0 -v
if what you get looks likeâŚ
07:00.0 VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1) (prog-if 00 [VGA controller])
Subsystem: Gigabyte Technology Co., Ltd GP106 [GeForce GTX 1060 6GB]
Flags: bus master, fast devsel, latency 0, IRQ 100
Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
Memory at f0000000 (64-bit, prefetchable) [size=32M]
I/O ports at e000 [size=128]
Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities:
Kernel driver in use: nouveau â should be nvidia
Kernel modules: nouveau <â should be nvidia
your driver is not running and you will need to sort that to get hardware acceleration working.
asuiming you have an nvidia gpuâŚ
if your using an igpu⌠then you do the same thing but your igpu should show up where nouveau is listed above.
I went on to install all vaapi drivers I could find. I enabled non-free and non-free-firmware.
I settled on the intel-media-va-driver-non-free because itâs non-free and I assumed most compatible. I also installed vainfo
It doesnât work. No VAAPI option is shown within VLCâs âTools â Preferences â Input / Codecsâ Menu (Only âAutomaitcâ, âVPDAU video decoderâ and âDisableâ
I launched vlc from the command line, then opened a sample HEVC .mp4 file. Output is as follows:
VLC media player 3.0.18 Vetinari (revision 3.0.13-8-g41878ff4f2)
[0000563b55cea550] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0000563b55d8c940] main playlist: playlist is empty
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu
[00007f2f1c004960] gl gl: Initialized libplacebo v4.208.0 (API v208)
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[00007f2f1c004960] gl gl: Initialized libplacebo v4.208.0 (API v208)
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[00007f2f30c18930] avcodec decoder: Using OpenGL/VAAPI backend for VDPAU for hardware decoding
[hevc @ 0x7f2f30cf0400] Failed setup for format vdpau: hwaccel initialisation returned error.
[00007f2f30c18930] avcodec decoder error: existing hardware acceleration cannot be reused
[00007f2f1c004960] gl gl: Initialized libplacebo v4.208.0 (API v208)
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[00007f2f1c004960] gl gl: Initialized libplacebo v4.208.0 (API v208)
[hevc @ 0x7f2f30f56a80] Could not find ref with POC 23
[hevc @ 0x7f2f31018f80] Could not find ref with POC 25
[hevc @ 0x7f2f30cf0400] Could not find ref with POC 27
[hevc @ 0x7f2f30dd2000] Could not find ref with POC 29
[hevc @ 0x7f2f30e945c0] Could not find ref with POC 31
[hevc @ 0x7f2f30f56a80] Could not find ref with POC 33
[hevc @ 0x7f2f31018f80] Could not find ref with POC 35
[hevc @ 0x7f2f30cf0400] Could not find ref with POC 37
[hevc @ 0x7f2f30dd2000] Could not find ref with POC 39
[hevc @ 0x7f2f30e945c0] Could not find ref with POC 41
[hevc @ 0x7f2f30f56a80] Could not find ref with POC 43
[hevc @ 0x7f2f31018f80] Could not find ref with POC 45
[hevc @ 0x7f2f30cf0400] Could not find ref with POC 47
[hevc @ 0x7f2f30dd2000] Could not find ref with POC 49
[hevc @ 0x7f2f30e945c0] Could not find ref with POC 51
[hevc @ 0x7f2f30f56a80] Could not find ref with POC 53
[hevc @ 0x7f2f31018f80] Could not find ref with POC 55
[hevc @ 0x7f2f30cf0400] Could not find ref with POC 57
[hevc @ 0x7f2f30e945c0] Could not find ref with POC 1
[hevc @ 0x7f2f30f56a80] Could not find ref with POC 3
[hevc @ 0x7f2f31018f80] Could not find ref with POC 5
[hevc @ 0x7f2f30cf0400] Could not find ref with POC 7
[hevc @ 0x7f2f30dd2000] Could not find ref with POC 9
`
âŚAnd the errors continue as long as playback continues
$ ffmpeg
ffmpeg version 4.3.6-0+deb11u1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
...
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
$ vlc
VLC media player 3.0.18 Vetinari (revision 3.0.13-8-g41878ff4f2)
[00005575695b25b0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0000557569651130] main playlist: playlist is empty
[00007eff88003f40] gl gl: Initialized libplacebo v2.72.0 (API v72)
libva info: VA-API version 1.10.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
[00007eff98c19380] avcodec decoder: Using Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 () for hardware decoding
I hope this is somewhat helpful.
EDIT: I just noticed that youâre testing with an HEVC video. I donât have any files encoded in that format so I canât test them, I was only able to test h264 encoded videos.
EDIT2: Alright, I just tested the Tractor x265 example, and VLC has no problem using the hardware decoder with it.
Is there something I can do to be able to playback media on this PC using Debian 12? Is another player going to work? mpv doesnât work either (although it has way less dropped frames), and VLC 4.0 nightly doesnât seem to have fixed the issue (although it is quite beta at the moment, showing various weird behaviors). VLC 4.0 was installed as a snap package, Iâm not sure if I need to install something else along with it
What resolution is your video file? I did some napkin math using the processor specs, and calculated that software 4k30 video playback would have less than 10 clock cycles per pixel.
Thatâs really hard to achieve, even with highly optimized players like MPV. I think your best bet would be either trying lower-res versions of your videos, or reverting back to Debian 11 until FFMPEG is patched.
One other thing is that when I used flatpak, I had to install other libraries along with my application to get updated functionality.
Iâm not sure if this applies to snap, perhaps someone will chime in who knows more about it than I do.
Anything 720p and 1080p should work just fine unless performance is severely hampered in some way. 4k will be a bit of struggle specially if itâs AV1 or/and if you make use of shaders or 3D for rendering output.
When putting new stuff on a âstableâ distro, the phrase âhere be dragonsâ is appropriate. My personal experience tells me this will either be very easy, or will turn into a fractal hydra of a problem, where each surface level issue depends on one or more prerequisite issues to be discovered and solved first, ultimately spending days where it may not even work out in the end.
I strongly recommend a backup before experimenting.
â The absolute first thing I would try either the snap or the flatpack. No sure how up to date those are. This should be easy to do and âjust workâ. It may not however resolve your stutter problem, but are easy to remove in such a case.
Another thing that could be tried is using the âNixâ package manager on debian. This lets you choose (latest or specific prior) versions of a package, without creating a dependency hell because each package is isolated in itâs own folder (/nix/store/verylonghash-package-version.num/). This likewise is done with all the dependencies it needs and the program is linked to what it needs. This is a bit more technically involved, but should be a fairly clean solution when used for those few select packages you need to be recent. You will need to remember that this is now a second package manager on your system youâll have to update occasionally in addition to apt. A quick and simple rundown is here. âNix the package managerâ is related to but not to be confused with the âNix languageâ, or âNixOSâ which is a full distro based on that package manager.
Or maby thereâs a backport that can be used? Never messed around with this personally, not familiar with it.
Finally you could attempt to compile the source code, but this seems like it would accomplish the same thing as trying to just install a more recent vlc.deb from the arch repo or something, that could require newer dependencies to install. Which would fail or end up creating a âfranken-debianâ mess, typically resulting in a wipe and reinstall to bury your tears and shame.
Would you guys say that primarily Debian is leaning towards more of a server distro or desktop distro? Because this certainly seems like a server first, desktop second kind of experience.
Desktop is hard and in general Debian makes a good effort in keeping packages up to date however it takes quite a bit of time before it goes into stable.