├── .gitignore ├── debian ├── install ├── .gitignore ├── control ├── changelog ├── rules ├── postinst └── copyright ├── .github └── workflows │ ├── Dockerfile │ └── build_and_release.yml ├── 99-rk-device-permissions.rules ├── create-chromium-vda-vea-devices.sh └── Readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.deb 2 | *.build 3 | *.buildinfo 4 | *.changes -------------------------------------------------------------------------------- /debian/install: -------------------------------------------------------------------------------- 1 | 99-rk-device-permissions.rules /etc/udev/rules.d/ 2 | create-chromium-vda-vea-devices.sh /usr/bin/ 3 | -------------------------------------------------------------------------------- /debian/.gitignore: -------------------------------------------------------------------------------- 1 | rockchip-multimedia-config/ 2 | debhelper-build-stamp 3 | files 4 | rockchip-multimedia-config.substvars -------------------------------------------------------------------------------- /.github/workflows/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG IMAGE 2 | FROM ${IMAGE} 3 | ENV DEBIAN_FRONTEND=noninteractive 4 | RUN apt-get update && apt-get install -y --no-install-recommends \ 5 | build-essential \ 6 | debhelper \ 7 | devscripts \ 8 | dh-exec \ 9 | pkg-config && \ 10 | rm -rf /var/lib/apt/lists/* 11 | COPY . /src/ 12 | WORKDIR /src/ 13 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: rockchip-multimedia-config 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Jianfeng Liu 5 | Build-Depends: debhelper-compat (= 11) 6 | Standards-Version: 4.6.0 7 | Homepage: https://github.com/amazingfate/rockchip-multimedia-config 8 | Rules-Requires-Root: no 9 | 10 | Package: rockchip-multimedia-config 11 | Architecture: all 12 | Depends: ${shlibs:Depends}, ${misc:Depends}, libv4l-0, udev 13 | Description: System config for rockchip legacy multimedia 14 | -------------------------------------------------------------------------------- /99-rk-device-permissions.rules: -------------------------------------------------------------------------------- 1 | KERNEL=="mpp_service", MODE="0660", GROUP="video" RUN+="/usr/bin/create-chromium-vda-vea-devices.sh" 2 | KERNEL=="rga", MODE="0660", GROUP="video" 3 | KERNEL=="system-dma32", MODE="0666", GROUP="video" 4 | KERNEL=="system-uncached", MODE="0666", GROUP="video" 5 | KERNEL=="system-uncached-dma32", MODE="0666", GROUP="video" RUN+="/usr/bin/chmod a+rw /dev/dma_heap" 6 | # If /dev/ion exists (ION is enabled in the kernel) and the decoder process has access to /dev/ion, 7 | # mpp will try to initialize the HW decoder using ION and will fail. 8 | # To avoid this, disable ION pseudo. 9 | KERNEL=="ion", RUN+="/bin/rm -f /dev/ion" 10 | -------------------------------------------------------------------------------- /create-chromium-vda-vea-devices.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | case "$(cat /proc/device-tree/compatible)" in 3 | *rk3588*) 4 | { 5 | echo "type=dec" 6 | echo "codecs=VP8:VP9:H.264:H.265:AV1" 7 | echo "max-width=7680" 8 | echo "max-height=4320" 9 | } > /dev/video-dec0 10 | ;; 11 | *rk3568*) 12 | { 13 | echo "type=dec" 14 | echo "codecs=VP8:VP9:H.264:H.265" 15 | echo "max-width=3840" 16 | echo "max-height=2160" 17 | } > /dev/video-dec0 18 | ;; 19 | *) 20 | echo dec > /dev/video-dec0 21 | esac 22 | chown root:video /dev/video-dec0 23 | chmod 0660 /dev/video-dec0 24 | echo enc > /dev/video-enc0 25 | chown root:video /dev/video-enc0 26 | chmod 0660 /dev/video-enc0 27 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | rockchip-multimedia-config (1.0.2-1) unstable; urgency=medium 2 | 3 | * Add udev rule to remove /dev/ion 4 | 5 | -- tsukumi Thu, 20 Apr 2023 03:24:00 +0900 6 | 7 | rockchip-multimedia-config (1.0.1-1) unstable; urgency=medium 8 | 9 | * Update packaging 10 | 11 | -- tsukumi Mon, 10 Apr 2023 05:14:00 +0900 12 | 13 | rockchip-multimedia-config (1.0.0-1+jammy) jammy; urgency=medium 14 | 15 | * Package for jammy 16 | 17 | -- Jianfeng Liu Thu, 02 Feb 2023 11:47:53 +0000 18 | 19 | rockchip-multimedia-config (1.0.0-1) jammy; urgency=medium 20 | 21 | * Initial release 22 | 23 | -- Jianfeng Liu Wed, 01 Feb 2023 11:05:08 +0800 24 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # See debhelper(7) (uncomment to enable) 3 | # output every command that modifies files on the build system. 4 | #export DH_VERBOSE = 1 5 | 6 | 7 | # see FEATURE AREAS in dpkg-buildflags(1) 8 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 9 | 10 | # see ENVIRONMENT in dpkg-buildflags(1) 11 | # package maintainers to append CFLAGS 12 | #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 13 | # package maintainers to append LDFLAGS 14 | #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 15 | 16 | 17 | %: 18 | dh $@ 19 | 20 | 21 | # dh_make generated override targets 22 | # This is example for Cmake (See https://bugs.debian.org/641051 ) 23 | #override_dh_auto_configure: 24 | # dh_auto_configure -- \ 25 | # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) 26 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # rockchip-multimedia-config 2 | 3 | This debian package is to enable legacy multimedia support in ARM Linux environments with Rockchip SoCs. 4 | 5 | Installing rockchip-multimedia-config enables hardware media decoding and encoding provided by [mpp](https://github.com/rockchip-linux/mpp) and others on your system (requires separate installation of [mpp](https://github.com/tsukumijima/mpp/releases), [librga](https://github.com/tsukumijima/librga/releases) and others). 6 | Note that additional configs may be required. 7 | 8 | ## Installation 9 | 10 | ```bash 11 | wget https://github.com/tsukumijima/rockchip-multimedia-config/releases/download/v1.0.1-1/rockchip-multimedia-config_1.0.1-1_all.deb 12 | sudo apt install ./rockchip-multimedia-config_1.0.1-1_all.deb 13 | rm rockchip-multimedia-config_1.0.1-1_all.deb 14 | ``` 15 | -------------------------------------------------------------------------------- /debian/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | case "$1" in 6 | configure) 7 | libdir=/usr/lib64 8 | libv4l_filename=$(dpkg -L libv4l-0|grep libv4l2.so.0.0.0) 9 | if [ -L $libdir ];then 10 | echo "is link" 11 | if [ -L ${libdir}/libv4l2.so ];then 12 | rm -f ${libdir}/libv4l2.so 13 | fi 14 | cp ${libv4l_filename} ${libdir}/libv4l2.so 15 | elif [ -d $libdir ];then 16 | echo "dir already exist" 17 | if [ -L ${libdir}/libv4l2.so ];then 18 | rm -f ${libdir}/libv4l2.so 19 | fi 20 | cp ${libv4l_filename} ${libdir}/libv4l2.so 21 | else 22 | echo "dir not exist" 23 | ln -s /lib /usr/lib64 24 | if [ -L ${libdir}/libv4l2.so ];then 25 | rm -f ${libdir}/libv4l2.so 26 | fi 27 | cp ${libv4l_filename} ${libdir}/libv4l2.so 28 | fi 29 | udevadm control --reload-rules 30 | udevadm trigger 31 | ;; 32 | esac 33 | -------------------------------------------------------------------------------- /.github/workflows/build_and_release.yml: -------------------------------------------------------------------------------- 1 | name: Build and Release Debian Package 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | 9 | jobs: 10 | 11 | build_and_release: 12 | name: Build and Release Debian Package 13 | runs-on: ubuntu-latest 14 | strategy: 15 | matrix: 16 | image: 17 | - arm64v8/ubuntu 18 | permissions: 19 | contents: write 20 | steps: 21 | 22 | - name: Checkout repository 23 | uses: actions/checkout@v3 24 | 25 | - name: Set up QEMU 26 | uses: docker/setup-qemu-action@v2 27 | with: 28 | platforms: linux/arm64 29 | 30 | - name: Set up Docker Buildx 31 | uses: docker/setup-buildx-action@v2 32 | 33 | - name: Cache Docker layers 34 | uses: docker/build-push-action@v3 35 | with: 36 | context: .github/workflows/ 37 | tags: ${{ matrix.image }}:build 38 | build-args: IMAGE=${{ matrix.image }}:20.04 39 | cache-from: type=gha,scope=${{ matrix.image }} 40 | cache-to: type=gha,scope=${{ matrix.image }},mode=max 41 | load: true 42 | 43 | - name: Build 44 | run: | 45 | docker run --rm -i -v $(pwd):/work -w /work ${{ matrix.image }}:build bash -c 'debuild -us -uc -b && cp -a ../*.deb ./' 46 | 47 | - name: Get version 48 | id: get_version 49 | run: | 50 | echo "version=$(docker run --rm -i -v $(pwd):/work -w /work ${{ matrix.image }}:build bash -c 'dpkg-parsechangelog --show-field Version')" >> $GITHUB_OUTPUT 51 | 52 | - name: Release 53 | uses: softprops/action-gh-release@v1 54 | with: 55 | name: Release v${{ steps.get_version.outputs.version }} 56 | tag_name: v${{ steps.get_version.outputs.version }} 57 | generate_release_notes: true 58 | files: | 59 | ./*.deb -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: rockchip-multimedia-config 3 | Upstream-Contact: 4 | Source: 5 | 6 | Files: * 7 | Copyright: 2023 Jianfeng Liu 8 | License: GPL-2+ 9 | This package is free software; you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation; either version 2 of the License, or 12 | (at your option) any later version. 13 | . 14 | This package is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | . 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see 21 | . 22 | On Debian systems, the complete text of the GNU General 23 | Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". 24 | 25 | # If you want to use GPL v2 or later for the /debian/* files use 26 | # the following clauses, or change it to suit. Delete these two lines 27 | Files: debian/* 28 | Copyright: 2023 Jianfeng Liu 29 | License: GPL-2+ 30 | This package is free software; you can redistribute it and/or modify 31 | it under the terms of the GNU General Public License as published by 32 | the Free Software Foundation; either version 2 of the License, or 33 | (at your option) any later version. 34 | . 35 | This package is distributed in the hope that it will be useful, 36 | but WITHOUT ANY WARRANTY; without even the implied warranty of 37 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 38 | GNU General Public License for more details. 39 | . 40 | You should have received a copy of the GNU General Public License 41 | along with this program. If not, see 42 | . 43 | On Debian systems, the complete text of the GNU General 44 | Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". 45 | 46 | # Please also look if there are files or directories which have a 47 | # different copyright/license attached and list them here. 48 | # Please avoid picking licenses with terms that are more restrictive than the 49 | # packaged work, as it may make Debian's contributions unacceptable upstream. 50 | # 51 | # If you need, there are some extra license texts available in two places: 52 | # /usr/share/debhelper/dh_make/licenses/ 53 | # /usr/share/common-licenses/ 54 | --------------------------------------------------------------------------------