Bug 252927 - multimedia/kodi: Add support for SSE4* on AMD64
Summary: multimedia/kodi: Add support for SSE4* on AMD64
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Bernhard Froehlich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-23 01:49 UTC by Daniel Ebdrup Jensen
Modified: 2021-01-24 20:27 UTC (History)
3 users (show)

See Also:
yzrh: maintainer-feedback+


Attachments
A svn patch for Makefile which adds SSE4_1 and SSE4_2 to the AMD64 default options (521 bytes, patch)
2021-01-23 01:49 UTC, Daniel Ebdrup Jensen
debdrup: maintainer-approval? (yzrh)
Details | Diff
patch (641 bytes, patch)
2021-01-24 16:25 UTC, yzrh
no flags Details | Diff
testport log (120.56 KB, application/gzip)
2021-01-24 16:26 UTC, yzrh
no flags Details
portlint log (433 bytes, text/plain)
2021-01-24 16:26 UTC, yzrh
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Ebdrup Jensen freebsd_committer freebsd_triage 2021-01-23 01:49:47 UTC
Created attachment 221820 [details]
A svn patch for Makefile which adds SSE4_1 and SSE4_2 to the AMD64 default options

As of the update to Kodi 19, kodi reports the following when trying to play back video with VAAPI:

2021-01-23 00:47:17.594 T:101301   DEBUG <general>: SECTION:LoadDLL(special://xbmcbin/system/libsse4-x86_64-freebsd.so)
2021-01-23 00:47:17.594 T:101301   DEBUG <general>: Loading: /usr/local/lib/kodi/system/libsse4-x86_64-freebsd.so
2021-01-23 00:47:17.595 T:101301   ERROR <general>: Unable to load /usr/local/lib/kodi/system/libsse4-x86_64-freebsd.so, reason: Cannot open "/usr/local/lib/kodi/system/libsse4-x86_64-freebsd.so"
2021-01-23 00:47:17.595 T:101301   ERROR <general>: VAAPI::SupportsFilter failed loading sse4 lib

Since there is no AMD64 architecture, since Nehalem in 2008, which doesn't support SSE4.1 and 4_2, it seems like now is a good time to flip these options on for AMD64.

I've not added it to i386, since it's possible someone might have an old NetBurst x86 from 2000 without SSE4.1 and SSE4.2.
Comment 1 Daniel Ebdrup Jensen freebsd_committer freebsd_triage 2021-01-23 18:57:39 UTC
I have built kodi with this patch on a machine running 12.2-RELEASE, and confirmed that I no longer get the error during playback, so it works.

I'll also start poudriere testport on it, just to test if it runs on 13 (from a few days ago) and 11.4-RELEASE.
Comment 2 yzrh 2021-01-23 19:28:44 UTC
I think it is safe to enable all but AVX* on amd64.  AVX
requires Sandy Bridge (2011) and later,  AVX2 requires
Haswell (2013) and later.

Will test it tonight.
Comment 3 Daniel Ebdrup Jensen freebsd_committer freebsd_triage 2021-01-23 21:50:00 UTC
I have finished running poudriere testport on a pair of 11.4-RELEASE and 12.2-RELEASE jails.

Logs can be found here:
11.4-RELEASE: https://0x0.st/--Xn.log
12.2-RELEASE: https://0x0.st/--XR.log
Comment 4 Daniel Ebdrup Jensen freebsd_committer freebsd_triage 2021-01-24 15:19:00 UTC
I also followed up with a poudriere testport run on 13-CURRENT as of FreeBSD_version 1300134, which is only about a week old.

13-CURRENT: https://0x0.st/--Nn.log

Can I get approval for the patch, so I can commit it?
Comment 5 yzrh 2021-01-24 16:25:35 UTC
Created attachment 221881 [details]
patch
Comment 6 yzrh 2021-01-24 16:26:09 UTC
Created attachment 221882 [details]
testport log
Comment 7 yzrh 2021-01-24 16:26:34 UTC
Created attachment 221883 [details]
portlint log
Comment 8 yzrh 2021-01-24 16:28:22 UTC
Enable SSSE3 too.  Please take the patch.  Thanks.
Comment 9 Daniel Ebdrup Jensen freebsd_committer freebsd_triage 2021-01-24 19:09:21 UTC
Kodi doesn't make use of SSSE3, so I don't know if there's any point in enabling it.

Either way, you're the maintainer, you need to approve it here in Bugzilla before I can do anything.
Comment 10 yzrh 2021-01-24 19:52:27 UTC
CPU flags are taken from the cmake module in source.
It doesn't do anything now,  but for completeness,
let's enable it.
Comment 11 commit-hook freebsd_committer freebsd_triage 2021-01-24 20:27:01 UTC
A commit references this bug:

Author: debdrup
Date: Sun Jan 24 20:26:39 UTC 2021
New revision: 562510
URL: https://svnweb.freebsd.org/changeset/ports/562510

Log:
  multimedia/kodi: Add support for SSSE3, SSE4.1 and SSE4.2 on AMD64

  As of the update to Kodi 19, kodi reports missing SSE4 shared objects
  during video playback with VAAPI.

  Bump PORTREVISION accordingly.

  PR:		252927
  Submitted by:	debdrup@ (previous version), yzrh at noema.org(maintainer)
  Approved by:	yzrh at noema.org (maintainer), jrm

Changes:
  head/multimedia/kodi/Makefile
Comment 12 Daniel Ebdrup Jensen freebsd_committer freebsd_triage 2021-01-24 20:27:46 UTC
Thanks. :)