Create Getting Started authored by Rouben Rehman's avatar Rouben Rehman
# Getting started
This tutorial will teach you, how to setup this project on your machine. Before you start, make sure to install [Node and NPM](https://nodejs.org/en/download/) and [Virtual Audio Cable (Lite version)](https://vac.muzychenko.net/en/download.htm) on your machine. You will need to
1. configure your Unreal Engine project to use the [Pixel Streaming](https://docs.unrealengine.com/5.1/en-US/pixel-streaming-in-unreal-engine/) and [Unreal VA plugin](https://verdi.akustik.rwth-aachen.de/wiki/index.php?title=Unreal_VA_Plugin) (only accessable within the IHTA network).
2. download and configure [VA](https://virtualacoustics.org)
3. download and configure the [Streaming Dashboard git repository](https://git.rwth-aachen.de/ihta/unreal/tools/ue-va-streaming)
4. Setup a way to pipe VA's audio output back into your machine as a microphone input
<br>
## Configure your Unreal Engine project
### Pixel Streaming plugin
To add the PixelStreaming plugin to your project, open your project in the Unreal Engine Editor and navigate to `Edit -> Plugins`.
Search for `pixel streaming` and activate the plugin. You will need to restart the editor afterwards.
![editor_plugin_view](uploads/126df81a9f6a5b2bd864f8b6c8ff4cf3/editor_plugin_view.png)
*source: [Pixel Streaming documentation, 13.12.2022](https://docs.unrealengine.com/5.1/en-US/getting-started-with-pixel-streaming-in-unreal-engine/).*
To enable running and testing the project from within the editor, you need to add the following as additional launch parameters:
1. Navigate to `Edit -> Editor Preferences` and select `play` in the newly opened window under `Level Editor`
2. Paste this line `-AudioMixer -PixelStreamingIP=localhost -PixelStreamingPort=8888` into the textbox labeled `additional launch parameters`
![preferences_view](uploads/b5974ec684f5e1fb30ed73e2dfef59e2/preferences_view.png)
*source: [Pixel Streaming documentation, 13.12.2022](https://docs.unrealengine.com/5.1/en-US/getting-started-with-pixel-streaming-in-unreal-engine/).*
If you intend on packaging your UE project, you will also need to run the executable with these additional parameters. This can be done via the command line, a batch file or a symbolic link. For further information refer to the [Pixel Streaming documentation](https://docs.unrealengine.com/5.1/en-US/getting-started-with-pixel-streaming-in-unreal-engine/).
### Unreal VA Plugin
The Unreal VA plugin can be found on the IHTA GitLab. To add it to your project and start using it, refer to it's [wiki page](https://verdi.akustik.rwth-aachen.de/wiki/index.php?title=Unreal_VA_Plugin) on the IHTA wiki. <br>
*Note: This page is only accessible within the IHTA network, you may need to use a VPN.*
## Configure Virtual Acoustics
Navigate to [virtualacoustics.org](https://virtualacoustics.org) and download the newest version of VA for your machine.
Unzip it and open `conf/VACore.ini` in a text editor.
You will have to add `VA/` infront of all paths under the `[Paths]` tag. This is due to VA being later launched via the dashboard's control server, which will live one folder up in the folder structure we are going to build. The top of your `VACore.ini` should look something like this:
```python
[Paths]
# Any entry value will be added to the search path list, but only if existing! They will also be made available as macros (see below).
# If a file can not be found during runtime by local name, the core will try to locate it using the paths in ascending name order.
# Macros are not substituted, here. However, it is recommended to use AddSearchPath during runtime, if you have individual directories
# you want to add.
# Relative configuration path (with some more hardware setup files)
conf_dir = VA/conf
# Relative data path (with some common files)
data_dir = VA/data
# Path for TTS Voices of CereVoice
voices_dir = VA/data/Voices
[Files]
...
```
If you intend on using Virtual Audio Cable as your way of accessing VA's audio output, you will also need to download and configure [ASIO4All](https://www.asio4all.org/). A detailed explanation can be found under "Streaming VA's audio output".
## Streaming Dashboard
This dashboard serves as the admin frontend for the whole streaming setup. It can be used to control VA and the Signalling Server and also handles audio streaming from VA to the clients. To get started, firtst [clone the git repository](https://git.rwth-aachen.de/ihta/unreal/tools/ue-va-streaming). You will need to have [node and npm](https://nodejs.org/en/download/) installed on your machine.
After cloning the repository, navigate to `Server` and run `start.bat`. On first startup, this will install all dependencies and prompt you to configure a user. Additional users can be configured by running `newUser.bat`. To remove users, simply remove them from `config/users.json`.
### Adding VA
To run VA from within the dashboard (recommended), move your VA folder into the `Server` folder (same level as `start.bat`) and rename it to `VA`.
Your folder structure should look similar to this:
![folderstruct](uploads/0b9ad8323bb43ca1171127cd3631ebba/folderstruct.png)
## Streaming VA's audio output
VA is designed to output its audio signal directly to a soundcard, so in order to stream the signal, a trick is used in this project - for further information on this, refer to the [architecture documentation](https://via.placeholder.com/600x400?text=This+is+just+a+placeholder). The trick is to let VA output its signal to a mock soundcard and pipe that signal back into the PC as a microphone input. This microphone input can then be easily used by the streaming dashboard. There are multiple ways of achieving this, you could for example physically connect a soundcards output to its microphone input using a cable, but in this tutorial two reliable methods are presented, one using [ASIO4All](https://www.asio4all.org/) and [Virtual Audio Cable](https://vac.muzychenko.net/en/) and one only using the latter.
### Method 1: ASIO4ALL and Virtual Audio Cable
#### ASIO4All
1. Navigate to [asio4all.org](https://asio4all.org), download the latest version and install it.
2. Open your `VACore.ini` and under `[Audio driver]` select `ASIO` as your driver and `ASIO4ALL v2` as your device. Your config file should look something like this:
```
[Audio driver]
# MANDATORY: Audio driver backend (ASIO|Portaudio|Virtual)
#Driver = Virtual
Driver = ASIO
#Driver = Portaudio
# MANDATORY: Audio device ( e.g. ASIO4ALL v2, ASIO Hammerfall DSP, Portaudio 'default', 0,1,2,3,..., virtual user 'Trigger' )
Device = ASIO4ALL v2
#Device = ASIO Hammerfall DSP
#Device = ASIO Fireface USB
#Device = ASIO MADIface USB
#Device = Focusrite USB 2.0 Audio Driver
#Device = M-Audio Fast Track Ultra ASIO
#Device = Yamaha Steinberg USB ASIO
#Device = default
#Device = Trigger
```
#### Virtual Audio Cable
Virtual Audio Cable is a software used to digitally patch outputs and inputs together.
- Navigate to [vac.muzychenko.net/en/](https://vac.muzychenko.net/en/) and download Virtual Audio Cable. The free lite version is enough to stream one instance of VA
- Unzip the archive and run the installer
- After installing you may need to reset Windows default input and output devices in the system's sound settings
- Now run VA by double-clicking `run_VAServer.bat`.
> #### Note
> You will probably see some errors in the VA console:
> ```
> [ VAInfo ][ Config ] Could not find path 'VA/conf', removed from search path list.
> [ VAInfo ][ Config ] Could not find path 'VA/data', removed from search path list.
>[ VAInfo ][ Config ] Could not find path 'VA/data/Voices', removed from search path list.
> ```
> Those are due to the changes we made to the paths earlier in `VACore.ini` and can be ignored. Once VA is launched via the dashboard, these should disappear.
- Once VA is running, you should see the ASIO4All icon in your system tray. Click it
![asio4alltray](uploads/d687dad03e6c4d627b5f994d2e3fe332/asio4alltray.png)
- Click on the cog wheel icon to enable advanced settings, look for Virtual Audio Cable in the device list and unfold it by clicking the + icon
- Activate `Virtual Audio Cable 1` with the speaker symbol next to it and deactivate all other devices in the list.
![asio4allmenu](uploads/af449f83844787d875f925e775afb7cf/asio4allmenu.png)
VA now outputs its signals to Virtual Audio Cable 1, that can also be used as a microphone input in any other software running on the system.
### Method 2: Only using Virtual Audio Cable
Since output devices can also be specified withing VA's config file, one can skip using and configuring those via ASIO4ALL.
1. Open `VACore.ini` and under `[Audio Driver]` select `Portaudio`
```python
[Audio driver]
# MANDATORY: Audio driver backend (ASIO|Portaudio|Virtual)
#Driver = Virtual
Driver = ASIO
#Driver = Portaudio
# MANDATORY: Audio device ( e.g. ASIO4ALL v2, ASIO Hammerfall DSP, Portaudio 'default', 0,1,2,3,..., virtual user 'Trigger' )
Device = ASIO4ALL v2
#Device = ASIO Hammerfall DSP
...
```
2. After installation, Virtual Audio Cable should have registered at least one new audio device both as input and output (usually called `Line 1`). Check the exact name by opening Windows' sound settings and specify it in `VACore.ini`
```python
...
# MANDATORY: Audio device ( e.g. ASIO4ALL v2, ASIO Hammerfall DSP, Portaudio 'default', 0,1,2,3,..., virtual user 'Trigger' )
#Device = ASIO4ALL v2
#Device = ASIO Hammerfall DSP
Device = Line 1
...
```
Now VA should output its audio directly to Virtual Audio Cable without the need of ASIO4ALL in the middle.
> ### Note
> While this method is simpler than method 1, as of 10.01.2023 it is not equally well tested.
\ No newline at end of file