diff --git a/Changelog.md b/Changelog.md index 638bfb2f..be97cee8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,7 +9,8 @@ OpenCore Changelog - Made `Builtin` text renderer ignore UI Scale, when required to ensure that text mode reaches minimum supported size of 80x25 - Added save and restore of text and graphics mode round tools and failed boot entries - Updated out-of-range cursor handling to work round minor display issue in memtest86 -- Add optional `--enable-mouse-click` argument to `CrScreenshotDxe` driver to additionally respond on mouse click +- Added optional `--enable-mouse-click` argument to `CrScreenshotDxe` driver to additionally respond on mouse click +- Added `--use-conn-none` option to `AudioDxe` driver to discover additional usable output channels on some systems #### v0.9.2 - Added `DisableIoMapperMapping` quirk, thx @CaseySJ diff --git a/Docs/Configuration.md5 b/Docs/Configuration.md5 index 4a1121af..9673f868 100644 --- a/Docs/Configuration.md5 +++ b/Docs/Configuration.md5 @@ -1 +1 @@ -a54a2bb132146d90046911c0bf3ea798 +f926c9a3fc0eaf349a76ca4af8bbba55 diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index 83cd72b3..f0eabc25 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index e0d4b621..28bbb335 100755 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -7098,6 +7098,16 @@ the driver within the \texttt{UEFI/Drivers} section: be added to AudioDxe driver arguments. Not enabled by default, since restoring the flag can prevent sound from working in macOS on some other systems. \medskip + + \item \texttt{-{}-use-conn-none} - Boolean flag, enabled if present. \medskip + + On some sound cards enabling this option will enable additional usable audio channels (e.g. + the bass or treble speaker of a pair, where only one is found without it). + \medskip + + \emph{Note}: Enabling this option may increase the available channels, in which case any + custom setting of \texttt{AudioOutMask} may need to be changed to match the new channel list. + \medskip \end{itemize} \subsection{OpenVariableRuntimeDxe}\label{emunvram} diff --git a/Docs/Differences/Differences.pdf b/Docs/Differences/Differences.pdf index b060d5aa..4d054b7c 100644 Binary files a/Docs/Differences/Differences.pdf and b/Docs/Differences/Differences.pdf differ diff --git a/Docs/Differences/Differences.tex b/Docs/Differences/Differences.tex index e2ac30e1..642e1f9a 100644 --- a/Docs/Differences/Differences.tex +++ b/Docs/Differences/Differences.tex @@ -1,7 +1,7 @@ \documentclass[]{article} %DIF LATEXDIFF DIFFERENCE FILE %DIF DEL PreviousConfiguration.tex Wed May 10 20:45:31 2023 -%DIF ADD ../Configuration.tex Sat May 20 00:57:56 2023 +%DIF ADD ../Configuration.tex Sat May 20 08:58:22 2023 \usepackage{lmodern} \usepackage{amssymb,amsmath} @@ -7085,14 +7085,14 @@ the driver within the \texttt{UEFI/Drivers} section: Amount of time in milliseconds to wait for all widgets to come fully on, applied per codec during driver connection phase. In most systems this should not be needed and a faster boot will be achieved by using \texttt{Audio} section \texttt{SetupDelay} if any audio setup delay - is required. Where required, values of up to one second may be needed\DIFaddbegin \DIFadd{. }\medskip + is required. Where required, values of up to one second may be needed. \medskip - \item \texttt{\DIFadd{-}{}\DIFadd{-force-codec}} \DIFadd{- Integer value, no default. }\medskip + \item \DIFaddbegin \texttt{\DIFadd{-}{}\DIFadd{-force-codec}} \DIFadd{- Integer value, no default. }\medskip \DIFadd{Force use of an audio codec, this value should be equal to }\texttt{\DIFadd{Audio}} \DIFadd{section }\texttt{\DIFadd{AudioCodec}}\DIFadd{. - Can result in faster boot especially when used in conjuction with }\texttt{\DIFadd{-}{}\DIFadd{-force-device}}\DIFaddend . \medskip + Can result in faster boot especially when used in conjuction with }\DIFaddend \texttt{-{}-force-device}\DIFaddbegin \DIFadd{. }\medskip - \item \texttt{-{}-force-device} - String value, no default. \medskip + \item \texttt{\DIFadd{-}{}\DIFadd{-force-device}} \DIFaddend - String value, no default. \medskip When this option is present and has a value (e.g. \texttt{-{}-force-device=PciRoot(0x0)/Pci(0x1f,0x3)}), it forces AudioDxe to connect to the specified PCI device, even if the device does not report itself as @@ -7160,7 +7160,17 @@ the driver within the \texttt{UEFI/Drivers} section: be reversed on exit in order to avoid breaking sound in Windows or Linux. If so, this flag should be added to AudioDxe driver arguments. Not enabled by default, since restoring the flag can prevent sound from working in macOS on - some other systems. \medskip + some other systems\DIFaddbegin \DIFadd{. }\medskip + + \item \texttt{\DIFadd{-}{}\DIFadd{-use-conn-none}} \DIFadd{- Boolean flag, enabled if present. }\medskip + + \DIFadd{On some sound cards enabling this option will enable additional usable audio channels (e.g. + the bass or treble speaker of a pair, where only one is found without it). + }\medskip + + \emph{\DIFadd{Note}}\DIFadd{: Enabling this option may increase the available channels, in which case any + custom setting of }\texttt{\DIFadd{AudioOutMask}} \DIFadd{may need to be changed to match the new channel list}\DIFaddend . + \medskip \end{itemize} \subsection{OpenVariableRuntimeDxe}\label{emunvram} diff --git a/Docs/Errata/Errata.pdf b/Docs/Errata/Errata.pdf index 1da5be6c..d5ffbdeb 100644 Binary files a/Docs/Errata/Errata.pdf and b/Docs/Errata/Errata.pdf differ diff --git a/Staging/AudioDxe/AudioDxe.c b/Staging/AudioDxe/AudioDxe.c index ea238da4..e3588aa2 100644 --- a/Staging/AudioDxe/AudioDxe.c +++ b/Staging/AudioDxe/AudioDxe.c @@ -32,27 +32,6 @@ #include #include -UINTN - gGpioSetupStageMask = GPIO_SETUP_STAGE_NONE; - -UINTN - gGpioPinMask = GPIO_PIN_MASK_AUTO; - -BOOLEAN - gRestoreNoSnoop = FALSE; - -EFI_DEVICE_PATH_PROTOCOL * - gForcedControllerDevicePath = NULL; - -UINTN - gCodecSetupDelay = 0; - -BOOLEAN - gUseForcedCodec = FALSE; - -UINTN - gForcedCodec = 0; - /** HdaController Driver Binding. **/ @@ -131,6 +110,8 @@ AudioDxeInit ( gUseForcedCodec = TRUE; } + gCodecUseConnNoneNode = OcHasParsedVar (ParsedLoadOptions, L"--use-conn-none", OcStringFormatUnicode); + OcFlexArrayFree (&ParsedLoadOptions); } else if (Status != EFI_NOT_FOUND) { return Status; @@ -138,12 +119,15 @@ AudioDxeInit ( DEBUG (( DEBUG_INFO, - "HDA: GPIO setup stages 0x%X GPIO pin mask 0x%X%a Restore NSNPEN %d Force device %s Setup delay %u\n", + "HDA: GPIO stages 0x%X mask 0x%X%a; Restore NSNPEN %d; Force device %s codec %u(%u); Conn none %u; Delay %u\n", gGpioSetupStageMask, gGpioPinMask, gGpioPinMask == 0 ? " (auto)" : "", gRestoreNoSnoop, DevicePathName, + gUseForcedCodec, + gForcedCodec, + gCodecUseConnNoneNode, gCodecSetupDelay )); diff --git a/Staging/AudioDxe/AudioDxe.h b/Staging/AudioDxe/AudioDxe.h index 583476f9..1087d76b 100644 --- a/Staging/AudioDxe/AudioDxe.h +++ b/Staging/AudioDxe/AudioDxe.h @@ -68,67 +68,4 @@ extern EFI_AUDIO_DECODE_PROTOCOL gEfiAudioDecodeProtocol; // REF: MdeModulePkg/Core/Dxe/Event/Timer.c #define TPL_DXE_CORE_TIMER (TPL_HIGH_LEVEL - 1) -// GPIO setup stages. -#define GPIO_SETUP_STAGE_DATA BIT0 -#define GPIO_SETUP_STAGE_DIRECTION BIT1 -#define GPIO_SETUP_STAGE_ENABLE BIT2 - -#define GPIO_SETUP_STAGE_NONE 0 - -#define GPIO_SETUP_STAGE_ALL ( \ - GPIO_SETUP_STAGE_DATA | \ - GPIO_SETUP_STAGE_DIRECTION | \ - GPIO_SETUP_STAGE_ENABLE \ - ) - -// GPIO setup pin mask. -#define GPIO_PIN_MASK_AUTO 0 ///< Auto: use all reported available pins. - -// -// Setup stage mask. -// -extern -UINTN - gGpioSetupStageMask; - -// -// GPIO pin mask. -// -extern -UINTN - gGpioPinMask; - -// -// Whether to restore NOSNOOPEN at exit. -// -extern -BOOLEAN - gRestoreNoSnoop; - -// -// Forced device path for HDA controller (ignore advertised class/subclass). -// -extern -EFI_DEVICE_PATH_PROTOCOL * - gForcedControllerDevicePath; - -// -// Time to wait in microseconds per codec for all widgets to fully come on. -// -extern -UINTN - gCodecSetupDelay; - -// -// Whether to use forced codec. -// -extern BOOLEAN - gUseForcedCodec; - -// -// Forced codec number. -// -extern UINTN - gForcedCodec; - #endif // EFI_AUDIODXE_H diff --git a/Staging/AudioDxe/HdaCodec/HdaCodec.c b/Staging/AudioDxe/HdaCodec/HdaCodec.c index 86b4eeee..c959d21e 100644 --- a/Staging/AudioDxe/HdaCodec/HdaCodec.c +++ b/Staging/AudioDxe/HdaCodec/HdaCodec.c @@ -30,6 +30,24 @@ #include #include +UINTN + gGpioSetupStageMask = GPIO_SETUP_STAGE_NONE; + +UINTN + gGpioPinMask = GPIO_PIN_MASK_AUTO; + +UINTN + gCodecSetupDelay = 0; + +BOOLEAN + gUseForcedCodec = FALSE; + +UINTN + gForcedCodec = 0; + +BOOLEAN + gCodecUseConnNoneNode = FALSE; + EFI_STATUS EFIAPI HdaCodecProbeWidget ( @@ -933,7 +951,7 @@ HdaCodecParsePorts ( // If this is a pin complex but it has no connection to a port, also ignore it. // If the default association for the pin complex is zero, also ignore it. if ((HdaWidget->Type != HDA_WIDGET_TYPE_PIN_COMPLEX) || - (HDA_VERB_GET_CONFIGURATION_DEFAULT_PORT_CONN (HdaWidget->DefaultConfiguration) == HDA_CONFIG_DEFAULT_PORT_CONN_NONE) || + (!gCodecUseConnNoneNode && (HDA_VERB_GET_CONFIGURATION_DEFAULT_PORT_CONN (HdaWidget->DefaultConfiguration) == HDA_CONFIG_DEFAULT_PORT_CONN_NONE)) || (HDA_VERB_GET_CONFIGURATION_DEFAULT_ASSOCIATION (HdaWidget->DefaultConfiguration) == 0)) { DEBUG (( diff --git a/Staging/AudioDxe/HdaCodec/HdaCodec.h b/Staging/AudioDxe/HdaCodec/HdaCodec.h index d0d11caf..3ab981ef 100644 --- a/Staging/AudioDxe/HdaCodec/HdaCodec.h +++ b/Staging/AudioDxe/HdaCodec/HdaCodec.h @@ -366,4 +366,59 @@ HdaCodecDriverBindingStop ( IN EFI_HANDLE *ChildHandleBuffer OPTIONAL ); +// GPIO setup stages. +#define GPIO_SETUP_STAGE_DATA BIT0 +#define GPIO_SETUP_STAGE_DIRECTION BIT1 +#define GPIO_SETUP_STAGE_ENABLE BIT2 + +#define GPIO_SETUP_STAGE_NONE 0 + +#define GPIO_SETUP_STAGE_ALL ( \ + GPIO_SETUP_STAGE_DATA | \ + GPIO_SETUP_STAGE_DIRECTION | \ + GPIO_SETUP_STAGE_ENABLE \ + ) + +// GPIO setup pin mask. +#define GPIO_PIN_MASK_AUTO 0 ///< Auto: use all reported available pins. + +// +// Setup stage mask. +// +extern +UINTN + gGpioSetupStageMask; + +// +// GPIO pin mask. +// +extern +UINTN + gGpioPinMask; + +// +// Time to wait in microseconds per codec for all widgets to fully come on. +// +extern +UINTN + gCodecSetupDelay; + +// +// Whether to use forced codec. +// +extern BOOLEAN + gUseForcedCodec; + +// +// Forced codec number. +// +extern UINTN + gForcedCodec; + +// +// Whether to attempt to output on CONN_NONE nodes. +// +extern BOOLEAN + gCodecUseConnNoneNode; + #endif diff --git a/Staging/AudioDxe/HdaController/HdaController.c b/Staging/AudioDxe/HdaController/HdaController.c index f53f5780..666d8d64 100644 --- a/Staging/AudioDxe/HdaController/HdaController.c +++ b/Staging/AudioDxe/HdaController/HdaController.c @@ -34,6 +34,12 @@ #include #include +BOOLEAN + gRestoreNoSnoop = FALSE; + +EFI_DEVICE_PATH_PROTOCOL * + gForcedControllerDevicePath = NULL; + VOID EFIAPI HdaControllerStreamOutputPollTimerHandler ( diff --git a/Staging/AudioDxe/HdaController/HdaController.h b/Staging/AudioDxe/HdaController/HdaController.h index e9a0c061..6443e8a5 100644 --- a/Staging/AudioDxe/HdaController/HdaController.h +++ b/Staging/AudioDxe/HdaController/HdaController.h @@ -618,4 +618,18 @@ HdaControllerStreamAbort ( IN HDA_STREAM *HdaStream ); +// +// Whether to restore NOSNOOPEN at exit. +// +extern +BOOLEAN + gRestoreNoSnoop; + +// +// Forced device path for HDA controller (ignore advertised class/subclass). +// +extern +EFI_DEVICE_PATH_PROTOCOL * + gForcedControllerDevicePath; + #endif