Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
d4f7f39c
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,发现更多精彩内容 >>
提交
d4f7f39c
编写于
2月 25, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OpenCoreAudio: Added voice assistance support and language detect
上级
7001e935
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
199 addition
and
52 deletion
+199
-52
Changelog.md
Changelog.md
+1
-0
Docs/Sample.plist
Docs/Sample.plist
+2
-0
Docs/SampleFull.plist
Docs/SampleFull.plist
+2
-0
Platform/OpenCore/OpenCoreMisc.c
Platform/OpenCore/OpenCoreMisc.c
+1
-0
Platform/OpenCore/OpenCoreUefiAudio.c
Platform/OpenCore/OpenCoreUefiAudio.c
+193
-52
未找到文件。
Changelog.md
浏览文件 @
d4f7f39c
...
@@ -29,6 +29,7 @@ OpenCore Changelog
...
@@ -29,6 +29,7 @@ OpenCore Changelog
-
Fixed drivers starting with
`#`
not being skipped
-
Fixed drivers starting with
`#`
not being skipped
-
Added audio support through AudioDxe with optional boot chime
-
Added audio support through AudioDxe with optional boot chime
-
Added VoiceOver accessability support in boot.efi for 10.13+
-
Added VoiceOver accessability support in boot.efi for 10.13+
-
Added
`PickerAudioAssist`
option for audio assistance in picker
#### v0.5.5
#### v0.5.5
-
Fixed CPU bus ratio calculation for Nehalem and Westmere
-
Fixed CPU bus ratio calculation for Nehalem and Westmere
...
...
Docs/Sample.plist
浏览文件 @
d4f7f39c
...
@@ -591,6 +591,8 @@
...
@@ -591,6 +591,8 @@
<true/>
<true/>
<key>
PickerAttributes
</key>
<key>
PickerAttributes
</key>
<integer>
0
</integer>
<integer>
0
</integer>
<key>
PickerAudioAssist
</key>
<false/>
<key>
PollAppleHotKeys
</key>
<key>
PollAppleHotKeys
</key>
<false/>
<false/>
<key>
ShowPicker
</key>
<key>
ShowPicker
</key>
...
...
Docs/SampleFull.plist
浏览文件 @
d4f7f39c
...
@@ -591,6 +591,8 @@
...
@@ -591,6 +591,8 @@
<true/>
<true/>
<key>
PickerAttributes
</key>
<key>
PickerAttributes
</key>
<integer>
0
</integer>
<integer>
0
</integer>
<key>
PickerAudioAssist
</key>
<false/>
<key>
PollAppleHotKeys
</key>
<key>
PollAppleHotKeys
</key>
<false/>
<false/>
<key>
ShowPicker
</key>
<key>
ShowPicker
</key>
...
...
Platform/OpenCore/OpenCoreMisc.c
浏览文件 @
d4f7f39c
...
@@ -536,6 +536,7 @@ OcMiscBoot (
...
@@ -536,6 +536,7 @@ OcMiscBoot (
Context
->
AllCustomEntryCount
=
EntryIndex
;
Context
->
AllCustomEntryCount
=
EntryIndex
;
Context
->
PollAppleHotKeys
=
Config
->
Misc
.
Boot
.
PollAppleHotKeys
;
Context
->
PollAppleHotKeys
=
Config
->
Misc
.
Boot
.
PollAppleHotKeys
;
Context
->
HideAuxiliary
=
Config
->
Misc
.
Boot
.
HideAuxiliary
;
Context
->
HideAuxiliary
=
Config
->
Misc
.
Boot
.
HideAuxiliary
;
Context
->
PickerAudioAssist
=
Config
->
Misc
.
Boot
.
PickerAudioAssist
;
OcLoadPickerHotKeys
(
Context
);
OcLoadPickerHotKeys
(
Context
);
...
...
Platform/OpenCore/OpenCoreUefiAudio.c
浏览文件 @
d4f7f39c
...
@@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
...
@@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <OpenCore.h>
#include <OpenCore.h>
#include <Guid/AppleVariable.h>
#include <Guid/OcVariables.h>
#include <Guid/OcVariables.h>
#include <Guid/GlobalVariable.h>
#include <Guid/GlobalVariable.h>
...
@@ -49,6 +50,19 @@ STATIC
...
@@ -49,6 +50,19 @@ STATIC
OC_AUDIO_PROTOCOL
*
OC_AUDIO_PROTOCOL
*
mOcAudio
;
mOcAudio
;
typedef
struct
OC_AUDIO_FILE_
{
UINT8
*
Buffer
;
UINT32
Size
;
}
OC_AUDIO_FILE
;
STATIC
OC_AUDIO_FILE
mAppleAudioFiles
[
AppleVoiceOverAudioFileMax
];
STATIC
OC_AUDIO_FILE
mOcAudioFiles
[
OcVoiceOverAudioFileMax
-
OcVoiceOverAudioFileBase
];
//
// Note, currently we are not I/O bound, so enabling this has no effect at all.
// Reconsider it when we resolve lags with AudioDxe.
//
STATIC
BOOLEAN
mEnableAudioCaching
=
FALSE
;
STATIC
STATIC
EFI_STATUS
EFI_STATUS
EFIAPI
EFIAPI
...
@@ -60,58 +74,176 @@ OcAudioAcquireFile (
...
@@ -60,58 +74,176 @@ OcAudioAcquireFile (
OUT
UINT32
*
BufferSize
OUT
UINT32
*
BufferSize
)
)
{
{
CHAR8
IndexPath
[
8
];
CHAR16
FilePath
[
96
];
CHAR16
FilePath
[
96
];
OC_STORAGE_CONTEXT
*
Storage
;
OC_STORAGE_CONTEXT
*
Storage
;
CONST
CHAR8
*
BaseType
;
CONST
CHAR8
*
BaseType
;
CONST
CHAR8
*
BasePath
;
CONST
CHAR8
*
BasePath
;
BOOLEAN
Localised
;
BOOLEAN
Localised
;
OC_AUDIO_FILE
*
CacheFile
;
Storage
=
(
OC_STORAGE_CONTEXT
*
)
Context
;
Storage
=
(
OC_STORAGE_CONTEXT
*
)
Context
;
Localised
=
TRUE
;
Localised
=
TRUE
;
BaseType
=
"AXEFIAudio"
;
CacheFile
=
NULL
;
switch
(
File
)
{
if
(
File
>=
OcVoiceOverAudioFileBase
&&
File
<
OcVoiceOverAudioFileMax
)
{
case
AppleVoiceOverAudioFileVoiceOverOn
:
if
(
mEnableAudioCaching
)
{
BasePath
=
"VoiceOverOn"
;
CacheFile
=
&
mOcAudioFiles
[
File
-
OcVoiceOverAudioFileBase
];
break
;
if
(
CacheFile
->
Buffer
!=
NULL
)
{
case
AppleVoiceOverAudioFileVoiceOverOff
:
*
Buffer
=
CacheFile
->
Buffer
;
BasePath
=
"VoiceOverOff"
;
*
BufferSize
=
CacheFile
->
Size
;
break
;
return
EFI_SUCCESS
;
case
AppleVoiceOverAudioFileUsername
:
}
BasePath
=
"Username"
;
}
break
;
case
AppleVoiceOverAudioFilePassword
:
BaseType
=
"OCEFIAudio"
;
BasePath
=
"Password"
;
if
(
File
>
OcVoiceOverAudioFileIndexBase
&&
File
<=
OcVoiceOverAudioFileIndexMax
)
{
break
;
AsciiSPrint
(
case
AppleVoiceOverAudioFileUsernameOrPasswordIncorrect
:
IndexPath
,
BasePath
=
"UsernameOrPasswordIncorrect"
;
sizeof
(
IndexPath
),
break
;
"%a%c"
,
case
AppleVoiceOverAudioFileAccountLockedTryLater
:
File
>=
OcVoiceOverAudioFileIndexAlphabetical
?
"Letter"
:
""
,
BasePath
=
"AccountLockedTryLater"
;
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
[
File
-
OcVoiceOverAudioFileIndexBase
]
break
;
);
case
AppleVoiceOverAudioFileAccountLocked
:
BasePath
=
IndexPath
;
BasePath
=
"AccountLocked"
;
if
(
File
>=
OcVoiceOverAudioFileIndexAlphabetical
)
{
break
;
Localised
=
FALSE
;
case
AppleVoiceOverAudioFileVoiceOverBoot
:
}
BaseType
=
"OCEFIAudio"
;
}
else
{
BasePath
=
"VoiceOver_Boot"
;
switch
(
File
)
{
Localised
=
FALSE
;
case
OcVoiceOverAudioFileAbortTimeout
:
break
;
BasePath
=
"AbortTimeout"
;
case
AppleVoiceOverAudioFileVoiceOverBoot2
:
break
;
BasePath
=
"VoiceOver_Boot"
;
case
OcVoiceOverAudioFileChooseOS
:
Localised
=
FALSE
;
BasePath
=
"ChooseOS"
;
break
;
break
;
case
AppleVoiceOverAudioFileClick
:
case
OcVoiceOverAudioFileDefault
:
BasePath
=
"Click"
;
BasePath
=
"Default"
;
Localised
=
FALSE
;
break
;
break
;
case
OcVoiceOverAudioFileDiskImage
:
case
AppleVoiceOverAudioFileBeep
:
BasePath
=
"DiskImage"
;
BasePath
=
"Beep"
;
break
;
Localised
=
FALSE
;
case
OcVoiceOverAudioFileEnterPassword
:
break
;
BasePath
=
"EnterPassword"
;
default:
break
;
BasePath
=
NULL
;
case
OcVoiceOverAudioFileExecutionFailure
:
break
;
BasePath
=
"ExecutionFailure"
;
break
;
case
OcVoiceOverAudioFileExecutionSuccessful
:
BasePath
=
"ExecutionSuccessful"
;
break
;
case
OcVoiceOverAudioFileExternal
:
BasePath
=
"External"
;
break
;
case
OcVoiceOverAudioFileExternalOption
:
BasePath
=
"ExternalOption"
;
break
;
case
OcVoiceOverAudioFileLoading
:
BasePath
=
"Loading"
;
break
;
case
OcVoiceOverAudioFilemacOS
:
BasePath
=
"macOS"
;
break
;
case
OcVoiceOverAudioFilemacOS_Recovery
:
BasePath
=
"macOS_Recovery"
;
break
;
case
OcVoiceOverAudioFileOtherOS
:
BasePath
=
"OtherOS"
;
break
;
case
OcVoiceOverAudioFilePasswordAccepted
:
BasePath
=
"PasswordAccepted"
;
break
;
case
OcVoiceOverAudioFilePasswordIncorrect
:
BasePath
=
"PasswordIncorrect"
;
break
;
case
OcVoiceOverAudioFilePasswordRetryLimit
:
BasePath
=
"PasswordRetryLimit"
;
break
;
case
OcVoiceOverAudioFileReloading
:
BasePath
=
"Reloading"
;
break
;
case
OcVoiceOverAudioFileResetNVRAM
:
BasePath
=
"ResetNVRAM"
;
break
;
case
OcVoiceOverAudioFileSelected
:
BasePath
=
"Selected"
;
break
;
case
OcVoiceOverAudioFileShowAuxiliary
:
BasePath
=
"ShowAuxiliary"
;
break
;
case
OcVoiceOverAudioFileTimeout
:
BasePath
=
"Timeout"
;
break
;
case
OcVoiceOverAudioFileUEFI_Shell
:
BasePath
=
"UEFI_Shell"
;
break
;
case
OcVoiceOverAudioFileWelcome
:
BasePath
=
"Welcome"
;
break
;
case
OcVoiceOverAudioFileWindows
:
BasePath
=
"Windows"
;
break
;
default:
BasePath
=
NULL
;
break
;
}
}
}
else
if
(
File
<
AppleVoiceOverAudioFileMax
)
{
if
(
mEnableAudioCaching
)
{
CacheFile
=
&
mAppleAudioFiles
[
File
];
if
(
CacheFile
->
Buffer
!=
NULL
)
{
*
Buffer
=
CacheFile
->
Buffer
;
*
BufferSize
=
CacheFile
->
Size
;
return
EFI_SUCCESS
;
}
}
BaseType
=
"AXEFIAudio"
;
switch
(
File
)
{
case
AppleVoiceOverAudioFileVoiceOverOn
:
BasePath
=
"VoiceOverOn"
;
break
;
case
AppleVoiceOverAudioFileVoiceOverOff
:
BasePath
=
"VoiceOverOff"
;
break
;
case
AppleVoiceOverAudioFileUsername
:
BasePath
=
"Username"
;
break
;
case
AppleVoiceOverAudioFilePassword
:
BasePath
=
"Password"
;
break
;
case
AppleVoiceOverAudioFileUsernameOrPasswordIncorrect
:
BasePath
=
"UsernameOrPasswordIncorrect"
;
break
;
case
AppleVoiceOverAudioFileAccountLockedTryLater
:
BasePath
=
"AccountLockedTryLater"
;
break
;
case
AppleVoiceOverAudioFileAccountLocked
:
BasePath
=
"AccountLocked"
;
break
;
case
AppleVoiceOverAudioFileVoiceOverBoot
:
BaseType
=
"OCEFIAudio"
;
BasePath
=
"VoiceOver_Boot"
;
Localised
=
FALSE
;
break
;
case
AppleVoiceOverAudioFileVoiceOverBoot2
:
BasePath
=
"VoiceOver_Boot"
;
Localised
=
FALSE
;
break
;
case
AppleVoiceOverAudioFileClick
:
BasePath
=
"Click"
;
Localised
=
FALSE
;
break
;
case
AppleVoiceOverAudioFileBeep
:
BasePath
=
"Beep"
;
Localised
=
FALSE
;
break
;
default:
BasePath
=
NULL
;
break
;
}
}
else
{
BasePath
=
NULL
;
}
}
if
(
BasePath
==
NULL
)
{
if
(
BasePath
==
NULL
)
{
...
@@ -165,6 +297,11 @@ OcAudioAcquireFile (
...
@@ -165,6 +297,11 @@ OcAudioAcquireFile (
return
EFI_NOT_FOUND
;
return
EFI_NOT_FOUND
;
}
}
if
(
CacheFile
!=
NULL
)
{
CacheFile
->
Buffer
=
*
Buffer
;
CacheFile
->
Size
=
*
BufferSize
;
}
return
EFI_SUCCESS
;
return
EFI_SUCCESS
;
}
}
...
@@ -176,7 +313,9 @@ OcAudioReleaseFile (
...
@@ -176,7 +313,9 @@ OcAudioReleaseFile (
IN
UINT8
*
Buffer
IN
UINT8
*
Buffer
)
)
{
{
FreePool
(
Buffer
);
if
(
!
mEnableAudioCaching
)
{
FreePool
(
Buffer
);
}
return
EFI_SUCCESS
;
return
EFI_SUCCESS
;
}
}
...
@@ -186,13 +325,13 @@ OcLoadUefiAudioSupport (
...
@@ -186,13 +325,13 @@ OcLoadUefiAudioSupport (
IN
OC_GLOBAL_CONFIG
*
Config
IN
OC_GLOBAL_CONFIG
*
Config
)
)
{
{
EFI_STATUS
Status
;
EFI_STATUS
Status
;
CHAR8
*
AsciiDevicePath
;
CHAR8
*
AsciiDevicePath
;
CHAR16
*
UnicodeDevicePath
;
CHAR16
*
UnicodeDevicePath
;
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
;
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
;
OC_AUDIO_PROTOCOL
*
OcAudio
;
OC_AUDIO_PROTOCOL
*
OcAudio
;
UINT8
VolumeLevel
;
UINT8
VolumeLevel
;
BOOLEAN
Muted
;
BOOLEAN
Muted
;
if
(
!
Config
->
Uefi
.
Audio
.
AudioSupport
)
{
if
(
!
Config
->
Uefi
.
Audio
.
AudioSupport
)
{
DEBUG
((
DEBUG_INFO
,
"OC: Requested not to use audio
\n
"
));
DEBUG
((
DEBUG_INFO
,
"OC: Requested not to use audio
\n
"
));
...
@@ -252,6 +391,8 @@ OcLoadUefiAudioSupport (
...
@@ -252,6 +391,8 @@ OcLoadUefiAudioSupport (
return
FALSE
;
return
FALSE
;
}
}
OcSetVoiceOverLanguage
(
NULL
);
if
(
Config
->
Uefi
.
Audio
.
PlayChime
&&
VolumeLevel
>
0
&&
!
Muted
)
{
if
(
Config
->
Uefi
.
Audio
.
PlayChime
&&
VolumeLevel
>
0
&&
!
Muted
)
{
DEBUG
((
DEBUG_INFO
,
"OC: Starting to play chime...
\n
"
));
DEBUG
((
DEBUG_INFO
,
"OC: Starting to play chime...
\n
"
));
Status
=
OcAudio
->
PlayFile
(
Status
=
OcAudio
->
PlayFile
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录