Files
OpenVR-AdvancedSettings-frame/.circleci/config.yml
T
Vasily bb30a7c041 Add framework for implementing Linux AudioManager
Source outputs must all be moved to new default source.
Reference topic
https://askubuntu.com/a/72076

* Adds microphone controls on Linux via PulseAudio (PA) for several
points in
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/43.

It can not be overstated how unsuited the public AudioManager API is for
using the PA API.

It can also not be overstated how undocumented and horrible the PA API
is. The PA way of doing audio is very unlike the Windows way of doing
audio, which the AudioManager is heavily influenced by.

Since I don't have a Linux machine I have not been able to personally
test this. https://github.com/feilen/ has graciously helped with
testing.

PulseAudio is very undocumented and not very widely used for what we
need outside of official utilities. As such there's most likely a better
way of doing things than I've done.
Additional information can be found at
https://github.com/username223/pulseaudio-device-changing.

The "complex" PA API is asynchronous. Since our current AudioManager is
running synchronously and would not work asynchronously (functions are
expected to return valid data on function return) it is necessary to
massage the PA API until it runs synchronously.

This is done with a general workflow of

1. Register a callback function (`pa_context_get_source_info_list()`,
        for example).
2. Run the PA loop through `customPulseLoop()`. This will trigger
any registered callbacks. Sometimes a `void*` is passed through the
callback that can be used for custom data. `successCallback()` uses
this to set the success variable.
3. Run the callback function and do required work.
4. Return to original function, do work or return values.

It is not possible to run a `customPulseLoop()` inside of an already
running loop (inside a callback), as this will lead to a PA assert
error on runtime.
2020-04-08 22:44:12 +02:00

190 lines
7.4 KiB
YAML

workflows:
version: 2
gcc_1:
jobs:
- gcc
clang_1:
jobs:
- clang
clang_tidy:
jobs:
- clang-tidy
update_and_install_prereqs: &update_and_install_prereqs
- checkout
- run: apt-get update && apt-get upgrade -y
- run:
name: Get wget and apt-key
command: |
apt-get install wget -y
apt-get install software-properties-common apt-transport-https -y
- run:
name: Set up LLVM-8 repo
command: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
add-apt-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
add-apt-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main'
apt update -qq
- run:
name: Install LLVM-8 binaries
command: |
apt install clang-format-8 -y
apt install clang-tidy-7 -y
apt install clang-8 -y
apt install clang -y
- run:
name: Run clang-format
command: python ./build_scripts/run-clang-format.py ./src -r --color always --clang-format-executable clang-format-8
- run:
name: Install g++-7
command: |
add-apt-repository ppa:ubuntu-toolchain-r/test
apt update
apt install g++-7 -y
- run:
name: Add required QT repos
command: |
add-apt-repository ppa:beineri/opt-qt-5.12.2-xenial -y
apt-get update -qq
- run: apt-get install build-essential libgl1-mesa-dev -y
- run:
name: Install QT packages
command: |
apt-get install qt512-meta-minimal qt512multimedia qt512declarative qt512quickcontrols2 qt512quickcontrols qt512tools qt512imageformats qt512svg qt512base qtchooser -y
- run:
name: Install X11 packages
command: apt-get install libx11-dev libxt-dev libxtst-dev -y
- run:
name: Install pulse packages
command: apt-get install libpulse-dev -y
- run:
name: Install bear/clang-tidy
command: apt-get install bear clang-tidy -y
- run:
name: Set up qtchooser
command: qtchooser -install opt-qt512 /opt/qt512/bin/qmake
- run:
name: Give build scripts +x
command: |
chmod +x ./build_scripts/linux/build_linux.sh
chmod +x ./build_scripts/linux/format.sh
chmod +x ./build_scripts/linux/run-clang-tidy.sh
chmod +x ./build_scripts/linux/verify_formatting.sh
- run:
name: Run build script
command: ./build_scripts/linux/build_linux.sh
jobs:
gcc:
environment:
QMAKE_SPEC: linux-g++
QT_SELECT: opt-qt512
MAKE_JOBS: 2
docker:
- image: circleci/buildpack-deps:xenial
steps:
- checkout
- run: sudo apt-get update && sudo apt-get upgrade -y
- run:
name: Get apt-key
# Required for LLVM
command: |
sudo apt-get install software-properties-common apt-transport-https -y
- run:
name: Get LLVM repos
command: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
sudo add-apt-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main'
sudo apt-get update -qq
- run:
name: Install LLVM-8 binaries
# clang is required due to a check by Qmake.
# clang-tidy-8 has new errors compared to clang-tidy-7, so we haven't upgraded.
command: |
sudo apt-get install clang-format-8 -y
sudo apt-get install clang-tidy-7 -y
sudo apt-get install clang-8 -y
sudo apt-get install clang -y
- run:
name: Run clang-format
command: python ./build_scripts/run-clang-format.py ./src -r --color always --clang-format-executable clang-format-8
- run:
name: Install g++
command: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-7 -y
- run:
name: Add required QT repos
command: |
sudo add-apt-repository ppa:beineri/opt-qt-5.12.2-xenial -y
sudo apt-get update -qq
- run: sudo apt-get install build-essential libgl1-mesa-dev -y
- run:
name: Install QT packages
command: |
sudo apt-get install qt512-meta-minimal qt512multimedia qt512declarative qt512quickcontrols2 qt512quickcontrols qt512tools qt512imageformats qt512svg qt512base qtchooser -y
- run:
name: Install X11 packages
command: sudo apt-get install libx11-dev libxt-dev libxtst-dev -y
- run:
name: Install pulse packages
command: sudo apt-get install libpulse-dev -y
- run:
name: Install bear/clang-tidy
command: sudo apt-get install bear clang-tidy -y
- run:
name: Set up qtchooser
command: qtchooser -install opt-qt512 /opt/qt512/bin/qmake
- run:
name: Give build scripts +x
command: |
chmod +x ./build_scripts/linux/build_linux.sh
chmod +x ./build_scripts/linux/format.sh
chmod +x ./build_scripts/linux/run-clang-tidy.sh
chmod +x ./build_scripts/linux/verify_formatting.sh
- run:
name: Update version number
command: |
python ./build_scripts/append_to_version_file.py $(git rev-parse HEAD | cut -c -8)
cat ./build_scripts/compile_version_string.txt
- run:
name: Run build script
command: ./build_scripts/linux/build_linux.sh
- run:
name: Get qtdeploylinux
command: |
wget -c -nv https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x ./linuxdeployqt-continuous-x86_64.AppImage
- run:
name: Create AppImage
command: ./build_scripts/linux/appimage.sh
- run:
name: Copy Artifacts
command: |
mkdir artifacts
cp -v ./OpenVR_Advanced_Settings-*.AppImage ./artifacts/
- store_artifacts:
path: ./artifacts/
clang:
environment:
QMAKE_SPEC: linux-clang
QT_SELECT: opt-qt512
MAKE_JOBS: 2
docker:
- image: "ubuntu:xenial"
steps: *update_and_install_prereqs
clang-tidy:
environment:
QMAKE_SPEC: linux-clang
QT_SELECT: opt-qt512
USE_TIDY: TRUE
CLANG_TIDY_EXECUTABLE: clang-tidy-7
MAKE_JOBS: 2
docker:
- image: "ubuntu:xenial"
steps: *update_and_install_prereqs