Skip to content

Commit

Permalink
Add notes on requirement for OpenAL being installed for the audio buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mwydmuch committed Dec 15, 2023
1 parent de4b248 commit d931641
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
29 changes: 24 additions & 5 deletions docs/introduction/pythonQuickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,27 @@ pip install vizdoom
Both x86-64 and AArch64 (ARM64) architectures are supported.
Wheels are available for Python 3.8+ on Linux.

### Audio buffer requirement

If you want to use audio buffer, you need to have OpenAL library installed.
It is installed by default in many desktop distros. Otherwise it can be installed from the package manager.
On apt-based distros (Ubuntu, Debian, Linux Mint, etc.), you can install it by running:
```sh
apt install libopenal1
```
And on dnf/yum-based distros (Fedora, RHEL, CentOS, Alma/Rocky Linux, etc.), you can install it by running:
```sh
dnf install openal-soft
```
On RHEL/CentOS/Alma/Rocky Linux 9, you may need first enable crb repository by running `dnf --enablerepo=crb install`.

### Installing from source distribution on Linux

If Python wheel is not available for your platform (distros incompatible with manylinux_2_28 standard), pip will try to install (build) ViZDoom from the source.
ViZDoom requires a C++11 compiler, CMake 3.12+, Boost 1.54+ SDL2, OpenAL (optional), and Python 3.8+ to install from source. Below, you will find instructions on how to install these dependencies.
ViZDoom requires a C++11 compiler, CMake 3.12+, Boost 1.54+ SDL2, OpenAL (optional), and Python 3.8+ to install from source.
Below, you will find instructions on how to install these dependencies.

### apt-based distros (Ubuntu, Debian, Linux Mint, etc.)
#### apt-based distros (Ubuntu, Debian, Linux Mint, etc.)

To build ViZDoom run (it may take a few minutes):
```sh
Expand All @@ -20,22 +37,23 @@ pip install vizdoom
```
We recommend using at least Ubuntu 18.04+ or Debian 10+ with Python 3.7+.

### dnf/yum-based distros (Fedora, RHEL, CentOS, Alma/Rocky Linux, etc.)
#### dnf/yum-based distros (Fedora, RHEL, CentOS, Alma/Rocky Linux, etc.)

To install ViZDoom, run (it may take a few minutes):
```sh
dnf install cmake git boost-devel SDL2-devel openal-soft-devel
pip install vizdoom
```
We recommend using at least Fedora 35+ or RHEL/CentOS/Alma/Rocky Linux 9+ with Python 3.8+.
To install openal-soft-devel on RHEL/CentOS/Alma/Rocky Linux 9, one needs to use `dnf --enablerepo=crb install`.
To install openal-soft-devel on RHEL/CentOS/Alma/Rocky Linux 9, one needs to enable crb repository first by running `dnf --enablerepo=crb install`.

### master branch version
### Installing master branch version

To install the master branch version of ViZDoom run:
```sh
pip install git+https://github.com/Farama-Foundation/ViZDoom
```
It requires the to have the above dependencies installed.


## macOS
Expand Down Expand Up @@ -65,3 +83,4 @@ Wheels are available for Python 3.8+ x86-64 on Windows.
Please note that the Windows version is not as well-tested as Linux and macOS versions.
It can be used for development and testing but if you want to conduct serious (time and resource-extensive) experiments on Windows,
please consider using [Docker](https://docs.docker.com/docker-for-windows/install/) or [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) with Linux version.
Windows version is bundled with OpenAL library, so you don't need to install it separately.
10 changes: 7 additions & 3 deletions examples/python/audio_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
# Turns on the audio buffer. (turned off by default)
# If this is switched on, the audio will stop playing on device, even with game.set_sound_enabled(True)
# Setting game.set_sound_enabled(True) is not required for audio buffer to work.
# Note: This requires OpenAL library to be installed on your system.
# It is installed by default on many Linux desktop distros.
# And it can be installed from package manager, see: https://vizdoom.farama.org/introduction/pythonQuickstart/#audio-buffer-requirements
AUDIO_BUFFER_ENABLED = True
game.set_audio_buffer_enabled(AUDIO_BUFFER_ENABLED)

Expand Down Expand Up @@ -91,9 +94,10 @@
print(
"[WARNING] Audio buffers were full of silence. This is a common bug on e.g. Ubuntu 20.04\n"
" See https://github.com/Farama-Foundation/ViZDoom/pull/486\n"
" Two possible fixes:\n"
" 1) Try setting game.add_game_args('+snd_efx 0'). This my disable some audio effects\n"
" 2) Try installing OpenAL or a newer version of OpenAL Soft library, see https://github.com/Farama-Foundation/ViZDoom/pull/486#issuecomment-889389185"
" There are some possible fixes:\n"
" 1) Check that you have OpenAL installed, if not install, see: https://vizdoom.farama.org/introduction/pythonQuickstart/#audio-buffer-requirements\n"
" 2) Try setting game.add_game_args('+snd_efx 0'). This my disable some audio effects\n"
" 3) Try installing a newer version of OpenAL Soft library, see https://github.com/Farama-Foundation/ViZDoom/pull/486#issuecomment-889389185"
)
# Save audio file
wavfile.write("basic_sounds.wav", 22050, np.concatenate(audio_slices, axis=0))

0 comments on commit d931641

Please sign in to comment.