Skip to content

Commit

Permalink
Merge pull request #108 from HEnquist/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
HEnquist authored Apr 27, 2021
2 parents de02d7a + f342b23 commit 7cdc687
Show file tree
Hide file tree
Showing 54 changed files with 3,735 additions and 693 deletions.
36 changes: 31 additions & 5 deletions .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push, pull_request]
name: CI test and lint

jobs:
check_lint_linux:
check_lint_test_linux:
name: Check test and lint Linux
runs-on: ubuntu-latest
#container: ubuntu:20.04
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:



check_arm:
check_test_arm:
name: Check and test Linux arm
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
use-cross: true
args: --target armv7-unknown-linux-gnueabihf --no-default-features --features alsa-backend --features websocket

check_arm64:
check_test_arm64:
name: Check and test Linux arm 64bit
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
args: --target aarch64-unknown-linux-gnu --no-default-features --features alsa-backend --features websocket


check_lint_windows:
check_test_windows:
name: Check and test Windows
runs-on: windows-latest
steps:
Expand All @@ -155,7 +155,7 @@ jobs:
command: test
args: --no-default-features --features cpal-backend

check_lint_macos:
check_test_macos:
name: Check and test macOS
runs-on: macos-latest
steps:
Expand All @@ -182,5 +182,31 @@ jobs:
args: --no-default-features --features cpal-backend


check_macos_arm:
name: Check macOS aarch64
runs-on: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain for arm
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: aarch64-apple-darwin

- name: Run cargo check for arm
uses: actions-rs/cargo@v1
with:
command: check
args: --target aarch64-apple-darwin --no-default-features --features cpal-backend
env:
SDKROOT: /Applications/Xcode_12.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk
MACOSX_DEPLOYMENT_TARGET: 11.0
DEVELOPER_DIR: /Applications/Xcode_12.2.app




47 changes: 41 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: nightly
target: aarch64-unknown-linux-gnu
override: true

Expand All @@ -114,9 +114,7 @@ jobs:
with:
command: build
use-cross: true
args: --release --target aarch64-unknown-linux-gnu --no-default-features --features alsa-backend --features websocket
env:
RUSTFLAGS: "-C target-feature=+neon"
args: --release --target aarch64-unknown-linux-gnu --no-default-features --features alsa-backend --features websocket --features neon

- name: Compress
run: tar -zcvf camilladsp.tar.gz -C target/aarch64-unknown-linux-gnu/release camilladsp
Expand All @@ -126,7 +124,7 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: camilladsp.tar.gz
asset_name: camilladsp-linux-armv8.tar.gz
asset_name: camilladsp-linux-aarch64.tar.gz
tag: ${{ github.ref }}

windows:
Expand Down Expand Up @@ -190,3 +188,40 @@ jobs:
file: camilladsp.tar.gz
asset_name: camilladsp-macos-amd64.tar.gz
tag: ${{ github.ref }}


macos_arm:
name: macOS aarch64
runs-on: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain for arm
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: aarch64-apple-darwin

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target aarch64-apple-darwin --no-default-features --features cpal-backend --features websocket
env:
SDKROOT: /Applications/Xcode_12.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk
MACOSX_DEPLOYMENT_TARGET: 11.0
DEVELOPER_DIR: /Applications/Xcode_12.2.app

- name: Compress
run: tar -zcvf camilladsp.tar.gz -C target/aarch64-apple-darwin/release camilladsp

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: camilladsp.tar.gz
asset_name: camilladsp-macos-aarch64.tar.gz
tag: ${{ github.ref }}
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
## 0.5.0
New features:
- Add RMS and Peak measurement for each channel at input and output.
- Add a `Volume` filter for volume control.
- Add exit codes.
- Adapt `check` output to be more suitable for scripts.
- Search for filter coefficient files with relative paths first in config file dir.
- Add `ShibataLow` dither types.
- Add option to write logs to file.
- Skip processing of channels that are not used in the pipeline.
- Update to new faster RustFFT.
- Overriding samplerate also scales chunksize.
- Use updated faster resampler.
- Enable experimental neon support in resampler via `neon` feature.
- Add `Loudness` volume control filter.
- Add mute options in mixer and Gain filters.
- Add mute function to Volume and Loundness filters, with websocket commands.
- Add `debug` feature for extra logging.
- Improve validation of filters.
- Setting to enable retry on reads from Alsa capture devices (helps avoiding driver bugs/quirks for some devices).
- Optionally avoid blocking reads on Alsa capture devices (helps avoiding driver bugs/quirks for some devices).
- Read FIR coefficients from WAV.
- Add subsample delay.

Bugfixes:
- Don't block playback for CoreAudio/Wasapi if there is no data in time.
- Validate `silence_threshold` and `silence_timeout` fields.
- Fix panic when reloading config if a new filter was defined but not added to the pipeline.
- Check for mixer parameter changes when reloading config.
- Token substutution and overrides also work via websocket.
- Don't exit on SIGHUP when waiting for a config.
- Fix handling of negative values when reading filter coeffs in S24LE3 format.
- Gain filters react to mute setting on reload.
- Fix noise in output when resampling and muting all channels in mixer.
- Fix handling of negative values for input and output in S24LE format.


## 0.4.2
Bugfixes:
- Fix random garbage output when using the Stdout playback device.
Expand Down
24 changes: 16 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "camilladsp"
version = "0.4.2"
version = "0.5.0"
authors = ["Henrik Enquist <[email protected]>"]
description = "A flexible tool for processing audio"

Expand All @@ -13,6 +13,8 @@ cpal-backend = ["cpal"]
websocket = ["tungstenite"]
secure-websocket = ["websocket", "native-tls", "tungstenite/tls"]
FFTW = ["fftw"]
neon = ["rubato/neon"]
debug = []

[lib]
name = "camillalib"
Expand All @@ -24,33 +26,39 @@ path = "src/bin.rs"


[target.'cfg(target_os="linux")'.dependencies]
alsa = { version = "0.4", optional = true }
alsa = { version = "0.4.3", optional = true }
nix = { version = "0.15", optional = true }

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8"
serde_json = "1.0"
serde_with = "1.5"
realfft = "0.3.0"
realfft = "1.0.0"
fftw = { version = "0.6.2", optional = true }
num-complex = "0.3"
num-integer = "0.1.43"
num-traits = "0.2"
signal-hook = "0.1.16"
signal-hook = "0.3.6"
rand = "0.7.3"
rand_distr = "0.3.0"
clap = "2.33.0"
lazy_static = "1.4.0"
log = "0.4.11"
env_logger = "0.7.1"
slog = { version = "2.7.0", features = ["release_max_level_trace", "max_level_trace"] }
slog-term = "2.6.0"
slog-async = "2.5.0"
slog-scope = "4.3.0"
chrono = "0.4"
tungstenite = { version = "0.11.1", optional = true, default-features = false }
native-tls = { version = "0.2.4", optional = true }
libpulse-binding = { version = "2.0", optional = true }
libpulse-simple-binding = { version = "2.0", optional = true }
rubato = "0.5.1"
cpal = { version = "0.12.1", optional = true }
rubato = "0.7.0"
#rubato = { git = "https://github.com/HEnquist/rubato", branch = "simd" }
cpal = { version = "0.13.1", optional = true }

[build-dependencies]
version_check = "0.9"

[dev-dependencies]
criterion = "0.3"
Expand Down
8 changes: 0 additions & 8 deletions Dockerfile

This file was deleted.

27 changes: 27 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Frequently asked questions

## Filtering

- I only have filters with negative gain, why do I get clipping anyway?

If all filters have negative gain, then the
It's not very intuitive, but the peak amplitude can actually increase when you apply filters that only attenuate.

The signal is a sum of a large number of frequency components, and in each particular sample some components
will add to increase the amplitude while other decrease it.
If a filter happens to remove a component that lowers the amplitude in a sample, then the value here will go up.
Also all filters affect the phase in a wide range, and this also makes the components sum up to a new waveform that can have higher peaks.
This is mostly a problem with modern productions that are already a bit clipped to begin with, meaning they have many samples at max amplitude.
Try adding a -3 dB Gain filter, that should be enough in most cases.

- When do I need to use an asynchronous resampler?

The asynchronous resampler must be used when the ratio between the input and output sample rates cannot be expressed as a fixed ratio.
This is only the case when resampling to adaptively match the rate of two devices with independant clocks, where the ratio drifts a little all the time.
Note that resampling between the fixed rates 44.1 kHz -> 48 kHz corresponds to a ratio of 160/147, and can be handled by the synchronous resampler.
This works for any fixed resampling between the standard rates, 44.1 <-> 96 kHz, 88.2 <-> 192 kHz, 88.1 <-> 48 kHz etc.

- My impulse response is a wav-file. How to I use it in CamillaDSP?

The wav-file must be converted to raw format, with one file per channel. Please see the [guide for converting](coefficients_from_wav.md).

Loading

0 comments on commit 7cdc687

Please sign in to comment.