Compare commits
150 Commits
__refs_pul
...
__refs_pul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41e855bd42 | ||
|
|
acc887cc34 | ||
|
|
8d4458ef24 | ||
|
|
3a5f9409c8 | ||
|
|
7172339c7a | ||
|
|
9c32f29af1 | ||
|
|
4a7a771340 | ||
|
|
eb726677b2 | ||
|
|
92813f01a4 | ||
|
|
49870baea4 | ||
|
|
344006b856 | ||
|
|
8dafe15600 | ||
|
|
44ccec7846 | ||
|
|
882dfa36ae | ||
|
|
672e61d802 | ||
|
|
60aa942210 | ||
|
|
809126c94a | ||
|
|
7e3cdfc453 | ||
|
|
d5d6322640 | ||
|
|
6b1cb73350 | ||
|
|
e4bc7b8611 | ||
|
|
b2c2138af7 | ||
|
|
b862d5d8d8 | ||
|
|
36c77761cf | ||
|
|
7a5d235d94 | ||
|
|
d1f3c121a0 | ||
|
|
e9109cb5f2 | ||
|
|
cb2a33babc | ||
|
|
a278fa6e2a | ||
|
|
9554c67809 | ||
|
|
e85bda5f31 | ||
|
|
b5a06bc419 | ||
|
|
b06ef5d530 | ||
|
|
0a63d43ad6 | ||
|
|
2c91fbf7f1 | ||
|
|
463cc9559f | ||
|
|
d55046c5e9 | ||
|
|
1c7dae966d | ||
|
|
fbbedb032c | ||
|
|
eeb0ec67c3 | ||
|
|
7fda6de5cb | ||
|
|
f08046f4d7 | ||
|
|
fd876f200f | ||
|
|
bdb866af1d | ||
|
|
e93e898df5 | ||
|
|
1be456db83 | ||
|
|
56be24d50a | ||
|
|
949917babc | ||
|
|
4b07596b83 | ||
|
|
1deecc6f70 | ||
|
|
5d907d9acd | ||
|
|
cd4b9bffb2 | ||
|
|
16080b6e4e | ||
|
|
a967c41fa0 | ||
|
|
0cef3b47f3 | ||
|
|
f663966599 | ||
|
|
35ecd062ac | ||
|
|
9c6cd93195 | ||
|
|
e78a623342 | ||
|
|
063b23cc58 | ||
|
|
4834961736 | ||
|
|
caa138b33f | ||
|
|
19a4e12e6e | ||
|
|
848f69eb19 | ||
|
|
de8f7e1250 | ||
|
|
2898be69f4 | ||
|
|
4ffbbc5348 | ||
|
|
dd2faab372 | ||
|
|
dc8d42243b | ||
|
|
9dc9e501de | ||
|
|
12f7d42d32 | ||
|
|
45b343d1d0 | ||
|
|
c976613ab2 | ||
|
|
e339ec0e00 | ||
|
|
3dbaafe1f3 | ||
|
|
f958cbc737 | ||
|
|
016fa3ffee | ||
|
|
2129d040a5 | ||
|
|
c3b16cf8d3 | ||
|
|
3faa1c54b6 | ||
|
|
c7a814f10f | ||
|
|
b1a18355fb | ||
|
|
3bcfd0dc42 | ||
|
|
b1076859c4 | ||
|
|
5addff8d59 | ||
|
|
199f77b92f | ||
|
|
ea9ff71725 | ||
|
|
6690dfc486 | ||
|
|
65718e2876 | ||
|
|
03aedccaa2 | ||
|
|
f294b886db | ||
|
|
cbc2761f11 | ||
|
|
0e275cfe6e | ||
|
|
9533365486 | ||
|
|
7e379207ec | ||
|
|
a83a5d2e4c | ||
|
|
118503f6e5 | ||
|
|
c881a67dba | ||
|
|
6791301d9a | ||
|
|
63b236d853 | ||
|
|
27d7db1fae | ||
|
|
2b6ac4463c | ||
|
|
339758c9fc | ||
|
|
839e1faf49 | ||
|
|
b961b385c3 | ||
|
|
d92826963a | ||
|
|
e431cb8d16 | ||
|
|
b904652d69 | ||
|
|
d1ef4b2b86 | ||
|
|
4b96f9864e | ||
|
|
db3eb168cd | ||
|
|
b2a6dde438 | ||
|
|
a07502a638 | ||
|
|
56f1dc8dad | ||
|
|
0c8aeb09d2 | ||
|
|
3e1426c9a3 | ||
|
|
db2335e2f8 | ||
|
|
5503d572ab | ||
|
|
bd018e0123 | ||
|
|
825ac7b9f4 | ||
|
|
7fab7b829c | ||
|
|
b99596e312 | ||
|
|
3701255e4f | ||
|
|
064f836d1c | ||
|
|
518317b717 | ||
|
|
e37e3d3634 | ||
|
|
1088e8ce5c | ||
|
|
7a3e5fe927 | ||
|
|
776bcec3e1 | ||
|
|
47c716e892 | ||
|
|
5863f16b4c | ||
|
|
4bab0d07a6 | ||
|
|
14e9de6678 | ||
|
|
39cf6abd94 | ||
|
|
bfbee62340 | ||
|
|
606cdb17d3 | ||
|
|
658e1ee426 | ||
|
|
83a24ad638 | ||
|
|
9d3b190465 | ||
|
|
260430c849 | ||
|
|
adc8c03fe4 | ||
|
|
6b58db9ccd | ||
|
|
d77fe3b1c2 | ||
|
|
69bd6cd490 | ||
|
|
dc915aff62 | ||
|
|
8b40b59084 | ||
|
|
064625ef58 | ||
|
|
18550b165b | ||
|
|
f85118604e | ||
|
|
d25b193bfd |
@@ -5,21 +5,24 @@
|
||||
|
||||
. .ci/scripts/common/pre-upload.sh
|
||||
|
||||
APPIMAGE_NAME="yuzu-${GITDATE}-${GITREV}.AppImage"
|
||||
REV_NAME="yuzu-linux-${GITDATE}-${GITREV}"
|
||||
APPIMAGE_NAME="yuzu-${RELEASE_NAME}-${GITDATE}-${GITREV}.AppImage"
|
||||
BASE_NAME="yuzu-linux"
|
||||
REV_NAME="${BASE_NAME}-${GITDATE}-${GITREV}"
|
||||
ARCHIVE_NAME="${REV_NAME}.tar.xz"
|
||||
COMPRESSION_FLAGS="-cJvf"
|
||||
|
||||
if [ "${RELEASE_NAME}" = "mainline" ]; then
|
||||
DIR_NAME="${REV_NAME}"
|
||||
if [ "${RELEASE_NAME}" = "mainline" ] || [ "${RELEASE_NAME}" = "early-access" ]; then
|
||||
DIR_NAME="${BASE_NAME}-${RELEASE_NAME}"
|
||||
else
|
||||
DIR_NAME="${REV_NAME}_${RELEASE_NAME}"
|
||||
DIR_NAME="${REV_NAME}-${RELEASE_NAME}"
|
||||
fi
|
||||
|
||||
mkdir "$DIR_NAME"
|
||||
|
||||
cp build/bin/yuzu-cmd "$DIR_NAME"
|
||||
cp build/bin/yuzu "$DIR_NAME"
|
||||
if [ "${RELEASE_NAME}" != "early-access" ] && [ "${RELEASE_NAME}" != "mainline" ]; then
|
||||
cp build/bin/yuzu "$DIR_NAME"
|
||||
fi
|
||||
|
||||
# Build an AppImage
|
||||
cd build
|
||||
@@ -32,6 +35,11 @@ if ! ./appimagetool-x86_64.AppImage --version; then
|
||||
export APPIMAGE_EXTRACT_AND_RUN=1
|
||||
fi
|
||||
|
||||
# Don't let AppImageLauncher ask to integrate EA
|
||||
if [ "${RELEASE_NAME}" = "mainline" ] || [ "${RELEASE_NAME}" = "early-access" ]; then
|
||||
echo "X-AppImage-Integrate=false" >> AppDir/org.yuzu_emu.yuzu.desktop
|
||||
fi
|
||||
|
||||
if [ "${RELEASE_NAME}" = "mainline" ]; then
|
||||
# Generate update information if releasing to mainline
|
||||
./appimagetool-x86_64.AppImage -u "gh-releases-zsync|yuzu-emu|yuzu-${RELEASE_NAME}|latest|yuzu-*.AppImage.zsync" AppDir "${APPIMAGE_NAME}"
|
||||
@@ -46,4 +54,9 @@ if [ -f "build/${APPIMAGE_NAME}.zsync" ]; then
|
||||
cp "build/${APPIMAGE_NAME}.zsync" "${ARTIFACTS_DIR}/"
|
||||
fi
|
||||
|
||||
# Copy the AppImage to the general release directory and remove git revision info
|
||||
if [ "${RELEASE_NAME}" = "mainline" ] || [ "${RELEASE_NAME}" = "early-access" ]; then
|
||||
cp "build/${APPIMAGE_NAME}" "${DIR_NAME}/yuzu-${RELEASE_NAME}.AppImage"
|
||||
fi
|
||||
|
||||
. .ci/scripts/common/post-upload.sh
|
||||
|
||||
@@ -21,6 +21,7 @@ cmake .. \
|
||||
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DUSE_CCACHE=ON \
|
||||
-DYUZU_CRASH_DUMPS=ON \
|
||||
-DYUZU_USE_BUNDLED_SDL2=OFF \
|
||||
-DYUZU_USE_EXTERNAL_SDL2=OFF \
|
||||
-DYUZU_TESTS=OFF \
|
||||
|
||||
@@ -65,8 +65,8 @@ if ("$env:GITHUB_ACTIONS" -eq "true") {
|
||||
# None of the other GHA builds are including source, so commenting out today
|
||||
#Copy-Item $MSVC_SOURCE_TARXZ -Destination "artifacts"
|
||||
|
||||
# Are debug symbols important?
|
||||
# cp .\build\bin\yuzu*.pdb .\pdb\
|
||||
# Debugging symbols
|
||||
cp .\build\bin\yuzu*.pdb .\artifacts\
|
||||
|
||||
# Write out a tag BUILD_TAG to environment for the Upload step
|
||||
# We're getting ${{ github.event.number }} as $env:PR_NUMBER"
|
||||
|
||||
@@ -9,7 +9,7 @@ parameters:
|
||||
steps:
|
||||
- script: choco install vulkan-sdk
|
||||
displayName: 'Install vulkan-sdk'
|
||||
- script: refreshenv && mkdir build && cd build && cmake -G "Visual Studio 16 2019" -A x64 -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DYUZU_TESTS=OFF -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DDISPLAY_VERSION=${{ parameters['version'] }} -DCMAKE_BUILD_TYPE=Release .. && cd ..
|
||||
- script: refreshenv && mkdir build && cd build && cmake -G "Visual Studio 17 2022" -A x64 -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DYUZU_TESTS=OFF -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DDISPLAY_VERSION=${{ parameters['version'] }} -DCMAKE_BUILD_TYPE=Release -DYUZU_CRASH_DUMPS=ON .. && cd ..
|
||||
displayName: 'Configure CMake'
|
||||
- task: MSBuild@1
|
||||
displayName: 'Build'
|
||||
|
||||
@@ -50,7 +50,7 @@ stages:
|
||||
timeoutInMinutes: 120
|
||||
displayName: 'msvc'
|
||||
pool:
|
||||
vmImage: windows-2019
|
||||
vmImage: windows-2022
|
||||
steps:
|
||||
- template: ./templates/sync-source.yml
|
||||
parameters:
|
||||
|
||||
@@ -11,11 +11,32 @@ stages:
|
||||
- stage: build
|
||||
displayName: 'build'
|
||||
jobs:
|
||||
- job: build
|
||||
- job: linux
|
||||
timeoutInMinutes: 120
|
||||
displayName: 'windows-msvc'
|
||||
displayName: 'linux'
|
||||
pool:
|
||||
vmImage: windows-2019
|
||||
vmImage: ubuntu-latest
|
||||
strategy:
|
||||
maxParallel: 10
|
||||
matrix:
|
||||
linux:
|
||||
BuildSuffix: 'linux'
|
||||
ScriptFolder: 'linux'
|
||||
steps:
|
||||
- template: ./templates/sync-source.yml
|
||||
parameters:
|
||||
artifactSource: $(parameters.artifactSource)
|
||||
needSubmodules: 'true'
|
||||
- template: ./templates/build-single.yml
|
||||
parameters:
|
||||
artifactSource: 'false'
|
||||
cache: $(parameters.cache)
|
||||
version: $(DisplayVersion)
|
||||
- job: msvc
|
||||
timeoutInMinutes: 120
|
||||
displayName: 'windows'
|
||||
pool:
|
||||
vmImage: windows-2022
|
||||
steps:
|
||||
- template: ./templates/sync-source.yml
|
||||
parameters:
|
||||
|
||||
4
.github/workflows/verify.yml
vendored
@@ -71,7 +71,7 @@ jobs:
|
||||
build-msvc:
|
||||
name: 'test build (windows, msvc)'
|
||||
needs: format
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: Set up cache
|
||||
uses: actions/cache@v3
|
||||
@@ -104,7 +104,7 @@ jobs:
|
||||
run: |
|
||||
glslangValidator --version
|
||||
mkdir build
|
||||
cmake . -B build -GNinja -DCMAKE_TOOLCHAIN_FILE="CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DGIT_BRANCH=pr-verify
|
||||
cmake . -B build -GNinja -DCMAKE_TOOLCHAIN_FILE="CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DGIT_BRANCH=pr-verify -DYUZU_CRASH_DUMPS=ON
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
- name: Cache Summary
|
||||
|
||||
2
.gitignore
vendored
@@ -2,7 +2,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Build directory
|
||||
[Bb]uild/
|
||||
[Bb]uild*/
|
||||
doc-build/
|
||||
|
||||
# Generated source files
|
||||
|
||||
11
.reuse/dep5
@@ -6,6 +6,7 @@ Files: dist/english_plurals/*
|
||||
dist/icons/controller/*.png
|
||||
dist/icons/overlay/*.png
|
||||
dist/languages/*
|
||||
dist/qt_themes/*/icons/48x48/sd_card.png
|
||||
dist/qt_themes/*/icons/index.theme
|
||||
dist/qt_themes/default/style.qss
|
||||
Copyright: yuzu Emulator Project
|
||||
@@ -51,6 +52,8 @@ Files: dist/qt_themes/colorful/icons/16x16/lock.png
|
||||
dist/qt_themes/colorful/icons/48x48/chip.png
|
||||
dist/qt_themes/colorful/icons/48x48/folder.png
|
||||
dist/qt_themes/colorful_dark/icons/16x16/lock.png
|
||||
dist/qt_themes/colorful/icons/16x16/info.png
|
||||
dist/qt_themes/colorful/icons/16x16/sync.png
|
||||
Copyright: Icons8
|
||||
License: MIT
|
||||
Comment: https://github.com/icons8/flat-color-icons
|
||||
@@ -66,11 +69,9 @@ Files: dist/qt_themes/*/icons/48x48/no_avatar.png
|
||||
Copyright: Ionic (http://ionic.io/)
|
||||
License: MIT
|
||||
|
||||
|
||||
Files: dist/qt_themes/*/icons/48x48/sd_card.png
|
||||
dist/qt_themes/colorful/icons/48x48/star.png
|
||||
dist/qt_themes/default/icons/16x16/checked.png
|
||||
dist/qt_themes/default/icons/16x16/failed.png
|
||||
Files: dist/qt_themes/colorful/icons/48x48/star.png
|
||||
dist/qt_themes/colorful/icons/16x16/checked.png
|
||||
dist/qt_themes/colorful/icons/16x16/failed.png
|
||||
Copyright: SVG Repo
|
||||
License: CC0-1.0
|
||||
|
||||
|
||||
@@ -38,12 +38,19 @@ option(YUZU_USE_BUNDLED_OPUS "Compile bundled opus" ON)
|
||||
|
||||
option(YUZU_TESTS "Compile tests" ON)
|
||||
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile Windows crash dump (Minidump) support" OFF "WIN32" OFF)
|
||||
|
||||
option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" "${MSVC}")
|
||||
|
||||
option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ON)
|
||||
|
||||
if (YUZU_USE_BUNDLED_VCPKG)
|
||||
if (YUZU_TESTS)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "yuzu-tests")
|
||||
endif()
|
||||
if (YUZU_CRASH_DUMPS)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "dbghelp")
|
||||
endif()
|
||||
|
||||
include(${CMAKE_SOURCE_DIR}/externals/vcpkg/scripts/buildsystems/vcpkg.cmake)
|
||||
elseif(NOT "$ENV{VCPKG_TOOLCHAIN_FILE}" STREQUAL "")
|
||||
@@ -81,12 +88,17 @@ function(check_submodules_present)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/.gitmodules)
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/.gitmodules AND YUZU_CHECK_SUBMODULES)
|
||||
check_submodules_present()
|
||||
endif()
|
||||
configure_file(${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.qrc
|
||||
${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc
|
||||
COPYONLY)
|
||||
if (EXISTS ${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.json)
|
||||
configure_file("${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.json"
|
||||
"${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json"
|
||||
COPYONLY)
|
||||
endif()
|
||||
if (ENABLE_COMPATIBILITY_LIST_DOWNLOAD AND NOT EXISTS ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json)
|
||||
message(STATUS "Downloading compatibility list for yuzu...")
|
||||
file(DOWNLOAD
|
||||
@@ -440,6 +452,13 @@ elseif (WIN32)
|
||||
# PSAPI is the Process Status API
|
||||
set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} psapi imm32 version)
|
||||
endif()
|
||||
|
||||
if (YUZU_CRASH_DUMPS)
|
||||
find_library(DBGHELP_LIBRARY dbghelp)
|
||||
if ("${DBGHELP_LIBRARY}" STREQUAL "DBGHELP_LIBRARY-NOTFOUND")
|
||||
message(FATAL_ERROR "YUZU_CRASH_DUMPS enabled but dbghelp library not found")
|
||||
endif()
|
||||
endif()
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU|SunOS)$")
|
||||
set(PLATFORM_LIBRARIES rt)
|
||||
endif()
|
||||
|
||||
628
dist/languages/ca.ts
vendored
628
dist/languages/cs.ts
vendored
628
dist/languages/da.ts
vendored
630
dist/languages/de.ts
vendored
628
dist/languages/el.ts
vendored
922
dist/languages/es.ts
vendored
730
dist/languages/fr.ts
vendored
628
dist/languages/id.ts
vendored
1612
dist/languages/it.ts
vendored
1025
dist/languages/ja_JP.ts
vendored
628
dist/languages/ko_KR.ts
vendored
628
dist/languages/nb.ts
vendored
628
dist/languages/nl.ts
vendored
882
dist/languages/pl.ts
vendored
628
dist/languages/pt_BR.ts
vendored
628
dist/languages/pt_PT.ts
vendored
963
dist/languages/ru_RU.ts
vendored
628
dist/languages/sv.ts
vendored
628
dist/languages/tr_TR.ts
vendored
628
dist/languages/vi.ts
vendored
628
dist/languages/vi_VN.ts
vendored
632
dist/languages/zh_CN.ts
vendored
632
dist/languages/zh_TW.ts
vendored
|
Before Width: | Height: | Size: 414 B After Width: | Height: | Size: 414 B |
|
Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 431 B |
BIN
dist/qt_themes/colorful/icons/16x16/info.png
vendored
Normal file
|
After Width: | Height: | Size: 428 B |
BIN
dist/qt_themes/colorful/icons/16x16/sync.png
vendored
Normal file
|
After Width: | Height: | Size: 548 B |
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
|
Before Width: | Height: | Size: 678 B After Width: | Height: | Size: 678 B |
BIN
dist/qt_themes/colorful/icons/48x48/sd_card.png
vendored
|
Before Width: | Height: | Size: 981 B After Width: | Height: | Size: 228 B |
1
dist/qt_themes/colorful/icons/index.theme
vendored
@@ -1,7 +1,6 @@
|
||||
[Icon Theme]
|
||||
Name=colorful
|
||||
Comment=Colorful theme
|
||||
Inherits=default
|
||||
Directories=16x16,48x48,256x256
|
||||
|
||||
[16x16]
|
||||
|
||||
6
dist/qt_themes/colorful/style.qrc
vendored
@@ -6,14 +6,20 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||
<RCC>
|
||||
<qresource prefix="icons/colorful">
|
||||
<file alias="index.theme">icons/index.theme</file>
|
||||
<file alias="16x16/checked.png">icons/16x16/checked.png</file>
|
||||
<file alias="16x16/connected.png">icons/16x16/connected.png</file>
|
||||
<file alias="16x16/connected_notification.png">icons/16x16/connected_notification.png</file>
|
||||
<file alias="16x16/disconnected.png">icons/16x16/disconnected.png</file>
|
||||
<file alias="16x16/failed.png">icons/16x16/failed.png</file>
|
||||
<file alias="16x16/info.png">icons/16x16/info.png</file>
|
||||
<file alias="16x16/lock.png">icons/16x16/lock.png</file>
|
||||
<file alias="16x16/sync.png">icons/16x16/sync.png</file>
|
||||
<file alias="16x16/view-refresh.png">icons/16x16/view-refresh.png</file>
|
||||
<file alias="48x48/bad_folder.png">icons/48x48/bad_folder.png</file>
|
||||
<file alias="48x48/chip.png">icons/48x48/chip.png</file>
|
||||
<file alias="48x48/folder.png">icons/48x48/folder.png</file>
|
||||
<file alias="48x48/list-add.png">icons/48x48/list-add.png</file>
|
||||
<file alias="48x48/no_avatar.png">icons/48x48/no_avatar.png</file>
|
||||
<file alias="48x48/sd_card.png">icons/48x48/sd_card.png</file>
|
||||
<file alias="48x48/star.png">icons/48x48/star.png</file>
|
||||
<file alias="256x256/plus_folder.png">icons/256x256/plus_folder.png</file>
|
||||
|
||||
10
dist/qt_themes/colorful_dark/style.qrc
vendored
@@ -5,19 +5,9 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
<RCC>
|
||||
<qresource prefix="icons/colorful_dark">
|
||||
<file alias="16x16/connected.png">../colorful/icons/16x16/connected.png</file>
|
||||
<file alias="16x16/connected_notification.png">../colorful/icons/16x16/connected_notification.png</file>
|
||||
<file alias="16x16/disconnected.png">../colorful/icons/16x16/disconnected.png</file>
|
||||
<file alias="index.theme">icons/index.theme</file>
|
||||
<file alias="16x16/lock.png">icons/16x16/lock.png</file>
|
||||
<file alias="16x16/view-refresh.png">icons/16x16/view-refresh.png</file>
|
||||
<file alias="48x48/bad_folder.png">../colorful/icons/48x48/bad_folder.png</file>
|
||||
<file alias="48x48/chip.png">../colorful/icons/48x48/chip.png</file>
|
||||
<file alias="48x48/folder.png">../colorful/icons/48x48/folder.png</file>
|
||||
<file alias="48x48/no_avatar.png">../qdarkstyle/icons/48x48/no_avatar.png</file>
|
||||
<file alias="48x48/list-add.png">../colorful/icons/48x48/list-add.png</file>
|
||||
<file alias="48x48/sd_card.png">../colorful/icons/48x48/sd_card.png</file>
|
||||
<file alias="256x256/plus_folder.png">../colorful/icons/256x256/plus_folder.png</file>
|
||||
</qresource>
|
||||
|
||||
<qresource prefix="qss_icons">
|
||||
|
||||
11
dist/qt_themes/default/default.qrc
vendored
@@ -5,23 +5,20 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
<RCC>
|
||||
<qresource prefix="icons/default">
|
||||
<!-- "colorful" is now the default theme, add new icons there -->
|
||||
<file alias="index.theme">icons/index.theme</file>
|
||||
<file alias="16x16/checked.png">icons/16x16/checked.png</file>
|
||||
<file alias="16x16/failed.png">icons/16x16/failed.png</file>
|
||||
<file alias="16x16/lock.png">icons/16x16/lock.png</file>
|
||||
<file alias="16x16/connected.png">icons/16x16/connected.png</file>
|
||||
<file alias="16x16/disconnected.png">icons/16x16/disconnected.png</file>
|
||||
<file alias="16x16/connected_notification.png">icons/16x16/connected_notification.png</file>
|
||||
<file alias="16x16/view-refresh.png">icons/16x16/view-refresh.png</file>
|
||||
<file alias="16x16/disconnected.png">icons/16x16/disconnected.png</file>
|
||||
<file alias="16x16/lock.png">icons/16x16/lock.png</file>
|
||||
<file alias="48x48/bad_folder.png">icons/48x48/bad_folder.png</file>
|
||||
<file alias="48x48/chip.png">icons/48x48/chip.png</file>
|
||||
<file alias="48x48/folder.png">icons/48x48/folder.png</file>
|
||||
<file alias="48x48/no_avatar.png">icons/48x48/no_avatar.png</file>
|
||||
<file alias="48x48/list-add.png">icons/48x48/list-add.png</file>
|
||||
<file alias="48x48/sd_card.png">icons/48x48/sd_card.png</file>
|
||||
<file alias="48x48/star.png">icons/48x48/star.png</file>
|
||||
<file alias="256x256/yuzu.png">icons/256x256/yuzu.png</file>
|
||||
<file alias="256x256/plus_folder.png">icons/256x256/plus_folder.png</file>
|
||||
<file alias="256x256/yuzu.png">icons/256x256/yuzu.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="default">
|
||||
<file>style.qss</file>
|
||||
|
||||
BIN
dist/qt_themes/default/icons/48x48/sd_card.png
vendored
|
Before Width: | Height: | Size: 561 B After Width: | Height: | Size: 198 B |
3
dist/qt_themes/default/icons/index.theme
vendored
@@ -1,6 +1,7 @@
|
||||
[Icon Theme]
|
||||
Name=default
|
||||
Comment=default theme
|
||||
Inherits=colorful
|
||||
Directories=16x16,48x48,256x256
|
||||
|
||||
[16x16]
|
||||
@@ -10,4 +11,4 @@ Size=16
|
||||
Size=48
|
||||
|
||||
[256x256]
|
||||
Size=256
|
||||
Size=256
|
||||
|
||||
BIN
dist/qt_themes/qdarkstyle/icons/48x48/sd_card.png
vendored
|
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 214 B |
4
dist/qt_themes/qdarkstyle/icons/index.theme
vendored
@@ -1,7 +1,7 @@
|
||||
[Icon Theme]
|
||||
Name=qdarkstyle
|
||||
Comment=dark theme
|
||||
Inherits=default
|
||||
Inherits=colorful
|
||||
Directories=16x16,48x48,256x256
|
||||
|
||||
[16x16]
|
||||
@@ -11,4 +11,4 @@ Size=16
|
||||
Size=48
|
||||
|
||||
[256x256]
|
||||
Size=256
|
||||
Size=256
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Icon Theme]
|
||||
Name=qdarkstyle_midnight_blue
|
||||
Comment=dark theme
|
||||
Inherits=default
|
||||
Inherits=colorful
|
||||
Directories=16x16,48x48,256x256
|
||||
|
||||
[16x16]
|
||||
|
||||
3
externals/CMakeLists.txt
vendored
@@ -16,7 +16,6 @@ endif()
|
||||
|
||||
# Dynarmic
|
||||
if (ARCHITECTURE_x86_64)
|
||||
set(DYNARMIC_TESTS OFF)
|
||||
set(DYNARMIC_NO_BUNDLED_FMT ON)
|
||||
set(DYNARMIC_IGNORE_ASSERTS ON CACHE BOOL "" FORCE)
|
||||
add_subdirectory(dynarmic)
|
||||
@@ -128,7 +127,7 @@ endif()
|
||||
if (YUZU_USE_BUNDLED_OPUS)
|
||||
add_subdirectory(opus EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
find_package(opus 1.3 REQUIRED)
|
||||
find_package(Opus 1.3 REQUIRED)
|
||||
endif()
|
||||
|
||||
# FFMpeg
|
||||
|
||||
51
externals/find-modules/FindCatch2.cmake
vendored
@@ -1,51 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_Catch2 QUIET Catch2)
|
||||
|
||||
find_path(Catch2_INCLUDE_DIR
|
||||
NAMES catch.hpp
|
||||
PATHS ${PC_Catch2_INCLUDE_DIRS} ${CONAN_CATCH2_ROOT}
|
||||
PATH_SUFFIXES catch2
|
||||
)
|
||||
|
||||
if(Catch2_INCLUDE_DIR)
|
||||
file(STRINGS "${Catch2_INCLUDE_DIR}/catch.hpp" _Catch2_version_lines
|
||||
REGEX "#define[ \t]+CATCH_VERSION_(MAJOR|MINOR|PATCH)")
|
||||
string(REGEX REPLACE ".*CATCH_VERSION_MAJOR +\([0-9]+\).*" "\\1" _Catch2_version_major "${_Catch2_version_lines}")
|
||||
string(REGEX REPLACE ".*CATCH_VERSION_MINOR +\([0-9]+\).*" "\\1" _Catch2_version_minor "${_Catch2_version_lines}")
|
||||
string(REGEX REPLACE ".*CATCH_VERSION_PATCH +\([0-9]+\).*" "\\1" _Catch2_version_patch "${_Catch2_version_lines}")
|
||||
set(Catch2_VERSION "${_Catch2_version_major}.${_Catch2_version_minor}.${_Catch2_version_patch}")
|
||||
unset(_Catch2_version_major)
|
||||
unset(_Catch2_version_minor)
|
||||
unset(_Catch2_version_patch)
|
||||
unset(_Catch2_version_lines)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Catch2
|
||||
FOUND_VAR Catch2_FOUND
|
||||
REQUIRED_VARS
|
||||
Catch2_INCLUDE_DIR
|
||||
Catch2_VERSION
|
||||
VERSION_VAR Catch2_VERSION
|
||||
)
|
||||
|
||||
if(Catch2_FOUND)
|
||||
set(Catch2_INCLUDE_DIRS ${Catch2_INCLUDE_DIR})
|
||||
set(Catch2_DEFINITIONS ${PC_Catch2_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
if(Catch2_FOUND AND NOT TARGET Catch2::Catch2)
|
||||
add_library(Catch2::Catch2 UNKNOWN IMPORTED)
|
||||
set_target_properties(Catch2::Catch2 PROPERTIES
|
||||
IMPORTED_LOCATION "${Catch2_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_Catch2_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Catch2_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
Catch2_INCLUDE_DIR
|
||||
)
|
||||
19
externals/find-modules/FindOpus.cmake
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_search_module(opus IMPORTED_TARGET GLOBAL opus)
|
||||
if (opus_FOUND)
|
||||
add_library(Opus::opus ALIAS PkgConfig::opus)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Opus
|
||||
REQUIRED_VARS
|
||||
opus_LINK_LIBRARIES
|
||||
opus_FOUND
|
||||
VERSION_VAR opus_VERSION
|
||||
)
|
||||
71
externals/find-modules/Findfmt.cmake
vendored
@@ -1,71 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_fmt QUIET fmt)
|
||||
|
||||
find_path(fmt_INCLUDE_DIR
|
||||
NAMES format.h
|
||||
PATHS ${PC_fmt_INCLUDE_DIRS} ${CONAN_INCLUDE_DIRS_fmt}
|
||||
PATH_SUFFIXES fmt
|
||||
)
|
||||
|
||||
find_library(fmt_LIBRARY
|
||||
NAMES fmt
|
||||
PATHS ${PC_fmt_LIBRARY_DIRS} ${CONAN_LIB_DIRS_fmt}
|
||||
)
|
||||
|
||||
if(fmt_INCLUDE_DIR)
|
||||
set(_fmt_version_file "${fmt_INCLUDE_DIR}/core.h")
|
||||
if(NOT EXISTS "${_fmt_version_file}")
|
||||
set(_fmt_version_file "${fmt_INCLUDE_DIR}/format.h")
|
||||
endif()
|
||||
if(EXISTS "${_fmt_version_file}")
|
||||
# parse "#define FMT_VERSION 60200" to 6.2.0
|
||||
file(STRINGS "${_fmt_version_file}" fmt_VERSION_LINE
|
||||
REGEX "^#define[ \t]+FMT_VERSION[ \t]+[0-9]+$")
|
||||
string(REGEX REPLACE "^#define[ \t]+FMT_VERSION[ \t]+([0-9]+)$"
|
||||
"\\1" fmt_VERSION "${fmt_VERSION_LINE}")
|
||||
foreach(ver "fmt_VERSION_PATCH" "fmt_VERSION_MINOR" "fmt_VERSION_MAJOR")
|
||||
math(EXPR ${ver} "${fmt_VERSION} % 100")
|
||||
math(EXPR fmt_VERSION "(${fmt_VERSION} - ${${ver}}) / 100")
|
||||
endforeach()
|
||||
set(fmt_VERSION
|
||||
"${fmt_VERSION_MAJOR}.${fmt_VERSION_MINOR}.${fmt_VERSION_PATCH}")
|
||||
endif()
|
||||
unset(_fmt_version_file)
|
||||
unset(fmt_VERSION_LINE)
|
||||
unset(fmt_VERSION_MAJOR)
|
||||
unset(fmt_VERSION_MINOR)
|
||||
unset(fmt_VERSION_PATCH)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(fmt
|
||||
FOUND_VAR fmt_FOUND
|
||||
REQUIRED_VARS
|
||||
fmt_LIBRARY
|
||||
fmt_INCLUDE_DIR
|
||||
fmt_VERSION
|
||||
VERSION_VAR fmt_VERSION
|
||||
)
|
||||
|
||||
if(fmt_FOUND)
|
||||
set(fmt_LIBRARIES ${fmt_LIBRARY})
|
||||
set(fmt_INCLUDE_DIRS ${fmt_INCLUDE_DIR})
|
||||
set(fmt_DEFINITIONS ${PC_fmt_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
if(fmt_FOUND AND NOT TARGET fmt::fmt)
|
||||
add_library(fmt::fmt UNKNOWN IMPORTED)
|
||||
set_target_properties(fmt::fmt PROPERTIES
|
||||
IMPORTED_LOCATION "${fmt_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_fmt_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${fmt_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
fmt_INCLUDE_DIR
|
||||
fmt_LIBRARY
|
||||
)
|
||||
59
externals/find-modules/Findlz4.cmake
vendored
@@ -1,56 +1,19 @@
|
||||
# SPDX-FileCopyrightText: 2020 yuzu Emulator Project
|
||||
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_lz4 QUIET lz4)
|
||||
find_package(PkgConfig)
|
||||
|
||||
find_path(lz4_INCLUDE_DIR
|
||||
NAMES lz4.h
|
||||
PATHS ${PC_lz4_INCLUDE_DIRS}
|
||||
)
|
||||
find_library(lz4_LIBRARY
|
||||
NAMES lz4
|
||||
PATHS ${PC_lz4_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
if(lz4_INCLUDE_DIR)
|
||||
file(STRINGS "${lz4_INCLUDE_DIR}/lz4.h" _lz4_version_lines
|
||||
REGEX "#define[ \t]+LZ4_VERSION_(MAJOR|MINOR|RELEASE)")
|
||||
string(REGEX REPLACE ".*LZ4_VERSION_MAJOR *\([0-9]*\).*" "\\1" _lz4_version_major "${_lz4_version_lines}")
|
||||
string(REGEX REPLACE ".*LZ4_VERSION_MINOR *\([0-9]*\).*" "\\1" _lz4_version_minor "${_lz4_version_lines}")
|
||||
string(REGEX REPLACE ".*LZ4_VERSION_RELEASE *\([0-9]*\).*" "\\1" _lz4_version_release "${_lz4_version_lines}")
|
||||
set(lz4_VERSION "${_lz4_version_major}.${_lz4_version_minor}.${_lz4_version_release}")
|
||||
unset(_lz4_version_major)
|
||||
unset(_lz4_version_minor)
|
||||
unset(_lz4_version_release)
|
||||
unset(_lz4_version_lines)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_search_module(liblz4 IMPORTED_TARGET GLOBAL liblz4)
|
||||
if (liblz4_FOUND)
|
||||
add_library(lz4::lz4 ALIAS PkgConfig::liblz4)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(lz4
|
||||
FOUND_VAR lz4_FOUND
|
||||
REQUIRED_VARS
|
||||
lz4_LIBRARY
|
||||
lz4_INCLUDE_DIR
|
||||
VERSION_VAR lz4_VERSION
|
||||
)
|
||||
|
||||
if(lz4_FOUND)
|
||||
set(lz4_LIBRARIES ${lz4_LIBRARY})
|
||||
set(lz4_INCLUDE_DIRS ${lz4_INCLUDE_DIR})
|
||||
set(lz4_DEFINITIONS ${PC_lz4_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
if(lz4_FOUND AND NOT TARGET lz4::lz4)
|
||||
add_library(lz4::lz4 UNKNOWN IMPORTED)
|
||||
set_target_properties(lz4::lz4 PROPERTIES
|
||||
IMPORTED_LOCATION "${lz4_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_lz4_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${lz4_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
lz4_INCLUDE_DIR
|
||||
lz4_LIBRARY
|
||||
REQUIRED_VARS
|
||||
liblz4_LINK_LIBRARIES
|
||||
liblz4_FOUND
|
||||
VERSION_VAR liblz4_VERSION
|
||||
)
|
||||
|
||||
51
externals/find-modules/Findnlohmann_json.cmake
vendored
@@ -1,51 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_nlohmann_json QUIET nlohmann_json)
|
||||
|
||||
find_path(nlohmann_json_INCLUDE_DIR
|
||||
NAMES json.hpp
|
||||
PATHS ${PC_nlohmann_json_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES nlohmann
|
||||
)
|
||||
|
||||
if(nlohmann_json_INCLUDE_DIR)
|
||||
file(STRINGS "${nlohmann_json_INCLUDE_DIR}/json.hpp" _nlohmann_json_version_lines
|
||||
REGEX "#define[ \t]+NLOHMANN_JSON_VERSION_(MAJOR|MINOR|PATCH)")
|
||||
string(REGEX REPLACE ".*NLOHMANN_JSON_VERSION_MAJOR +\([0-9]+\).*" "\\1" _nlohmann_json_version_major "${_nlohmann_json_version_lines}")
|
||||
string(REGEX REPLACE ".*NLOHMANN_JSON_VERSION_MINOR +\([0-9]+\).*" "\\1" _nlohmann_json_version_minor "${_nlohmann_json_version_lines}")
|
||||
string(REGEX REPLACE ".*NLOHMANN_JSON_VERSION_PATCH +\([0-9]+\).*" "\\1" _nlohmann_json_version_patch "${_nlohmann_json_version_lines}")
|
||||
set(nlohmann_json_VERSION "${_nlohmann_json_version_major}.${_nlohmann_json_version_minor}.${_nlohmann_json_version_patch}")
|
||||
unset(_nlohmann_json_version_major)
|
||||
unset(_nlohmann_json_version_minor)
|
||||
unset(_nlohmann_json_version_patch)
|
||||
unset(_nlohmann_json_version_lines)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(nlohmann_json
|
||||
FOUND_VAR nlohmann_json_FOUND
|
||||
REQUIRED_VARS
|
||||
nlohmann_json_INCLUDE_DIR
|
||||
nlohmann_json_VERSION
|
||||
VERSION_VAR nlohmann_json_VERSION
|
||||
)
|
||||
|
||||
if(nlohmann_json_FOUND)
|
||||
set(nlohmann_json_INCLUDE_DIRS ${nlohmann_json_INCLUDE_DIR})
|
||||
set(nlohmann_json_DEFINITIONS ${PC_nlohmann_json_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
if(nlohmann_json_FOUND AND NOT TARGET nlohmann_json::nlohmann_json)
|
||||
add_library(nlohmann_json::nlohmann_json UNKNOWN IMPORTED)
|
||||
set_target_properties(nlohmann_json::nlohmann_json PROPERTIES
|
||||
IMPORTED_LOCATION "${nlohmann_json_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_nlohmann_json_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${nlohmann_json_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
nlohmann_json_INCLUDE_DIR
|
||||
)
|
||||
44
externals/find-modules/Findopus.cmake
vendored
@@ -1,44 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2020 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_opus QUIET opus)
|
||||
|
||||
find_path(opus_INCLUDE_DIR
|
||||
NAMES opus.h
|
||||
PATHS ${PC_opus_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES opus
|
||||
)
|
||||
find_library(opus_LIBRARY
|
||||
NAMES opus
|
||||
PATHS ${PC_opus_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(opus
|
||||
FOUND_VAR opus_FOUND
|
||||
REQUIRED_VARS
|
||||
opus_LIBRARY
|
||||
opus_INCLUDE_DIR
|
||||
VERSION_VAR opus_VERSION
|
||||
)
|
||||
|
||||
if(opus_FOUND)
|
||||
set(Opus_LIBRARIES ${opus_LIBRARY})
|
||||
set(Opus_INCLUDE_DIRS ${opus_INCLUDE_DIR})
|
||||
set(Opus_DEFINITIONS ${PC_opus_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
if(opus_FOUND AND NOT TARGET Opus::Opus)
|
||||
add_library(Opus::Opus UNKNOWN IMPORTED GLOBAL)
|
||||
set_target_properties(Opus::Opus PROPERTIES
|
||||
IMPORTED_LOCATION "${opus_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_opus_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${opus_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
opus_INCLUDE_DIR
|
||||
opus_LIBRARY
|
||||
)
|
||||
60
externals/find-modules/Findzstd.cmake
vendored
@@ -1,57 +1,19 @@
|
||||
# SPDX-FileCopyrightText: 2020 yuzu Emulator Project
|
||||
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_zstd QUIET libzstd)
|
||||
find_package(PkgConfig)
|
||||
|
||||
find_path(zstd_INCLUDE_DIR
|
||||
NAMES zstd.h
|
||||
PATHS ${PC_zstd_INCLUDE_DIRS}
|
||||
)
|
||||
find_library(zstd_LIBRARY
|
||||
NAMES zstd
|
||||
PATHS ${PC_zstd_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
if(zstd_INCLUDE_DIR)
|
||||
file(STRINGS "${zstd_INCLUDE_DIR}/zstd.h" _zstd_version_lines
|
||||
REGEX "#define[ \t]+ZSTD_VERSION_(MAJOR|MINOR|RELEASE)")
|
||||
string(REGEX REPLACE ".*ZSTD_VERSION_MAJOR *\([0-9]*\).*" "\\1" _zstd_version_major "${_zstd_version_lines}")
|
||||
string(REGEX REPLACE ".*ZSTD_VERSION_MINOR *\([0-9]*\).*" "\\1" _zstd_version_minor "${_zstd_version_lines}")
|
||||
string(REGEX REPLACE ".*ZSTD_VERSION_RELEASE *\([0-9]*\).*" "\\1" _zstd_version_release "${_zstd_version_lines}")
|
||||
set(zstd_VERSION "${_zstd_version_major}.${_zstd_version_minor}.${_zstd_version_release}")
|
||||
unset(_zstd_version_major)
|
||||
unset(_zstd_version_minor)
|
||||
unset(_zstd_version_release)
|
||||
unset(_zstd_version_lines)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_search_module(libzstd IMPORTED_TARGET GLOBAL libzstd)
|
||||
if (libzstd_FOUND)
|
||||
add_library(zstd::zstd ALIAS PkgConfig::libzstd)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(zstd
|
||||
FOUND_VAR zstd_FOUND
|
||||
REQUIRED_VARS
|
||||
zstd_LIBRARY
|
||||
zstd_INCLUDE_DIR
|
||||
zstd_VERSION
|
||||
VERSION_VAR zstd_VERSION
|
||||
)
|
||||
|
||||
if(zstd_FOUND)
|
||||
set(zstd_LIBRARIES ${zstd_LIBRARY})
|
||||
set(zstd_INCLUDE_DIRS ${zstd_INCLUDE_DIR})
|
||||
set(zstd_DEFINITIONS ${PC_zstd_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
if(zstd_FOUND AND NOT TARGET zstd::zstd)
|
||||
add_library(zstd::zstd UNKNOWN IMPORTED)
|
||||
set_target_properties(zstd::zstd PROPERTIES
|
||||
IMPORTED_LOCATION "${zstd_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_zstd_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
zstd_INCLUDE_DIR
|
||||
zstd_LIBRARY
|
||||
REQUIRED_VARS
|
||||
libzstd_LINK_LIBRARIES
|
||||
libzstd_FOUND
|
||||
VERSION_VAR libzstd_VERSION
|
||||
)
|
||||
|
||||
2
externals/opus/CMakeLists.txt
vendored
@@ -256,4 +256,4 @@ PRIVATE
|
||||
opus/src
|
||||
)
|
||||
|
||||
add_library(Opus::Opus ALIAS opus)
|
||||
add_library(Opus::opus ALIAS opus)
|
||||
|
||||
@@ -194,6 +194,7 @@ add_library(audio_core STATIC
|
||||
sink/sink.h
|
||||
sink/sink_details.cpp
|
||||
sink/sink_details.h
|
||||
sink/sink_stream.cpp
|
||||
sink/sink_stream.h
|
||||
)
|
||||
|
||||
|
||||
@@ -47,22 +47,12 @@ AudioRenderer::ADSP::ADSP& AudioCore::GetADSP() {
|
||||
return *adsp;
|
||||
}
|
||||
|
||||
void AudioCore::PauseSinks(const bool pausing) const {
|
||||
if (pausing) {
|
||||
output_sink->PauseStreams();
|
||||
input_sink->PauseStreams();
|
||||
} else {
|
||||
output_sink->UnpauseStreams();
|
||||
input_sink->UnpauseStreams();
|
||||
}
|
||||
void AudioCore::SetNVDECActive(bool active) {
|
||||
nvdec_active = active;
|
||||
}
|
||||
|
||||
u32 AudioCore::GetStreamQueue() const {
|
||||
return estimated_queue.load();
|
||||
}
|
||||
|
||||
void AudioCore::SetStreamQueue(u32 size) {
|
||||
estimated_queue.store(size);
|
||||
bool AudioCore::IsNVDECActive() const {
|
||||
return nvdec_active;
|
||||
}
|
||||
|
||||
} // namespace AudioCore
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace AudioCore {
|
||||
|
||||
class AudioManager;
|
||||
/**
|
||||
* Main audio class, sotred inside the core, and holding the audio manager, all sinks, and the ADSP.
|
||||
* Main audio class, stored inside the core, and holding the audio manager, all sinks, and the ADSP.
|
||||
*/
|
||||
class AudioCore {
|
||||
public:
|
||||
@@ -58,26 +58,16 @@ public:
|
||||
AudioRenderer::ADSP::ADSP& GetADSP();
|
||||
|
||||
/**
|
||||
* Pause the sink. Called from the core.
|
||||
* Toggle NVDEC state, used to avoid stall in playback.
|
||||
*
|
||||
* @param pausing - Is this pause due to an actual pause, or shutdown?
|
||||
* Unfortunately, shutdown also pauses streams, which can cause issues.
|
||||
* @param active - Set true if nvdec is active, otherwise false.
|
||||
*/
|
||||
void PauseSinks(bool pausing) const;
|
||||
void SetNVDECActive(bool active);
|
||||
|
||||
/**
|
||||
* Get the size of the current stream queue.
|
||||
*
|
||||
* @return Current stream queue size.
|
||||
* Get NVDEC state.
|
||||
*/
|
||||
u32 GetStreamQueue() const;
|
||||
|
||||
/**
|
||||
* Get the size of the current stream queue.
|
||||
*
|
||||
* @param size - New stream size.
|
||||
*/
|
||||
void SetStreamQueue(u32 size);
|
||||
bool IsNVDECActive() const;
|
||||
|
||||
private:
|
||||
/**
|
||||
@@ -93,8 +83,8 @@ private:
|
||||
std::unique_ptr<Sink::Sink> input_sink;
|
||||
/// The ADSP in the sysmodule
|
||||
std::unique_ptr<AudioRenderer::ADSP::ADSP> adsp;
|
||||
/// Current size of the stream queue
|
||||
std::atomic<u32> estimated_queue{0};
|
||||
/// Is NVDec currently active?
|
||||
bool nvdec_active{false};
|
||||
};
|
||||
|
||||
} // namespace AudioCore
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace AudioCore {
|
||||
* Responsible for the input/output events, set by the stream backend when buffers are consumed, and
|
||||
* waited on by the audio manager. These callbacks signal the game's events to keep the audio buffer
|
||||
* recycling going.
|
||||
* In a real Switch this is not a seprate class, and exists entirely within the audio manager.
|
||||
* In a real Switch this is not a separate class, and exists entirely within the audio manager.
|
||||
* On the Switch it's implemented more simply through a MultiWaitEventHolder, where it can
|
||||
* wait on multiple events at once, and the events are not needed by the backend.
|
||||
*/
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
void ClearEvents();
|
||||
|
||||
private:
|
||||
/// Lock, used bythe audio manager
|
||||
/// Lock, used by the audio manager
|
||||
std::mutex event_lock;
|
||||
/// Array of events, one per system type (see Type), last event is used to terminate
|
||||
std::array<std::atomic<bool>, 4> events_signalled;
|
||||
|
||||
@@ -82,7 +82,7 @@ u32 Manager::GetDeviceNames(std::vector<AudioRenderer::AudioDevice::AudioDeviceN
|
||||
|
||||
auto input_devices{Sink::GetDeviceListForSink(Settings::values.sink_id.GetValue(), true)};
|
||||
if (input_devices.size() > 1) {
|
||||
names.push_back(AudioRenderer::AudioDevice::AudioDeviceName("Uac"));
|
||||
names.emplace_back("Uac");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -59,9 +59,10 @@ public:
|
||||
/**
|
||||
* Get a list of audio in device names.
|
||||
*
|
||||
* @oaram names - Output container to write names to.
|
||||
* @param max_count - Maximum numebr of deivce names to write. Unused
|
||||
* @param names - Output container to write names to.
|
||||
* @param max_count - Maximum number of device names to write. Unused
|
||||
* @param filter - Should the list be filtered? Unused.
|
||||
*
|
||||
* @return Number of names written.
|
||||
*/
|
||||
u32 GetDeviceNames(std::vector<AudioRenderer::AudioDevice::AudioDeviceName>& names,
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
|
||||
private:
|
||||
/**
|
||||
* Main thread, waiting on a manager signal and calling the registered fucntion.
|
||||
* Main thread, waiting on a manager signal and calling the registered function.
|
||||
*/
|
||||
void ThreadFunc();
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ void Manager::BufferReleaseAndRegister() {
|
||||
|
||||
u32 Manager::GetAudioOutDeviceNames(
|
||||
std::vector<AudioRenderer::AudioDevice::AudioDeviceName>& names) const {
|
||||
names.push_back({"DeviceOut"});
|
||||
names.emplace_back("DeviceOut");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ SystemManager& Manager::GetSystemManager() {
|
||||
return *system_manager;
|
||||
}
|
||||
|
||||
auto Manager::GetWorkBufferSize(const AudioRendererParameterInternal& params, u64& out_count)
|
||||
-> Result {
|
||||
Result Manager::GetWorkBufferSize(const AudioRendererParameterInternal& params,
|
||||
u64& out_count) const {
|
||||
if (!CheckValidRevision(params.revision)) {
|
||||
return Service::Audio::ERR_INVALID_REVISION;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ void Manager::ReleaseSessionId(const s32 session_id) {
|
||||
session_ids[--session_count] = session_id;
|
||||
}
|
||||
|
||||
u32 Manager::GetSessionCount() {
|
||||
u32 Manager::GetSessionCount() const {
|
||||
std::scoped_lock l{session_lock};
|
||||
return session_count;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
* @param out_count - Output size of the required workbuffer.
|
||||
* @return Result code.
|
||||
*/
|
||||
Result GetWorkBufferSize(const AudioRendererParameterInternal& params, u64& out_count);
|
||||
Result GetWorkBufferSize(const AudioRendererParameterInternal& params, u64& out_count) const;
|
||||
|
||||
/**
|
||||
* Get a new session id.
|
||||
@@ -60,14 +60,14 @@ public:
|
||||
*
|
||||
* @return The number of active sessions.
|
||||
*/
|
||||
u32 GetSessionCount();
|
||||
u32 GetSessionCount() const;
|
||||
|
||||
/**
|
||||
* Add a renderer system to the manager.
|
||||
* The system will be reguarly called to generate commands for the AudioRenderer.
|
||||
* The system will be regularly called to generate commands for the AudioRenderer.
|
||||
*
|
||||
* @param system - The system to add.
|
||||
* @return True if the system was sucessfully added, otherwise false.
|
||||
* @return True if the system was successfully added, otherwise false.
|
||||
*/
|
||||
bool AddSystem(System& system);
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
* Remove a renderer system from the manager.
|
||||
*
|
||||
* @param system - The system to remove.
|
||||
* @return True if the system was sucessfully removed, otherwise false.
|
||||
* @return True if the system was successfully removed, otherwise false.
|
||||
*/
|
||||
bool RemoveSystem(System& system);
|
||||
|
||||
@@ -94,7 +94,7 @@ private:
|
||||
/// Number of active renderers
|
||||
u32 session_count{};
|
||||
/// Lock for interacting with the sessions
|
||||
std::mutex session_lock{};
|
||||
mutable std::mutex session_lock{};
|
||||
/// Regularly generates commands from the registered systems for the AudioRenderer
|
||||
std::unique_ptr<SystemManager> system_manager{};
|
||||
};
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
namespace AudioCore {
|
||||
|
||||
struct AudioBuffer {
|
||||
/// Timestamp this buffer started playing.
|
||||
u64 start_timestamp;
|
||||
/// Timestamp this buffer should finish playing.
|
||||
u64 end_timestamp;
|
||||
/// Timestamp this buffer completed playing.
|
||||
s64 played_timestamp;
|
||||
/// Game memory address for these samples.
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
*
|
||||
* @param buffer - The new buffer.
|
||||
*/
|
||||
void AppendBuffer(AudioBuffer& buffer) {
|
||||
void AppendBuffer(const AudioBuffer& buffer) {
|
||||
std::scoped_lock l{lock};
|
||||
buffers[appended_index] = buffer;
|
||||
appended_count++;
|
||||
@@ -58,6 +58,7 @@ public:
|
||||
if (index < 0) {
|
||||
index += N;
|
||||
}
|
||||
|
||||
out_buffers.push_back(buffers[index]);
|
||||
registered_count++;
|
||||
registered_index = (registered_index + 1) % append_limit;
|
||||
@@ -87,10 +88,12 @@ public:
|
||||
/**
|
||||
* Release all registered buffers.
|
||||
*
|
||||
* @param timestamp - The released timestamp for this buffer.
|
||||
* @param core_timing - The CoreTiming instance
|
||||
* @param session - The device session
|
||||
*
|
||||
* @return Is the buffer was released.
|
||||
*/
|
||||
bool ReleaseBuffers(Core::Timing::CoreTiming& core_timing, DeviceSession& session) {
|
||||
bool ReleaseBuffers(const Core::Timing::CoreTiming& core_timing, const DeviceSession& session) {
|
||||
std::scoped_lock l{lock};
|
||||
bool buffer_released{false};
|
||||
while (registered_count > 0) {
|
||||
@@ -100,7 +103,7 @@ public:
|
||||
}
|
||||
|
||||
// Check with the backend if this buffer can be released yet.
|
||||
if (!session.IsBufferConsumed(buffers[index].tag)) {
|
||||
if (!session.IsBufferConsumed(buffers[index])) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -280,6 +283,16 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
u64 GetNextTimestamp() const {
|
||||
// Iterate backwards through the buffer queue, and take the most recent buffer's end
|
||||
std::scoped_lock l{lock};
|
||||
auto index{appended_index - 1};
|
||||
if (index < 0) {
|
||||
index += append_limit;
|
||||
}
|
||||
return buffers[index].end_timestamp;
|
||||
}
|
||||
|
||||
private:
|
||||
/// Buffer lock
|
||||
mutable std::recursive_mutex lock{};
|
||||
|
||||
@@ -7,11 +7,20 @@
|
||||
#include "audio_core/device/device_session.h"
|
||||
#include "audio_core/sink/sink_stream.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace AudioCore {
|
||||
|
||||
DeviceSession::DeviceSession(Core::System& system_) : system{system_} {}
|
||||
using namespace std::literals;
|
||||
constexpr auto INCREMENT_TIME{5ms};
|
||||
|
||||
DeviceSession::DeviceSession(Core::System& system_)
|
||||
: system{system_}, thread_event{Core::Timing::CreateEvent(
|
||||
"AudioOutSampleTick",
|
||||
[this](std::uintptr_t, s64 time, std::chrono::nanoseconds) {
|
||||
return ThreadFunc();
|
||||
})} {}
|
||||
|
||||
DeviceSession::~DeviceSession() {
|
||||
Finalize();
|
||||
@@ -50,25 +59,26 @@ void DeviceSession::Finalize() {
|
||||
}
|
||||
|
||||
void DeviceSession::Start() {
|
||||
stream->SetPlayedSampleCount(played_sample_count);
|
||||
stream->Start();
|
||||
if (stream) {
|
||||
stream->Start();
|
||||
system.CoreTiming().ScheduleLoopingEvent(std::chrono::nanoseconds::zero(), INCREMENT_TIME,
|
||||
thread_event);
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceSession::Stop() {
|
||||
if (stream) {
|
||||
played_sample_count = stream->GetPlayedSampleCount();
|
||||
stream->Stop();
|
||||
system.CoreTiming().UnscheduleEvent(thread_event, {});
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceSession::AppendBuffers(std::span<AudioBuffer> buffers) const {
|
||||
auto& memory{system.Memory()};
|
||||
|
||||
for (size_t i = 0; i < buffers.size(); i++) {
|
||||
void DeviceSession::AppendBuffers(std::span<const AudioBuffer> buffers) const {
|
||||
for (const auto& buffer : buffers) {
|
||||
Sink::SinkBuffer new_buffer{
|
||||
.frames = buffers[i].size / (channel_count * sizeof(s16)),
|
||||
.frames = buffer.size / (channel_count * sizeof(s16)),
|
||||
.frames_played = 0,
|
||||
.tag = buffers[i].tag,
|
||||
.tag = buffer.tag,
|
||||
.consumed = false,
|
||||
};
|
||||
|
||||
@@ -76,26 +86,22 @@ void DeviceSession::AppendBuffers(std::span<AudioBuffer> buffers) const {
|
||||
std::vector<s16> samples{};
|
||||
stream->AppendBuffer(new_buffer, samples);
|
||||
} else {
|
||||
std::vector<s16> samples(buffers[i].size / sizeof(s16));
|
||||
memory.ReadBlockUnsafe(buffers[i].samples, samples.data(), buffers[i].size);
|
||||
std::vector<s16> samples(buffer.size / sizeof(s16));
|
||||
system.Memory().ReadBlockUnsafe(buffer.samples, samples.data(), buffer.size);
|
||||
stream->AppendBuffer(new_buffer, samples);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceSession::ReleaseBuffer(AudioBuffer& buffer) const {
|
||||
void DeviceSession::ReleaseBuffer(const AudioBuffer& buffer) const {
|
||||
if (type == Sink::StreamType::In) {
|
||||
auto& memory{system.Memory()};
|
||||
auto samples{stream->ReleaseBuffer(buffer.size / sizeof(s16))};
|
||||
memory.WriteBlockUnsafe(buffer.samples, samples.data(), buffer.size);
|
||||
system.Memory().WriteBlockUnsafe(buffer.samples, samples.data(), buffer.size);
|
||||
}
|
||||
}
|
||||
|
||||
bool DeviceSession::IsBufferConsumed(u64 tag) const {
|
||||
if (stream) {
|
||||
return stream->IsBufferConsumed(tag);
|
||||
}
|
||||
return true;
|
||||
bool DeviceSession::IsBufferConsumed(const AudioBuffer& buffer) const {
|
||||
return played_sample_count >= buffer.end_timestamp;
|
||||
}
|
||||
|
||||
void DeviceSession::SetVolume(f32 volume) const {
|
||||
@@ -105,10 +111,22 @@ void DeviceSession::SetVolume(f32 volume) const {
|
||||
}
|
||||
|
||||
u64 DeviceSession::GetPlayedSampleCount() const {
|
||||
if (stream) {
|
||||
return stream->GetPlayedSampleCount();
|
||||
return played_sample_count;
|
||||
}
|
||||
|
||||
std::optional<std::chrono::nanoseconds> DeviceSession::ThreadFunc() {
|
||||
// Add 5ms of samples at a 48K sample rate.
|
||||
played_sample_count += 48'000 * INCREMENT_TIME / 1s;
|
||||
if (type == Sink::StreamType::Out) {
|
||||
system.AudioCore().GetAudioManager().SetEvent(Event::Type::AudioOutManager, true);
|
||||
} else {
|
||||
system.AudioCore().GetAudioManager().SetEvent(Event::Type::AudioInManager, true);
|
||||
}
|
||||
return 0;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void DeviceSession::SetRingSize(u32 ring_size) {
|
||||
stream->SetRingSize(ring_size);
|
||||
}
|
||||
|
||||
} // namespace AudioCore
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
|
||||
#include "audio_core/common/common.h"
|
||||
@@ -11,9 +14,13 @@
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
namespace Timing {
|
||||
struct EventType;
|
||||
} // namespace Timing
|
||||
} // namespace Core
|
||||
|
||||
namespace AudioCore {
|
||||
|
||||
namespace Sink {
|
||||
class SinkStream;
|
||||
struct SinkBuffer;
|
||||
@@ -55,22 +62,23 @@ public:
|
||||
*
|
||||
* @param buffers - The buffers to play.
|
||||
*/
|
||||
void AppendBuffers(std::span<AudioBuffer> buffers) const;
|
||||
void AppendBuffers(std::span<const AudioBuffer> buffers) const;
|
||||
|
||||
/**
|
||||
* (Audio In only) Pop samples from the backend, and write them back to this buffer's address.
|
||||
*
|
||||
* @param buffer - The buffer to write to.
|
||||
*/
|
||||
void ReleaseBuffer(AudioBuffer& buffer) const;
|
||||
void ReleaseBuffer(const AudioBuffer& buffer) const;
|
||||
|
||||
/**
|
||||
* Check if the buffer for the given tag has been consumed by the backend.
|
||||
*
|
||||
* @param tag - Unqiue tag of the buffer to check.
|
||||
* @param buffer - the buffer to check.
|
||||
*
|
||||
* @return true if the buffer has been consumed, otherwise false.
|
||||
*/
|
||||
bool IsBufferConsumed(u64 tag) const;
|
||||
bool IsBufferConsumed(const AudioBuffer& buffer) const;
|
||||
|
||||
/**
|
||||
* Start this device session, starting the backend stream.
|
||||
@@ -96,6 +104,16 @@ public:
|
||||
*/
|
||||
u64 GetPlayedSampleCount() const;
|
||||
|
||||
/*
|
||||
* CoreTiming callback to increment played_sample_count over time.
|
||||
*/
|
||||
std::optional<std::chrono::nanoseconds> ThreadFunc();
|
||||
|
||||
/*
|
||||
* Set the size of the ring buffer.
|
||||
*/
|
||||
void SetRingSize(u32 ring_size);
|
||||
|
||||
private:
|
||||
/// System
|
||||
Core::System& system;
|
||||
@@ -118,9 +136,13 @@ private:
|
||||
/// Applet resource user id of this device session
|
||||
u64 applet_resource_user_id{};
|
||||
/// Total number of samples played by this device session
|
||||
u64 played_sample_count{};
|
||||
std::atomic<u64> played_sample_count{};
|
||||
/// Event increasing the played sample count every 5ms
|
||||
std::shared_ptr<Core::Timing::EventType> thread_event;
|
||||
/// Is this session initialised?
|
||||
bool initialized{};
|
||||
/// Buffer queue
|
||||
std::vector<AudioBuffer> buffer_queue{};
|
||||
};
|
||||
|
||||
} // namespace AudioCore
|
||||
|
||||
@@ -72,7 +72,7 @@ Kernel::KReadableEvent& In::GetBufferEvent() {
|
||||
return event->GetReadableEvent();
|
||||
}
|
||||
|
||||
f32 In::GetVolume() {
|
||||
f32 In::GetVolume() const {
|
||||
std::scoped_lock l{parent_mutex};
|
||||
return system.GetVolume();
|
||||
}
|
||||
@@ -82,17 +82,17 @@ void In::SetVolume(f32 volume) {
|
||||
system.SetVolume(volume);
|
||||
}
|
||||
|
||||
bool In::ContainsAudioBuffer(u64 tag) {
|
||||
bool In::ContainsAudioBuffer(u64 tag) const {
|
||||
std::scoped_lock l{parent_mutex};
|
||||
return system.ContainsAudioBuffer(tag);
|
||||
}
|
||||
|
||||
u32 In::GetBufferCount() {
|
||||
u32 In::GetBufferCount() const {
|
||||
std::scoped_lock l{parent_mutex};
|
||||
return system.GetBufferCount();
|
||||
}
|
||||
|
||||
u64 In::GetPlayedSampleCount() {
|
||||
u64 In::GetPlayedSampleCount() const {
|
||||
std::scoped_lock l{parent_mutex};
|
||||
return system.GetPlayedSampleCount();
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
*
|
||||
* @return The current volume.
|
||||
*/
|
||||
f32 GetVolume();
|
||||
f32 GetVolume() const;
|
||||
|
||||
/**
|
||||
* Set the system volume.
|
||||
@@ -117,21 +117,21 @@ public:
|
||||
* @param tag - The tag to search for.
|
||||
* @return True if the buffer is in the system, otherwise false.
|
||||
*/
|
||||
bool ContainsAudioBuffer(u64 tag);
|
||||
bool ContainsAudioBuffer(u64 tag) const;
|
||||
|
||||
/**
|
||||
* Get the maximum number of buffers.
|
||||
*
|
||||
* @return The maximum number of buffers.
|
||||
*/
|
||||
u32 GetBufferCount();
|
||||
u32 GetBufferCount() const;
|
||||
|
||||
/**
|
||||
* Get the total played sample count for this audio in.
|
||||
*
|
||||
* @return The played sample count.
|
||||
*/
|
||||
u64 GetPlayedSampleCount();
|
||||
u64 GetPlayedSampleCount() const;
|
||||
|
||||
private:
|
||||
/// The AudioIn::Manager this audio in is registered with
|
||||
|
||||
@@ -34,16 +34,16 @@ size_t System::GetSessionId() const {
|
||||
return session_id;
|
||||
}
|
||||
|
||||
std::string_view System::GetDefaultDeviceName() {
|
||||
std::string_view System::GetDefaultDeviceName() const {
|
||||
return "BuiltInHeadset";
|
||||
}
|
||||
|
||||
std::string_view System::GetDefaultUacDeviceName() {
|
||||
std::string_view System::GetDefaultUacDeviceName() const {
|
||||
return "Uac";
|
||||
}
|
||||
|
||||
Result System::IsConfigValid(const std::string_view device_name,
|
||||
const AudioInParameter& in_params) {
|
||||
const AudioInParameter& in_params) const {
|
||||
if ((device_name.size() > 0) &&
|
||||
(device_name != GetDefaultDeviceName() && device_name != GetDefaultUacDeviceName())) {
|
||||
return Service::Audio::ERR_INVALID_DEVICE_NAME;
|
||||
@@ -93,6 +93,7 @@ Result System::Start() {
|
||||
std::vector<AudioBuffer> buffers_to_flush{};
|
||||
buffers.RegisterBuffers(buffers_to_flush);
|
||||
session->AppendBuffers(buffers_to_flush);
|
||||
session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));
|
||||
|
||||
return ResultSuccess;
|
||||
}
|
||||
@@ -112,8 +113,15 @@ bool System::AppendBuffer(const AudioInBuffer& buffer, const u64 tag) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AudioBuffer new_buffer{
|
||||
.played_timestamp = 0, .samples = buffer.samples, .tag = tag, .size = buffer.size};
|
||||
const auto timestamp{buffers.GetNextTimestamp()};
|
||||
const AudioBuffer new_buffer{
|
||||
.start_timestamp = timestamp,
|
||||
.end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)),
|
||||
.played_timestamp = 0,
|
||||
.samples = buffer.samples,
|
||||
.tag = tag,
|
||||
.size = buffer.size,
|
||||
};
|
||||
|
||||
buffers.AppendBuffer(new_buffer);
|
||||
RegisterBuffers();
|
||||
@@ -194,11 +202,11 @@ void System::SetVolume(const f32 volume_) {
|
||||
session->SetVolume(volume_);
|
||||
}
|
||||
|
||||
bool System::ContainsAudioBuffer(const u64 tag) {
|
||||
bool System::ContainsAudioBuffer(const u64 tag) const {
|
||||
return buffers.ContainsBuffer(tag);
|
||||
}
|
||||
|
||||
u32 System::GetBufferCount() {
|
||||
u32 System::GetBufferCount() const {
|
||||
return buffers.GetAppendedRegisteredCount();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
*
|
||||
* @return The default audio input device name.
|
||||
*/
|
||||
std::string_view GetDefaultDeviceName();
|
||||
std::string_view GetDefaultDeviceName() const;
|
||||
|
||||
/**
|
||||
* Get the default USB audio input device name.
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
*
|
||||
* @return The default USB audio input device name.
|
||||
*/
|
||||
std::string_view GetDefaultUacDeviceName();
|
||||
std::string_view GetDefaultUacDeviceName() const;
|
||||
|
||||
/**
|
||||
* Is the given initialize config valid?
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
* @param in_params - Input parameters, see AudioInParameter.
|
||||
* @return Result code.
|
||||
*/
|
||||
Result IsConfigValid(std::string_view device_name, const AudioInParameter& in_params);
|
||||
Result IsConfigValid(std::string_view device_name, const AudioInParameter& in_params) const;
|
||||
|
||||
/**
|
||||
* Initialize this system.
|
||||
@@ -208,7 +208,7 @@ public:
|
||||
/**
|
||||
* Set this system's current volume.
|
||||
*
|
||||
* @param The new volume.
|
||||
* @param volume The new volume.
|
||||
*/
|
||||
void SetVolume(f32 volume);
|
||||
|
||||
@@ -218,14 +218,14 @@ public:
|
||||
* @param tag - Unique tag to search for.
|
||||
* @return True if the buffer is in the system, otherwise false.
|
||||
*/
|
||||
bool ContainsAudioBuffer(u64 tag);
|
||||
bool ContainsAudioBuffer(u64 tag) const;
|
||||
|
||||
/**
|
||||
* Get the maximum number of usable buffers (default 32).
|
||||
*
|
||||
* @return The number of buffers.
|
||||
*/
|
||||
u32 GetBufferCount();
|
||||
u32 GetBufferCount() const;
|
||||
|
||||
/**
|
||||
* Get the total number of samples played by this system.
|
||||
|
||||
@@ -72,7 +72,7 @@ Kernel::KReadableEvent& Out::GetBufferEvent() {
|
||||
return event->GetReadableEvent();
|
||||
}
|
||||
|
||||
f32 Out::GetVolume() {
|
||||
f32 Out::GetVolume() const {
|
||||
std::scoped_lock l{parent_mutex};
|
||||
return system.GetVolume();
|
||||
}
|
||||
@@ -82,17 +82,17 @@ void Out::SetVolume(const f32 volume) {
|
||||
system.SetVolume(volume);
|
||||
}
|
||||
|
||||
bool Out::ContainsAudioBuffer(const u64 tag) {
|
||||
bool Out::ContainsAudioBuffer(const u64 tag) const {
|
||||
std::scoped_lock l{parent_mutex};
|
||||
return system.ContainsAudioBuffer(tag);
|
||||
}
|
||||
|
||||
u32 Out::GetBufferCount() {
|
||||
u32 Out::GetBufferCount() const {
|
||||
std::scoped_lock l{parent_mutex};
|
||||
return system.GetBufferCount();
|
||||
}
|
||||
|
||||
u64 Out::GetPlayedSampleCount() {
|
||||
u64 Out::GetPlayedSampleCount() const {
|
||||
std::scoped_lock l{parent_mutex};
|
||||
return system.GetPlayedSampleCount();
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
*
|
||||
* @return The current volume.
|
||||
*/
|
||||
f32 GetVolume();
|
||||
f32 GetVolume() const;
|
||||
|
||||
/**
|
||||
* Set the system volume.
|
||||
@@ -117,21 +117,21 @@ public:
|
||||
* @param tag - The tag to search for.
|
||||
* @return True if the buffer is in the system, otherwise false.
|
||||
*/
|
||||
bool ContainsAudioBuffer(u64 tag);
|
||||
bool ContainsAudioBuffer(u64 tag) const;
|
||||
|
||||
/**
|
||||
* Get the maximum number of buffers.
|
||||
*
|
||||
* @return The maximum number of buffers.
|
||||
*/
|
||||
u32 GetBufferCount();
|
||||
u32 GetBufferCount() const;
|
||||
|
||||
/**
|
||||
* Get the total played sample count for this audio out.
|
||||
*
|
||||
* @return The played sample count.
|
||||
*/
|
||||
u64 GetPlayedSampleCount();
|
||||
u64 GetPlayedSampleCount() const;
|
||||
|
||||
private:
|
||||
/// The AudioOut::Manager this audio out is registered with
|
||||
|
||||
@@ -27,11 +27,12 @@ void System::Finalize() {
|
||||
buffer_event->GetWritableEvent().Signal();
|
||||
}
|
||||
|
||||
std::string_view System::GetDefaultOutputDeviceName() {
|
||||
std::string_view System::GetDefaultOutputDeviceName() const {
|
||||
return "DeviceOut";
|
||||
}
|
||||
|
||||
Result System::IsConfigValid(std::string_view device_name, const AudioOutParameter& in_params) {
|
||||
Result System::IsConfigValid(std::string_view device_name,
|
||||
const AudioOutParameter& in_params) const {
|
||||
if ((device_name.size() > 0) && (device_name != GetDefaultOutputDeviceName())) {
|
||||
return Service::Audio::ERR_INVALID_DEVICE_NAME;
|
||||
}
|
||||
@@ -92,6 +93,7 @@ Result System::Start() {
|
||||
std::vector<AudioBuffer> buffers_to_flush{};
|
||||
buffers.RegisterBuffers(buffers_to_flush);
|
||||
session->AppendBuffers(buffers_to_flush);
|
||||
session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));
|
||||
|
||||
return ResultSuccess;
|
||||
}
|
||||
@@ -111,8 +113,15 @@ bool System::AppendBuffer(const AudioOutBuffer& buffer, u64 tag) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AudioBuffer new_buffer{
|
||||
.played_timestamp = 0, .samples = buffer.samples, .tag = tag, .size = buffer.size};
|
||||
const auto timestamp{buffers.GetNextTimestamp()};
|
||||
const AudioBuffer new_buffer{
|
||||
.start_timestamp = timestamp,
|
||||
.end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)),
|
||||
.played_timestamp = 0,
|
||||
.samples = buffer.samples,
|
||||
.tag = tag,
|
||||
.size = buffer.size,
|
||||
};
|
||||
|
||||
buffers.AppendBuffer(new_buffer);
|
||||
RegisterBuffers();
|
||||
@@ -192,11 +201,11 @@ void System::SetVolume(const f32 volume_) {
|
||||
session->SetVolume(volume_);
|
||||
}
|
||||
|
||||
bool System::ContainsAudioBuffer(const u64 tag) {
|
||||
bool System::ContainsAudioBuffer(const u64 tag) const {
|
||||
return buffers.ContainsBuffer(tag);
|
||||
}
|
||||
|
||||
u32 System::GetBufferCount() {
|
||||
u32 System::GetBufferCount() const {
|
||||
return buffers.GetAppendedRegisteredCount();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
*
|
||||
* @return The default audio output device name.
|
||||
*/
|
||||
std::string_view GetDefaultOutputDeviceName();
|
||||
std::string_view GetDefaultOutputDeviceName() const;
|
||||
|
||||
/**
|
||||
* Is the given initialize config valid?
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
* @param in_params - Input parameters, see AudioOutParameter.
|
||||
* @return Result code.
|
||||
*/
|
||||
Result IsConfigValid(std::string_view device_name, const AudioOutParameter& in_params);
|
||||
Result IsConfigValid(std::string_view device_name, const AudioOutParameter& in_params) const;
|
||||
|
||||
/**
|
||||
* Initialize this system.
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
/**
|
||||
* Set this system's current volume.
|
||||
*
|
||||
* @param The new volume.
|
||||
* @param volume The new volume.
|
||||
*/
|
||||
void SetVolume(f32 volume);
|
||||
|
||||
@@ -209,14 +209,14 @@ public:
|
||||
* @param tag - Unique tag to search for.
|
||||
* @return True if the buffer is in the system, otherwise false.
|
||||
*/
|
||||
bool ContainsAudioBuffer(u64 tag);
|
||||
bool ContainsAudioBuffer(u64 tag) const;
|
||||
|
||||
/**
|
||||
* Get the maximum number of usable buffers (default 32).
|
||||
*
|
||||
* @return The number of buffers.
|
||||
*/
|
||||
u32 GetBufferCount();
|
||||
u32 GetBufferCount() const;
|
||||
|
||||
/**
|
||||
* Get the total number of samples played by this system.
|
||||
|
||||
@@ -50,7 +50,7 @@ u32 ADSP::GetRemainCommandCount(const u32 session_id) const {
|
||||
return render_mailbox.GetRemainCommandCount(session_id);
|
||||
}
|
||||
|
||||
void ADSP::SendCommandBuffer(const u32 session_id, CommandBuffer& command_buffer) {
|
||||
void ADSP::SendCommandBuffer(const u32 session_id, const CommandBuffer& command_buffer) {
|
||||
render_mailbox.SetCommandBuffer(session_id, command_buffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,8 +63,6 @@ public:
|
||||
|
||||
/**
|
||||
* Stop the ADSP.
|
||||
*
|
||||
* @return True if started or already running, otherwise false.
|
||||
*/
|
||||
void Stop();
|
||||
|
||||
@@ -133,7 +131,7 @@ public:
|
||||
* @param session_id - The session id to check (0 or 1).
|
||||
* @param command_buffer - The command buffer to process.
|
||||
*/
|
||||
void SendCommandBuffer(u32 session_id, CommandBuffer& command_buffer);
|
||||
void SendCommandBuffer(u32 session_id, const CommandBuffer& command_buffer);
|
||||
|
||||
/**
|
||||
* Clear the command buffers (does not clear the time taken or the remaining command count)
|
||||
|
||||
@@ -51,7 +51,7 @@ CommandBuffer& AudioRenderer_Mailbox::GetCommandBuffer(const s32 session_id) {
|
||||
return command_buffers[session_id];
|
||||
}
|
||||
|
||||
void AudioRenderer_Mailbox::SetCommandBuffer(const u32 session_id, CommandBuffer& buffer) {
|
||||
void AudioRenderer_Mailbox::SetCommandBuffer(const u32 session_id, const CommandBuffer& buffer) {
|
||||
command_buffers[session_id] = buffer;
|
||||
}
|
||||
|
||||
@@ -106,9 +106,6 @@ void AudioRenderer::Start(AudioRenderer_Mailbox* mailbox_) {
|
||||
|
||||
mailbox = mailbox_;
|
||||
thread = std::thread(&AudioRenderer::ThreadFunc, this);
|
||||
for (auto& stream : streams) {
|
||||
stream->Start();
|
||||
}
|
||||
running = true;
|
||||
}
|
||||
|
||||
@@ -130,6 +127,7 @@ void AudioRenderer::CreateSinkStreams() {
|
||||
std::string name{fmt::format("ADSP_RenderStream-{}", i)};
|
||||
streams[i] =
|
||||
sink.AcquireSinkStream(system, channels, name, ::AudioCore::Sink::StreamType::Render);
|
||||
streams[i]->SetRingSize(4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,11 +196,6 @@ void AudioRenderer::ThreadFunc() {
|
||||
command_list_processor.Process(index) - start_time;
|
||||
}
|
||||
|
||||
if (index == 0) {
|
||||
auto stream{command_list_processor.GetOutputSinkStream()};
|
||||
system.AudioCore().SetStreamQueue(stream->GetQueueSize());
|
||||
}
|
||||
|
||||
const auto end_time{system.CoreTiming().GetClockTicks()};
|
||||
|
||||
command_buffer.remaining_command_count =
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
/**
|
||||
* Send a message from the host to the AudioRenderer.
|
||||
*
|
||||
* @param message_ - The message to send to the AudioRenderer.
|
||||
* @param message - The message to send to the AudioRenderer.
|
||||
*/
|
||||
void HostSendMessage(RenderMessage message);
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
/**
|
||||
* Send a message from the AudioRenderer to the host.
|
||||
*
|
||||
* @param message_ - The message to send to the host.
|
||||
* @param message - The message to send to the host.
|
||||
*/
|
||||
void ADSPSendMessage(RenderMessage message);
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
* @param session_id - The session id to get (0 or 1).
|
||||
* @param buffer - The command buffer to set.
|
||||
*/
|
||||
void SetCommandBuffer(u32 session_id, CommandBuffer& buffer);
|
||||
void SetCommandBuffer(u32 session_id, const CommandBuffer& buffer);
|
||||
|
||||
/**
|
||||
* Get the total render time taken for the last command lists sent.
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
/**
|
||||
* Start the AudioRenderer.
|
||||
*
|
||||
* @param The mailbox to use for this session.
|
||||
* @param mailbox The mailbox to use for this session.
|
||||
*/
|
||||
void Start(AudioRenderer_Mailbox* mailbox);
|
||||
|
||||
|
||||
@@ -33,10 +33,10 @@ public:
|
||||
/**
|
||||
* Initialize the processor.
|
||||
*
|
||||
* @param system_ - The core system.
|
||||
* @param buffer - The command buffer to process.
|
||||
* @param size - The size of the buffer.
|
||||
* @param stream_ - The stream to be used for sending the samples.
|
||||
* @param system - The core system.
|
||||
* @param buffer - The command buffer to process.
|
||||
* @param size - The size of the buffer.
|
||||
* @param stream - The stream to be used for sending the samples.
|
||||
*/
|
||||
void Initialize(Core::System& system, CpuAddr buffer, u64 size, Sink::SinkStream* stream);
|
||||
|
||||
@@ -72,7 +72,8 @@ public:
|
||||
/**
|
||||
* Process the command list.
|
||||
*
|
||||
* @param index - Index of the current command list.
|
||||
* @param session_id - Session ID for the commands being processed.
|
||||
*
|
||||
* @return The time taken to process.
|
||||
*/
|
||||
u64 Process(u32 session_id);
|
||||
@@ -89,7 +90,7 @@ public:
|
||||
u8* commands{};
|
||||
/// The command buffer size
|
||||
u64 commands_buffer_size{};
|
||||
/// The maximum processing time alloted
|
||||
/// The maximum processing time allotted
|
||||
u64 max_process_time{};
|
||||
/// The number of commands in the buffer
|
||||
u32 command_count{};
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <array>
|
||||
#include <span>
|
||||
|
||||
#include "audio_core/audio_core.h"
|
||||
#include "audio_core/common/feature_support.h"
|
||||
#include "audio_core/renderer/audio_device.h"
|
||||
@@ -9,14 +12,33 @@
|
||||
|
||||
namespace AudioCore::AudioRenderer {
|
||||
|
||||
constexpr std::array usb_device_names{
|
||||
AudioDevice::AudioDeviceName{"AudioStereoJackOutput"},
|
||||
AudioDevice::AudioDeviceName{"AudioBuiltInSpeakerOutput"},
|
||||
AudioDevice::AudioDeviceName{"AudioTvOutput"},
|
||||
AudioDevice::AudioDeviceName{"AudioUsbDeviceOutput"},
|
||||
};
|
||||
|
||||
constexpr std::array device_names{
|
||||
AudioDevice::AudioDeviceName{"AudioStereoJackOutput"},
|
||||
AudioDevice::AudioDeviceName{"AudioBuiltInSpeakerOutput"},
|
||||
AudioDevice::AudioDeviceName{"AudioTvOutput"},
|
||||
};
|
||||
|
||||
constexpr std::array output_device_names{
|
||||
AudioDevice::AudioDeviceName{"AudioBuiltInSpeakerOutput"},
|
||||
AudioDevice::AudioDeviceName{"AudioTvOutput"},
|
||||
AudioDevice::AudioDeviceName{"AudioExternalOutput"},
|
||||
};
|
||||
|
||||
AudioDevice::AudioDevice(Core::System& system, const u64 applet_resource_user_id_,
|
||||
const u32 revision)
|
||||
: output_sink{system.AudioCore().GetOutputSink()},
|
||||
applet_resource_user_id{applet_resource_user_id_}, user_revision{revision} {}
|
||||
|
||||
u32 AudioDevice::ListAudioDeviceName(std::vector<AudioDeviceName>& out_buffer,
|
||||
const size_t max_count) {
|
||||
std::span<AudioDeviceName> names{};
|
||||
const size_t max_count) const {
|
||||
std::span<const AudioDeviceName> names{};
|
||||
|
||||
if (CheckFeatureSupported(SupportTags::AudioUsbDeviceOutput, user_revision)) {
|
||||
names = usb_device_names;
|
||||
@@ -24,7 +46,7 @@ u32 AudioDevice::ListAudioDeviceName(std::vector<AudioDeviceName>& out_buffer,
|
||||
names = device_names;
|
||||
}
|
||||
|
||||
u32 out_count{static_cast<u32>(std::min(max_count, names.size()))};
|
||||
const u32 out_count{static_cast<u32>(std::min(max_count, names.size()))};
|
||||
for (u32 i = 0; i < out_count; i++) {
|
||||
out_buffer.push_back(names[i]);
|
||||
}
|
||||
@@ -32,8 +54,8 @@ u32 AudioDevice::ListAudioDeviceName(std::vector<AudioDeviceName>& out_buffer,
|
||||
}
|
||||
|
||||
u32 AudioDevice::ListAudioOutputDeviceName(std::vector<AudioDeviceName>& out_buffer,
|
||||
const size_t max_count) {
|
||||
u32 out_count{static_cast<u32>(std::min(max_count, output_device_names.size()))};
|
||||
const size_t max_count) const {
|
||||
const u32 out_count{static_cast<u32>(std::min(max_count, output_device_names.size()))};
|
||||
|
||||
for (u32 i = 0; i < out_count; i++) {
|
||||
out_buffer.push_back(output_device_names[i]);
|
||||
@@ -45,7 +67,7 @@ void AudioDevice::SetDeviceVolumes(const f32 volume) {
|
||||
output_sink.SetDeviceVolume(volume);
|
||||
}
|
||||
|
||||
f32 AudioDevice::GetDeviceVolume([[maybe_unused]] std::string_view name) {
|
||||
f32 AudioDevice::GetDeviceVolume([[maybe_unused]] std::string_view name) const {
|
||||
return output_sink.GetDeviceVolume();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
|
||||
#include "audio_core/audio_render_manager.h"
|
||||
|
||||
@@ -23,21 +23,13 @@ namespace AudioRenderer {
|
||||
class AudioDevice {
|
||||
public:
|
||||
struct AudioDeviceName {
|
||||
std::array<char, 0x100> name;
|
||||
std::array<char, 0x100> name{};
|
||||
|
||||
AudioDeviceName(const char* name_) {
|
||||
std::strncpy(name.data(), name_, name.size());
|
||||
constexpr AudioDeviceName(std::string_view name_) {
|
||||
name_.copy(name.data(), name.size() - 1);
|
||||
}
|
||||
};
|
||||
|
||||
std::array<AudioDeviceName, 4> usb_device_names{"AudioStereoJackOutput",
|
||||
"AudioBuiltInSpeakerOutput", "AudioTvOutput",
|
||||
"AudioUsbDeviceOutput"};
|
||||
std::array<AudioDeviceName, 3> device_names{"AudioStereoJackOutput",
|
||||
"AudioBuiltInSpeakerOutput", "AudioTvOutput"};
|
||||
std::array<AudioDeviceName, 3> output_device_names{"AudioBuiltInSpeakerOutput", "AudioTvOutput",
|
||||
"AudioExternalOutput"};
|
||||
|
||||
explicit AudioDevice(Core::System& system, u64 applet_resource_user_id, u32 revision);
|
||||
|
||||
/**
|
||||
@@ -47,7 +39,7 @@ public:
|
||||
* @param max_count - Maximum number of devices to write (count of out_buffer).
|
||||
* @return Number of device names written.
|
||||
*/
|
||||
u32 ListAudioDeviceName(std::vector<AudioDeviceName>& out_buffer, size_t max_count);
|
||||
u32 ListAudioDeviceName(std::vector<AudioDeviceName>& out_buffer, size_t max_count) const;
|
||||
|
||||
/**
|
||||
* Get a list of the available output devices.
|
||||
@@ -57,7 +49,7 @@ public:
|
||||
* @param max_count - Maximum number of devices to write (count of out_buffer).
|
||||
* @return Number of device names written.
|
||||
*/
|
||||
u32 ListAudioOutputDeviceName(std::vector<AudioDeviceName>& out_buffer, size_t max_count);
|
||||
u32 ListAudioOutputDeviceName(std::vector<AudioDeviceName>& out_buffer, size_t max_count) const;
|
||||
|
||||
/**
|
||||
* Set the volume of all streams in the backend sink.
|
||||
@@ -73,7 +65,7 @@ public:
|
||||
* @param name - Name of the device to check. Unused.
|
||||
* @return Volume of the device.
|
||||
*/
|
||||
f32 GetDeviceVolume(std::string_view name);
|
||||
f32 GetDeviceVolume(std::string_view name) const;
|
||||
|
||||
private:
|
||||
/// Backend output sink for the device
|
||||
|
||||
@@ -34,7 +34,7 @@ void BehaviorInfo::ClearError() {
|
||||
error_count = 0;
|
||||
}
|
||||
|
||||
void BehaviorInfo::AppendError(ErrorInfo& error) {
|
||||
void BehaviorInfo::AppendError(const ErrorInfo& error) {
|
||||
LOG_ERROR(Service_Audio, "Error during RequestUpdate, reporting code {:04X} address {:08X}",
|
||||
error.error_code.raw, error.address);
|
||||
if (error_count < MaxErrors) {
|
||||
@@ -42,14 +42,16 @@ void BehaviorInfo::AppendError(ErrorInfo& error) {
|
||||
}
|
||||
}
|
||||
|
||||
void BehaviorInfo::CopyErrorInfo(std::span<ErrorInfo> out_errors, u32& out_count) {
|
||||
auto error_count_{std::min(error_count, MaxErrors)};
|
||||
std::memset(out_errors.data(), 0, MaxErrors * sizeof(ErrorInfo));
|
||||
void BehaviorInfo::CopyErrorInfo(std::span<ErrorInfo> out_errors, u32& out_count) const {
|
||||
out_count = std::min(error_count, MaxErrors);
|
||||
|
||||
for (size_t i = 0; i < error_count_; i++) {
|
||||
out_errors[i] = errors[i];
|
||||
for (size_t i = 0; i < MaxErrors; i++) {
|
||||
if (i < out_count) {
|
||||
out_errors[i] = errors[i];
|
||||
} else {
|
||||
out_errors[i] = {};
|
||||
}
|
||||
}
|
||||
out_count = error_count_;
|
||||
}
|
||||
|
||||
void BehaviorInfo::UpdateFlags(const Flags flags_) {
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
*
|
||||
* @param error - The new error.
|
||||
*/
|
||||
void AppendError(ErrorInfo& error);
|
||||
void AppendError(const ErrorInfo& error);
|
||||
|
||||
/**
|
||||
* Copy errors to the given output container.
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
* @param out_errors - Output container to receive the errors.
|
||||
* @param out_count - The number of errors written.
|
||||
*/
|
||||
void CopyErrorInfo(std::span<ErrorInfo> out_errors, u32& out_count);
|
||||
void CopyErrorInfo(std::span<ErrorInfo> out_errors, u32& out_count) const;
|
||||
|
||||
/**
|
||||
* Update the behaviour flags.
|
||||
|
||||
@@ -485,7 +485,7 @@ Result InfoUpdater::UpdateBehaviorInfo(BehaviorInfo& behaviour_) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result InfoUpdater::UpdateErrorInfo(BehaviorInfo& behaviour_) {
|
||||
Result InfoUpdater::UpdateErrorInfo(const BehaviorInfo& behaviour_) {
|
||||
auto out_params{reinterpret_cast<BehaviorInfo::OutStatus*>(output)};
|
||||
behaviour_.CopyErrorInfo(out_params->errors, out_params->error_count);
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
* @param behaviour - Behaviour to update.
|
||||
* @return Result code.
|
||||
*/
|
||||
Result UpdateErrorInfo(BehaviorInfo& behaviour);
|
||||
Result UpdateErrorInfo(const BehaviorInfo& behaviour);
|
||||
|
||||
/**
|
||||
* Update splitter.
|
||||
|
||||
@@ -191,6 +191,7 @@ public:
|
||||
* @param volume - Current mix volume used for calculating the ramp.
|
||||
* @param prev_volume - Previous mix volume, used for calculating the ramp,
|
||||
* also applied to the input.
|
||||
* @param prev_samples - Previous sample buffer. Used for depopping.
|
||||
* @param precision - Number of decimal bits for fixed point operations.
|
||||
*/
|
||||
void GenerateMixRampCommand(s32 node_id, s16 buffer_count, s16 input_index, s16 output_index,
|
||||
@@ -208,6 +209,7 @@ public:
|
||||
* @param volumes - Current mix volumes used for calculating the ramp.
|
||||
* @param prev_volumes - Previous mix volumes, used for calculating the ramp,
|
||||
* also applied to the input.
|
||||
* @param prev_samples - Previous sample buffer. Used for depopping.
|
||||
* @param precision - Number of decimal bits for fixed point operations.
|
||||
*/
|
||||
void GenerateMixRampGroupedCommand(s32 node_id, s16 buffer_count, s16 input_index,
|
||||
@@ -297,11 +299,11 @@ public:
|
||||
/**
|
||||
* Generate a device sink command, adding it to the command list.
|
||||
*
|
||||
* @param node_id - Node id of the voice this command is generated for.
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param sink_info - The sink_info to generate this command from.
|
||||
* @session_id - System session id this command is generated from.
|
||||
* @samples_buffer - The buffer to be sent to the sink if upsampling is not used.
|
||||
* @param node_id - Node id of the voice this command is generated for.
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param sink_info - The sink_info to generate this command from.
|
||||
* @param session_id - System session id this command is generated from.
|
||||
* @param samples_buffer - The buffer to be sent to the sink if upsampling is not used.
|
||||
*/
|
||||
void GenerateDeviceSinkCommand(s32 node_id, s16 buffer_offset, SinkInfoBase& sink_info,
|
||||
u32 session_id, std::span<s32> samples_buffer);
|
||||
|
||||
@@ -197,9 +197,9 @@ public:
|
||||
/**
|
||||
* Generate an I3DL2 reverb effect command.
|
||||
*
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info_base - I3DL2Reverb effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info - I3DL2Reverb effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
*/
|
||||
void GenerateI3dl2ReverbEffectCommand(s16 buffer_offset, EffectInfoBase& effect_info,
|
||||
s32 node_id);
|
||||
@@ -207,18 +207,18 @@ public:
|
||||
/**
|
||||
* Generate an aux effect command.
|
||||
*
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info_base - Aux effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info - Aux effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
*/
|
||||
void GenerateAuxCommand(s16 buffer_offset, EffectInfoBase& effect_info, s32 node_id);
|
||||
|
||||
/**
|
||||
* Generate a biquad filter effect command.
|
||||
*
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info_base - Aux effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info - Aux effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
*/
|
||||
void GenerateBiquadFilterEffectCommand(s16 buffer_offset, EffectInfoBase& effect_info,
|
||||
s32 node_id);
|
||||
@@ -226,10 +226,10 @@ public:
|
||||
/**
|
||||
* Generate a light limiter effect command.
|
||||
*
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info_base - Limiter effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
* @param effect_index - Index for the statistics state.
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info - Limiter effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
* @param effect_index - Index for the statistics state.
|
||||
*/
|
||||
void GenerateLightLimiterEffectCommand(s16 buffer_offset, EffectInfoBase& effect_info,
|
||||
s32 node_id, u32 effect_index);
|
||||
@@ -238,21 +238,20 @@ public:
|
||||
* Generate a capture effect command.
|
||||
* Writes a mix buffer back to game memory.
|
||||
*
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info_base - Capture effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info - Capture effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
*/
|
||||
void GenerateCaptureCommand(s16 buffer_offset, EffectInfoBase& effect_info, s32 node_id);
|
||||
|
||||
/**
|
||||
* Generate a compressor effect command.
|
||||
*
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info_base - Compressor effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param effect_info - Compressor effect info.
|
||||
* @param node_id - Node id of the mix this command is generated for.
|
||||
*/
|
||||
void GenerateCompressorCommand(const s16 buffer_offset, EffectInfoBase& effect_info,
|
||||
const s32 node_id);
|
||||
void GenerateCompressorCommand(s16 buffer_offset, EffectInfoBase& effect_info, s32 node_id);
|
||||
|
||||
/**
|
||||
* Generate all effect commands for a mix.
|
||||
@@ -318,8 +317,9 @@ public:
|
||||
* Generate a performance command.
|
||||
* Used to report performance metrics of the AudioRenderer back to the game.
|
||||
*
|
||||
* @param buffer_offset - Base mix buffer offset to use.
|
||||
* @param sink_info - Sink info to generate the commands from.
|
||||
* @param node_id - Node ID of the mix this command is generated for
|
||||
* @param state - Output state of the generated performance command
|
||||
* @param entry_addresses - Addresses to be written
|
||||
*/
|
||||
void GeneratePerformanceCommand(s32 node_id, PerformanceState state,
|
||||
const PerformanceEntryAddresses& entry_addresses);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace AudioCore::AudioRenderer {
|
||||
|
||||
static void SetCompressorEffectParameter(CompressorInfo::ParameterVersion2& params,
|
||||
static void SetCompressorEffectParameter(const CompressorInfo::ParameterVersion2& params,
|
||||
CompressorInfo::State& state) {
|
||||
const auto ratio{1.0f / params.compressor_ratio};
|
||||
auto makeup_gain{0.0f};
|
||||
@@ -31,9 +31,9 @@ static void SetCompressorEffectParameter(CompressorInfo::ParameterVersion2& para
|
||||
state.unk_20 = c;
|
||||
}
|
||||
|
||||
static void InitializeCompressorEffect(CompressorInfo::ParameterVersion2& params,
|
||||
static void InitializeCompressorEffect(const CompressorInfo::ParameterVersion2& params,
|
||||
CompressorInfo::State& state) {
|
||||
std::memset(&state, 0, sizeof(CompressorInfo::State));
|
||||
state = {};
|
||||
|
||||
state.unk_00 = 0;
|
||||
state.unk_04 = 1.0f;
|
||||
@@ -42,7 +42,7 @@ static void InitializeCompressorEffect(CompressorInfo::ParameterVersion2& params
|
||||
SetCompressorEffectParameter(params, state);
|
||||
}
|
||||
|
||||
static void ApplyCompressorEffect(CompressorInfo::ParameterVersion2& params,
|
||||
static void ApplyCompressorEffect(const CompressorInfo::ParameterVersion2& params,
|
||||
CompressorInfo::State& state, bool enabled,
|
||||
std::vector<std::span<const s32>> input_buffers,
|
||||
std::vector<std::span<s32>> output_buffers, u32 sample_count) {
|
||||
@@ -103,8 +103,7 @@ static void ApplyCompressorEffect(CompressorInfo::ParameterVersion2& params,
|
||||
} else {
|
||||
for (s16 channel = 0; channel < params.channel_count; channel++) {
|
||||
if (params.inputs[channel] != params.outputs[channel]) {
|
||||
std::memcpy((char*)output_buffers[channel].data(),
|
||||
(char*)input_buffers[channel].data(),
|
||||
std::memcpy(output_buffers[channel].data(), input_buffers[channel].data(),
|
||||
output_buffers[channel].size_bytes());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,17 +7,7 @@
|
||||
#include "common/logging/log.h"
|
||||
|
||||
namespace AudioCore::AudioRenderer {
|
||||
/**
|
||||
* Mix input mix buffer into output mix buffer, with volume applied to the input.
|
||||
*
|
||||
* @tparam Q - Number of bits for fixed point operations.
|
||||
* @param output - Output mix buffer.
|
||||
* @param input - Input mix buffer.
|
||||
* @param volume - Volume applied to the input.
|
||||
* @param ramp - Ramp applied to volume every sample.
|
||||
* @param sample_count - Number of samples to process.
|
||||
* @return The final gained input sample, used for depopping.
|
||||
*/
|
||||
|
||||
template <size_t Q>
|
||||
s32 ApplyMixRamp(std::span<s32> output, std::span<const s32> input, const f32 volume_,
|
||||
const f32 ramp_, const u32 sample_count) {
|
||||
@@ -40,10 +30,8 @@ s32 ApplyMixRamp(std::span<s32> output, std::span<const s32> input, const f32 vo
|
||||
return sample.to_int();
|
||||
}
|
||||
|
||||
template s32 ApplyMixRamp<15>(std::span<s32>, std::span<const s32>, const f32, const f32,
|
||||
const u32);
|
||||
template s32 ApplyMixRamp<23>(std::span<s32>, std::span<const s32>, const f32, const f32,
|
||||
const u32);
|
||||
template s32 ApplyMixRamp<15>(std::span<s32>, std::span<const s32>, f32, f32, u32);
|
||||
template s32 ApplyMixRamp<23>(std::span<s32>, std::span<const s32>, f32, f32, u32);
|
||||
|
||||
void MixRampCommand::Dump(const ADSP::CommandListProcessor& processor, std::string& string) {
|
||||
const auto ramp{(volume - prev_volume) / static_cast<f32>(processor.sample_count)};
|
||||
|
||||
@@ -61,13 +61,13 @@ struct MixRampCommand : ICommand {
|
||||
* @tparam Q - Number of bits for fixed point operations.
|
||||
* @param output - Output mix buffer.
|
||||
* @param input - Input mix buffer.
|
||||
* @param volume - Volume applied to the input.
|
||||
* @param ramp - Ramp applied to volume every sample.
|
||||
* @param volume_ - Volume applied to the input.
|
||||
* @param ramp_ - Ramp applied to volume every sample.
|
||||
* @param sample_count - Number of samples to process.
|
||||
* @return The final gained input sample, used for depopping.
|
||||
*/
|
||||
template <size_t Q>
|
||||
s32 ApplyMixRamp(std::span<s32> output, std::span<const s32> input, const f32 volume_,
|
||||
const f32 ramp_, const u32 sample_count);
|
||||
s32 ApplyMixRamp(std::span<s32> output, std::span<const s32> input, f32 volume_, f32 ramp_,
|
||||
u32 sample_count);
|
||||
|
||||
} // namespace AudioCore::AudioRenderer
|
||||
|
||||
@@ -50,9 +50,9 @@ struct MixRampGroupedCommand : ICommand {
|
||||
std::array<s16, MaxMixBuffers> inputs;
|
||||
/// Output mix buffer indexes for each mix buffer
|
||||
std::array<s16, MaxMixBuffers> outputs;
|
||||
/// Previous mix vloumes for each mix buffer
|
||||
/// Previous mix volumes for each mix buffer
|
||||
std::array<f32, MaxMixBuffers> prev_volumes;
|
||||
/// Current mix vloumes for each mix buffer
|
||||
/// Current mix volumes for each mix buffer
|
||||
std::array<f32, MaxMixBuffers> volumes;
|
||||
/// Pointer to the previous sample buffer, used for depop
|
||||
CpuAddr previous_samples;
|
||||
|
||||
@@ -46,6 +46,10 @@ void DeviceSinkCommand::Process(const ADSP::CommandListProcessor& processor) {
|
||||
|
||||
out_buffer.tag = reinterpret_cast<u64>(samples.data());
|
||||
stream->AppendBuffer(out_buffer, samples);
|
||||
|
||||
if (stream->IsPaused()) {
|
||||
stream->Start();
|
||||
}
|
||||
}
|
||||
|
||||
bool DeviceSinkCommand::Verify(const ADSP::CommandListProcessor& processor) {
|
||||
|
||||
@@ -15,15 +15,15 @@ class EffectContext {
|
||||
public:
|
||||
/**
|
||||
* Initialize the effect context
|
||||
* @param effect_infos List of effect infos for this context
|
||||
* @param effect_count The number of effects in the list
|
||||
* @param result_states_cpu The workbuffer of result states for the CPU for this context
|
||||
* @param result_states_dsp The workbuffer of result states for the DSP for this context
|
||||
* @param state_count The number of result states
|
||||
* @param effect_infos_ - List of effect infos for this context
|
||||
* @param effect_count_ - The number of effects in the list
|
||||
* @param result_states_cpu_ - The workbuffer of result states for the CPU for this context
|
||||
* @param result_states_dsp_ - The workbuffer of result states for the DSP for this context
|
||||
* @param dsp_state_count - The number of result states
|
||||
*/
|
||||
void Initialize(std::span<EffectInfoBase> effect_infos_, const u32 effect_count_,
|
||||
void Initialize(std::span<EffectInfoBase> effect_infos_, u32 effect_count_,
|
||||
std::span<EffectResultState> result_states_cpu_,
|
||||
std::span<EffectResultState> result_states_dsp_, const size_t dsp_state_count);
|
||||
std::span<EffectResultState> result_states_dsp_, size_t dsp_state_count);
|
||||
|
||||
/**
|
||||
* Get the EffectInfo for a given index
|
||||
|
||||
@@ -291,7 +291,7 @@ public:
|
||||
* Update the info with new parameters, version 1.
|
||||
*
|
||||
* @param error_info - Used to write call result code.
|
||||
* @param in_params - New parameters to update the info with.
|
||||
* @param params - New parameters to update the info with.
|
||||
* @param pool_mapper - Pool for mapping buffers.
|
||||
*/
|
||||
virtual void Update(BehaviorInfo::ErrorInfo& error_info,
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
* Update the info with new parameters, version 2.
|
||||
*
|
||||
* @param error_info - Used to write call result code.
|
||||
* @param in_params - New parameters to update the info with.
|
||||
* @param params - New parameters to update the info with.
|
||||
* @param pool_mapper - Pool for mapping buffers.
|
||||
*/
|
||||
virtual void Update(BehaviorInfo::ErrorInfo& error_info,
|
||||
|
||||