Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
d7a27a44
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d7a27a44
编写于
12月 26, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OpenCoreUefiAudio: Implement UEFI audio `SetupDelay`
closes acidanthera/bugtracker#971
上级
a2da0c2c
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
97 addition
and
3 deletion
+97
-3
Changelog.md
Changelog.md
+1
-0
Docs/Configuration.pdf
Docs/Configuration.pdf
+0
-0
Docs/Configuration.tex
Docs/Configuration.tex
+10
-0
Docs/Differences/Differences.pdf
Docs/Differences/Differences.pdf
+0
-0
Docs/Differences/Differences.tex
Docs/Differences/Differences.tex
+14
-2
Docs/Errata/Errata.pdf
Docs/Errata/Errata.pdf
+0
-0
Docs/Sample.plist
Docs/Sample.plist
+2
-0
Docs/SampleCustom.plist
Docs/SampleCustom.plist
+2
-0
Include/Acidanthera/Library/OcConfigurationLib.h
Include/Acidanthera/Library/OcConfigurationLib.h
+1
-0
Include/Acidanthera/Protocol/OcAudio.h
Include/Acidanthera/Protocol/OcAudio.h
+17
-1
Library/OcAudioLib/OcAudio.c
Library/OcAudioLib/OcAudio.c
+26
-0
Library/OcAudioLib/OcAudioGenBeep.c
Library/OcAudioLib/OcAudioGenBeep.c
+8
-0
Library/OcAudioLib/OcAudioInternal.h
Library/OcAudioLib/OcAudioInternal.h
+8
-0
Library/OcAudioLib/OcAudioLib.c
Library/OcAudioLib/OcAudioLib.c
+2
-0
Library/OcConfigurationLib/OcConfigurationLib.c
Library/OcConfigurationLib/OcConfigurationLib.c
+1
-0
Platform/OpenCore/OpenCoreUefiAudio.c
Platform/OpenCore/OpenCoreUefiAudio.c
+5
-0
未找到文件。
Changelog.md
浏览文件 @
d7a27a44
...
...
@@ -13,6 +13,7 @@ OpenCore Changelog
-
Fixed macserial crashes when processing invalid serials
-
Fixed macserial issues when processing 2021 year serials
-
Added advanced error checking in ocvalidate utility
-
Added
`SetupDelay`
to configure audio setup delay
#### v0.6.4
-
Added
`BlacklistAppleUpdate`
to fix macOS 11 broken update optout
...
...
Docs/Configuration.pdf
浏览文件 @
d7a27a44
无法预览此类型文件
Docs/Configuration.tex
浏览文件 @
d7a27a44
...
...
@@ -5923,6 +5923,16 @@ functioning. Feature highlights:
\emph
{
Note
}
:
\texttt
{
Enabled
}
can be used in separate from
\texttt
{
StartupMute
}
NVRAM variable to avoid conflicts when the firmware is able to play boot chime.
\item
\texttt
{
SetupDelay
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
integer
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
0
}
\\
\textbf
{
Description
}
: Audio codec reconfiguration delay in microseconds.
Some codecs require a vendor
-
specific delay after the reconfiguration
(
e.g. volume setting
)
. This option makes it configurable. In general
the necessary delay may be as long as
0
.
5
seconds.
\item
\texttt
{
VolumeAmplifier
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
integer
}
\\
...
...
Docs/Differences/Differences.pdf
浏览文件 @
d7a27a44
无法预览此类型文件
Docs/Differences/Differences.tex
浏览文件 @
d7a27a44
\documentclass
[]
{
article
}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Wed Dec 16 19:38:04 2020
%DIF ADD ../Configuration.tex
Wed Dec 23 00:33:29
2020
%DIF ADD ../Configuration.tex
Sat Dec 26 11:23:56
2020
\usepackage
{
lmodern
}
\usepackage
{
amssymb,amsmath
}
...
...
@@ -5984,7 +5984,19 @@ functioning. Feature highlights:
NVRAM variable to avoid conflicts when the firmware is able to play boot chime.
\item
\texttt
{
VolumeAmplifier
}
\\
\DIFaddbegin
\texttt
{
\DIFadd
{
SetupDelay
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
integer
}}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
0
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: Audio codec reconfiguration delay in microseconds.
}
\DIFadd
{
Some codecs require a vendor
-
specific delay after the reconfiguration
(
e.g. volume setting
)
. This option makes it configurable. In general
the necessary delay may be as long as
0
.
5
seconds.
}
\item
\DIFaddend
\texttt
{
VolumeAmplifier
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
integer
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
0
}
\\
\textbf
{
Description
}
: Multiplication coefficient for system volume to raw volume linear translation
...
...
Docs/Errata/Errata.pdf
浏览文件 @
d7a27a44
无法预览此类型文件
Docs/Sample.plist
浏览文件 @
d7a27a44
...
...
@@ -1068,6 +1068,8 @@
<integer>
0
</integer>
<key>
AudioSupport
</key>
<false/>
<key>
SetupDelay
</key>
<integer>
0
</integer>
<key>
MinimumVolume
</key>
<integer>
20
</integer>
<key>
PlayChime
</key>
...
...
Docs/SampleCustom.plist
浏览文件 @
d7a27a44
...
...
@@ -1263,6 +1263,8 @@
<integer>
0
</integer>
<key>
AudioSupport
</key>
<false/>
<key>
SetupDelay
</key>
<integer>
0
</integer>
<key>
MinimumVolume
</key>
<integer>
20
</integer>
<key>
PlayChime
</key>
...
...
Include/Acidanthera/Library/OcConfigurationLib.h
浏览文件 @
d7a27a44
...
...
@@ -579,6 +579,7 @@ typedef enum {
#define OC_UEFI_AUDIO_FIELDS(_, __) \
_(OC_STRING , AudioDevice , , OC_STRING_CONSTR ("", _, __) , OC_DESTR (OC_STRING)) \
_(OC_STRING , PlayChime , , OC_STRING_CONSTR ("", _, __) , OC_DESTR (OC_STRING)) \
_(UINTN , SetupDelay , , 0 , ()) \
_(UINT16 , VolumeAmplifier , , 0 , ()) \
_(BOOLEAN , AudioSupport , , FALSE , ()) \
_(UINT8 , AudioCodec , , 0 , ()) \
...
...
Include/Acidanthera/Protocol/OcAudio.h
浏览文件 @
d7a27a44
...
...
@@ -18,7 +18,7 @@
#include <Protocol/AppleVoiceOver.h>
#include <Protocol/DevicePath.h>
#define OC_AUDIO_PROTOCOL_REVISION 0x0
1
0000
#define OC_AUDIO_PROTOCOL_REVISION 0x0
2
0000
//
// OC_AUDIO_PROTOCOL_GUID
...
...
@@ -217,6 +217,21 @@ EFI_STATUS
IN
BOOLEAN
Wait
);
/**
Set playback delay.
@param[in,out] This Audio protocol instance.
@param[in] Delay Delay after audio configuration in microseconds.
@return previous delay, defaults to 0.
**/
typedef
UINTN
(
EFIAPI
*
OC_AUDIO_SET_DELAY
)
(
IN
OUT
OC_AUDIO_PROTOCOL
*
This
,
IN
UINTN
Delay
);
//
// Includes a revision for debugging reasons.
//
...
...
@@ -226,6 +241,7 @@ struct OC_AUDIO_PROTOCOL_ {
OC_AUDIO_SET_PROVIDER
SetProvider
;
OC_AUDIO_PLAY_FILE
PlayFile
;
OC_AUDIO_STOP_PLAYBACK
StopPlayback
;
OC_AUDIO_SET_DELAY
SetDelay
;
};
extern
EFI_GUID
gOcAudioProtocolGuid
;
...
...
Library/OcAudioLib/OcAudio.c
浏览文件 @
d7a27a44
...
...
@@ -352,6 +352,14 @@ InternalOcAudioPlayFile (
Channels
);
if
(
!
EFI_ERROR
(
Status
))
{
//
// We are required to wait for some time after codec setup on some systems.
// REF: https://github.com/acidanthera/bugtracker/issues/971
//
if
(
Private
->
PlaybackDelay
>
0
)
{
gBS
->
Stall
(
Private
->
PlaybackDelay
);
}
Status
=
Private
->
AudioIo
->
StartPlaybackAsync
(
Private
->
AudioIo
,
RawBuffer
,
...
...
@@ -467,3 +475,21 @@ InternalOcAudioStopPlayBack (
return
EFI_SUCCESS
;
}
UINTN
EFIAPI
InternalOcAudioSetDelay
(
IN
OUT
OC_AUDIO_PROTOCOL
*
This
,
IN
UINTN
Delay
)
{
OC_AUDIO_PROTOCOL_PRIVATE
*
Private
;
UINTN
PreviousDelay
;
Private
=
OC_AUDIO_PROTOCOL_PRIVATE_FROM_OC_AUDIO
(
This
);
PreviousDelay
=
Private
->
PlaybackDelay
;
Private
->
PlaybackDelay
=
Delay
;
return
PreviousDelay
;
}
Library/OcAudioLib/OcAudioGenBeep.c
浏览文件 @
d7a27a44
...
...
@@ -143,6 +143,14 @@ InternalOcAudioGenBeep (
return
EFI_ABORTED
;
}
//
// We are required to wait for some time after codec setup on some systems.
// REF: https://github.com/acidanthera/bugtracker/issues/971
//
if
(
Private
->
PlaybackDelay
>
0
)
{
gBS
->
Stall
(
Private
->
PlaybackDelay
);
}
for
(
Index
=
0
;
Index
<
ToneCount
;
++
Index
)
{
Status
=
Private
->
AudioIo
->
StartPlayback
(
Private
->
AudioIo
,
...
...
Library/OcAudioLib/OcAudioInternal.h
浏览文件 @
d7a27a44
...
...
@@ -48,6 +48,7 @@ typedef struct {
VOID
*
ProviderContext
;
VOID
*
CurrentBuffer
;
EFI_EVENT
PlaybackEvent
;
UINTN
PlaybackDelay
;
UINT8
Language
;
UINT8
OutputIndex
;
UINT8
Volume
;
...
...
@@ -90,6 +91,13 @@ InternalOcAudioStopPlayBack (
IN
BOOLEAN
Wait
);
UINTN
EFIAPI
InternalOcAudioSetDelay
(
IN
OUT
OC_AUDIO_PROTOCOL
*
This
,
IN
UINTN
Delay
);
EFI_STATUS
EFIAPI
InternalOcAudioGenBeep
(
...
...
Library/OcAudioLib/OcAudioLib.c
浏览文件 @
d7a27a44
...
...
@@ -47,6 +47,7 @@ mAudioProtocol = {
.
ProviderContext
=
NULL
,
.
CurrentBuffer
=
NULL
,
.
PlaybackEvent
=
NULL
,
.
PlaybackDelay
=
0
,
.
Language
=
AppleVoiceOverLanguageEn
,
.
OutputIndex
=
0
,
.
Volume
=
100
,
...
...
@@ -56,6 +57,7 @@ mAudioProtocol = {
.
SetProvider
=
InternalOcAudioSetProvider
,
.
PlayFile
=
InternalOcAudioPlayFile
,
.
StopPlayback
=
InternalOcAudioStopPlayBack
,
.
SetDelay
=
InternalOcAudioSetDelay
},
.
BeepGen
=
{
.
GenBeep
=
InternalOcAudioGenBeep
,
...
...
Library/OcConfigurationLib/OcConfigurationLib.c
浏览文件 @
d7a27a44
...
...
@@ -707,6 +707,7 @@ mUefiAudioSchema[] = {
OC_SCHEMA_BOOLEAN_IN
(
"AudioSupport"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Audio
.
AudioSupport
),
OC_SCHEMA_INTEGER_IN
(
"MinimumVolume"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Audio
.
MinimumVolume
),
OC_SCHEMA_STRING_IN
(
"PlayChime"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Audio
.
PlayChime
),
OC_SCHEMA_INTEGER_IN
(
"SetupDelay"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Audio
.
SetupDelay
),
OC_SCHEMA_INTEGER_IN
(
"VolumeAmplifier"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Audio
.
VolumeAmplifier
),
};
...
...
Platform/OpenCore/OpenCoreUefiAudio.c
浏览文件 @
d7a27a44
...
...
@@ -447,6 +447,11 @@ OcLoadUefiAudioSupport (
return
;
}
OcAudio
->
SetDelay
(
OcAudio
,
Config
->
Uefi
.
Audio
.
SetupDelay
);
OcSetVoiceOverLanguage
(
NULL
);
if
(
OcShouldPlayChime
(
OC_BLOB_GET
(
&
Config
->
Uefi
.
Audio
.
PlayChime
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录