[PATCH] gnu: Add intel-vaapi-driver-g45-h264.

OpenSubmitted by Jelle Licht.
Details
4 participants
  • iung
  • Jelle Licht
  • Tobias Geerinckx-Rice
  • Vincent Legoll
Owner
unassigned
Severity
normal
J
J
Jelle Licht wrote on 27 Nov 2019 17:59
(address . guix-patches@gnu.org)
87y2w1uug9.fsf@jlicht.xyz
Hey Guix,

I am not sure if this package offers any practical benefit or not, so I
defer to someone who actually knows what they are talking about to make
a judgment call ;-).

This variant of intel-vaapi-driver is a backport of the ancient g45-h264
branch that used to be maintained by the intel-vaapi-driver team. As far
as I know, the reason they don't maintain this branch anymore is that
hardware accelerated h264 decoding on the G45 chipset was much too slow
for 1080p video, as by default it only had 32MB of VRAM to work with.

It so happens that the librebooted Thinkpad T400 has one of these
G45-based iGPUs, with one change: the iGPU has 256MB VRAM
available. Using this package and a `hwdec=vaapi' setting in
~/.config/mpv/mpv.conf, I enjoy smooth video playback and low CPU usage
for 1080p video using mpv.
From 8727588a6bca185f17480efc7327774b041e240d Mon Sep 17 00:00:00 2001
From: Jelle Licht <jlicht@fsfe.org>
Date: Wed, 27 Nov 2019 16:16:47 +0100
Subject: [PATCH] gnu: Add intel-vaapi-driver-g45-h264.

* gnu/packages/video.scm (intel-vaapi-driver-g45-h264): New variable.
---
gnu/packages/video.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 9836f67386..5eb0c7175f 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -2787,6 +2787,35 @@ post-processing of video formats like MPEG2, H.264/AVC, and VC-1.")
     (license (list license:bsd-2        ; src/gen9_vp9_const_def.c
                    license:expat))))    ; the rest, excluding the test suite
 
+(define-public intel-vaapi-driver-g45-h264
+  (let ((base intel-vaapi-driver))
+    (package
+      (inherit base)
+      (name "intel-vaapi-driver-g45-h264")
+      (version "2.3.0")
+      (source (origin
+                (method url-fetch)
+                (uri
+                 (string-append
+                  "https://bitbucket.org/alium/g45-h264/downloads/intel-driver-g45-h264-"
+                  version ".tar.gz"))
+                (sha256
+                 (base32
+                  "0hf6h6754qf2sfhfq5i6pwn5dc06hjib6m05r8999ilbvrv4axar"))))
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases '%standard-phases)
+          `(modify-phases ,phases
+             (add-before 'bootstrap 'skip-premature-configure
+               (lambda _
+                 (setenv "NOCONFIGURE" "set")
+                 #t))))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)
+         ,@(package-native-inputs base))))))
+
 (define-public openh264
   (package
     (name "openh264")
-- 
2.24.0
T
T
Tobias Geerinckx-Rice wrote on 27 Nov 2019 19:58
(address . guix-patches@gnu.org)(address . 38403@debbugs.gnu.org)
875zj59mes.fsf@nckx
Jelle,

Jelle Licht 写道:
Toggle quote (6 lines)
> I am not sure if this package offers any practical benefit or
> not, so I
> defer to someone who actually knows what they are talking about
> to make
> a judgment call ;-).

I don't have a G45, but if this driver verifiably works for you
(and the regular version does not) I think it's good to to include
it. Also because I expect this card to be overrepresented amongst
Guix users: there aren't that many common Librebootable machines.

It needs its own clear synopsis, description, and home page
though. Is there a home page? I'm not good at navigating
BitBucket.

Toggle quote (11 lines)
> This variant of intel-vaapi-driver is a backport of the ancient
> g45-h264
> branch that used to be maintained by the intel-vaapi-driver
> team. As far
> as I know, the reason they don't maintain this branch anymore is
> that
> hardware accelerated h264 decoding on the G45 chipset was much
> too slow
> for 1080p video, as by default it only had 32MB of VRAM to work
> with.

These devices don't have their own RAM chips, so ‘by default’ here
means the BIOS menu setting, right? If so, it should be mentioned
in the description for lack of upstream documentation.

I'm guessing that your card identifies as an Intel® GMA X4500MHD.
Is that correct? We should include the marketing name in the
synopsis & description too, even if it might not map 1:1 to the
chipset.

Toggle quote (11 lines)
> This variant of intel-vaapi-driver is a backport of the ancient
> g45-h264
> branch that used to be maintained by the intel-vaapi-driver
> team. As far
> as I know, the reason they don't maintain this branch anymore is
> that
> hardware accelerated h264 decoding on the G45 chipset was much
> too slow
> for 1080p video, as by default it only had 32MB of VRAM to work
> with.

This is good! :-) It should be slightly edited and used as a
description together with the original intel-vaapi-driver text.

Apart from that, the package LGTM. Thanks!

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfo+u0AlEeO9y5k0W2Imw8BjFSTwFAl3ex0sACgkQ2Imw8BjF
STyxuA//VpCXPwBUI1N8uTdYzHO6DkhbmDlcpxV9PKvHAWQNGROrD+Z5XjcP+Srd
QHR1rCqWMkNgCvcw8DX7P8QR4SHe7SB0kUtyZF5zPUOiLZW1SpTcI7qdaNbQ36yS
tJXemW02JXredPhfm87QCGm0csGib6JlZfs4ph8R9eeWGTlaWLUllnlrJITkBJSG
PuvnL8wYPuAlkWhbmZH54i2CVde815Y1DGb1poC03sTMtkWGI5TahEFHYWb8Vw1D
sXOuApsKbn/mC0yfdLefkGlj1VJWdqPRQXYkXEfAKpEJHQPgjNFurdntboSdNCST
yViI12dy4lCQnVKqTtrgjFwLInITMsGMcTnbqaW2HN6/wkIg3zsanWyN6wVGfNn1
yOXFQOdtSUEWsMVmakSFXXvkLkh0O24vIbq7CkEQg/a0MTB5rOHfNPrsBYbCbDn9
qRSUhs9XvaKiZtrYbzqYe19+FT95boUahYmUdGdnsIRp0dILG8Jb7d7eKdIhwTae
qVScSeFQQEOtF+JUQwNzsKLBbmi46hSnfmnipNsuPN675WGmY+k/OIT0im7Owluh
EEGiBb1Xmj67TYfCNJDO8EXvqwg+9nw1AKNYT3VYD9+NR62tv0bH7eVWnxDqlt6t
RWCn3/HsYyhyl9kBLzlT4Tdzsx01JbBGqo1h/aW3PDXhBs8Q3KA=
=8gG9
-----END PGP SIGNATURE-----

J
J
Jelle Licht wrote on 29 Nov 2019 12:00
87lfrzueuc.fsf@jlicht.xyz
Hey Tobias,

Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org>
writes:

Toggle quote (18 lines)
> Jelle,
>
> Jelle Licht 写道:
>> I am not sure if this package offers any practical benefit or
>> not, so I
>> defer to someone who actually knows what they are talking about
>> to make
>> a judgment call ;-).
>
> I don't have a G45, but if this driver verifiably works for you
> (and the regular version does not) I think it's good to to include
> it. Also because I expect this card to be overrepresented amongst
> Guix users: there aren't that many common Librebootable machines.
>
> It needs its own clear synopsis, description, and home page
> though. Is there a home page? I'm not good at navigating
> BitBucket.

I am in contact with the upstream author (of this tarball): They do not
have access to a G45-based chipset, so we are currently looking into
options for the future. There is currently no home page.

The actual bitbucket repo has been made public only yesterday, so it was
not that weird that you could not find it :-).
Toggle quote (15 lines)
>
>> This variant of intel-vaapi-driver is a backport of the ancient
>> g45-h264
>> branch that used to be maintained by the intel-vaapi-driver
>> team. As far
>> as I know, the reason they don't maintain this branch anymore is
>> that
>> hardware accelerated h264 decoding on the G45 chipset was much
>> too slow
>> for 1080p video, as by default it only had 32MB of VRAM to work
>> with.
>
> These devices don't have their own RAM chips, so ‘by default’ here
> means the BIOS menu setting, right? If so, it should be mentioned
> in the description for lack of upstream documentation.
This is correct. I think it makes sense to point people to the right
documentation for at least libreboot and coreboot, and refer them to
their BIOS supplier for other instructions.

OTOH, I do not feel that the package description is the right place to
do this. Where would such instructions normally exist on GNU/Linux
machines?

Toggle quote (4 lines)
> I'm guessing that your card identifies as an Intel® GMA X4500MHD.
> Is that correct? We should include the marketing name in the
> synopsis & description too, even if it might not map 1:1 to the
> chipset.
Yes on all fronts.

- Jelle
V
V
Vincent Legoll wrote on 13 Apr 2020 19:52
(address . 38403@debbugs.gnu.org)(name . Jelle Licht)(address . jlicht@fsfe.org)
36a82919-98e3-cfa8-db98-e2c154d28f7a@gmail.com
Hello,

I have an old laptop (Vaio VGN-TT90S) with such a chipset,
that I can get out of the attic, if you need some testing.

--
Vincent Legoll
J
J
Jelle Licht wrote on 13 Apr 2020 22:01
87o8rvp338.fsf@jlicht.xyz
Hey,

Vincent Legoll <vincent.legoll@gmail.com> writes:

Toggle quote (5 lines)
> Hello,
>
> I have an old laptop (Vaio VGN-TT90S) with such a chipset,
> that I can get out of the attic, if you need some testing.

That would be nice! I am waiting until we remove all linux-libre kernels
between 5.0 and 5.5, as these lead to pretty bad crashes with this
package.

I have it on my agenda for early May to backport the latest
intel-vaapi-driver changes to the g45-h264 branch and subsequently push
it to Guix.

- Jelle
V
V
Vincent Legoll wrote on 16 Apr 2020 00:06
7e6c8e91-39b9-b640-c1e3-03dcb42fe738@gmail.com
On 13/04/2020 22:01, Jelle Licht wrote:
Toggle quote (4 lines)
> I have it on my agenda for early May to backport the latest
> intel-vaapi-driver changes to the g45-h264 branch and subsequently push
> it to Guix.

Just ping me when needed

--
Vincent Legoll
T
T
Tobias Geerinckx-Rice wrote on 16 Apr 2020 00:32
(name . Jelle Licht)(address . jlicht@fsfe.org)(address . 38403@debbugs.gnu.org)
87v9m0z8gq.fsf@nckx
Necro tiem (thanks Vincent),

Jelle Licht 写道:
Toggle quote (15 lines)
>> These devices don't have their own RAM chips, so ‘by default’
>> here
>> means the BIOS menu setting, right? If so, it should be
>> mentioned
>> in the description for lack of upstream documentation.
> This is correct. I think it makes sense to point people to the
> right
> documentation for at least libreboot and coreboot, and refer
> them to
> their BIOS supplier for other instructions.
>
> OTOH, I do not feel that the package description is the right
> place to
> do this.

I agree it's not ideal.

Toggle quote (3 lines)
> Where would such instructions normally exist on GNU/Linux
> machines?

Well… /share/doc. I check it; I don't know how many people
(still) do.

It seems to be less well known than it used to be, which is a
shame, but it's technically the answer to your question.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfo+u0AlEeO9y5k0W2Imw8BjFSTwFAl6Xi2UACgkQ2Imw8BjF
STybZxAAj4LwPBLp++cafK0q/Y6T3Yo/vi/6ydJEqwbxXqgqYfw6iQwWvHp5fKJn
2H844F/XAP04kiViZKbEXrVEOheTUuDU4ASJjph+m16PsfE1l1mctabxOX/DYlxe
qrzSM6bFGbBMiN59EL/FDKbBswr5RxEWW3K+QBUXYGPkUh8guFMu5ulOn2t0xXiz
8aPNmpesSf36RkzjQOCY18Z4LppnfUia2aiHE5NXytrvmHbgaDNHU3Z8u2QxtIeU
rnhL9lzwOjO+qS5Swqs9cjr8yJRZbscgiX81mZ08X8bIs5wJFjFqCkFTvZRLq3XR
U03OB4TqTcXOvfoB7NYIJuD0SpYERVw1TJdoyXZ0r8+AXmSw/1bcliczX5h6Ndhg
pBdLBIx8w5xNEXlBp2ZYmLxuFGBPwQe76uHUzfEy2fUl5/ahxNtFkQ9vKn1qjrOt
TsJAtMNvRp0F7oaGEViSsUksMu4JCIxO1OAfOmfWLvEsFs36guyhu2pA+VjjuQIp
5sKZOPXiLWBqoM8jPIWjDpPF4VK+wWjKGpykJuBZKXWMhVxboxMd/1LMhsm6btjj
uzi9uUNxdHbLXM8nQv23s5llm7yC5GtPCajhPuV07mzgCSud3SrZX0QHX9qYN3jm
FyxvjJvCX9BWG/oUUbmZTBN/MLa4FyqWsUIAhUERQw8umLgtWcM=
=CHoU
-----END PGP SIGNATURE-----

J
J
Jelle Licht wrote on 12 Sep 2020 13:20
87pn6rkzrc.fsf@jlicht.xyz
Vincent Legoll <vincent.legoll@gmail.com> writes:

Toggle quote (7 lines)
> On 13/04/2020 22:01, Jelle Licht wrote:
>> I have it on my agenda for early May to backport the latest
>> intel-vaapi-driver changes to the g45-h264 branch and subsequently push
>> it to Guix.
>
> Just ping me when needed

Some changes made in linux kernel 5.X made it harder to get this to work
reliably. Since getting this to work allows me to watch videos on my
laptop without melting my pants off, I'm still very much motivated to
get it to work in the long run ;-).

I been made aware that the 5.x series of kernels have seen a lot of
regressions (and improvements, probably) for intel-drm related code
paths; my hope is that this still somehow stabilizes in the coming
months.

For now, it seems to work on linux kernel 4.19.143. See [1] for the
maintainer of the AUR package that I based my work on.

Is there some way to 'park' this debbugs issue? As in, keep it open, but
rather as a reminder to revisit this issue in the future?

Thanks,
Jelle

I
[PATCH] gnu: Add intel-vaapi-driver-g45-h264.
(address . 38403@debbugs.gnu.org)
d076db27e9f88fdd5699b8576eed1cbc@autistici.org
Still doesn't work on linux 5.15. Situation same as in comments to aur
package: version 2.4.1 hangs gpu, 2.4.1-experimental doesn't work.
?