Skip to content

Commit f870c0f

Browse files
committed
[update] audio to be an optional feature and create separate matrices for testing audio out (Will make a headless/game feature set to group certain features together in the future)
1 parent 2ae6419 commit f870c0f

File tree

4 files changed

+42
-21
lines changed

4 files changed

+42
-21
lines changed

.github/workflows/compile_lambda_rs.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,21 @@ jobs:
2323
- os: ubuntu-latest
2424
rustup-toolchain: "stable"
2525
features: "lambda-rs/with-vulkan"
26+
- os: ubuntu-latest
27+
rustup-toolchain: "stable"
28+
features: "lambda-rs/with-vulkan,lambda-rs/audio-output-device"
2629
- os: windows-latest
2730
rustup-toolchain: "stable"
2831
features: "lambda-rs/with-dx12"
32+
- os: windows-latest
33+
rustup-toolchain: "stable"
34+
features: "lambda-rs/with-dx12,lambda-rs/audio-output-device"
2935
- os: macos-latest
3036
rustup-toolchain: "stable"
3137
features: "lambda-rs/with-metal"
38+
- os: macos-latest
39+
rustup-toolchain: "stable"
40+
features: "lambda-rs/with-metal,lambda-rs/audio-output-device"
3241

3342
steps:
3443
- name: Checkout Repository
@@ -48,9 +57,15 @@ jobs:
4857
pkg-config libx11-dev libxcb1-dev libxcb-render0-dev \
4958
libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev \
5059
libwayland-dev libudev-dev \
51-
libasound2-dev \
5260
libvulkan-dev libvulkan1 mesa-vulkan-drivers vulkan-tools
5361
62+
- name: Install Linux deps for audio
63+
if: ${{ matrix.os == 'ubuntu-latest' && contains(matrix.features, 'lambda-rs/audio-output-device') }}
64+
run: |
65+
sudo apt-get update
66+
sudo apt-get install -y \
67+
libasound2-dev
68+
5469
- name: Configure Vulkan (Ubuntu)
5570
if: ${{ matrix.os == 'ubuntu-latest' }}
5671
run: |

crates/lambda-rs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cargo-audit = "0.16.0"
2020
mockall = "0.14.0"
2121

2222
[features]
23-
default=["with-wgpu", "audio"]
23+
default=["with-wgpu"]
2424
with-vulkan=["with-wgpu", "lambda-rs-platform/wgpu-with-vulkan"]
2525
with-opengl=["with-wgpu", "lambda-rs-platform/wgpu-with-gl"]
2626
with-dx11=["with-wgpu"]

docs/features.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: "Cargo Features Overview"
33
document_id: "features-2025-11-17"
44
status: "living"
55
created: "2025-11-17T23:59:00Z"
6-
last_updated: "2026-01-30T23:40:49Z"
7-
version: "0.1.10"
6+
last_updated: "2026-01-31T00:00:27Z"
7+
version: "0.1.11"
88
engine_workspace_version: "2023.1.30"
99
wgpu_version: "26.0.1"
1010
shader_backend_default: "naga"
1111
winit_version: "0.29.10"
12-
repo_commit: "df62c624ca869e0493a3a92297d1cebe94251e69"
12+
repo_commit: "2ae6419f001550adaa13a387b94fdf2bd86a882b"
1313
owners: ["lambda-sh"]
1414
reviewers: ["engine", "rendering"]
1515
tags: ["guide", "features", "validation", "cargo", "audio"]
@@ -31,11 +31,12 @@ relationships, and expected behavior in debug and release builds.
3131
- Workspace defaults prefer `wgpu` on supported platforms and `naga` for shader compilation.
3232
- Debug builds enable all validations unconditionally via `debug_assertions`.
3333
- Release builds enable only cheap safety checks by default; validation logs and per-draw checks MUST be enabled explicitly via features.
34-
- Audio support in `lambda-rs` is enabled by default and incurs runtime cost
35-
only when an audio device is initialized and kept alive.
36-
- Linux builds that include the default audio backend MUST provide ALSA
37-
development headers and `pkg-config` (for example, `libasound2-dev` on
38-
Debian/Ubuntu).
34+
- Audio support in `lambda-rs` is opt-in (disabled by default) and incurs
35+
runtime cost only when an audio device is initialized and kept alive.
36+
- Linux builds that enable audio output devices MUST provide ALSA development
37+
headers and `pkg-config` (for example, `libasound2-dev` on Debian/Ubuntu).
38+
- To minimize dependencies in headless or minimal environments, prefer
39+
`--no-default-features` and enable only the required features explicitly.
3940

4041
## lambda-rs
4142

@@ -59,9 +60,9 @@ Rendering backends
5960
- `with-dx11`: alias for `with-wgpu`.
6061

6162
Audio
62-
- `audio` (umbrella, enabled by default): enables audio support by composing
63+
- `audio` (umbrella, disabled by default): enables audio support by composing
6364
granular audio features. This umbrella includes `audio-output-device`.
64-
- `audio-output-device` (granular, enabled by default): enables audio output
65+
- `audio-output-device` (granular, disabled by default): enables audio output
6566
device enumeration and callback-based audio output via `lambda::audio`. This
6667
feature enables `lambda-rs-platform/audio-device` internally. Expected
6768
runtime cost is proportional to the output callback workload and buffer size;
@@ -135,6 +136,7 @@ Audio
135136
backend module `lambda_platform::cpal` backed by `cpal =0.17.1`.
136137

137138
## Changelog
139+
- 0.1.11 (2026-01-30): Make `lambda-rs` audio features opt-in by default.
138140
- 0.1.10 (2026-01-30): Document Linux system dependencies required by the
139141
default audio backend.
140142
- 0.1.9 (2026-01-30): Clarify workspace default audio behavior after enabling

docs/specs/audio-devices.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: "Audio Device Abstraction"
33
document_id: "audio-device-abstraction-2026-01-28"
44
status: "draft"
55
created: "2026-01-28T22:59:00Z"
6-
last_updated: "2026-01-30T23:40:49Z"
7-
version: "0.1.13"
6+
last_updated: "2026-01-31T00:00:27Z"
7+
version: "0.1.15"
88
engine_workspace_version: "2023.1.30"
99
wgpu_version: "26.0.1"
1010
shader_backend_default: "naga"
1111
winit_version: "0.29.10"
12-
repo_commit: "df62c624ca869e0493a3a92297d1cebe94251e69"
12+
repo_commit: "2ae6419f001550adaa13a387b94fdf2bd86a882b"
1313
owners: ["lambda-sh"]
1414
reviewers: ["engine", "rendering"]
1515
tags: ["spec", "audio", "lambda-rs", "platform", "cpal"]
@@ -326,10 +326,10 @@ Implementation rules
326326

327327
Features
328328

329-
- `lambda-rs` granular feature: `audio-output-device` (default: enabled)
329+
- `lambda-rs` granular feature: `audio-output-device` (default: disabled)
330330
- Enables the `lambda::audio` output device surface.
331331
- Enables `lambda-rs-platform` `audio-device` internally.
332-
- `lambda-rs` umbrella feature: `audio` (default: enabled)
332+
- `lambda-rs` umbrella feature: `audio` (default: disabled)
333333
- Composes `audio-output-device` only.
334334

335335
### Application Interaction
@@ -522,10 +522,10 @@ Validation rules
522522
Features introduced by this spec
523523

524524
- Crate: `lambda-rs`
525-
- Granular feature: `audio-output-device` (default: enabled)
525+
- Granular feature: `audio-output-device` (default: disabled)
526526
- Enables `lambda::audio` output device APIs.
527527
- Enables `lambda-rs-platform` `audio-device` internally.
528-
- Umbrella feature: `audio` (default: enabled)
528+
- Umbrella feature: `audio` (default: disabled)
529529
- Composes `audio-output-device` only.
530530
- Crate: `lambda-rs-platform`
531531
- Granular feature: `audio-device` (default: disabled)
@@ -625,7 +625,7 @@ Example (lambda-rs facade)
625625
This example is the primary application-facing reference.
626626

627627
- Add `crates/lambda-rs/examples/audio_sine_wave.rs` (feature:
628-
`audio-output-device`, enabled by default) that:
628+
`audio-output-device`, disabled by default) that:
629629
- Prints `lambda::audio::enumerate_output_devices()` output.
630630
- Builds the default output device via the facade builder and plays a
631631
deterministic 440 Hz tone for at least 2 seconds.
@@ -648,14 +648,18 @@ Manual checks
648648

649649
- Run the `lambda-rs` facade example and confirm audible playback for at least
650650
2 seconds.
651-
- `cargo run -p lambda-rs --example audio_sine_wave`
651+
- `cargo run -p lambda-rs --example audio_sine_wave --features audio-output-device`
652652

653653
## Compatibility and Migration
654654

655655
- None. No existing audio APIs exist in the workspace.
656656

657657
## Changelog
658658

659+
- 2026-01-31 (v0.1.15) — Update verification command to include
660+
`audio-output-device`.
661+
- 2026-01-30 (v0.1.14) — Make `lambda-rs` audio features opt-in by default and
662+
update CI to test Linux audio builds explicitly.
659663
- 2026-01-30 (v0.1.13) — Document Linux system dependencies required by the
660664
default audio backend.
661665
- 2026-01-30 (v0.1.12) — Populate the requirements checklist with file

0 commit comments

Comments
 (0)