kodi: adapt ALSA/PULSE for PR16913

This commit is contained in:
MilhouseVH 2019-11-14 15:08:45 +00:00
parent d0f5bf579c
commit 67fe7002d4
2 changed files with 1 additions and 188 deletions

View File

@ -1,188 +0,0 @@
From c8265155b5aa6716c6c74e15f255dd1bdbdf2441 Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Wed, 10 Jul 2019 17:52:11 +0100
Subject: [PATCH] allow using alsa and pulse together
---
xbmc/windowing/X11/WinSystemX11GLContext.cpp | 35 ++--------------------------
xbmc/windowing/gbm/WinSystemGbm.cpp | 34 ++-------------------------
xbmc/windowing/rpi/WinSystemRpi.cpp | 17 ++++----------
xbmc/windowing/wayland/WinSystemWayland.cpp | 35 +++-------------------------
4 files changed, 11 insertions(+), 110 deletions(-)
diff --git a/xbmc/windowing/X11/WinSystemX11GLContext.cpp b/xbmc/windowing/X11/WinSystemX11GLContext.cpp
index 8ff2abd..1c00a93 100644
--- a/xbmc/windowing/X11/WinSystemX11GLContext.cpp
+++ b/xbmc/windowing/X11/WinSystemX11GLContext.cpp
@@ -43,39 +43,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/gbm/WinSystemGbm.cpp b/xbmc/windowing/gbm/WinSystemGbm.cpp
index a714192..4b52e39 100644
--- a/xbmc/windowing/gbm/WinSystemGbm.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbm.cpp
@@ -35,38 +35,8 @@ CWinSystemGbm::CWinSystemGbm() :
m_GBM(new CGBMUtils),
m_libinput(new CLibInputHandler)
{
- 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_dpms = std::make_shared<CGBMDPMSSupport>();
CLinuxPowerSyscall::Register();
diff --git a/xbmc/windowing/rpi/WinSystemRpi.cpp b/xbmc/windowing/rpi/WinSystemRpi.cpp
index 75fbe56..ac06490 100644
--- a/xbmc/windowing/rpi/WinSystemRpi.cpp
+++ b/xbmc/windowing/rpi/WinSystemRpi.cpp
@@ -10,7 +10,9 @@
#include "ServiceBroker.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 "guilib/DispResource.h"
#include "settings/DisplaySettings.h"
#include "settings/Settings.h"
@@ -46,19 +48,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();
diff --git a/xbmc/windowing/wayland/WinSystemWayland.cpp b/xbmc/windowing/wayland/WinSystemWayland.cpp
index 9d00312..2b76e77 100644
--- a/xbmc/windowing/wayland/WinSystemWayland.cpp
+++ b/xbmc/windowing/wayland/WinSystemWayland.cpp
@@ -137,38 +137,9 @@ struct MsgBufferScale
CWinSystemWayland::CWinSystemWayland()
: CWinSystemBase{}, m_protocol{"WinSystemWaylandInternal"}
{
- 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_winEvents.reset(new CWinEventsWayland());
CLinuxPowerSyscall::Register();
m_lirc.reset(OPTIONALS::LircRegister());
--
2.14.1

View File

@ -5,6 +5,7 @@ Requires=graphical.target
Wants=network-online.target
[Service]
Environment=KODI_AE_SINK=ALSA+PULSE
Environment=__GL_YIELD=USLEEP
Environment=DISPLAY=:0.0
Environment=WAYLAND_DISPLAY=wayland-0