Skip to content

Commit

Permalink
Several bug fixes, including an index out of bounds exception.
Browse files Browse the repository at this point in the history
- Fix a bug which causes "go-dsp-guitar" to terminate with an index out of
  bounds exception when batch-processing audio files containing only a
  single channel.
- Correct compiler flags for go version >= 1.10.
- Fix several issues with the build system when cross-compiling
  "go-dsp-guitar".
- Correct the changelog.
- Increment patch version number: v1.3.0 --> v1.3.1
- Update 'README.md'.
  • Loading branch information
andrepxx committed May 19, 2019
1 parent 85a9cb9 commit 7e4c75a
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 25 deletions.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
WIN_SYSROOT := $(HOME)/win-sysroot
CGO_FLAGS_AARCH64 := ""
CGO_FLAGS_ALLOW_WIN := ".*"
CGO_FLAGS_AMD64 := "-m64"
CGO_FLAGS_ARM := ""
CGO_FLAGS_I686 := "-m32"
GCFLAGS := '-N -l'
CGO_FLAGS_WIN_AMD64 := "-m64 --sysroot=$(WIN_SYSROOT) -I$(WIN_SYSROOT)/include"
CGO_FLAGS_WIN_I686 := "-m32 --sysroot=$(WIN_SYSROOT) -I$(WIN_SYSROOT)/include"
CGO_LDFLAGS_ALLOW_WIN := ".*"
CGO_LDFLAGS_WIN := "--sysroot=$(WIN_SYSROOT) -L$(WIN_SYSROOT)/lib"
GCFLAGS := 'all=-N -l'
GOPATH := `pwd`/../../../..
PACKAGE_BIN := config ir keys webroot `ls dsp*`

Expand Down Expand Up @@ -31,12 +37,12 @@ dsp-linux-arm:
GOPATH=$(GOPATH) CGO_ENABLED=1 CGO_CFLAGS=$(CGO_FLAGS_ARM) CC=arm-linux-gnu-gcc GOOS=linux GOARCH=arm GOARM=7 go build -o dsp-linux-arm -gcflags $(GCFLAGS)

dsp-win-amd64.exe:
GOPATH=$(GOPATH) CGO_ENABLED=1 CGO_CFLAGS=$(CGO_FLAGS_AMD64) CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -o dsp-win-amd64.exe -gcflags $(GCFLAGS)
GOPATH=$(GOPATH) CGO_ENABLED=1 CGO_CFLAGS=$(CGO_FLAGS_WIN_AMD64) CGO_LDFLAGS=$(CGO_LDFLAGS_WIN) CGO_CFLAGS_ALLOW=$(CGO_FLAGS_ALLOW_WIN) CGO_LDFLAGS_ALLOW=$(CGO_LDFLAGS_ALLOW_WIN) CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -o dsp-win-amd64.exe -gcflags $(GCFLAGS)

dsp-win-i686.exe:
GOPATH=$(GOPATH) CGO_ENABLED=1 CGO_CFLAGS=$(CGO_FLAGS_I686) CC=i686-w64-mingw32-gcc GOOS=windows GOARCH=386 go build -o dsp-win-i686.exe -gcflags $(GCFLAGS)
GOPATH=$(GOPATH) CGO_ENABLED=1 CGO_CFLAGS=$(CGO_FLAGS_WIN_I686) CGO_LDFLAGS=$(CGO_LDFLAGS_WIN) CGO_CFLAGS_ALLOW=$(CGO_FLAGS_ALLOW_WIN) CGO_LDFLAGS_ALLOW=$(CGO_LDFLAGS_ALLOW_WIN) CC=i686-w64-mingw32-gcc GOOS=windows GOARCH=386 go build -o dsp-win-i686.exe -gcflags $(GCFLAGS)

dist: dsp-linux-amd64 dsp-linux-arm dsp-win-amd64.exe
dist:
mkdir dist
mkdir dist/bin
mkdir dist/bin/go-dsp-guitar
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ In order to cross-compile the software, you will need a cross-compilation toolch
/usr/i686-w64-mingw32/sys-root/
```

The `sysroot` for the Windows cross-compilation builds is set to `~/win-sysroot` from `v1.3.1` onwards.

## Packaging the software for distribution

After you build either a binary for your system or cross-compiled binaries for different systems (or both), you can bundle your binaries, along with scripts and auxiliary data, into packages for distribution.
Expand All @@ -138,6 +140,8 @@ You may need the following packages in order to build the software on your syste

- `gcc-aarch64-linux-gnu`
- `gcc-arm-linux-gnu`
- `gcc-mingw-w64-i686` (Debian / Ubuntu)
- `gcc-mingw-w64-x86-64` (Debian / Ubuntu)
- `gcc-x86_64-linux`
- `git`
- `glibc-arm-linux-gnu`
Expand All @@ -150,12 +154,12 @@ You may need the following packages in order to build the software on your syste
- `jack-audio-connection-kit` (Fedora / RHEL)
- `jack-audio-connection-kit-devel` (Fedora / RHEL)
- `libjack-jackd2-dev` (Debian / Ubuntu)
- `mingw32-gcc`
- `mingw32-gcc-c++`
- `mingw32-pkg-config`
- `mingw64-gcc`
- `mingw64-gcc-c++`
- `mingw64-pkg-config`
- `mingw32-gcc` (Fedora / RHEL)
- `mingw32-gcc-c++` (Fedora / RHEL)
- `mingw32-pkg-config` (Fedora / RHEL)
- `mingw64-gcc` (Fedora / RHEL)
- `mingw64-gcc-c++` (Fedora / RHEL)
- `mingw64-pkg-config` (Fedora / RHEL)
- `openssl`
- `rsync`

Expand All @@ -175,7 +179,7 @@ You may need the following packages in order to build the software on your syste

**Q: Which platforms can I run this software on?**

**A:** We currently provide binaries for Linux on x86-64 / amd64 (typically PCs), Linux on ARM (typically embedded devices, like a Raspberry Pi), Windows on x86-64 / amd64 (64-bit CPUs, basically all current machines) and Windows on i686 (32-bit CPUs, PCs from pre-2004 or very ressource-limited devices like netbooks from pre-2010). Note that even though the 32-bit variant of the software will typically run on a 64-bit CPU (but not the other way round), using the native (64-bit) variant on a 64-bit machine will be both faster and able to process larger files due to the larger address space of the process. We highly recommend Linux on x86-64 / amd64 for real-time use with JACK. Based upon our own testing, current ARM-based devices will not nearly be fast enough for real-time processing, and Linux currently performs better on x86-64 / amd64 for real-time use than Windows does. We still chose to support Windows as well due to its high market share on the desktop. When running this software on Windows, use the x86-64 / amd64 binary if possible. (It should run, unless your're on a very old machine.) And, of course, you can always use the file-based batch processing mode on slower machines.
**A:** We currently provide binaries for Linux on x86-64 / amd64 (typically PCs), Linux on ARM or AArch64 (typically embedded devices, like a Raspberry Pi), Windows on x86-64 / amd64 (64-bit CPUs, basically all current machines) and Windows on i686 (32-bit CPUs, PCs from pre-2004 or very ressource-limited devices like netbooks from pre-2010). Note that even though the 32-bit variant of the software will typically run on a 64-bit CPU (but not the other way round), using the native (64-bit) variant on a 64-bit machine will be both faster and able to process larger files due to the larger address space of the process. We highly recommend Linux on x86-64 / amd64 for real-time use with JACK. Based upon our own testing, current ARM-based devices will not nearly be fast enough for real-time processing, and Linux currently performs better on x86-64 / amd64 for real-time use than Windows does. We still chose to support Windows as well due to its high market share on the desktop. When running this software on Windows, use the x86-64 / amd64 binary if possible. (It should run, unless your're on a very old machine.) And, of course, you can always use the file-based batch processing mode on slower machines.

**Q: Why do I run out of memory when batch-processing files?**

Expand Down
2 changes: 1 addition & 1 deletion config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"ImpulseResponses": "ir/index.json",

"WebServer": {
"Name": "go-dsp-guitar/1.3.0",
"Name": "go-dsp-guitar/1.3.1",
"Port": "8080",
"TLSPort": "8443",
"TLSPrivateKey": "keys/private.pem",
Expand Down
7 changes: 5 additions & 2 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2827,8 +2827,11 @@ func (this *controllerStruct) processFiles(scanner *bufio.Scanner, targetRate ui
* Check if channel could be loaded.
*/
if err != nil {
buf := c.Floats()
inputs = append(inputs, buf)
inputs[fileId] = make([]float64, 0)
sampleRates[fileId] = DEFAULT_SAMPLE_RATE
} else {
inputs[fileId] = c.Floats()
sampleRates[fileId] = f.SampleRate()
}

} else {
Expand Down
23 changes: 18 additions & 5 deletions doc/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
Changelog for go-dsp-guitar
---------------------------

v1.3.1

Changelog:

Maintenance / bugfixes / corrections:

- Fix a bug which causes "go-dsp-guitar" to terminate with an index out of bounds exception when batch-processing audio files containing only a single channel.
- Correct compiler flags for go version >= 1.10.
- Fix several issues with the build system when cross-compiling "go-dsp-guitar".
- Correct the changelog.
- Increment patch version number: v1.3.0 --> v1.3.1


v1.3.0

Changelog:

New features / enhancements:

Implement persistence of user patches to / from JSON files.
- Implement persistence of user patches to / from JSON files.

Maintenance / bugfixes / corrections:

Update documentation.
Fix minor bugs in code.
Improve code structure.
Increment version number: v1.2.0 --> v1.3.0
- Update documentation.
- Fix minor bugs in code.
- Improve code structure.
- Increment minor version number: v1.2.0 --> v1.3.0


v1.2.0
Expand Down
14 changes: 8 additions & 6 deletions doc/packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Commonly required packages for building go-dsp-guitar

gcc-aarch64-linux-gnu
gcc-arm-linux-gnu
gcc-mingw-w64-i686 (Debian / Ubuntu)
gcc-mingw-w64-x86-64 (Debian / Ubuntu)
gcc-x86_64-linux
git
glibc-arm-linux-gnu
Expand All @@ -15,12 +17,12 @@ golang-go (Debian / Ubuntu)
jack-audio-connection-kit (Fedora / RHEL)
jack-audio-connection-kit-devel (Fedora / RHEL)
libjack-jackd2-dev (Debian / Ubuntu)
mingw32-gcc
mingw32-gcc-c++
mingw32-pkg-config
mingw64-gcc
mingw64-gcc-c++
mingw64-pkg-config
mingw32-gcc (Fedora / RHEL)
mingw32-gcc-c++ (Fedora / RHEL)
mingw32-pkg-config (Fedora / RHEL)
mingw64-gcc (Fedora / RHEL)
mingw64-gcc-c++ (Fedora / RHEL)
mingw64-pkg-config (Fedora / RHEL)
openssl
rsync

0 comments on commit 7e4c75a

Please sign in to comment.