Merge pull request #3618 from HiassofT/le92-kodi-vendor-rpi4

kodi: switch RPi4 to use vendor tree
This commit is contained in:
MilhouseVH 2019-07-05 22:52:20 +01:00 committed by GitHub
commit 5fd83ea792
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 192 additions and 5490 deletions

View File

@ -17,6 +17,12 @@ case $KODI_VENDOR in
PKG_URL="https://github.com/popcornmix/xbmc/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_NAME="kodi-$KODI_VENDOR-$PKG_VERSION.tar.gz"
;;
raspberrypi4)
PKG_VERSION="932b08f071fd6cf8d95d01fe0c9e186821a38983" # 18.3-Leia
PKG_SHA256="4f678f48baedca0b6bfacec451424d38a8b8b04c47490899c656305de72f8a15"
PKG_URL="https://github.com/popcornmix/xbmc/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_NAME="kodi-$KODI_VENDOR-$PKG_VERSION.tar.gz"
;;
rockchip)
PKG_VERSION="rockchip_18.3-Leia-v2"
PKG_SHA256="dfce13129aa8381a4e06cd6c0f597c6212f4230184723edf802d06ea20d5509b"

View File

@ -0,0 +1,167 @@
From e4a12e4cdcec5d3482302258daedf1392f4c147a Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Wed, 26 Sep 2018 02:47:03 +0100
Subject: [PATCH] allow using alsa and pulse together
rebased on leia_pi4 branch, WinSystemGbm.cpp had a merge conflict
because PiSink is added there, too.
---
xbmc/windowing/X11/WinSystemX11GLContext.cpp | 35 ++-----------------
xbmc/windowing/amlogic/WinSystemAmlogic.cpp | 2 ++
xbmc/windowing/gbm/WinSystemGbm.cpp | 36 ++------------------
xbmc/windowing/rpi/WinSystemRpi.cpp | 17 +++------
4 files changed, 10 insertions(+), 80 deletions(-)
diff --git a/xbmc/windowing/X11/WinSystemX11GLContext.cpp b/xbmc/windowing/X11/WinSystemX11GLContext.cpp
index 5b0b155736..a3a3251a5d 100644
--- a/xbmc/windowing/X11/WinSystemX11GLContext.cpp
+++ b/xbmc/windowing/X11/WinSystemX11GLContext.cpp
@@ -40,39 +40,8 @@ std::unique_ptr<CWinSystemBase> CWinSystemBase::CreateWinSystem()
CWinSystemX11GLContext::CWinSystemX11GLContext()
{
- std::string envSink;
- if (getenv("KODI_AE_SINK"))
- envSink = getenv("KODI_AE_SINK");
- if (StringUtils::EqualsNoCase(envSink, "ALSA"))
- {
- OPTIONALS::ALSARegister();
- }
- else if (StringUtils::EqualsNoCase(envSink, "PULSE"))
- {
- OPTIONALS::PulseAudioRegister();
- }
- else if (StringUtils::EqualsNoCase(envSink, "OSS"))
- {
- OPTIONALS::OSSRegister();
- }
- else if (StringUtils::EqualsNoCase(envSink, "SNDIO"))
- {
- OPTIONALS::SndioRegister();
- }
- else
- {
- if (!OPTIONALS::PulseAudioRegister())
- {
- if (!OPTIONALS::ALSARegister())
- {
- if (!OPTIONALS::SndioRegister())
- {
- OPTIONALS::OSSRegister();
- }
- }
- }
- }
-
+ OPTIONALS::ALSARegister();
+ OPTIONALS::PulseAudioRegister();
m_lirc.reset(OPTIONALS::LircRegister());
}
diff --git a/xbmc/windowing/amlogic/WinSystemAmlogic.cpp b/xbmc/windowing/amlogic/WinSystemAmlogic.cpp
index 0637f83fc0..b1b41b0503 100644
--- a/xbmc/windowing/amlogic/WinSystemAmlogic.cpp
+++ b/xbmc/windowing/amlogic/WinSystemAmlogic.cpp
@@ -20,6 +20,7 @@
// AESink Factory
#include "cores/AudioEngine/AESinkFactory.h"
#include "cores/AudioEngine/Sinks/AESinkALSA.h"
+#include "cores/AudioEngine/Sinks/AESinkPULSE.h"
#include "windowing/GraphicContext.h"
#include "windowing/Resolution.h"
#include "platform/linux/powermanagement/LinuxPowerSyscall.h"
@@ -67,6 +68,7 @@ CWinSystemAmlogic::CWinSystemAmlogic() :
// Register sink
AE::CAESinkFactory::ClearSinks();
CAESinkALSA::Register();
+ CAESinkPULSE::Register();
CLinuxPowerSyscall::Register();
m_lirc.reset(OPTIONALS::LircRegister());
m_libinput->Start();
diff --git a/xbmc/windowing/gbm/WinSystemGbm.cpp b/xbmc/windowing/gbm/WinSystemGbm.cpp
index 65606911ed..dc5a61bb54 100644
--- a/xbmc/windowing/gbm/WinSystemGbm.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbm.cpp
@@ -34,41 +34,9 @@ CWinSystemGbm::CWinSystemGbm() :
m_GBM(new CGBMUtils),
m_libinput(new CLibInputHandler)
{
- std::string envSink;
-
CAESinkPi::Register();
-
- if (getenv("KODI_AE_SINK"))
- envSink = getenv("KODI_AE_SINK");
- if (StringUtils::EqualsNoCase(envSink, "ALSA"))
- {
- OPTIONALS::ALSARegister();
- }
- else if (StringUtils::EqualsNoCase(envSink, "PULSE"))
- {
- OPTIONALS::PulseAudioRegister();
- }
- else if (StringUtils::EqualsNoCase(envSink, "OSS"))
- {
- OPTIONALS::OSSRegister();
- }
- else if (StringUtils::EqualsNoCase(envSink, "SNDIO"))
- {
- OPTIONALS::SndioRegister();
- }
- else
- {
- if (!OPTIONALS::PulseAudioRegister())
- {
- if (!OPTIONALS::ALSARegister())
- {
- if (!OPTIONALS::SndioRegister())
- {
- OPTIONALS::OSSRegister();
- }
- }
- }
- }
+ OPTIONALS::ALSARegister();
+ OPTIONALS::PulseAudioRegister();
CLinuxPowerSyscall::Register();
m_lirc.reset(OPTIONALS::LircRegister());
diff --git a/xbmc/windowing/rpi/WinSystemRpi.cpp b/xbmc/windowing/rpi/WinSystemRpi.cpp
index bdeb68c8c0..f5bc22c3cb 100644
--- a/xbmc/windowing/rpi/WinSystemRpi.cpp
+++ b/xbmc/windowing/rpi/WinSystemRpi.cpp
@@ -22,7 +22,9 @@
#include "guilib/DispResource.h"
#include "utils/log.h"
#include "cores/AudioEngine/AESinkFactory.h"
+#include "cores/AudioEngine/Sinks/AESinkALSA.h"
#include "cores/AudioEngine/Sinks/AESinkPi.h"
+#include "cores/AudioEngine/Sinks/AESinkPULSE.h"
#include "platform/linux/powermanagement/LinuxPowerSyscall.h"
#include <EGL/egl.h>
@@ -45,19 +47,8 @@ CWinSystemRpi::CWinSystemRpi() :
AE::CAESinkFactory::ClearSinks();
CAESinkPi::Register();
- std::string envSink;
- if (getenv("KODI_AE_SINK"))
- envSink = getenv("KODI_AE_SINK");
-
- if (StringUtils::EqualsNoCase(envSink, "PULSE"))
- {
- OPTIONALS::PulseAudioRegister();
- }
- else
- {
- OPTIONALS::ALSARegister();
- }
-
+ CAESinkALSA::Register();
+ CAESinkPULSE::Register();
CLinuxPowerSyscall::Register();
m_lirc.reset(OPTIONALS::LircRegister());
m_libinput->Start();
--
2.20.1

View File

@ -0,0 +1 @@
../default/kodi-100.14-use-alsa-and-pulse-together.patch

View File

@ -546,10 +546,10 @@ index 7d73da8676..01799f869a 100644
#endif /* AVCODEC_HWACCELS_H */
diff --git a/libavcodec/rpi_ctrl_ffmpeg.c b/libavcodec/rpi_ctrl_ffmpeg.c
new file mode 100644
index 0000000000..6d93adba03
index 0000000000..af00de6339
--- /dev/null
+++ b/libavcodec/rpi_ctrl_ffmpeg.c
@@ -0,0 +1,427 @@
@@ -0,0 +1,433 @@
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
@ -704,7 +704,6 @@ index 0000000000..6d93adba03
+
+struct RPI_DEBUG {
+ FILE *fp_reg;
+ FILE *fp_bin;
+ int mbox;
+ GPU_MEM_PTR_T axi;
+ void *read_buf;
@ -947,14 +946,21 @@ index 0000000000..6d93adba03
+
+ bcm_host_init();
+ vcsm_init();
+
+ rpi->fp_reg = stderr;
+ rpi->apb = setup_io("/dev/argon-hevcmem", 0);
+ rpi->interrupt = setup_io("/dev/argon-intcmem", 0);
+ //rpi->sdram = setup_io(0xfe001000);
+
+ rpi->fp_bin = stderr;
+ rpi->fp_reg = stderr;
+ if (!rpi->apb)
+ return "Failed to open apb";
+ if (!rpi->interrupt)
+ return "Failed to open interrupt";
+
+ rpi->mbox = mbox_open();
+ if (rpi->mbox < 0)
+ return "Failed to open mbox";
+
+ if ((CACHED ? gpu_malloc_cached_internal:gpu_malloc_uncached_internal)(rpi->mbox, AXI_MEM_SIZE, &rpi->axi) != 0)
+ return "out of memory";
+
@ -966,8 +972,8 @@ index 0000000000..6d93adba03
+void rpi_ctrl_ffmpeg_free(void *id) {
+ struct RPI_DEBUG *rpi = (struct RPI_DEBUG *) id;
+ printf("%s id=%p\n", __FUNCTION__, rpi);
+ release_io(rpi->apb);
+ release_io(rpi->interrupt);
+ release_io((void *)rpi->apb);
+ release_io((void *)rpi->interrupt);
+ gpu_free_internal(rpi->mbox, &rpi->axi);
+ printf("%s freed axi mem\n", __FUNCTION__);
+ mbox_close(rpi->mbox);
@ -2310,10 +2316,10 @@ index 0000000000..f54657a957
+} RPI_T;
diff --git a/libavcodec/rpi_mailbox.c b/libavcodec/rpi_mailbox.c
new file mode 100644
index 0000000000..5f23e9b36c
index 0000000000..1b3532ba02
--- /dev/null
+++ b/libavcodec/rpi_mailbox.c
@@ -0,0 +1,149 @@
@@ -0,0 +1,150 @@
+/*
+Copyright (c) 2012, Broadcom Europe Ltd.
+All rights reserved.
@ -2350,6 +2356,7 @@ index 0000000000..5f23e9b36c
+#include <unistd.h>
+#include <assert.h>
+#include <stdint.h>
+#include <errno.h>
+#include <sys/ioctl.h>
+
+#include <linux/ioctl.h>
@ -2451,7 +2458,7 @@ index 0000000000..5f23e9b36c
+ // open a char device file used for communicating with kernel mbox driver
+ file_desc = open(DEVICE_FILE_NAME, 0);
+ if (file_desc < 0) {
+ printf("Can't open device file: %s\n", DEVICE_FILE_NAME);
+ printf("Can't open device file: %s (%d)\n", DEVICE_FILE_NAME, errno);
+ printf("Try creating a device file with: sudo mknod %s c %d 0\n", DEVICE_FILE_NAME, MAJOR_NUM);
+ }
+ return file_desc;

View File

@ -11,4 +11,4 @@
OPENGLES="mesa"
GRAPHIC_DRIVERS="vc4"
KODIPLAYER_DRIVER="mesa"
unset KODI_VENDOR
KODI_VENDOR="raspberrypi4"

View File

@ -1,206 +0,0 @@
From 8f0d283542fa8c55f2a9cdd520271b0b471e3393 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 10 Jun 2019 22:07:55 +0100
Subject: [PATCH] RBP: add PiSink
---
xbmc/cores/AudioEngine/CMakeLists.txt | 3 +++
xbmc/platform/linux/CMakeLists.txt | 10 +++++-----
xbmc/platform/linux/RBP.cpp | 24 ++++++++++++------------
xbmc/platform/linux/RBP.h | 22 +++++++++++-----------
xbmc/windowing/gbm/WinSystemGbm.cpp | 2 ++
5 files changed, 33 insertions(+), 28 deletions(-)
diff --git a/xbmc/cores/AudioEngine/CMakeLists.txt b/xbmc/cores/AudioEngine/CMakeLists.txt
index 060c6a960d..e5b80cf54a 100644
--- a/xbmc/cores/AudioEngine/CMakeLists.txt
+++ b/xbmc/cores/AudioEngine/CMakeLists.txt
@@ -101,6 +101,9 @@ if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
Sinks/AESinkPi.h)
endif()
+ list(APPEND SOURCES Sinks/AESinkPi.cpp)
+ list(APPEND HEADERS Sinks/AESinkPi.h)
+
if(CORE_SYSTEM_NAME STREQUAL osx)
list(APPEND SOURCES Sinks/AESinkDARWINOSX.cpp
Sinks/osx/AEDeviceEnumerationOSX.cpp
diff --git a/xbmc/platform/linux/CMakeLists.txt b/xbmc/platform/linux/CMakeLists.txt
index 88076c3d5a..16cdd478be 100644
--- a/xbmc/platform/linux/CMakeLists.txt
+++ b/xbmc/platform/linux/CMakeLists.txt
@@ -39,7 +39,7 @@ if(DBUS_FOUND)
DBusUtil.h)
endif()
-if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
+#if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
list(APPEND SOURCES RBP.cpp
OMXClock.cpp
OMXCore.cpp)
@@ -48,10 +48,10 @@ if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
DllOMX.h
OMXClock.h
OMXCore.h)
-else()
- list(APPEND SOURCES RBP.cpp)
- list(APPEND HEADERS RBP.h)
-endif()
+#else()
+# list(APPEND SOURCES RBP.cpp)
+# list(APPEND HEADERS RBP.h)
+#endif()
if(HAVE_SSE4_1)
add_subdirectory(sse4)
diff --git a/xbmc/platform/linux/RBP.cpp b/xbmc/platform/linux/RBP.cpp
index 6c045e9674..9ff4ed4e6f 100644
--- a/xbmc/platform/linux/RBP.cpp
+++ b/xbmc/platform/linux/RBP.cpp
@@ -68,13 +68,13 @@ typedef int vc_image_t_size_check[(sizeof(VC_IMAGE_T) == 64) * 2 - 1];
CRBP::CRBP()
{
m_initialized = false;
-#ifdef TARGET_RASPBERRY_PI
+//#ifdef TARGET_RASPBERRY_PI
m_omx_initialized = false;
-#endif
+//#endif
m_DllBcmHost = new DllBcmHost();
-#ifdef TARGET_RASPBERRY_PI
+//#ifdef TARGET_RASPBERRY_PI
m_OMX = new COMXCore();
-#endif
+//#endif
m_display = DISPMANX_NO_HANDLE;
m_mb = mbox_open();
vcsm_init();
@@ -103,11 +103,11 @@ bool CRBP::Initialize()
m_DllBcmHost->bcm_host_init();
-#ifdef TARGET_RASPBERRY_PI
+//#ifdef TARGET_RASPBERRY_PI
m_omx_initialized = m_OMX->Initialize();
if(!m_omx_initialized)
return false;
-#endif
+//#endif
char response[80] = "";
m_arm_mem = 0;
@@ -278,13 +278,13 @@ uint32_t CRBP::LastVsync()
void CRBP::Deinitialize()
{
-#ifdef TARGET_RASPBERRY_PI
- if (m_omx_image_init)
- g_OMXImage.Deinitialize();
+//#ifdef TARGET_RASPBERRY_PI
+// if (m_omx_image_init)
+// g_OMXImage.Deinitialize();
if(m_omx_initialized)
m_OMX->Deinitialize();
-#endif
+//#endif
m_DllBcmHost->bcm_host_deinit();
@@ -295,9 +295,9 @@ void CRBP::Deinitialize()
m_omx_image_init = false;
#endif
m_initialized = false;
-#ifdef TARGET_RASPBERRY_PI
+//#ifdef TARGET_RASPBERRY_PI
m_omx_initialized = false;
-#endif
+//#endif
if (m_mb)
mbox_close(m_mb);
m_mb = 0;
diff --git a/xbmc/platform/linux/RBP.h b/xbmc/platform/linux/RBP.h
index 63e02a1826..d3f46d34a1 100644
--- a/xbmc/platform/linux/RBP.h
+++ b/xbmc/platform/linux/RBP.h
@@ -19,9 +19,9 @@
#endif
#include "DllBCM.h"
-#ifdef TARGET_RASPBERRY_PI
+//#ifdef TARGET_RASPBERRY_PI
#include "OMXCore.h"
-#endif
+//#endif
#include "xbmc/utils/CPUInfo.h"
#include "threads/CriticalSection.h"
#include "threads/Event.h"
@@ -97,9 +97,9 @@ public:
int GetGUIResolutionLimit() { return m_gui_resolution_limit; }
// stride can be null for packed output
unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true);
-#ifdef TARGET_RASPBERRY_PI
+//#ifdef TARGET_RASPBERRY_PI
DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; }
-#endif
+//#endif
uint32_t LastVsync(int64_t &time);
uint32_t LastVsync();
uint32_t WaitVsync(uint32_t target = ~0U);
@@ -110,26 +110,26 @@ public:
private:
DllBcmHost *m_DllBcmHost;
bool m_initialized;
-#ifdef TARGET_RASPBERRY_PI
+//#ifdef TARGET_RASPBERRY_PI
bool m_omx_initialized;
- bool m_omx_image_init;
-#endif
+ //bool m_omx_image_init;
+//#endif
int m_arm_mem;
int m_gpu_mem;
int m_gui_resolution_limit;
bool m_codec_mpg2_enabled;
bool m_codec_wvc1_enabled;
-#ifdef TARGET_RASPBERRY_PI
+//#ifdef TARGET_RASPBERRY_PI
COMXCore *m_OMX;
-#endif
+//#endif
DISPMANX_DISPLAY_HANDLE_T m_display;
CCriticalSection m_vsync_lock;
XbmcThreads::ConditionVariable m_vsync_cond;
uint32_t m_vsync_count;
int64_t m_vsync_time;
-#ifdef TARGET_RASPBERRY_PI
+//#ifdef TARGET_RASPBERRY_PI
class DllLibOMXCore;
-#endif
+//#endif
CCriticalSection m_critSection;
int m_mb;
diff --git a/xbmc/windowing/gbm/WinSystemGbm.cpp b/xbmc/windowing/gbm/WinSystemGbm.cpp
index 9ad1f2daf1..418e0cf8b1 100644
--- a/xbmc/windowing/gbm/WinSystemGbm.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbm.cpp
@@ -25,6 +25,7 @@
#include "DRMLegacy.h"
#include "OffScreenModeSetting.h"
#include "messaging/ApplicationMessenger.h"
+#include "cores/AudioEngine/Sinks/AESinkPi.h"
using namespace KODI::WINDOWING::GBM;
@@ -33,6 +34,7 @@ CWinSystemGbm::CWinSystemGbm() :
m_GBM(new CGBMUtils),
m_libinput(new CLibInputHandler)
{
+ CAESinkPi::Register();
OPTIONALS::ALSARegister();
OPTIONALS::PulseAudioRegister();
--
2.20.1