Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widevine L3 DRM support #16

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aosptree/vendor/devices-community/gd_rpi4/BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
BC_PATH := $(patsubst $(CURDIR)/%,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))

include glodroid/configuration/common/board-common.mk
include glodroid/devices-community/gd_rpi4/drm/board.mk

BOARD_MESA3D_GALLIUM_DRIVERS := vc4 v3d
BOARD_MESA3D_VULKAN_DRIVERS := broadcom
Expand Down
1 change: 1 addition & 0 deletions aosptree/vendor/devices-community/gd_rpi4/device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Copyright (C) 2020-2023 Roman Stratiienko ([email protected])

$(call inherit-product, glodroid/configuration/common/device-common.mk)
$(call inherit-product, glodroid/devices-community/gd_rpi4/drm/device.mk)

# Firmware
PRODUCT_COPY_FILES += \
Expand Down
3 changes: 3 additions & 0 deletions aosptree/vendor/devices-community/gd_rpi4/drm/board.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TARGET_ENABLE_MEDIADRM_64 := true

BOARD_VENDOR_SEPOLICY_DIRS += glodroid/devices-community/gd_rpi4/drm/sepolicy/vendor
5 changes: 5 additions & 0 deletions aosptree/vendor/devices-community/gd_rpi4/drm/device.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$(call inherit-product, vendor/brcm/rpi4/rpi4-vendor.mk)
rsglobal marked this conversation as resolved.
Show resolved Hide resolved

PRODUCT_PACKAGES += \
android.hardware.drm-service.clearkey \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ -.-.-.-.widevine \ ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, my bad, didn't see manifest changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to move those to gd_rpi4/drm or leave them in the vendor repo... if they stay in the vendor I should also move the Wi-Fi/BT firmware there to be consistent.

That's why I left this as a draft, we need to decide if we want L3 DRM support. If we do it is worth checking if it works on the pine phones or not. It should, L3 is software DRM.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rsglobal do you want to include L3 DRM for RP4? If yes, I'll clean up this draft and get rid of the /vendor/brcm/rpi4 repo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is the legal one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is the legal one.

I get it, L3 is available on Raspbian by apt (libwidevinecdm0). The question is whether we can include the android equivalent or not... I don't know how the license works

Copy link
Collaborator Author

@mikegapinski mikegapinski Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.tomshardware.com/uk/news/raspberry-pi-widevine

I could try reaching out to the foundation and see what they say, I am no lawyer. Those libs show up everywhere: https://gitlab.com/rockchip_android_s/rk/platform/vendor/Widevine/-/commit/785cdb58f100144c365f80ad47995b1989557467

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those libs I use come from coral-tp1a.220624.014 btw, I can always add a setup-makefiles script and include them conditionally. But does it change anything?


Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type mediadrm_vendor_data_file, file_type, data_file_type;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/vendor/bin/hw/android\.hardware\.drm-service\.widevine u:object_r:hal_drm_widevine_exec:s0
/vendor/bin/hw/android\.hardware\.drm-service\.clearkey u:object_r:hal_drm_clearkey_exec:s0
# Data
/data/vendor/mediadrm(/.*)? u:object_r:mediadrm_vendor_data_file:s0
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type hal_drm_widevine, domain;
type hal_drm_widevine_exec, exec_type, vendor_file_type, file_type;

init_daemon_domain(hal_drm_widevine)

hal_server_domain(hal_drm_widevine, hal_drm)

vndbinder_use(hal_drm_widevine);

allow hal_drm_widevine hal_allocator_server:fd use;
allow hal_drm mediacodec:fd use;

hal_client_domain(hal_drm_widevine, hal_graphics_composer);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
android.hardware.drm.IDrmFactory/widevine u:object_r:hal_drm_service:s0
4 changes: 4 additions & 0 deletions manifests/glodroid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<manifest>

<remote name="glodroid" fetch="https://github.com/glodroid/" />
<remote name="github" fetch="https://github.com/" />
<remote name="gnome" fetch="https://github.com/GNOME/" />
<remote name="mbroadband" fetch="https://gitlab.freedesktop.org/mobile-broadband" />
<remote name="dbus" fetch="https://gitlab.freedesktop.org/dbus" />
Expand Down Expand Up @@ -56,6 +57,9 @@
<!-- kernel/firmware components (platform) -->
<project path="glodroid/kernel/broadcom" remote="glodroid" name="glodroid_forks.git" groups="glodroid" revision="refs/tags/kernel-broadcom-v0.9.0" />

<!-- drm -->
<project path="vendor/brcm/rpi4" remote="github" name="tesla-android/android-vendor-brcm-rpi4.git" revision="74c1e0cef599c83ef4549b2560e16e93f7dd6714" />

<!-- compilers for platform components -->
<project path="prebuilts/gcc/linux-x86/aarch64/gcc-linaro-aarch64-linux-gnu"
remote="glodroid" name="linaro_gcc_prebuilts.git" groups="glodroid" revision="refs/tags/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu" />
Expand Down