mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 22:26:42 +00:00
Merge pull request #4288 from HiassofT/le10-rpi4-v4l2
RPi4: switch to KMS driver and enable v4l2 HEVC decoding
This commit is contained in:
commit
fe5853df5f
@ -19,8 +19,10 @@ PKG_CMAKE_OPTS_TARGET="-DBUILD_SHARED_LIBS=1 \
|
||||
-DHAVE_AOCEC_API=0 -DHAVE_AMLOGIC_API=0 \
|
||||
-DHAVE_GIT_BIN=0"
|
||||
|
||||
if [ "$PROJECT" = "RPi" ]; then
|
||||
if [ "$KODIPLAYER_DRIVER" = "bcm2835-driver" ]; then
|
||||
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET bcm2835-driver"
|
||||
else
|
||||
PKG_CMAKE_OPTS_TARGET+=" -DHAVE_RPI_LIB=0"
|
||||
fi
|
||||
|
||||
# libX11 and xrandr to read the sink's EDID, used to determine the PC's HDMI physical address
|
||||
@ -35,7 +37,7 @@ else
|
||||
fi
|
||||
|
||||
pre_configure_target() {
|
||||
if [ "$PROJECT" = "RPi" ]; then
|
||||
if [ "$KODIPLAYER_DRIVER" = "bcm2835-driver" ]; then
|
||||
# detecting RPi support fails without -lvchiq_arm
|
||||
export LDFLAGS="$LDFLAGS -lvchiq_arm"
|
||||
fi
|
||||
|
@ -0,0 +1,120 @@
|
||||
From c7852992ed9c4973e83d961fcf92b6be316e6b60 Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Mon, 16 Mar 2020 20:38:37 +0000
|
||||
Subject: [PATCH 1/3] vc4_hdmi: Reduce max pixel rate to hide 4k modes
|
||||
|
||||
vc4_hdmi: Increase pixel clock to 162MHz for 1920x1200@60
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
index 2d608cf9dff9..152c9d8c2898 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -1791,7 +1791,7 @@ static const struct vc4_hdmi_variant bcm2835_variant = {
|
||||
static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
|
||||
.id = 0,
|
||||
.audio_available = true,
|
||||
- .max_pixel_clock = 297000000,
|
||||
+ .max_pixel_clock = 162000000,
|
||||
.cec_input_clock = 27000000,
|
||||
.registers = vc5_hdmi_hdmi0_fields,
|
||||
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields),
|
||||
@@ -1819,7 +1819,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
|
||||
static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = {
|
||||
.id = 1,
|
||||
.audio_available = true,
|
||||
- .max_pixel_clock = 297000000,
|
||||
+ .max_pixel_clock = 162000000,
|
||||
.cec_input_clock = 27000000,
|
||||
.registers = vc5_hdmi_hdmi1_fields,
|
||||
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi1_fields),
|
||||
--
|
||||
2.20.1
|
||||
|
||||
|
||||
From cc54619b00f89058791d3211843d043caad0cf0c Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Tue, 10 Mar 2020 22:19:51 +0000
|
||||
Subject: [PATCH 2/3] vc4_hdmi: Set channel mapping as expected by kodi
|
||||
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
index 152c9d8c2898..057595ec853d 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -775,6 +775,10 @@ static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask)
|
||||
int i;
|
||||
u32 channel_map = 0;
|
||||
|
||||
+ /* hack: return the mapping expected by kodi until we have a way of configuring this */
|
||||
+ if (channel_mask == 0xff)
|
||||
+ return 0xb13f88;
|
||||
+
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (channel_mask & BIT(i))
|
||||
channel_map |= i << (3 * i);
|
||||
@@ -787,6 +791,10 @@ static u32 vc5_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask)
|
||||
int i;
|
||||
u32 channel_map = 0;
|
||||
|
||||
+ /* hack: return the mapping expected by kodi until we have a way of configuring this */
|
||||
+ if (channel_mask == 0xff)
|
||||
+ return 0x54237610;
|
||||
+
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (channel_mask & BIT(i))
|
||||
channel_map |= i << (4 * i);
|
||||
--
|
||||
2.20.1
|
||||
|
||||
|
||||
From c8d2ab620ecb95cd12708876000a76fc003990bb Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Tue, 10 Mar 2020 23:07:11 +0000
|
||||
Subject: [PATCH 3/3] vc4_hdmi: Set channel_allocation to something plausible
|
||||
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
index 057595ec853d..2a733ab5343c 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -329,6 +329,17 @@ static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder)
|
||||
|
||||
static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
|
||||
{
|
||||
+ static const u8 cea_map[] = {
|
||||
+ 0xff, // 0
|
||||
+ 0xff, // 1
|
||||
+ 0x00, // 2.0
|
||||
+ 0x01, // 2.1
|
||||
+ 0x03, // 3.1
|
||||
+ 0x09, // 4.1
|
||||
+ 0x0b, // 5.1
|
||||
+ 0x12, // 7.0
|
||||
+ 0x13, // 7.1
|
||||
+ };
|
||||
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
|
||||
union hdmi_infoframe frame;
|
||||
int ret;
|
||||
@@ -339,6 +350,10 @@ static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
|
||||
frame.audio.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM;
|
||||
frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM;
|
||||
frame.audio.channels = vc4_hdmi->audio.channels;
|
||||
+ if (frame.audio.channels < 2 || frame.audio.channels > 8)
|
||||
+ DRM_ERROR("Unable to map channels: %d\n", frame.audio.channels);
|
||||
+ else
|
||||
+ frame.audio.channel_allocation = cea_map[frame.audio.channels];
|
||||
|
||||
vc4_hdmi_write_infoframe(encoder, &frame);
|
||||
}
|
||||
--
|
||||
2.20.1
|
||||
|
@ -16,11 +16,28 @@ PKG_BUILD_FLAGS="-gold"
|
||||
# Dependencies
|
||||
get_graphicdrivers
|
||||
|
||||
PKG_FFMPEG_HWACCEL="--enable-hwaccels"
|
||||
|
||||
if [ "${V4L2_SUPPORT}" = "yes" ]; then
|
||||
PKG_DEPENDS_TARGET+=" libdrm"
|
||||
PKG_NEED_UNPACK+=" $(get_pkg_directory libdrm)"
|
||||
PKG_PATCH_DIRS+=" v4l2"
|
||||
PKG_FFMPEG_V4L2="--enable-v4l2_m2m --enable-libdrm"
|
||||
|
||||
if [ "${PROJECT}" = "RPi" ]; then
|
||||
PKG_PATCH_DIRS+=" v4l2-rpi"
|
||||
PKG_FFMPEG_RPI="--disable-rpi --disable-mmal"
|
||||
if [ "${DEVICE}" = "RPi4" ]; then
|
||||
PKG_DEPENDS_TARGET+=" systemd"
|
||||
PKG_NEED_UNPACK+=" $(get_pkg_directory systemd)"
|
||||
PKG_FFMPEG_V4L2+=" --enable-libudev \
|
||||
--enable-v4l2-request"
|
||||
PKG_FFMPEG_HWACCEL="--disable-hwaccel=h264_v4l2request \
|
||||
--disable-hwaccel=mpeg2_v4l2request \
|
||||
--disable-hwaccel=vp8_v4l2request"
|
||||
fi
|
||||
else
|
||||
PKG_PATCH_DIRS+=" v4l2"
|
||||
fi
|
||||
else
|
||||
PKG_FFMPEG_V4L2="--disable-v4l2_m2m"
|
||||
fi
|
||||
@ -58,6 +75,8 @@ if [ "${KODIPLAYER_DRIVER}" = "bcm2835-driver" ]; then
|
||||
PKG_DEPENDS_TARGET+=" bcm2835-driver"
|
||||
PKG_NEED_UNPACK+=" $(get_pkg_directory bcm2835-driver)"
|
||||
PKG_PATCH_DIRS+=" rpi-hevc"
|
||||
PKG_FFMPEG_LIBS="-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm"
|
||||
PKG_FFMPEG_RPI="--enable-rpi --enable-mmal"
|
||||
fi
|
||||
|
||||
if target_has_feature neon; then
|
||||
@ -79,11 +98,6 @@ fi
|
||||
pre_configure_target() {
|
||||
cd ${PKG_BUILD}
|
||||
rm -rf .${TARGET_NAME}
|
||||
|
||||
if [ "${KODIPLAYER_DRIVER}" = "bcm2835-driver" ]; then
|
||||
PKG_FFMPEG_LIBS="-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm"
|
||||
PKG_FFMPEG_RPI="--enable-rpi"
|
||||
fi
|
||||
}
|
||||
|
||||
configure_target() {
|
||||
@ -149,7 +163,7 @@ configure_target() {
|
||||
--enable-encoder=wmav2 \
|
||||
--enable-encoder=mjpeg \
|
||||
--enable-encoder=png \
|
||||
--enable-hwaccels \
|
||||
${PKG_FFMPEG_HWACCEL} \
|
||||
--disable-muxers \
|
||||
--enable-muxer=spdif \
|
||||
--enable-muxer=adts \
|
||||
|
@ -0,0 +1,78 @@
|
||||
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
|
||||
index fd87481a1c..d234271c5b 100644
|
||||
--- a/libavcodec/avcodec.h
|
||||
+++ b/libavcodec/avcodec.h
|
||||
@@ -2612,7 +2612,6 @@ typedef struct AVCodecContext {
|
||||
#define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders.
|
||||
#define FF_BUG_TRUNCATED 16384
|
||||
#define FF_BUG_IEDGE 32768
|
||||
-#define FF_BUG_GMC_UNSUPPORTED (1<<30)
|
||||
|
||||
/**
|
||||
* strictly follow the standard (MPEG-4, ...).
|
||||
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
|
||||
index 1bbb83eda3..12c63245f8 100644
|
||||
--- a/libavcodec/libdav1d.c
|
||||
+++ b/libavcodec/libdav1d.c
|
||||
@@ -53,16 +53,6 @@ static const enum AVPixelFormat pix_fmt_rgb[3] = {
|
||||
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12,
|
||||
};
|
||||
|
||||
-static enum AVPixelFormat libdav1d_get_format(AVCodecContext *avctx, const Dav1dPicture *p)
|
||||
-{
|
||||
- enum AVPixelFormat pix_fmts[2], *fmt = pix_fmts;
|
||||
-
|
||||
- *fmt++ = pix_fmt[p->p.layout][p->seq_hdr->hbd];
|
||||
- *fmt = AV_PIX_FMT_NONE;
|
||||
-
|
||||
- return ff_get_format(avctx, pix_fmts);
|
||||
-}
|
||||
-
|
||||
static void libdav1d_log_callback(void *opaque, const char *fmt, va_list vl)
|
||||
{
|
||||
AVCodecContext *c = opaque;
|
||||
@@ -239,7 +229,6 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
|
||||
c->profile = p->seq_hdr->profile;
|
||||
c->level = ((p->seq_hdr->operating_points[0].major_level - 2) << 2)
|
||||
| p->seq_hdr->operating_points[0].minor_level;
|
||||
- frame->format = c->pix_fmt = libdav1d_get_format(c, p);
|
||||
frame->width = p->p.w;
|
||||
frame->height = p->p.h;
|
||||
if (c->width != p->p.w || c->height != p->p.h) {
|
||||
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
|
||||
index fa208660c8..055afabc7e 100644
|
||||
--- a/libavcodec/mpeg4videodec.c
|
||||
+++ b/libavcodec/mpeg4videodec.c
|
||||
@@ -2662,9 +2662,6 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
|
||||
|
||||
if (ctx->divx_version >= 0)
|
||||
s->workaround_bugs |= FF_BUG_HPEL_CHROMA;
|
||||
-
|
||||
- if (ctx->num_sprite_warping_points > 1)
|
||||
- s->workaround_bugs |= FF_BUG_GMC_UNSUPPORTED;
|
||||
}
|
||||
|
||||
if (s->workaround_bugs & FF_BUG_STD_QPEL) {
|
||||
@@ -2689,7 +2686,6 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
|
||||
s->workaround_bugs, ctx->lavc_build, ctx->xvid_build,
|
||||
ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : "");
|
||||
|
||||
- avctx->workaround_bugs = s->workaround_bugs;
|
||||
if (CONFIG_MPEG4_DECODER && ctx->xvid_build >= 0 &&
|
||||
s->codec_id == AV_CODEC_ID_MPEG4 &&
|
||||
avctx->idct_algo == FF_IDCT_AUTO) {
|
||||
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
|
||||
index 6fb32fac77..d0df061e4d 100644
|
||||
--- a/libswscale/yuv2rgb.c
|
||||
+++ b/libswscale/yuv2rgb.c
|
||||
@@ -687,6 +687,10 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
|
||||
if (t)
|
||||
return t;
|
||||
|
||||
+ av_log(c, AV_LOG_WARNING,
|
||||
+ "No accelerated colorspace conversion found from %s to %s.\n",
|
||||
+ av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat));
|
||||
+
|
||||
switch (c->dstFormat) {
|
||||
case AV_PIX_FMT_BGR48BE:
|
||||
case AV_PIX_FMT_BGR48LE:
|
File diff suppressed because it is too large
Load Diff
@ -9,8 +9,8 @@
|
||||
# Memory (System/GPU configuration )
|
||||
################################################################################
|
||||
|
||||
# Default GPU memory split - at least 288M is needed for some 4k HEVC files
|
||||
gpu_mem=320
|
||||
# Default GPU memory split
|
||||
gpu_mem=76
|
||||
|
||||
################################################################################
|
||||
# For overclocking and various other settings, see:
|
||||
|
@ -2,6 +2,6 @@
|
||||
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
# WARNING: DO NOT EDIT THIS FILE - IT WILL BE OVERWRITTEN WHEN UPGRADING!
|
||||
dtoverlay=vc4-fkms-v3d
|
||||
dtoverlay=vc4-kms-v3d-pi4,cma-size=402653184
|
||||
dtoverlay=rpivid-v4l2
|
||||
disable_overscan=1
|
||||
dtparam=audio=on
|
||||
|
14
projects/RPi/devices/RPi4/kodi/appliance.xml
Normal file
14
projects/RPi/devices/RPi4/kodi/appliance.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<settings version="1">
|
||||
|
||||
<section id="system">
|
||||
<category id="audio">
|
||||
<group id="1">
|
||||
<setting id="audiooutput.audiodevice">
|
||||
<default>ALSA:hdmi:CARD=vc4hdmi,DEV=0</default>
|
||||
</setting>
|
||||
</group>
|
||||
</category>
|
||||
</section>
|
||||
|
||||
</settings>
|
@ -0,0 +1,27 @@
|
||||
From aeba1b05a001de407ed1618ec6b8b2e961879cde Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Thu, 12 Mar 2020 18:05:20 +0000
|
||||
Subject: [PATCH 4/8] DVDVideoCodecDRMPRIME: Increase thread count for hevc
|
||||
|
||||
rpi-vid hevc decoder works best with 3 threads
|
||||
---
|
||||
.../VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
index ba3c93d89d..f892b1140d 100644
|
||||
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
@@ -253,6 +253,9 @@ bool CDVDVideoCodecDRMPRIME::Open(CDVDStreamInfo& hints, CDVDCodecOptions& optio
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+ // rpi-vid hevc decoder works best with 3 threads
|
||||
+ if (pCodec->id == AV_CODEC_ID_HEVC)
|
||||
+ m_pCodecContext->thread_count = 3;
|
||||
|
||||
m_pCodecContext->pix_fmt = AV_PIX_FMT_DRM_PRIME;
|
||||
m_pCodecContext->opaque = static_cast<void*>(this);
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,104 @@
|
||||
From 63c6707ac488e5bb61da045845cf533f39899dbf Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Fri, 27 Mar 2020 15:14:11 +0000
|
||||
Subject: [PATCH 6/8] VideoPlayer: Add setting to disable non-hevc accel
|
||||
|
||||
---
|
||||
addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++
|
||||
system/settings/gbm.xml | 6 ++++++
|
||||
.../DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp | 7 +++++++
|
||||
xbmc/settings/Settings.cpp | 2 ++
|
||||
xbmc/settings/Settings.h | 1 +
|
||||
5 files changed, 26 insertions(+)
|
||||
|
||||
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
|
||||
index 35706f9f07..2ae4e31231 100644
|
||||
--- a/addons/resource.language.en_gb/resources/strings.po
|
||||
+++ b/addons/resource.language.en_gb/resources/strings.po
|
||||
@@ -7275,6 +7275,16 @@ msgctxt "#13467"
|
||||
msgid "Unlimited / 1080 (>30Hz)"
|
||||
msgstr ""
|
||||
|
||||
+#: system/settings/settings.xml
|
||||
+msgctxt "#13500"
|
||||
+msgid "Only allow acceleration for HEVC"
|
||||
+msgstr ""
|
||||
+
|
||||
+#: system/settings/settings.xml
|
||||
+msgctxt "#13501"
|
||||
+msgid "This option disables acceleration for other codecs as they don't currently support seeking with V4L2"
|
||||
+msgstr ""
|
||||
+
|
||||
#empty strings from id 13468 to 13504
|
||||
|
||||
#: system/settings/settings.xml
|
||||
diff --git a/system/settings/gbm.xml b/system/settings/gbm.xml
|
||||
index cdc6c2b284..fa6a14d4c6 100644
|
||||
--- a/system/settings/gbm.xml
|
||||
+++ b/system/settings/gbm.xml
|
||||
@@ -26,6 +26,12 @@
|
||||
<default>true</default>
|
||||
<control type="toggle" />
|
||||
</setting>
|
||||
+ <setting id="videoplayer.disablenonhevc" type="boolean" label="13500" help="13501">
|
||||
+ <visible>true</visible>
|
||||
+ <level>2</level>
|
||||
+ <default>true</default>
|
||||
+ <control type="toggle" />
|
||||
+ </setting>
|
||||
<setting id="videoplayer.useprimerenderer" type="integer" label="13462" help="13463">
|
||||
<visible>false</visible>
|
||||
<level>2</level>
|
||||
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
index f892b1140d..d25c64012c 100644
|
||||
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
@@ -221,6 +221,13 @@ int CDVDVideoCodecDRMPRIME::GetBuffer(struct AVCodecContext* avctx, AVFrame* fra
|
||||
|
||||
bool CDVDVideoCodecDRMPRIME::Open(CDVDStreamInfo& hints, CDVDCodecOptions& options)
|
||||
{
|
||||
+ if (CServiceBroker::GetSettingsComponent()->GetSettings()->GetBool(CSettings::SETTING_VIDEOPLAYER_DISABLE_NON_HEVC) && hints.codec != AV_CODEC_ID_HEVC)
|
||||
+ {
|
||||
+ CLog::Log(LOGNOTICE, "CDVDVideoCodecDRMPRIME::{} - codec {} disallowed",
|
||||
+ __FUNCTION__, hints.codec);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
const AVCodec* pCodec = FindDecoder(hints);
|
||||
if (!pCodec)
|
||||
{
|
||||
diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp
|
||||
index 67e87a53e5..2d91880849 100644
|
||||
--- a/xbmc/settings/Settings.cpp
|
||||
+++ b/xbmc/settings/Settings.cpp
|
||||
@@ -135,6 +135,7 @@ const std::string CSettings::SETTING_VIDEOPLAYER_RENDERMETHOD = "videoplayer.ren
|
||||
const std::string CSettings::SETTING_VIDEOPLAYER_HQSCALERS = "videoplayer.hqscalers";
|
||||
const std::string CSettings::SETTING_VIDEOPLAYER_USEMEDIACODEC = "videoplayer.usemediacodec";
|
||||
const std::string CSettings::SETTING_VIDEOPLAYER_USEMEDIACODECSURFACE = "videoplayer.usemediacodecsurface";
|
||||
+const std::string CSettings::SETTING_VIDEOPLAYER_DISABLE_NON_HEVC = "videoplayer.disablenonhevc";
|
||||
const std::string CSettings::SETTING_VIDEOPLAYER_USEVDPAU = "videoplayer.usevdpau";
|
||||
const std::string CSettings::SETTING_VIDEOPLAYER_USEVDPAUMIXER = "videoplayer.usevdpaumixer";
|
||||
const std::string CSettings::SETTING_VIDEOPLAYER_USEVDPAUMPEG2 = "videoplayer.usevdpaumpeg2";
|
||||
@@ -954,6 +955,7 @@ void CSettings::InitializeISettingCallbacks()
|
||||
settingSet.insert(CSettings::SETTING_VIDEOSCREEN_TESTPATTERN);
|
||||
settingSet.insert(CSettings::SETTING_VIDEOPLAYER_USEMEDIACODEC);
|
||||
settingSet.insert(CSettings::SETTING_VIDEOPLAYER_USEMEDIACODECSURFACE);
|
||||
+ settingSet.insert(CSettings::SETTING_VIDEOPLAYER_DISABLE_NON_HEVC);
|
||||
settingSet.insert(CSettings::SETTING_AUDIOOUTPUT_VOLUMESTEPS);
|
||||
settingSet.insert(CSettings::SETTING_SOURCE_VIDEOS);
|
||||
settingSet.insert(CSettings::SETTING_SOURCE_MUSIC);
|
||||
diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h
|
||||
index 7280587324..3dbaeeb234 100644
|
||||
--- a/xbmc/settings/Settings.h
|
||||
+++ b/xbmc/settings/Settings.h
|
||||
@@ -100,6 +100,7 @@ public:
|
||||
static const std::string SETTING_VIDEOPLAYER_HQSCALERS;
|
||||
static const std::string SETTING_VIDEOPLAYER_USEMEDIACODEC;
|
||||
static const std::string SETTING_VIDEOPLAYER_USEMEDIACODECSURFACE;
|
||||
+ static const std::string SETTING_VIDEOPLAYER_DISABLE_NON_HEVC;
|
||||
static const std::string SETTING_VIDEOPLAYER_USEVDPAU;
|
||||
static const std::string SETTING_VIDEOPLAYER_USEVDPAUMIXER;
|
||||
static const std::string SETTING_VIDEOPLAYER_USEVDPAUMPEG2;
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,49 @@
|
||||
From 48b41250d45c98ca19c8684bc5cdf4cde208c814 Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Wed, 8 Apr 2020 11:19:22 +0100
|
||||
Subject: [PATCH 7/8] pi4: hack: Try to hide pixel wrap issue
|
||||
|
||||
---
|
||||
.../VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp | 4 ++--
|
||||
xbmc/windowing/gbm/DRMAtomic.cpp | 4 ++--
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
|
||||
index bcb4badb9b..4aa0230460 100644
|
||||
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
|
||||
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
|
||||
@@ -238,11 +238,11 @@ void CVideoLayerBridgeDRMPRIME::SetVideoPlane(CVideoBufferDRMPRIME* buffer, cons
|
||||
m_DRM->AddProperty(plane, "CRTC_ID", m_DRM->GetCrtc()->crtc->crtc_id);
|
||||
m_DRM->AddProperty(plane, "SRC_X", 0);
|
||||
m_DRM->AddProperty(plane, "SRC_Y", 0);
|
||||
- m_DRM->AddProperty(plane, "SRC_W", buffer->GetWidth() << 16);
|
||||
+ m_DRM->AddProperty(plane, "SRC_W", (buffer->GetWidth()-2) << 16);
|
||||
m_DRM->AddProperty(plane, "SRC_H", buffer->GetHeight() << 16);
|
||||
m_DRM->AddProperty(plane, "CRTC_X", static_cast<int32_t>(destRect.x1) & ~1);
|
||||
m_DRM->AddProperty(plane, "CRTC_Y", static_cast<int32_t>(destRect.y1) & ~1);
|
||||
- m_DRM->AddProperty(plane, "CRTC_W", (static_cast<uint32_t>(destRect.Width()) + 1) & ~1);
|
||||
+ m_DRM->AddProperty(plane, "CRTC_W", (static_cast<uint32_t>(destRect.Width()) + 1) & ~1)-2;
|
||||
m_DRM->AddProperty(plane, "CRTC_H", (static_cast<uint32_t>(destRect.Height()) + 1) & ~1);
|
||||
}
|
||||
|
||||
diff --git a/xbmc/windowing/gbm/DRMAtomic.cpp b/xbmc/windowing/gbm/DRMAtomic.cpp
|
||||
index 092ad3fc18..178705236c 100644
|
||||
--- a/xbmc/windowing/gbm/DRMAtomic.cpp
|
||||
+++ b/xbmc/windowing/gbm/DRMAtomic.cpp
|
||||
@@ -69,11 +69,11 @@ void CDRMAtomic::DrmAtomicCommit(int fb_id, int flags, bool rendered, bool video
|
||||
AddProperty(m_gui_plane, "CRTC_ID", m_crtc->crtc->crtc_id);
|
||||
AddProperty(m_gui_plane, "SRC_X", 0);
|
||||
AddProperty(m_gui_plane, "SRC_Y", 0);
|
||||
- AddProperty(m_gui_plane, "SRC_W", m_width << 16);
|
||||
+ AddProperty(m_gui_plane, "SRC_W", (m_width-2) << 16);
|
||||
AddProperty(m_gui_plane, "SRC_H", m_height << 16);
|
||||
AddProperty(m_gui_plane, "CRTC_X", 0);
|
||||
AddProperty(m_gui_plane, "CRTC_Y", 0);
|
||||
- AddProperty(m_gui_plane, "CRTC_W", m_mode->hdisplay);
|
||||
+ AddProperty(m_gui_plane, "CRTC_W", m_mode->hdisplay-2);
|
||||
AddProperty(m_gui_plane, "CRTC_H", m_mode->vdisplay);
|
||||
}
|
||||
else if (videoLayer && !CServiceBroker::GetGUI()->GetWindowManager().HasVisibleControls())
|
||||
--
|
||||
2.20.1
|
||||
|
67
projects/RPi/filesystem/usr/share/alsa/cards/vc4-hdmi.conf
Normal file
67
projects/RPi/filesystem/usr/share/alsa/cards/vc4-hdmi.conf
Normal file
@ -0,0 +1,67 @@
|
||||
# Configuration for the VC4-HDMI sound card using software IEC958
|
||||
# subframe conversion
|
||||
|
||||
<confdir:pcm/hdmi.conf>
|
||||
vc4-hdmi.pcm.hdmi.0 {
|
||||
@args [ CARD AES0 AES1 AES2 AES3 ]
|
||||
@args.CARD {
|
||||
type string
|
||||
}
|
||||
@args.AES0 {
|
||||
type integer
|
||||
}
|
||||
@args.AES1 {
|
||||
type integer
|
||||
}
|
||||
@args.AES2 {
|
||||
type integer
|
||||
}
|
||||
@args.AES3 {
|
||||
type integer
|
||||
}
|
||||
type iec958
|
||||
slave {
|
||||
format IEC958_SUBFRAME_LE
|
||||
pcm {
|
||||
type hooks
|
||||
slave.pcm {
|
||||
type hw
|
||||
card $CARD
|
||||
device 0
|
||||
}
|
||||
hooks.0 {
|
||||
type ctl_elems
|
||||
hook_args [
|
||||
{
|
||||
name "IEC958 Playback Default"
|
||||
optional true
|
||||
lock true
|
||||
preserve true
|
||||
value [ $AES0 $AES1 $AES2 $AES3 ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
status [ $AES0 $AES1 $AES2 $AES3 ]
|
||||
}
|
||||
|
||||
# default with plug
|
||||
vc4-hdmi.pcm.default {
|
||||
@args [ CARD ]
|
||||
@args.CARD {
|
||||
type string
|
||||
}
|
||||
type plug
|
||||
slave.pcm {
|
||||
type softvol
|
||||
slave.pcm {
|
||||
@func concat
|
||||
strings [ "hdmi:" $CARD ]
|
||||
}
|
||||
control {
|
||||
name "PCM Playback Volume"
|
||||
card $CARD
|
||||
}
|
||||
}
|
||||
}
|
@ -93,6 +93,9 @@
|
||||
# KODI Player implementation to use (default / bcm2835-driver / mesa)
|
||||
KODIPLAYER_DRIVER="bcm2835-driver"
|
||||
|
||||
# use the kernel CEC framework for libcec (yes / no)
|
||||
CEC_FRAMEWORK_SUPPORT="yes"
|
||||
|
||||
# additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware)
|
||||
# Space separated list is supported,
|
||||
# e.g. FIRMWARE="dvb-firmware misc-firmware wlan-firmware"
|
||||
|
Loading…
x
Reference in New Issue
Block a user