Package Details: libcrystalhd 20131127-4

Git Clone URL: https://aur.archlinux.org/libcrystalhd.git (read-only, click to copy)
Package Base: libcrystalhd
Description: Broadcom Crystal HD library
Upstream URL: https://github.com/crystalhd-arch/libcrystalhd
Licenses: LGPLv2.1
Submitter: None
Maintainer: VxlerieUwU
Last Packager: VxlerieUwU
Votes: 4
Popularity: 0.000000
First Submitted: 2010-01-31 08:24 (UTC)
Last Updated: 2021-03-17 21:27 (UTC)

Latest Comments

dvd73 commented on 2024-10-03 19:32 (UTC) (edited on 2024-10-15 18:21 (UTC) by dvd73)

There are three problems with Broadcom Crystal HD support for today:

  1. Driver sources are mismatched to kernel 5.3 - 6.x
  2. Player's codec support
  3. Player parameters
I. Install Crystal HD driver and library

So at now there are 2 driver sources on GitHub, one for kernel 4.19 - 5.10 and other for modern kernel:

  1. kernel 4.19 - 5.10. All forks from dbason, I used this https://github.com/valerierx/crystalhd
  2. kernel 5.3 - 6.x. kcning respositories:

In both cases the order of building process is the same: headers first then driver. If you are going to build driver for kernel 4.19 - 5.10 please build and install library libctystalhd first and then build the driver from driver/linux folder. If you are going to build driver for kernel 5.3 - 6.x please build and install crystalhd-headers first and then build the driver from crystalhd-dkms folder and dont't forget about firmware. It doesn't matter how you will copy it. Just take a look on the Makefile for details.

Notes:

  1. some kernel could be customized by vendor and it's headers do not contain required sources to build crystalhd driver. AntiX linux is an example.

  2. In case if building driver for kernel 5.3 - 6.x. from kcning repo be sure that dkms package has been installed and install it if missing.

II. Build FFmpeg library with Crystal HD support

All players that are using FFmpeg library 6.x (mpv, mplayer etc) do not have Crystal HD support as it was removed from FFmpeg 6.0 "Von Neumann". Depending on player you need to be sure that Crystal HD support is exist.

  • For MPV player:

mpc -vd=help | grep -i crystalhd

Output:

h264_crystalhd (h264) - CrystalHD H264 decoder

mpeg4_crystalhd (mpeg4) - CrystalHD MPEG4 decoder

mpeg2_crystalhd (mpeg2video) - CrystalHD MPEG2VIDEO decoder

msmpeg4_crystalhd (msmpeg4v3) - CrystalHD MSMPEG4V3 decoder

vc1_crystalhd (vc1) - CrystalHD VC1 decoder

wmv3_crystalhd (wmv3) - CrystalHD WMV3 decoder

  • For mplayer:

mplayer.exe -vc help | egrep -i crystalhd\|fdshow

If you will get the empty response, you need to build your own player instance with FFmpeg version < 6.0. The MPV player allows this.

Below are steps for MPV player:

  1. ensure that libcrystalhd library (from driver sources) has been installed
  2. ensure that python3-pip package is installed and then run

    pip install ninja

  3. Optional, be sure that ninja command exist in terminal otherwise add it's path to the PATH variable:

    PATH=$PATH:~/.local/bin

  4. Here is a full dependency list, please install its to your OS (Build-Depends array): https://raw.githubusercontent.com/mpv-player/mpv-build/refs/heads/master/debian/control

  5. Create a new folder, for example, Projects and come into it.

    We have to use meson 0.62 or above, in case of mismatch, please pull the latest meson from git and use it as portable

    git clone https://github.com/mesonbuild/meson.git

  6. Add meson's path to the PATH variable

    PATH=$PATH:~/Projects/meson

    cd ..

  7. Create a new folder mpv and come into it

    git clone https://github.com/mpv-player/mpv-build.git

    If you are using meson as portable, please add the .py extension for the meson command in follow scripts in mpv/mpv-build/scripts forlder: mpv-install, mpv-config, libplacebo-config, mpv-build

  8. use-ffmpeg-custom n.5.1.5

  9. user-mpv-custom v0.38.0

  10. ./rebuild -jN (N is the number of cores)

  11. sudo ./install or just ./install (you will be asked for elevate privileges later)

mpv executable file will be installed into /usr/local/bin. It will have all dependencies in monolith. You can now specify the MPV's path in SMplayer options to work with MPV.

dvd73 commented on 2024-09-23 20:16 (UTC) (edited on 2024-10-21 09:18 (UTC) by dvd73)

III. Player parameters

To use crystalhd decoder we have to specify some parameters for player.

Below are some examples:

MPV

cli:

mpv --hwdec=crystalhd-copy --hwdec-codecs=h264,mpeg4,mpeg2video,msmpeg4v3,vc1,wmv3

mpv --vd=h264_crystalhd

config (~/.config/mpv/mpv.conf):

# Enable hardware decoding if available. Often, this does not work with all

# video outputs, but should work well with default settings on most systems.

# If performance or energy usage is an issue, forcing the vdpau or vaapi VOs

# may or may not help.

hwdec=crystalhd-copy

hwdec-codecs=h264,mpeg4,mpeg2video,msmpeg4v3,vc1,wmv3

vd=mpeg4_crystalhd,h264_crystalhd,mpeg2_crystalhd,msmpeg4_crystalhd,vc1_crystalhd,wmv3_crystalhd

VLC

cli:

vlc --codec crystalhd

GUI:

Tools | Preferences | Show ALL Settings. Choose Input/Codecs from the lengthy tree menu, and then scroll down to the bottom of the pane where Preferred decoders list appears. Add "crystalhd" to that field, and save your preferences.

config:

Normally in ~/.config/vlc/vlcrc, find the comment string "Preferred decoders list". Edit the following line to look like this:

# Preferred decoders list (string)

codec=crystalhd

Mplayer

cli: mplayer -vc=ffh264crystalhd

config:

vc=ffh264crystalhd,ffmpeg2crystalhd,ffdivxcrystalhd,ffvc1crystalhd,ffwmv3crystalhd,ffodivxcrystalhd,

Yes, the line must be ended by comma and line break.

yt-dlp

$ nano ${XDG_CONFIG_HOME}/yt-dlp/config

add follow line: -S codec:h264

Conclusion

The MX 19.4 linux with kernel 4.19 & 5.10 won as it were not any extra steps, just only install Crystal HD driver (+ max performance).

Tesing

Tested systems:

  • antiX 23.1 (5.10 & 6.1) - driver compilation failed with missing some kernel headers

  • antiX 21 (4.9 & 5.10) - driver compilation failed with missing some kernel headers

  • antiX 19.5 (4.9) - driver compilation failed with missing some kernel headers

  • MX 23.4 (6.1) - Ok

  • MX 21.3 (5.10 & 6.0) - Ok

  • MX 19.4 (4.19 & 5.10) - Ok

  • lubuntu 22.04.5 (5.10 & 6.9) - Ok

  • lubuntu 20.04.5 (5.10) - Ok

  • lubuntu 18.04.5 (5.4) - Ok

  • linuxmint 21 (5.15) - Ok

Please use command below to see how the driver works:

dmesg | grep crystalhd

Here is a example of successful usage:

dmitry@dmitry-lubuntu:~$ dmesg | grep crystalhd

[ 223.557512] crystalhd: disagrees about version of symbol module_layout

[ 838.246055] crystalhd: loading out-of-tree module taints kernel.

[ 838.246431] crystalhd: module verification failed: signature and/or required key missing - tainting kernel

[ 838.249665] Loading crystalhd v3.10.0

[ 838.249762] crystalhd 0000:05:00.0: Starting Device:0x1615

[ 9700.506122] crystalhd 0000:05:00.0: Opening new user[0] handle

[ 9876.773916] crystalhd 0000:05:00.0: Closing user[0] handle via ioctl with mode 1417200

[ 9966.938131] crystalhd 0000:05:00.0: Opening new user[0] handle

[10073.412405] crystalhd 0000:05:00.0: Closing user[0] handle with mode 1417200

[12530.810761] crystalhd 0000:05:00.0: Opening new user[0] handle

[12698.521412] crystalhd 0000:05:00.0: Closing user[0] handle with mode 1417200

[12749.743157] crystalhd 0000:05:00.0: Opening new user[0] handle

[12890.709221] crystalhd 0000:05:00.0: Closing user[0] handle with mode 1417200

dreieck commented on 2024-01-12 11:30 (UTC) (edited on 2024-01-12 11:36 (UTC) by dreieck)

You need to install into /usr/lib/, not /lib/, since /lib/ is a symlink to /usr/lib/. (Your package installs a directory /lib/firmware/.)

As it is now, installation will fail with a file conflict:

error: failed to commit transaction (conflicting files)
libcrystalhd: /lib exists in filesystem (owned by filesystem)
Errors occurred, no packages were upgraded.

Please fix.

You can add

  mv -v "${pkgdir}/lib"/* "${pkgdir}/usr/lib"/
  rmdir "${pkgdir}/lib"

to the bottom of package() to fix it.

Thanks for maintaining!

Ulin commented on 2021-10-07 14:12 (UTC)

libcrystalhd: /lib exists in filesystem (owned by filesystem)

joncppl commented on 2018-10-29 23:06 (UTC)

https://docs.broadcom.com/docs-and-downloads/docs/support/crystalhd/crystalhd_linux_20100703.zip

new url

mr_nuub commented on 2018-10-14 17:37 (UTC)

Source removed - If I try to manually download the source, I get a HTML document with "Document not found" inside.

simse commented on 2018-04-06 22:34 (UTC)

Seems like the source is messed up ?

... ==> Retrieving sources... -> Downloading crystalhd_linux_20100703.zip... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 285 100 285 0 0 620 0 --:--:-- --:--:-- --:--:-- 620 100 102 100 102 0 0 81 0 0:00:01 0:00:01 --:--:-- 0 ==> Validating source files with md5sums... crystalhd_linux_20100703.zip ... FAILED ==> ERROR: One or more files did not pass the validity check!

<deleted-account> commented on 2010-07-09 11:43 (UTC)

New pkgver=20100703