forked from LibreELEC/LibreELEC.tv
/
kodi-100.14-use-alsa-and-pulse-together.patch
206 lines (199 loc) · 6.1 KB
/
kodi-100.14-use-alsa-and-pulse-together.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
From 2e7de29a69b37ad0a7d8632c5aafcdd02a4f550d Mon Sep 17 00:00:00 2001
From: 5schatten <supervisedthinking@gmail.com>
Date: Tue, 7 May 2019 01:30:10 +0200
Subject: [PATCH] allow using alsa and pulse together
---
xbmc/windowing/X11/WinSystemX11GLContext.cpp | 35 ++------------------
xbmc/windowing/amlogic/WinSystemAmlogic.cpp | 2 ++
xbmc/windowing/gbm/WinSystemGbm.cpp | 34 ++-----------------
xbmc/windowing/rpi/WinSystemRpi.cpp | 17 +++-------
xbmc/windowing/wayland/WinSystemWayland.cpp | 35 ++------------------
5 files changed, 13 insertions(+), 110 deletions(-)
diff --git a/xbmc/windowing/X11/WinSystemX11GLContext.cpp b/xbmc/windowing/X11/WinSystemX11GLContext.cpp
index 5b0b155736b9..a3a3251a5d10 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 0637f83fc0fd..b1b41b05039e 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 4a3291a55045..9ad1f2daf1af 100644
--- a/xbmc/windowing/gbm/WinSystemGbm.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbm.cpp
@@ -33,38 +33,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();
CLinuxPowerSyscall::Register();
m_lirc.reset(OPTIONALS::LircRegister());
diff --git a/xbmc/windowing/rpi/WinSystemRpi.cpp b/xbmc/windowing/rpi/WinSystemRpi.cpp
index bdeb68c8c006..f5bc22c3cbdb 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();
diff --git a/xbmc/windowing/wayland/WinSystemWayland.cpp b/xbmc/windowing/wayland/WinSystemWayland.cpp
index 9d0031239c6e..2b76e773f329 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());