Skip to content

Commit 8215207

Browse files
committed
Merge remote-tracking branch 'upstream/master'
# Conflicts: # Cargo.toml # src/host/wasapi/device.rs
2 parents 7e82d99 + 0246442 commit 8215207

39 files changed

+1247
-7657
lines changed

.github/workflows/cpal.yml

Lines changed: 54 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -7,163 +7,111 @@ jobs:
77
clippy-test:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v4
1111
- name: Update apt
1212
run: sudo apt update
1313
- name: Install alsa
1414
run: sudo apt-get install libasound2-dev
1515
- name: Install libjack
1616
run: sudo apt-get install libjack-jackd2-dev libjack-jackd2-0
1717
- name: Install stable
18-
uses: actions-rs/toolchain@v1
18+
uses: dtolnay/rust-toolchain@stable
1919
with:
20-
profile: minimal
21-
toolchain: stable
22-
override: true
2320
components: clippy
2421
target: armv7-linux-androideabi
2522
- name: Run clippy
26-
uses: actions-rs/clippy-check@v1
27-
with:
28-
token: ${{ secrets.GITHUB_TOKEN }}
29-
args: --all --all-features
23+
run: cargo clippy --all --all-features
3024
- name: Run clippy for Android target
31-
uses: actions-rs/clippy-check@v1
32-
with:
33-
token: ${{ secrets.GITHUB_TOKEN }}
34-
args: --all --features asio --features oboe/fetch-prebuilt --target armv7-linux-androideabi
25+
run: cargo clippy --all --features asio --features oboe/fetch-prebuilt --target armv7-linux-androideabi
3526

3627
rustfmt-check:
3728
runs-on: ubuntu-latest
3829
steps:
39-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v4
4031
- name: Install stable
41-
uses: actions-rs/toolchain@v1
32+
uses: dtolnay/rust-toolchain@stable
4233
with:
43-
profile: minimal
44-
toolchain: stable
45-
override: true
4634
components: rustfmt
4735
- name: Run rustfmt
48-
uses: actions-rs/cargo@v1
49-
with:
50-
command: fmt
51-
args: --all -- --check
36+
run: cargo fmt --all -- --check
5237

5338
cargo-publish:
5439
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
5540
runs-on: ubuntu-latest
5641
steps:
57-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
5843
- name: Install rust
59-
uses: actions-rs/toolchain@v1
60-
with:
61-
toolchain: stable
62-
profile: minimal
63-
override: true
44+
uses: dtolnay/rust-toolchain@stable
6445
- name: Update apt
6546
run: sudo apt update
6647
- name: Install alsa
6748
run: sudo apt-get install libasound2-dev
6849
- name: Verify publish crate
69-
uses: katyo/publish-crates@v1
50+
uses: katyo/publish-crates@v2
7051
with:
7152
dry-run: true
7253
ignore-unpublished-changes: true
7354
- name: Publish crate
74-
uses: katyo/publish-crates@v1
55+
uses: katyo/publish-crates@v2
7556
with:
7657
ignore-unpublished-changes: true
7758
registry-token: ${{ secrets.CRATESIO_TOKEN }}
7859

7960
ubuntu-test:
8061
runs-on: ubuntu-latest
8162
steps:
82-
- uses: actions/checkout@v2
63+
- uses: actions/checkout@v4
8364
- name: Update apt
8465
run: sudo apt update
8566
- name: Install alsa
8667
run: sudo apt-get install libasound2-dev
8768
- name: Install libjack
8869
run: sudo apt-get install libjack-jackd2-dev libjack-jackd2-0
8970
- name: Install stable
90-
uses: actions-rs/toolchain@v1
91-
with:
92-
profile: minimal
93-
toolchain: stable
94-
override: true
71+
uses: dtolnay/rust-toolchain@stable
9572
- name: Run without features
96-
uses: actions-rs/cargo@v1
97-
with:
98-
command: test
99-
args: --all --no-default-features --verbose
73+
run: cargo test --all --no-default-features --verbose
10074
- name: Run all features
101-
uses: actions-rs/cargo@v1
102-
with:
103-
command: test
104-
args: --all --all-features --verbose
75+
run: cargo test --all --all-features --verbose
10576

10677
linux-check-and-test-armv7:
10778
runs-on: ubuntu-latest
10879
steps:
10980
- name: Checkout sources
110-
uses: actions/checkout@v2
81+
uses: actions/checkout@v4
11182

11283
- name: Install stable toolchain
113-
uses: actions-rs/toolchain@v1
84+
uses: dtolnay/rust-toolchain@stable
11485
with:
115-
profile: minimal
116-
toolchain: stable
11786
target: armv7-unknown-linux-gnueabihf
118-
override: true
11987

120-
- name: Build image
121-
run: docker build -t cross/cpal_armv7:v1 ./
88+
- name: Install cross
89+
run: cargo install cross
12290

12391
- name: Check without features for armv7
124-
uses: actions-rs/cargo@v1
125-
with:
126-
command: check
127-
use-cross: true
128-
args: --target armv7-unknown-linux-gnueabihf --workspace --no-default-features --verbose
92+
run: cross check --target armv7-unknown-linux-gnueabihf --workspace --no-default-features --verbose
12993

13094
- name: Test without features for armv7
131-
uses: actions-rs/cargo@v1
132-
with:
133-
command: test
134-
use-cross: true
135-
args: --target armv7-unknown-linux-gnueabihf --workspace --no-default-features --verbose
95+
run: cross test --target armv7-unknown-linux-gnueabihf --workspace --no-default-features --verbose
13696

13797
- name: Check all features for armv7
138-
uses: actions-rs/cargo@v1
139-
with:
140-
command: check
141-
use-cross: true
142-
args: --target armv7-unknown-linux-gnueabihf --workspace --all-features --verbose
98+
run: cross check --target armv7-unknown-linux-gnueabihf --workspace --all-features --verbose
14399

144100
- name: Test all features for armv7
145-
uses: actions-rs/cargo@v1
146-
with:
147-
command: test
148-
use-cross: true
149-
args: --target armv7-unknown-linux-gnueabihf --workspace --all-features --verbose
101+
run: cross test --target armv7-unknown-linux-gnueabihf --workspace --all-features --verbose
150102

151103
asmjs-wasm32-test:
152104
strategy:
153105
matrix:
154-
target: [asmjs-unknown-emscripten, wasm32-unknown-emscripten]
106+
target: [wasm32-unknown-emscripten]
155107
runs-on: ubuntu-latest
156108
steps:
157-
- uses: actions/checkout@v2
109+
- uses: actions/checkout@v4
158110
- name: Setup Emscripten toolchain
159-
uses: mymindstorm/setup-emsdk@v10
160-
with:
161-
version: 2.0.9 # https://github.com/rust-lang/rust/issues/85821
111+
uses: mymindstorm/setup-emsdk@v14
162112
- name: Install stable
163-
uses: actions-rs/toolchain@v1
113+
uses: dtolnay/rust-toolchain@stable
164114
with:
165-
profile: minimal
166-
toolchain: stable
167115
target: ${{ matrix.target }}
168116
- name: Build beep example
169117
run: cargo build --example beep --release --target ${{ matrix.target }}
@@ -177,12 +125,10 @@ jobs:
177125
runs-on: ubuntu-latest
178126

179127
steps:
180-
- uses: actions/checkout@v1
128+
- uses: actions/checkout@v4
181129
- name: Install stable
182-
uses: actions-rs/toolchain@v1
130+
uses: dtolnay/rust-toolchain@stable
183131
with:
184-
profile: minimal
185-
toolchain: stable
186132
target: ${{ matrix.target }}
187133
- name: Build beep example
188134
run: cargo build --example beep --target ${{ matrix.target }} --features=wasm-bindgen
@@ -196,12 +142,10 @@ jobs:
196142
runs-on: ubuntu-latest
197143

198144
steps:
199-
- uses: actions/checkout@v1
145+
- uses: actions/checkout@v4
200146
- name: Install stable
201-
uses: actions-rs/toolchain@v1
147+
uses: dtolnay/rust-toolchain@stable
202148
with:
203-
profile: minimal
204-
toolchain: stable
205149
target: ${{ matrix.target }}
206150
- name: Build beep example
207151
run: cargo build --example beep --target ${{ matrix.target }}
@@ -212,7 +156,7 @@ jobs:
212156
version: [x86_64, i686]
213157
runs-on: windows-latest
214158
steps:
215-
- uses: actions/checkout@v2
159+
- uses: actions/checkout@v4
216160
- name: Install ASIO SDK
217161
env:
218162
LINK: https://www.steinberg.net/asiosdk
@@ -225,12 +169,9 @@ jobs:
225169
- name: Install llvm and clang
226170
run: choco install llvm
227171
- name: Install stable
228-
uses: actions-rs/toolchain@v1
172+
uses: dtolnay/rust-toolchain@stable
229173
with:
230-
profile: minimal
231-
toolchain: stable
232174
target: ${{ matrix.version }}-pc-windows-msvc
233-
override: true
234175
- name: Run without features
235176
run: cargo test --all --no-default-features --verbose
236177
- name: Run all features
@@ -241,15 +182,11 @@ jobs:
241182
macos-test:
242183
runs-on: macOS-latest
243184
steps:
244-
- uses: actions/checkout@v2
185+
- uses: actions/checkout@v4
245186
- name: Install llvm and clang
246187
run: brew install llvm
247188
- name: Install stable
248-
uses: actions-rs/toolchain@v1
249-
with:
250-
profile: minimal
251-
toolchain: stable
252-
override: true
189+
uses: dtolnay/rust-toolchain@stable
253190
- name: Build beep example
254191
run: cargo build --example beep
255192
- name: Run without features
@@ -260,13 +197,10 @@ jobs:
260197
android-check:
261198
runs-on: ubuntu-latest
262199
steps:
263-
- uses: actions/checkout@v2
264-
- name: Install stable
265-
uses: actions-rs/toolchain@v1
200+
- uses: actions/checkout@v4
201+
- name: Install stable (Android target)
202+
uses: dtolnay/rust-toolchain@stable
266203
with:
267-
profile: minimal
268-
toolchain: stable
269-
override: true
270204
target: armv7-linux-androideabi
271205
- name: Check android
272206
run: cargo check --example android --target armv7-linux-androideabi --features oboe/fetch-prebuilt --verbose
@@ -282,13 +216,14 @@ jobs:
282216
android-apk-build:
283217
runs-on: ubuntu-latest
284218
steps:
285-
- uses: actions/checkout@v2
286-
- name: Install Android targets
219+
- uses: actions/checkout@v4
220+
- name: Install stable (Android targets)
221+
uses: dtolnay/rust-toolchain@stable
222+
with:
223+
targets: armv7-linux-androideabi,aarch64-linux-android,i686-linux-android,x86_64-linux-android
224+
- name: Set Up Android tools
287225
run: |
288-
rustup target add armv7-linux-androideabi
289-
rustup target add aarch64-linux-android
290-
rustup target add i686-linux-android
291-
rustup target add x86_64-linux-android
226+
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "platforms;android-30"
292227
- name: Install Cargo APK
293228
run: cargo install cargo-apk
294229
- name: Build APK
@@ -297,17 +232,13 @@ jobs:
297232
ios-build:
298233
runs-on: macOS-latest
299234
steps:
300-
- uses: actions/checkout@v2
235+
- uses: actions/checkout@v4
301236
- name: Install llvm and clang
302237
run: brew install llvm
303-
- name: Install stable
304-
uses: actions-rs/toolchain@v1
238+
- name: Install stable (iOS targets)
239+
uses: dtolnay/rust-toolchain@stable
305240
with:
306-
profile: minimal
307-
toolchain: stable
308-
override: true
309-
- name: Add iOS targets
310-
run: rustup target add aarch64-apple-ios x86_64-apple-ios
241+
targets: aarch64-apple-ios,x86_64-apple-ios
311242
- name: Install cargo lipo
312243
run: cargo install cargo-lipo
313244
- name: Build iphonesimulator feedback example
@@ -320,9 +251,11 @@ jobs:
320251
# It does not test the javascript/web integration
321252
runs-on: ubuntu-latest
322253
steps:
323-
- uses: actions/checkout@v2
324-
- name: Install Target
325-
run: rustup target add wasm32-unknown-unknown
254+
- uses: actions/checkout@v4
255+
- name: Install stable (wasm32 target)
256+
uses: dtolnay/rust-toolchain@stable
257+
with:
258+
targets: wasm32-unknown-unknown
326259
- name: Cargo Build
327260
working-directory: ./examples/wasm-beep
328261
run: cargo build --target wasm32-unknown-unknown

CHANGELOG.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# Unreleased
2+
3+
# Version 0.15.3 (2024-03-04)
4+
5+
- Add `try_with_sample_rate`, a non-panicking variant of `with_sample_rate`.
6+
- struct `platform::Stream` is now #[must_use].
7+
- enum `SupportedBufferSize` and struct `SupportedStreamConfigRange` are now `Copy`.
8+
- `platform::Device` is now `Clone`.
9+
- Remove `parking_lot` dependency in favor of the std library.
10+
- Fix crash on web/wasm when `atomics` flag is enabled.
11+
- Improve Examples: Migrate wasm example to `trunk`, Improve syth-thones example.
12+
- Improve CI: Update actions, Use Android 30 API level in CI, Remove `asmjs-unknown-emscripten` target.
13+
- Update `windows` dependency to v0.54
14+
- Update `jni` dependency to 0.21
15+
- Update `alsa` dependency to 0.9
16+
- Update `oboe` dependency to 0.6
17+
- Update `ndk` dependency to 0.8 and disable `default-features`.
18+
- Update `wasm-bindgen` to 0.2.89
19+
120
# Version 0.15.2 (2023-03-30)
221

322
- webaudio: support multichannel output streams
@@ -69,16 +88,16 @@
6988

7089
- Large refactor removing the blocking EventLoop API.
7190
- Rename many `Format` types to `StreamConfig`:
72-
- `Format` type's `data_type` field renamed to `sample_format`.
73-
- `Shape` -> `StreamConfig` - The configuration input required to build a stream.
74-
- `Format` -> `SupportedStreamConfig` - Describes a single supported stream configuration.
75-
- `SupportedFormat` -> `SupportedStreamConfigRange` - Describes a range of supported configurations.
76-
- `Device::default_input/output_format` -> `Device::default_input/output_config`.
77-
- `Device::supported_input/output_formats` -> `Device::supported_input/output_configs`.
78-
- `Device::SupportedInput/OutputFormats` -> `Device::SupportedInput/OutputConfigs`.
79-
- `SupportedFormatsError` -> `SupportedStreamConfigsError`
80-
- `DefaultFormatError` -> `DefaultStreamConfigError`
81-
- `BuildStreamError::FormatNotSupported` -> `BuildStreamError::StreamConfigNotSupported`
91+
- `Format` type's `data_type` field renamed to `sample_format`.
92+
- `Shape` -> `StreamConfig` - The configuration input required to build a stream.
93+
- `Format` -> `SupportedStreamConfig` - Describes a single supported stream configuration.
94+
- `SupportedFormat` -> `SupportedStreamConfigRange` - Describes a range of supported configurations.
95+
- `Device::default_input/output_format` -> `Device::default_input/output_config`.
96+
- `Device::supported_input/output_formats` -> `Device::supported_input/output_configs`.
97+
- `Device::SupportedInput/OutputFormats` -> `Device::SupportedInput/OutputConfigs`.
98+
- `SupportedFormatsError` -> `SupportedStreamConfigsError`
99+
- `DefaultFormatError` -> `DefaultStreamConfigError`
100+
- `BuildStreamError::FormatNotSupported` -> `BuildStreamError::StreamConfigNotSupported`
82101
- Address deprecated use of `mem::uninitialized` in WASAPI.
83102
- Removed `UnknownTypeBuffer` in favour of specifying sample type.
84103
- Added `build_input/output_stream_raw` methods allowing for dynamically

0 commit comments

Comments
 (0)