Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored audio stack with PortAudio #497

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
go-version: '1.19.5'
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
- run: sudo apt-get update -q
- run: sudo apt-get install libopenal-dev xorg-dev libgl1-mesa-dev -y --allow-unauthenticated
- run: sudo apt-get install portaudio19-dev xorg-dev libgl1-mesa-dev -y --allow-unauthenticated
- run: OS=Linux ARCH=x86_64 VERSION=$VERSION make tar
- run: OS=Linux ARCH=x86_64 VERSION=$VERSION make deb
- run: sha256sum Ludo-Linux-x86_64-${VERSION}.tar.gz > Ludo-Linux-x86_64-${VERSION}.tar.gz.sha256
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
- run: echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports bionic-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
- run: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6B05F25D762E3157
- run: sudo apt update -q
- run: sudo apt install -f libgl1-mesa-dev:amd64 libc6-dev:armhf gcc-arm-linux-gnueabihf libopenal-dev:armhf libgl1-mesa-dev:armhf libxcursor-dev:armhf libxrandr-dev:armhf libxinerama-dev:armhf libxi-dev:armhf -y --allow-unauthenticated
- run: sudo apt install -f libgl1-mesa-dev:amd64 libc6-dev:armhf gcc-arm-linux-gnueabihf portaudio19-dev:armhf libgl1-mesa-dev:armhf libxcursor-dev:armhf libxrandr-dev:armhf libxinerama-dev:armhf libxi-dev:armhf -y --allow-unauthenticated
- run: export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/
- run: GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go build -v
- run: OS=Linux ARCH=arm VERSION=$VERSION make tar
Expand All @@ -80,7 +80,7 @@ jobs:
- run: echo "/Users/runner/go/bin" >> $GITHUB_PATH
- run: go install golang.org/x/lint/golint@latest
- run: go install honnef.co/go/tools/cmd/staticcheck@latest
- run: brew install openal-soft
- run: brew install portaudio
- run: echo ${{ secrets.OSXCERT }} | base64 --decode > dev.p12
- run: security create-keychain -p github build.keychain
- run: security default-keychain -s build.keychain
Expand Down Expand Up @@ -113,13 +113,20 @@ jobs:
go-version: '1.19.5'
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
- run: choco install wget make hashdeep --ignore-checksums
- run: wget --no-check-certificate http://www.openal-soft.org/openal-binaries/openal-soft-1.21.0-bin.zip
- run: wget https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
- run: 7z x openal-soft-1.21.0-bin.zip -o/c/
- run: echo "CGO_CFLAGS=-I/c/openal-soft-1.21.0-bin/include/" >> $GITHUB_ENV
- run: echo "CGO_LDFLAGS=-L/c/openal-soft-1.21.0-bin/libs/Win64/" >> $GITHUB_ENV
- run: wget --no-check-certificate http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz
- run: tar -xf pa_stable_v190700_20210406.tgz -C/c/
# Not sure if this work on windows; Build portaudio because it has no binary dists
- run: cmake -G "MinGW Makefiles" -S/c/portaudio/ -B/c/portaudio/
- run: make -C/c/portaudio/
- run: echo "CGO_CFLAGS=-I/c/portaudio/include/" >> $GITHUB_ENV
- run: echo "CGO_LDFLAGS=-L/c/portaudio/" >> $GITHUB_ENV
#- run: sh -c 'cd /c/portaudio/; ./configure; make'
#- run: echo "CGO_CFLAGS=-I/c/openal-soft-1.21.0-bin/include/" >> $GITHUB_ENV
#- run: echo "CGO_LDFLAGS=-L/c/openal-soft-1.21.0-bin/libs/Win64/" >> $GITHUB_ENV
- run: cp /c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/lib/libwinpthread* .
- run: cp /c/openal-soft-1.21.0-bin/bin/Win64/soft_oal.dll OpenAL32.dll
# I'm not sure about this... Digged from configure, Needs more tests
- run: cp /c/portaudio/libportaudio.dll libportaudio.dll
- run: cp /c/Windows/System32/VCRUNTIME140.dll .
- run: mkdir -p ./Ludo-Windows-x86_64-${VERSION}/
- run: cp *.dll ./Ludo-Windows-x86_64-${VERSION}/
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- run: go install golang.org/x/lint/golint@latest
- run: go install honnef.co/go/tools/cmd/staticcheck@latest
- run: sudo apt-get update -q
- run: sudo apt-get install libopenal-dev xorg-dev libgl1-mesa-dev -y --allow-unauthenticated
- run: sudo apt-get install portaudio19-dev xorg-dev libgl1-mesa-dev -y --allow-unauthenticated
- run: go get .
- run: xvfb-run -a go test -v -race ./...
- run: go vet ./...
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- run: echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports bionic-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
- run: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6B05F25D762E3157
- run: sudo apt update -q
- run: sudo apt install -f libgl1-mesa-dev:amd64 libc6-dev:armhf gcc-arm-linux-gnueabihf libopenal-dev:armhf libgl1-mesa-dev:armhf libxcursor-dev:armhf libxrandr-dev:armhf libxinerama-dev:armhf libxi-dev:armhf -y --allow-unauthenticated
- run: sudo apt install -f libgl1-mesa-dev:amd64 libc6-dev:armhf gcc-arm-linux-gnueabihf portaudio19-dev:armhf libgl1-mesa-dev:armhf libxcursor-dev:armhf libxrandr-dev:armhf libxinerama-dev:armhf libxi-dev:armhf -y --allow-unauthenticated
- run: export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/
- run: GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go build -v

Expand All @@ -68,7 +68,7 @@ jobs:
- run: echo "/Users/runner/go/bin" >> $GITHUB_PATH
- run: go install golang.org/x/lint/golint@latest
- run: go install honnef.co/go/tools/cmd/staticcheck@latest
- run: brew install openal-soft
- run: brew install portaudio
- run: go get .
- run: go test -v -race ./...
- run: go vet ./...
Expand All @@ -89,10 +89,14 @@ jobs:
- run: go install golang.org/x/lint/golint@latest
- run: go install honnef.co/go/tools/cmd/staticcheck@latest
- run: choco install wget --ignore-checksums
- run: wget --no-check-certificate http://www.openal-soft.org/openal-binaries/openal-soft-1.21.0-bin.zip
- run: 7z x openal-soft-1.21.0-bin.zip -o/c/
- run: echo "CGO_CFLAGS=-I/c/openal-soft-1.21.0-bin/include/" >> $GITHUB_ENV
- run: echo "CGO_LDFLAGS=-L/c/openal-soft-1.21.0-bin/libs/Win64/" >> $GITHUB_ENV
- run: wget --no-check-certificate http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz
- run: tar -xf pa_stable_v190700_20210406.tgz -C/c/
# Not sure if this work on windows; Build portaudio because it has no binary dists
- run: cmake -G "MinGW Makefiles" -S/c/portaudio/ -B/c/portaudio/
- run: make -C/c/portaudio/
#- run: sh -c 'cd /c/portaudio/; ./configure; make'
- run: echo "CGO_CFLAGS=-I/c/portaudio/include/" >> $GITHUB_ENV
- run: echo "CGO_LDFLAGS=-L/c/portaudio/" >> $GITHUB_ENV
- run: go get .
#- run: go test -v -race ./...
#- run: go vet ./...
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@ It works on OSX, Linux, Linux ARM and Windows. You can download releases [here](

- GLFW 3.3
- OpenGL >= 2.1
- OpenAL
- PortAudio

#### On OSX

You can execute the following command and follow the instructions about exporting PKG_CONFIG

brew install openal-soft
brew install portaudio

#### On Debian or Ubuntu

sudo apt-get install libopenal-dev xorg-dev golang
sudo apt-get install portaudio19-dev xorg-dev golang

#### On Raspbian

You need to enable the experimental VC4 OpenGL support (Full KMS) in raspi-config.

sudo apt-get install libopenal-dev xorg-dev
sudo apt-get install portaudio19-dev xorg-dev

#### On Alpine / postmarketOS

sudo apk add musl-dev gcc openal-soft-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev mesa-dev
sudo apk add musl-dev gcc portaudio-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev mesa-dev

#### On Windows

Setup openal headers and dll in mingw-w64 `include` and `lib` folders.
Setup portaudio headers and dll in mingw-w64 `include` and `lib` folders.

## Building

Expand Down
Loading